diff --git a/linux/bin/swig/bin/swig b/linux/bin/swig/bin/swig index fc5049cb..2619331f 100755 Binary files a/linux/bin/swig/bin/swig and b/linux/bin/swig/bin/swig differ diff --git a/linux/bin/swig/share/swig/4.1.0/allkw.swg b/linux/bin/swig/share/swig/4.1.0/allkw.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/attribute.i b/linux/bin/swig/share/swig/4.1.0/attribute.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/carrays.i b/linux/bin/swig/share/swig/4.1.0/carrays.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/cdata.i b/linux/bin/swig/share/swig/4.1.0/cdata.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/cmalloc.i b/linux/bin/swig/share/swig/4.1.0/cmalloc.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/constraints.i b/linux/bin/swig/share/swig/4.1.0/constraints.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/cpointer.i b/linux/bin/swig/share/swig/4.1.0/cpointer.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/arrays_csharp.i b/linux/bin/swig/share/swig/4.1.0/csharp/arrays_csharp.i deleted file mode 100755 index 861da838..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/arrays_csharp.i +++ /dev/null @@ -1,179 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_csharp.i - * - * This file contains a two approaches to marshaling arrays. The first uses - * default p/invoke marshaling and the second uses pinning of the arrays. - * - * Default marshaling approach - * ---------------------------- - * Array typemaps using default p/invoke marshaling. The data is copied to a separately - * allocated buffer when passing over the managed-native boundary. - * - * There are separate typemaps for in, out and inout arrays to enable avoiding - * unnecessary copying. - * - * Example usage: - * - * %include "arrays_csharp.i" - * %apply int INPUT[] { int* sourceArray } - * %apply int OUTPUT[] { int* targetArray } - * void myArrayCopy( int* sourceArray, int* targetArray, int nitems ); - * - * %apply int INOUT[] { int* array1, int *array2 } - * void myArraySwap( int* array1, int* array2, int nitems ); - * - * If handling large arrays you should consider using the pinning array typemaps - * described next. - * - * Pinning approach - * ---------------- - * Array typemaps using pinning. These typemaps pin the managed array given - * as parameter and pass a pointer to it to the c/c++ side. This is very - * efficient as no copying is done (unlike in the default array marshaling), - * but it makes garbage collection more difficult. When considering using - * these typemaps, think carefully whether you have callbacks that may cause - * the control to re-enter the managed side from within the call (and produce - * garbage for the gc) or whether other threads may produce enough garbage to - * trigger gc while the call is being executed. In those cases it may be - * wiser to use the default marshaling typemaps. - * - * Please note that when using fixed arrays, you have to mark your corresponding - * module class method unsafe using - * %csmethodmodifiers "public unsafe" - * (the visibility of the method is up to you). - * - * Example usage: - * - * %include "arrays_csharp.i" - * %apply int FIXED[] { int* sourceArray, int *targetArray } - * %csmethodmodifiers myArrayCopy "public unsafe"; - * void myArrayCopy( int *sourceArray, int* targetArray, int nitems ); - * - * ----------------------------------------------------------------------------- */ - -%define CSHARP_ARRAYS( CTYPE, CSTYPE ) - -// input only arrays - -%typemap(ctype) CTYPE INPUT[] "CTYPE*" -%typemap(cstype) CTYPE INPUT[] "CSTYPE[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE INPUT[] "CSTYPE[]" -%typemap(csin) CTYPE INPUT[] "$csinput" - -%typemap(in) CTYPE INPUT[] "$1 = $input;" -%typemap(freearg) CTYPE INPUT[] "" -%typemap(argout) CTYPE INPUT[] "" - -// output only arrays - -%typemap(ctype) CTYPE OUTPUT[] "CTYPE*" -%typemap(cstype) CTYPE OUTPUT[] "CSTYPE[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE OUTPUT[] "CSTYPE[]" -%typemap(csin) CTYPE OUTPUT[] "$csinput" - -%typemap(in) CTYPE OUTPUT[] "$1 = $input;" -%typemap(freearg) CTYPE OUTPUT[] "" -%typemap(argout) CTYPE OUTPUT[] "" - -// inout arrays - -%typemap(ctype) CTYPE INOUT[] "CTYPE*" -%typemap(cstype) CTYPE INOUT[] "CSTYPE[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE INOUT[] "CSTYPE[]" -%typemap(csin) CTYPE INOUT[] "$csinput" - -%typemap(in) CTYPE INOUT[] "$1 = $input;" -%typemap(freearg) CTYPE INOUT[] "" -%typemap(argout) CTYPE INOUT[] "" - -%enddef // CSHARP_ARRAYS - -CSHARP_ARRAYS(signed char, sbyte) -CSHARP_ARRAYS(unsigned char, byte) -CSHARP_ARRAYS(short, short) -CSHARP_ARRAYS(unsigned short, ushort) -CSHARP_ARRAYS(int, int) -CSHARP_ARRAYS(unsigned int, uint) -// FIXME - on Unix 64 bit, long is 8 bytes but is 4 bytes on Windows 64 bit. -// How can this be handled sensibly? -// See e.g. http://www.xml.com/ldd/chapter/book/ch10.html -CSHARP_ARRAYS(long, int) -CSHARP_ARRAYS(unsigned long, uint) -CSHARP_ARRAYS(long long, long) -CSHARP_ARRAYS(unsigned long long, ulong) -CSHARP_ARRAYS(float, float) -CSHARP_ARRAYS(double, double) - -// By default C# will marshal bools as 4 bytes -// UnmanagedType.I1 will change this to 1 byte -// FIXME - When running on mono ArraySubType appears to be ignored and bools will be marshalled as 4-byte -// https://github.com/mono/mono/issues/15592 - -// input only arrays -%typemap(ctype) bool INPUT[] "bool*" -%typemap(cstype) bool INPUT[] "bool[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool INPUT[] "bool[]" -%typemap(csin) bool INPUT[] "$csinput" - -%typemap(in) bool INPUT[] %{ -$1 = $input; -%} -%typemap(freearg) bool INPUT[] "" -%typemap(argout) bool INPUT[] "" - -// output only arrays -%typemap(ctype) bool OUTPUT[] "bool*" -%typemap(cstype) bool OUTPUT[] "bool[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool OUTPUT[] "bool[]" -%typemap(csin) bool OUTPUT[] "$csinput" - -%typemap(in) bool OUTPUT[] %{ -$1 = $input; -%} -%typemap(freearg) bool OUTPUT[] "" -%typemap(argout) bool OUTPUT[] "" - -// inout arrays -%typemap(ctype) bool INOUT[] "bool*" -%typemap(cstype) bool INOUT[] "bool[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool INOUT[] "bool[]" -%typemap(csin) bool INOUT[] "$csinput" - -%typemap(in) bool INOUT[] %{ -$1 = $input; -%} -%typemap(freearg) bool INOUT[] "" -%typemap(argout) bool INOUT[] "" - - -%define CSHARP_ARRAYS_FIXED( CTYPE, CSTYPE ) - -%typemap(ctype) CTYPE FIXED[] "CTYPE*" -%typemap(imtype) CTYPE FIXED[] "global::System.IntPtr" -%typemap(cstype) CTYPE FIXED[] "CSTYPE[]" -%typemap(csin, - pre= " fixed ( CSTYPE* swig_ptrTo_$csinput = $csinput ) {", - terminator=" }") - CTYPE FIXED[] "(global::System.IntPtr)swig_ptrTo_$csinput" - -%typemap(in) CTYPE FIXED[] "$1 = $input;" -%typemap(freearg) CTYPE FIXED[] "" -%typemap(argout) CTYPE FIXED[] "" - - -%enddef // CSHARP_ARRAYS_FIXED - -CSHARP_ARRAYS_FIXED(signed char, sbyte) -CSHARP_ARRAYS_FIXED(unsigned char, byte) -CSHARP_ARRAYS_FIXED(short, short) -CSHARP_ARRAYS_FIXED(unsigned short, ushort) -CSHARP_ARRAYS_FIXED(int, int) -CSHARP_ARRAYS_FIXED(unsigned int, uint) -CSHARP_ARRAYS_FIXED(long, int) -CSHARP_ARRAYS_FIXED(unsigned long, uint) -CSHARP_ARRAYS_FIXED(long long, long) -CSHARP_ARRAYS_FIXED(unsigned long long, ulong) -CSHARP_ARRAYS_FIXED(float, float) -CSHARP_ARRAYS_FIXED(double, double) -CSHARP_ARRAYS_FIXED(bool, bool) - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/boost_intrusive_ptr.i b/linux/bin/swig/share/swig/4.1.0/csharp/boost_intrusive_ptr.i deleted file mode 100755 index 355a910c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/boost_intrusive_ptr.i +++ /dev/null @@ -1,517 +0,0 @@ -// Users can provide their own SWIG_INTRUSIVE_PTR_TYPEMAPS or SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP macros before including this file to change the -// visibility of the constructor and getCPtr method if desired to public if using multiple modules. -#ifndef SWIG_INTRUSIVE_PTR_TYPEMAPS -#define SWIG_INTRUSIVE_PTR_TYPEMAPS(CONST, TYPE...) SWIG_INTRUSIVE_PTR_TYPEMAPS_IMPLEMENTATION(internal, internal, CONST, TYPE) -#endif -#ifndef SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP -#define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(CONST, TYPE...) SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP_IMPLEMENTATION(internal, internal, CONST, TYPE) -#endif - -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - // plain value - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") CONST TYPE %{ - //plain value(out) - $1_ltype* resultp = new $1_ltype($1); - intrusive_ptr_add_ref(resultp); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(resultp, SWIG_intrusive_deleter< CONST TYPE >()); -%} - -%typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain pointer - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE * %{ - //plain pointer(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in, canthrow=1) CONST TYPE & %{ - // plain reference - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if(!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); - return $null; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE & %{ - //plain reference(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) %{ - // plain pointer by reference - temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") TYPE *CONST& %{ - // plain pointer by reference(out) - #if ($owner) - if (*$1) { - intrusive_ptr_add_ref(*$1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_0); - #endif -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by value - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if (smartarg) { - $1 = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ - if ($1) { - intrusive_ptr_add_ref($1.get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1.get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by reference - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - delete &($1); - if ($self) { - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * temp = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); - $1 = *temp; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - if (*$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - delete $1; - if ($self) $1 = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - if ($1 && *$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - if ($owner) delete $1; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& (SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > temp, $*1_ltype tempp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer reference - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if ($input) { - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } - tempp = &temp; - $1 = &tempp; -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if ($self) $1 = *$input; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if (*$1 && **$1) { - intrusive_ptr_add_ref((*$1)->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >((*$1)->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "void *" -%typemap (imtype, out="global::System.IntPtr") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(cstype, TYPE)" -%typemap(csin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(cstype, TYPE).getCPtr($csinput)" - -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ - get { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >& %{ - get { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >* %{ - get { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } %} - - -%typemap(csout, excode=SWIGEXCODE) CONST TYPE { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE & { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -// Base proxy classes -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnBase; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - -// CONST version needed ???? also for C# -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%template() SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; -%enddef - - -///////////////////////////////////////////////////////////////////// - - -%include - -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - - -// plain value -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -// plain pointer -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -// plain reference -%typemap(in, canthrow=1) CONST TYPE & %{ - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "void *" -%typemap (imtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "void *" -%typemap (cstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE)" -%typemap (csin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE).getCPtr($csinput)" -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true); - } - -%typemap(csout, excode=SWIGEXCODE) CONST TYPE { - return new $typemap(cstype, TYPE)($imcall, true); - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE & { - return new $typemap(cstype, TYPE)($imcall, true); - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE * { - global::System.IntPtr cPtr = $imcall; - return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true); - } -%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { - global::System.IntPtr cPtr = $imcall; - return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true); - } - -// Base proxy classes -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnBase; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - - -// CONST version needed ???? also for C# -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/boost_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/csharp/boost_shared_ptr.i deleted file mode 100755 index d47fab55..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/boost_shared_ptr.i +++ /dev/null @@ -1,323 +0,0 @@ -// Users can provide their own SWIG_SHARED_PTR_TYPEMAPS macro before including this file to change the -// visibility of the constructor and getCPtr method if desired to public if using multiple modules. -#ifndef SWIG_SHARED_PTR_TYPEMAPS -#define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(internal, internal, CONST, TYPE) -#endif - -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - argp = ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -%typemap(directorin) CONST TYPE -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (new $1_ltype(SWIG_STD_MOVE($1))); %} - -%typemap(directorout) CONST TYPE -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg->get(); -%} - -// plain pointer -%typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - $result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -%typemap(directorin) CONST TYPE * -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) CONST TYPE * %{ -#error "typemaps for $1_type not available" -%} - -// plain reference -%typemap(in, canthrow=1) CONST TYPE & %{ - $1 = ($1_ltype)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) CONST TYPE & -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (&$1 SWIG_NO_NULL_DELETER_0); %} - -%typemap(directorout) CONST TYPE & %{ -#error "typemaps for $1_type not available" -%} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = (TYPE *)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) TYPE *CONST& -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) TYPE *CONST& %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) $1 = *($&1_ltype)$input; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $result = $1 ? new $1_ltype($1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg; - } -%} - -// shared_ptr by reference -%typemap(in, canthrow=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $result = *$1 ? new $*1_ltype(*$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out, fragment="SWIG_null_deleter") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; - if ($owner) delete $1; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) -%{ temp = $input ? *($1_ltype)&$input : &tempnull; - $1 = &temp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "typemaps for $1_type not available" -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void *" -%typemap (imtype, out="global::System.IntPtr") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(cstype, TYPE)" - -%typemap(csin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(cstype, TYPE).getCPtr($csinput)" - -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - - -%typemap(csout, excode=SWIGEXCODE) CONST TYPE { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE & { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) CONST TYPE & %{ - get { - $csclassname ret = new $csclassname($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) CONST TYPE * %{ - get { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, true);$excode - return ret; - } %} - -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ - get { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ - get { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } %} - -%typemap(csdirectorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE).getCPtr($cscall).Handle" - -%typemap(csdirectorin) CONST TYPE, - CONST TYPE *, - CONST TYPE &, - TYPE *CONST& "($iminput == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)($iminput, true)" - -%typemap(csdirectorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "($iminput == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)($iminput, true)" - - -// Proxy classes (base classes, ie, not derived classes) -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnBase; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/complex.i b/linux/bin/swig/share/swig/4.1.0/csharp/complex.i deleted file mode 100755 index 4a6f91cd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/complex.i +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __cplusplus -%include -#else -#error C# module only supports complex in C++ mode. -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/csharp.swg b/linux/bin/swig/share/swig/4.1.0/csharp/csharp.swg deleted file mode 100755 index 1f80d12a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/csharp.swg +++ /dev/null @@ -1,1120 +0,0 @@ -/* ----------------------------------------------------------------------------- - * csharp.swg - * - * C# typemaps - * ----------------------------------------------------------------------------- */ - -%include - -/* The ctype, imtype and cstype typemaps work together and so there should be one of each. - * The ctype typemap contains the PInvoke type used in the PInvoke (C/C++) code. - * The imtype typemap contains the C# type used in the intermediary class. - * The cstype typemap contains the C# type used in the C# proxy classes, type wrapper classes and module class. */ - -/* SWIG 3 no longer inserts using directives into generated C# code. For backwards compatibility, the SWIG2_CSHARP - macro can be defined to have SWIG 3 generate using directives similar to those generated by SWIG 2. */ -#ifdef SWIG2_CSHARP - -%typemap(csimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "\nusing global::System;\nusing global::System.Runtime.InteropServices;\n" - -%pragma(csharp) moduleimports=%{ -using global::System; -using global::System.Runtime.InteropServices; -%} - -%pragma(csharp) imclassimports=%{ -using global::System; -using global::System.Runtime.InteropServices; -%} - -#endif - - -/* Fragments */ -%fragment("SWIG_PackData", "header") { -/* Pack binary data into a string */ -SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} -} - -%fragment("SWIG_UnPackData", "header") { -/* Unpack binary data from a string */ -SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} -} - -/* Primitive types */ -%typemap(ctype) bool, const bool & "unsigned int" -%typemap(ctype) char, const char & "char" -%typemap(ctype) signed char, const signed char & "signed char" -%typemap(ctype) unsigned char, const unsigned char & "unsigned char" -%typemap(ctype) short, const short & "short" -%typemap(ctype) unsigned short, const unsigned short & "unsigned short" -%typemap(ctype) int, const int & "int" -%typemap(ctype) unsigned int, const unsigned int & "unsigned int" -%typemap(ctype) long, const long & "long" -%typemap(ctype) unsigned long, const unsigned long & "unsigned long" -%typemap(ctype) long long, const long long & "long long" -%typemap(ctype) unsigned long long, const unsigned long long & "unsigned long long" -%typemap(ctype) float, const float & "float" -%typemap(ctype) double, const double & "double" -%typemap(ctype) void "void" - -%typemap(imtype) bool, const bool & "bool" -%typemap(imtype) char, const char & "char" -%typemap(imtype) signed char, const signed char & "sbyte" -%typemap(imtype) unsigned char, const unsigned char & "byte" -%typemap(imtype) short, const short & "short" -%typemap(imtype) unsigned short, const unsigned short & "ushort" -%typemap(imtype) int, const int & "int" -%typemap(imtype) unsigned int, const unsigned int & "uint" -%typemap(imtype) long, const long & "int" -%typemap(imtype) unsigned long, const unsigned long & "uint" -%typemap(imtype) long long, const long long & "long" -%typemap(imtype) unsigned long long, const unsigned long long & "ulong" -%typemap(imtype) float, const float & "float" -%typemap(imtype) double, const double & "double" -%typemap(imtype) void "void" - -%typemap(cstype) bool, const bool & "bool" -%typemap(cstype) char, const char & "char" -%typemap(cstype) signed char, const signed char & "sbyte" -%typemap(cstype) unsigned char, const unsigned char & "byte" -%typemap(cstype) short, const short & "short" -%typemap(cstype) unsigned short, const unsigned short & "ushort" -%typemap(cstype) int, const int & "int" -%typemap(cstype) unsigned int, const unsigned int & "uint" -%typemap(cstype) long, const long & "int" -%typemap(cstype) unsigned long, const unsigned long & "uint" -%typemap(cstype) long long, const long long & "long" -%typemap(cstype) unsigned long long, const unsigned long long & "ulong" -%typemap(cstype) float, const float & "float" -%typemap(cstype) double, const double & "double" -%typemap(cstype) void "void" - -%typemap(ctype) char *, char *&, char[ANY], char[] "char *" -%typemap(imtype) char *, char *&, char[ANY], char[] "string" -%typemap(cstype) char *, char *&, char[ANY], char[] "string" - -/* Non primitive types */ -%typemap(ctype) SWIGTYPE "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE "$&csclassname" - -%typemap(ctype) SWIGTYPE [] "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE [] "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE [] "$csclassname" - -%typemap(ctype) SWIGTYPE * "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE * "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE * "$csclassname" - -%typemap(ctype) SWIGTYPE & "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE & "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE & "$csclassname" - -%typemap(ctype) SWIGTYPE && "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE && "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE && "$csclassname" - -/* pointer to a class member */ -%typemap(ctype) SWIGTYPE (CLASS::*) "char *" -%typemap(imtype) SWIGTYPE (CLASS::*) "string" -%typemap(cstype) SWIGTYPE (CLASS::*) "$csclassname" - -/* The following are the in and out typemaps. These are the PInvoke code generating typemaps for converting from C# to C and visa versa. */ - -/* primitive types */ -%typemap(in) bool -%{ $1 = $input ? true : false; %} - -%typemap(directorout) bool -%{ $result = $input ? true : false; %} - -%typemap(csdirectorin) bool "$iminput" -%typemap(csdirectorout) bool "$cscall" - -%typemap(in) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $1 = ($1_ltype)$input; %} - -%typemap(directorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin) bool "$input = $1;" -%typemap(directorin) char "$input = $1;" -%typemap(directorin) signed char "$input = $1;" -%typemap(directorin) unsigned char "$input = $1;" -%typemap(directorin) short "$input = $1;" -%typemap(directorin) unsigned short "$input = $1;" -%typemap(directorin) int "$input = $1;" -%typemap(directorin) unsigned int "$input = $1;" -%typemap(directorin) long "$input = $1;" -%typemap(directorin) unsigned long "$input = (unsigned long)$1;" -%typemap(directorin) long long "$input = $1;" -%typemap(directorin) unsigned long long "$input = $1;" -%typemap(directorin) float "$input = $1;" -%typemap(directorin) double "$input = $1;" - -%typemap(csdirectorin) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double - "$iminput" - -%typemap(csdirectorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double - "$cscall" - -%typemap(out) bool %{ $result = $1; %} -%typemap(out) char %{ $result = $1; %} -%typemap(out) signed char %{ $result = $1; %} -%typemap(out) unsigned char %{ $result = $1; %} -%typemap(out) short %{ $result = $1; %} -%typemap(out) unsigned short %{ $result = $1; %} -%typemap(out) int %{ $result = $1; %} -%typemap(out) unsigned int %{ $result = $1; %} -%typemap(out) long %{ $result = $1; %} -%typemap(out) unsigned long %{ $result = (unsigned long)$1; %} -%typemap(out) long long %{ $result = $1; %} -%typemap(out) unsigned long long %{ $result = $1; %} -%typemap(out) float %{ $result = $1; %} -%typemap(out) double %{ $result = $1; %} - -/* char * - treat as String */ -%typemap(in) char * %{ $1 = ($1_ltype)$input; %} -%typemap(out) char * %{ $result = SWIG_csharp_string_callback((const char *)$1); %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char * %{ $input = SWIG_csharp_string_callback((const char *)$1); %} -%typemap(csdirectorin) char * "$iminput" -%typemap(csdirectorout) char * "$cscall" - -/* char *& - treat as String */ -%typemap(in) char *& ($*1_ltype temp = 0) %{ - temp = ($*1_ltype)$input; - $1 = &temp; -%} -%typemap(out) char *& %{ if ($1) $result = SWIG_csharp_string_callback((const char *)*$1); %} - -%typemap(out, null="") void "" -%typemap(csdirectorin) void "$iminput" -%typemap(csdirectorout) void "$cscall" -%typemap(directorin) void "" - -/* primitive types by const reference */ -%typemap(in) const bool & ($*1_ltype temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & -%{ static $*1_ltype temp; - temp = $input ? true : false; - $result = &temp; %} - -%typemap(csdirectorin) const bool & "$iminput" -%typemap(csdirectorout) const bool & "$cscall" - -%typemap(in) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ static $*1_ltype temp; - temp = ($*1_ltype)$input; - $result = &temp; %} - -%typemap(directorin) const bool & "$input = $1;" -%typemap(directorin) const char & "$input = $1;" -%typemap(directorin) const signed char & "$input = $1;" -%typemap(directorin) const unsigned char & "$input = $1;" -%typemap(directorin) const short & "$input = $1;" -%typemap(directorin) const unsigned short & "$input = $1;" -%typemap(directorin) const int & "$input = $1;" -%typemap(directorin) const unsigned int & "$input = $1;" -%typemap(directorin) const long & "$input = $1;" -%typemap(directorin) const unsigned long & "$input = $1;" -%typemap(directorin) const long long & "$input = $1;" -%typemap(directorin) const unsigned long long & "$input = $1;" -%typemap(directorin) const float & "$input = $1;" -%typemap(directorin) const double & "$input = $1;" - -%typemap(csdirectorin) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$iminput" - -%typemap(csdirectorout) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$cscall" - - -%typemap(out) const bool & %{ $result = *$1; %} -%typemap(out) const char & %{ $result = *$1; %} -%typemap(out) const signed char & %{ $result = *$1; %} -%typemap(out) const unsigned char & %{ $result = *$1; %} -%typemap(out) const short & %{ $result = *$1; %} -%typemap(out) const unsigned short & %{ $result = *$1; %} -%typemap(out) const int & %{ $result = *$1; %} -%typemap(out) const unsigned int & %{ $result = *$1; %} -%typemap(out) const long & %{ $result = *$1; %} -%typemap(out) const unsigned long & %{ $result = (unsigned long)*$1; %} -%typemap(out) const long long & %{ $result = *$1; %} -%typemap(out) const unsigned long long & %{ $result = *$1; %} -%typemap(out) const float & %{ $result = *$1; %} -%typemap(out) const double & %{ $result = *$1; %} - -/* Default handling. Object passed by value. Convert to a pointer */ -%typemap(in, canthrow=1) SWIGTYPE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; %} - -%typemap(directorout) SWIGTYPE -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); - return $null; - } - $result = *($&1_ltype)$input; %} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ $result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - $result = $1ptr; -} -#endif - -%typemap(directorin) SWIGTYPE -%{ $input = (void *)new $1_ltype(SWIG_STD_MOVE($1)); %} -%typemap(csdirectorin) SWIGTYPE "new $&csclassname($iminput, true)" -%typemap(csdirectorout) SWIGTYPE "$&csclassname.getCPtr($cscall).Handle" - -/* Generic pointers and references */ -%typemap(in) SWIGTYPE * %{ $1 = ($1_ltype)$input; %} -%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) %{ - SWIG_UnpackData($input, (void *)&$1, sizeof($1)); -%} -%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type is null", 0); - return $null; - } %} -%typemap(in, canthrow=1, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type is null", 0); - return $null; - } - rvrdeleter.reset($1); %} -%typemap(out) SWIGTYPE * %{ $result = (void *)$1; %} -%typemap(out, fragment="SWIG_PackData") SWIGTYPE (CLASS::*) %{ - char buf[128]; - char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); - *data = '\0'; - $result = SWIG_csharp_string_callback(buf); -%} -%typemap(out) SWIGTYPE & %{ $result = (void *)$1; %} -%typemap(out) SWIGTYPE && %{ $result = (void *)$1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * -%{ $result = ($1_ltype)$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin) SWIGTYPE * -%{ $input = (void *) $1; %} -%typemap(directorin) SWIGTYPE (CLASS::*) -%{ $input = (void *) $1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); - return $null; - } - $result = ($1_ltype)$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE && -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); - return $null; - } - $result = ($1_ltype)$input; %} -%typemap(directorin) SWIGTYPE & -%{ $input = ($1_ltype) &$1; %} -%typemap(directorin) SWIGTYPE && -%{ $input = ($1_ltype) &$1; %} - -%typemap(csdirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($iminput == global::System.IntPtr.Zero) ? null : new $csclassname($iminput, false)" -%typemap(csdirectorin) SWIGTYPE & "new $csclassname($iminput, false)" -%typemap(csdirectorin) SWIGTYPE && "new $csclassname($iminput, false)" -%typemap(csdirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE &, SWIGTYPE && "$csclassname.getCPtr($cscall).Handle" - -/* Default array handling */ -%typemap(in) SWIGTYPE [] %{ $1 = ($1_ltype)$input; %} -%typemap(out) SWIGTYPE [] %{ $result = $1; %} - -/* char arrays - treat as String */ -%typemap(in) char[ANY], char[] %{ $1 = ($1_ltype)$input; %} -%typemap(out) char[ANY], char[] %{ $result = SWIG_csharp_string_callback((const char *)$1); %} - -%typemap(directorout) char[ANY], char[] %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char[ANY], char[] %{ $input = SWIG_csharp_string_callback((const char *)$1); %} - -%typemap(csdirectorin) char[ANY], char[] "$iminput" -%typemap(csdirectorout) char[ANY], char[] "$cscall" - - -/* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions - * that cannot be overloaded in C# as more than one C++ type maps to a single C# type */ - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_UINT8) - unsigned char, - const unsigned char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) - short, - const short & - "" - -%typecheck(SWIG_TYPECHECK_UINT16) - unsigned short, - const unsigned short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) - int, - long, - const int &, - const long & - "" - -%typecheck(SWIG_TYPECHECK_UINT32) - unsigned int, - unsigned long, - const unsigned int &, - const unsigned long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) - long long, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_UINT64) - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) - char *, - char *&, - char[ANY], - char[] - "" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE *const&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - -/* Exception handling */ - -%typemap(throws, canthrow=1) int, - long, - short, - unsigned int, - unsigned long, - unsigned short -%{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, error_msg); - return $null; %} - -%typemap(throws, canthrow=1) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [ANY] -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(throws, canthrow=1) char * -%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1); - return $null; %} - - -/* Typemaps for code generation in proxy classes and C# type wrapper classes */ - -/* The csin typemap is used for converting function parameter types from the type - * used in the proxy, module or type wrapper class to the type used in the PInvoke class. */ -%typemap(csin) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double & - "$csinput" -%typemap(csin) char *, char *&, char[ANY], char[] "$csinput" -%typemap(csin) SWIGTYPE "$&csclassname.getCPtr($csinput)" -%typemap(csin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$csclassname.getCPtr($csinput)" -%typemap(csin) SWIGTYPE && "$csclassname.swigRelease($csinput)" -%typemap(csin) SWIGTYPE (CLASS::*) "$csclassname.getCMemberPtr($csinput)" - -/* The csout typemap is used for converting function return types from the return type - * used in the PInvoke class to the type returned by the proxy, module or type wrapper class. - * The $excode special variable is replaced by the excode typemap attribute code if the - * method can throw any exceptions from unmanaged code, otherwise replaced by nothing. */ - -// Macro used by the $excode special variable -%define SWIGEXCODE "\n if ($imclassname.SWIGPendingException.Pending) throw $imclassname.SWIGPendingException.Retrieve();" %enddef -%define SWIGEXCODE2 "\n if ($imclassname.SWIGPendingException.Pending) throw $imclassname.SWIGPendingException.Retrieve();" %enddef - -%typemap(csout, excode=SWIGEXCODE) bool, const bool & { - bool ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) char, const char & { - char ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) signed char, const signed char & { - sbyte ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned char, const unsigned char & { - byte ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) short, const short & { - short ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned short, const unsigned short & { - ushort ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) int, const int & { - int ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned int, const unsigned int & { - uint ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) long, const long & { - int ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned long, const unsigned long & { - uint ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) long long, const long long & { - long ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned long long, const unsigned long long & { - ulong ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) float, const float & { - float ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) double, const double & { - double ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) char *, char *&, char[ANY], char[] { - string ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) void { - $imcall;$excode - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE { - $&csclassname ret = new $&csclassname($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE & { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE && { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE *, SWIGTYPE [] { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE (CLASS::*) { - string cMemberPtr = $imcall; - $csclassname ret = (cMemberPtr == null) ? null : new $csclassname(cMemberPtr, $owner);$excode - return ret; - } - - -/* Properties */ -%typemap(csvarin, excode=SWIGEXCODE2) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ - set { - $imcall;$excode - } %} - -%typemap(csvarin, excode=SWIGEXCODE2) char *, char *&, char[ANY], char[] %{ - set { - $imcall;$excode - } %} - -%typemap(csvarout, excode=SWIGEXCODE2) bool, const bool & %{ - get { - bool ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) char, const char & %{ - get { - char ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) signed char, const signed char & %{ - get { - sbyte ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned char, const unsigned char & %{ - get { - byte ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) short, const short & %{ - get { - short ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned short, const unsigned short & %{ - get { - ushort ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) int, const int & %{ - get { - int ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned int, const unsigned int & %{ - get { - uint ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) long, const long & %{ - get { - int ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned long, const unsigned long & %{ - get { - uint ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) long long, const long long & %{ - get { - long ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned long long, const unsigned long long & %{ - get { - ulong ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) float, const float & %{ - get { - float ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) double, const double & %{ - get { - double ret = $imcall;$excode - return ret; - } %} - - -%typemap(csvarout, excode=SWIGEXCODE2) char *, char *&, char[ANY], char[] %{ - get { - string ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) void %{ - get { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE %{ - get { - $&csclassname ret = new $&csclassname($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE & %{ - get { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE && %{ - get { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE *, SWIGTYPE [] %{ - get { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode - return ret; - } %} - -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE (CLASS::*) %{ - get { - string cMemberPtr = $imcall; - $csclassname ret = (cMemberPtr == null) ? null : new $csclassname(cMemberPtr, $owner);$excode - return ret; - } %} - -/* Pointer reference typemaps */ -%typemap(ctype) SWIGTYPE *const& "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE *const& "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE *const& "$*csclassname" -%typemap(csin) SWIGTYPE *const& "$*csclassname.getCPtr($csinput)" -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE *const& { - global::System.IntPtr cPtr = $imcall; - $*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode - return ret; - } -%typemap(csvarout, excode=SWIGEXCODE) SWIGTYPE *const& %{ - get { - global::System.IntPtr cPtr = $imcall; - $*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode - return ret; - } %} - -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)$input; - $1 = ($1_ltype)&temp; %} -%typemap(out) SWIGTYPE *const& -%{ $result = (void *)*$1; %} -%typemap(directorin) SWIGTYPE *const& -%{ $input = (void *) $1; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = ($*1_ltype)$input; - $result = &swig_temp; %} -%typemap(csdirectorin) SWIGTYPE *const& "($iminput == global::System.IntPtr.Zero) ? null : new $*csclassname($iminput, false)" -%typemap(csdirectorout) SWIGTYPE *const& "$*csclassname.getCPtr($cscall).Handle" - -/* Marshal C/C++ pointer to global::System.IntPtr */ -%typemap(ctype) void *VOID_INT_PTR "void *" -%typemap(imtype) void *VOID_INT_PTR "global::System.IntPtr" -%typemap(cstype) void *VOID_INT_PTR "global::System.IntPtr" -%typemap(in) void *VOID_INT_PTR %{ $1 = ($1_ltype)$input; %} -%typemap(out) void *VOID_INT_PTR %{ $result = (void *)$1; %} -%typemap(csin) void *VOID_INT_PTR "$csinput" -%typemap(csout, excode=SWIGEXCODE) void *VOID_INT_PTR { - global::System.IntPtr ret = $imcall;$excode - return ret; - } -%typemap(csvarin, excode=SWIGEXCODE2) void *VOID_INT_PTR %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) void *VOID_INT_PTR %{ - get { - global::System.IntPtr ret = $imcall;$excode - return ret; - } %} -%typemap(csdirectorin) void *VOID_INT_PTR "$iminput" -%typemap(csdirectorout) void *VOID_INT_PTR "$cscall" - -/* Typemaps used for the generation of proxy and type wrapper class code */ -%typemap(csbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class" -%typemap(cscode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csinterfaces) SWIGTYPE "global::System.IDisposable" -%typemap(csinterfaces) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csinterfaces_derived) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csinterfacemodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public interface" - - -// csbody typemaps... these are in macros so that the visibility of the methods can be easily changed by users. - -%define SWIG_CSBODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Proxy classes (base classes, ie, not derived classes) -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef swigRelease($csclassname obj) { - if (obj != null) { - if (!obj.swigCMemOwn) - throw new global::System.ApplicationException("Cannot release ownership as memory is not owned"); - global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.Dispose(); - return ptr; - } else { - return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGUpcast(cPtr), cMemoryOwn) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef swigRelease($csclassname obj) { - if (obj != null) { - if (!obj.swigCMemOwn) - throw new global::System.ApplicationException("Cannot release ownership as memory is not owned"); - global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.Dispose(); - return ptr; - } else { - return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } -%} -%enddef - -%define SWIG_CSBODY_TYPEWRAPPER(PTRCTOR_VISIBILITY, DEFAULTCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Typewrapper classes -%typemap(csbody) TYPE *, TYPE &, TYPE &&, TYPE [] %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool futureUse) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - DEFAULTCTOR_VISIBILITY $csclassname() { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef swigRelease($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csbody) TYPE (CLASS::*) %{ - private string swigCMemberPtr; - - PTRCTOR_VISIBILITY $csclassname(string cMemberPtr, bool futureUse) { - swigCMemberPtr = cMemberPtr; - } - - DEFAULTCTOR_VISIBILITY $csclassname() { - swigCMemberPtr = null; - } - - CPTR_VISIBILITY static string getCMemberPtr($csclassname obj) { - return obj.swigCMemberPtr; - } -%} -%enddef - -/* Set the default csbody typemaps to use internal visibility. - Use the macros to change to public if using multiple modules. */ -SWIG_CSBODY_PROXY(internal, internal, SWIGTYPE) -SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE) - -%typemap(csdispose) SWIGTYPE %{ - ~$csclassname() { - Dispose(false); - } - - public void Dispose() { - Dispose(true); - global::System.GC.SuppressFinalize(this); - } -%} - -%typemap(csdispose_derived) SWIGTYPE "" - -%typemap(csconstruct, excode=SWIGEXCODE,directorconnect="\n SwigDirectorConnect();") SWIGTYPE %{: this($imcall, true) {$excode$directorconnect - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - -%typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{ - protected void $methodname() { - swigCMemOwn = false; - $imcall; - } -%} - -/* C# specific directives */ -#define %csconst(flag) %feature("cs:const","flag") -#define %csconstvalue(value) %feature("cs:constvalue",value) -#define %csenum(wrapapproach) %feature("cs:enum","wrapapproach") -#define %csmethodmodifiers %feature("cs:methodmodifiers") -#define %csnothrowexception %feature("except") -#define %csattributes %feature("cs:attributes") -#define %proxycode %insert("proxycode") - -%pragma(csharp) imclassclassmodifiers="class" -%pragma(csharp) moduleclassmodifiers="public class" - -/* Some ANSI C typemaps */ - -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* csharp keywords */ -%include - -// Default enum handling -%include - -// For vararg handling in macros, from swigmacros.swg -#define %arg(X...) X - -/* -// Alternative char * typemaps. -%pragma(csharp) imclasscode=%{ - public class SWIGStringMarshal : global::System.IDisposable { - public readonly global::System.Runtime.InteropServices.HandleRef swigCPtr; - public SWIGStringMarshal(string str) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, global::System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(str)); - } - public virtual void Dispose() { - global::System.Runtime.InteropServices.Marshal.FreeHGlobal(swigCPtr.Handle); - global::System.GC.SuppressFinalize(this); - } - } -%} - -%typemap(imtype, out="global::System.IntPtr") char *, char[ANY], char[] "global::System.Runtime.InteropServices.HandleRef" -%typemap(out) char *, char[ANY], char[] %{ $result = $1; %} -%typemap(csin) char *, char[ANY], char[] "new $imclassname.SWIGStringMarshal($csinput).swigCPtr" -%typemap(csout, excode=SWIGEXCODE) char *, char[ANY], char[] { - string ret = global::System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode - return ret; - } -%typemap(csvarin, excode=SWIGEXCODE2) char *, char[ANY], char[] %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) char *, char[ANY], char[] %{ - get { - string ret = global::System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode - return ret; - } %} -*/ - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/csharphead.swg b/linux/bin/swig/share/swig/4.1.0/csharp/csharphead.swg deleted file mode 100755 index 56a019bd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/csharphead.swg +++ /dev/null @@ -1,339 +0,0 @@ -/* ----------------------------------------------------------------------------- - * csharphead.swg - * - * Support code for exceptions if the SWIG_CSHARP_NO_EXCEPTION_HELPER is not defined - * Support code for strings if the SWIG_CSHARP_NO_STRING_HELPER is not defined - * ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ -#include -#include -#include -%} - -#if !defined(SWIG_CSHARP_NO_EXCEPTION_HELPER) -%insert(runtime) %{ -/* Support for throwing C# exceptions from C/C++. There are two types: - * Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */ -typedef enum { - SWIG_CSharpApplicationException, - SWIG_CSharpArithmeticException, - SWIG_CSharpDivideByZeroException, - SWIG_CSharpIndexOutOfRangeException, - SWIG_CSharpInvalidCastException, - SWIG_CSharpInvalidOperationException, - SWIG_CSharpIOException, - SWIG_CSharpNullReferenceException, - SWIG_CSharpOutOfMemoryException, - SWIG_CSharpOverflowException, - SWIG_CSharpSystemException -} SWIG_CSharpExceptionCodes; - -typedef enum { - SWIG_CSharpArgumentException, - SWIG_CSharpArgumentNullException, - SWIG_CSharpArgumentOutOfRangeException -} SWIG_CSharpExceptionArgumentCodes; - -typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *); -typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *); - -typedef struct { - SWIG_CSharpExceptionCodes code; - SWIG_CSharpExceptionCallback_t callback; -} SWIG_CSharpException_t; - -typedef struct { - SWIG_CSharpExceptionArgumentCodes code; - SWIG_CSharpExceptionArgumentCallback_t callback; -} SWIG_CSharpExceptionArgument_t; - -static SWIG_CSharpException_t SWIG_csharp_exceptions[] = { - { SWIG_CSharpApplicationException, NULL }, - { SWIG_CSharpArithmeticException, NULL }, - { SWIG_CSharpDivideByZeroException, NULL }, - { SWIG_CSharpIndexOutOfRangeException, NULL }, - { SWIG_CSharpInvalidCastException, NULL }, - { SWIG_CSharpInvalidOperationException, NULL }, - { SWIG_CSharpIOException, NULL }, - { SWIG_CSharpNullReferenceException, NULL }, - { SWIG_CSharpOutOfMemoryException, NULL }, - { SWIG_CSharpOverflowException, NULL }, - { SWIG_CSharpSystemException, NULL } -}; - -static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = { - { SWIG_CSharpArgumentException, NULL }, - { SWIG_CSharpArgumentNullException, NULL }, - { SWIG_CSharpArgumentOutOfRangeException, NULL } -}; - -static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) { - SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback; - if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) { - callback = SWIG_csharp_exceptions[code].callback; - } - callback(msg); -} - -static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { - SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback; - if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) { - callback = SWIG_csharp_exceptions_argument[code].callback; - } - callback(msg, param_name); -} -%} - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_$module( - SWIG_CSharpExceptionCallback_t applicationCallback, - SWIG_CSharpExceptionCallback_t arithmeticCallback, - SWIG_CSharpExceptionCallback_t divideByZeroCallback, - SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback, - SWIG_CSharpExceptionCallback_t invalidCastCallback, - SWIG_CSharpExceptionCallback_t invalidOperationCallback, - SWIG_CSharpExceptionCallback_t ioCallback, - SWIG_CSharpExceptionCallback_t nullReferenceCallback, - SWIG_CSharpExceptionCallback_t outOfMemoryCallback, - SWIG_CSharpExceptionCallback_t overflowCallback, - SWIG_CSharpExceptionCallback_t systemCallback) { - SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback; - SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback; - SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback; - SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback; - SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback; - SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback; - SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback; - SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback; - SWIG_csharp_exceptions[SWIG_CSharpOutOfMemoryException].callback = outOfMemoryCallback; - SWIG_csharp_exceptions[SWIG_CSharpOverflowException].callback = overflowCallback; - SWIG_csharp_exceptions[SWIG_CSharpSystemException].callback = systemCallback; -} - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( - SWIG_CSharpExceptionArgumentCallback_t argumentCallback, - SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback, - SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) { - SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback; - SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback; - SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback; -} -%} - -%pragma(csharp) imclasscode=%{ - protected class SWIGExceptionHelper { - - public delegate void ExceptionDelegate(string message); - public delegate void ExceptionArgumentDelegate(string message, string paramName); - - static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException); - static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException); - static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException); - static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException); - static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException); - static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException); - static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException); - static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException); - static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException); - static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException); - static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException); - - static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException); - static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException); - static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException); - - [global::System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="SWIGRegisterExceptionCallbacks_$module")] - public static extern void SWIGRegisterExceptionCallbacks_$module( - ExceptionDelegate applicationDelegate, - ExceptionDelegate arithmeticDelegate, - ExceptionDelegate divideByZeroDelegate, - ExceptionDelegate indexOutOfRangeDelegate, - ExceptionDelegate invalidCastDelegate, - ExceptionDelegate invalidOperationDelegate, - ExceptionDelegate ioDelegate, - ExceptionDelegate nullReferenceDelegate, - ExceptionDelegate outOfMemoryDelegate, - ExceptionDelegate overflowDelegate, - ExceptionDelegate systemExceptionDelegate); - - [global::System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_$module")] - public static extern void SWIGRegisterExceptionCallbacksArgument_$module( - ExceptionArgumentDelegate argumentDelegate, - ExceptionArgumentDelegate argumentNullDelegate, - ExceptionArgumentDelegate argumentOutOfRangeDelegate); - - static void SetPendingApplicationException(string message) { - SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingArithmeticException(string message) { - SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingDivideByZeroException(string message) { - SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingIndexOutOfRangeException(string message) { - SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingInvalidCastException(string message) { - SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingInvalidOperationException(string message) { - SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingIOException(string message) { - SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingNullReferenceException(string message) { - SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingOutOfMemoryException(string message) { - SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingOverflowException(string message) { - SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingSystemException(string message) { - SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve())); - } - - static void SetPendingArgumentException(string message, string paramName) { - SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve())); - } - static void SetPendingArgumentNullException(string message, string paramName) { - global::System.Exception e = SWIGPendingException.Retrieve(); - if (e != null) message = message + " Inner Exception: " + e.Message; - SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message)); - } - static void SetPendingArgumentOutOfRangeException(string message, string paramName) { - global::System.Exception e = SWIGPendingException.Retrieve(); - if (e != null) message = message + " Inner Exception: " + e.Message; - SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message)); - } - - static SWIGExceptionHelper() { - SWIGRegisterExceptionCallbacks_$module( - applicationDelegate, - arithmeticDelegate, - divideByZeroDelegate, - indexOutOfRangeDelegate, - invalidCastDelegate, - invalidOperationDelegate, - ioDelegate, - nullReferenceDelegate, - outOfMemoryDelegate, - overflowDelegate, - systemDelegate); - - SWIGRegisterExceptionCallbacksArgument_$module( - argumentDelegate, - argumentNullDelegate, - argumentOutOfRangeDelegate); - } - } - - protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper(); - - public class SWIGPendingException { - [global::System.ThreadStatic] - private static global::System.Exception pendingException = null; - private static int numExceptionsPending = 0; - private static global::System.Object exceptionsLock = null; - - public static bool Pending { - get { - bool pending = false; - if (numExceptionsPending > 0) - if (pendingException != null) - pending = true; - return pending; - } - } - - public static void Set(global::System.Exception e) { - if (pendingException != null) - throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); - pendingException = e; - lock(exceptionsLock) { - numExceptionsPending++; - } - } - - public static global::System.Exception Retrieve() { - global::System.Exception e = null; - if (numExceptionsPending > 0) { - if (pendingException != null) { - e = pendingException; - pendingException = null; - lock(exceptionsLock) { - numExceptionsPending--; - } - } - } - return e; - } - - static SWIGPendingException() { - exceptionsLock = new global::System.Object(); - } - } -%} -#endif // SWIG_CSHARP_NO_EXCEPTION_HELPER - -#if !defined(SWIG_CSHARP_NO_STRING_HELPER) -%insert(runtime) %{ -/* Callback for returning strings to C# without leaking memory */ -typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *); -static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL; -%} - -%pragma(csharp) imclasscode=%{ - protected class SWIGStringHelper { - - public delegate string SWIGStringDelegate(string message); - static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString); - - [global::System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="SWIGRegisterStringCallback_$module")] - public static extern void SWIGRegisterStringCallback_$module(SWIGStringDelegate stringDelegate); - - static string CreateString(string cString) { - return cString; - } - - static SWIGStringHelper() { - SWIGRegisterStringCallback_$module(stringDelegate); - } - } - - static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper(); -%} - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_$module(SWIG_CSharpStringHelperCallback callback) { - SWIG_csharp_string_callback = callback; -} -%} -#endif // SWIG_CSHARP_NO_STRING_HELPER - -#if !defined(SWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR) -// Ensure the class is not marked beforefieldinit -%pragma(csharp) imclasscode=%{ - static $imclassname() { - } -%} -#endif - -%insert(runtime) %{ -/* Contract support */ - -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } } while (0) -%} diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/csharpkw.swg b/linux/bin/swig/share/swig/4.1.0/csharp/csharpkw.swg deleted file mode 100755 index 1904fce9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/csharpkw.swg +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef CSHARP_CSHARPKW_SWG_ -#define CSHARP_CSHARPKW_SWG_ - -/* Warnings for C# keywords */ -#define CSHARPKW(x) %keywordwarn("'" `x` "' is a C# keyword",rename="%s_") `x` - -#define CSHARPCLASSKW(x) %keywordwarn("'" `x` "' is a special method name used in the C# wrapper classes",%$isclass,rename="%s_") `x` - -/* - from - http://www.jaggersoft.com/csharp_grammar.html#1.7%20Keywords - -*/ - -CSHARPKW(abstract); -CSHARPKW(as); -CSHARPKW(base); -CSHARPKW(bool); -CSHARPKW(break); -CSHARPKW(byte); -CSHARPKW(case); -CSHARPKW(catch); -CSHARPKW(char); -CSHARPKW(checked); -CSHARPKW(class); -CSHARPKW(const); -CSHARPKW(continue); -CSHARPKW(decimal); -CSHARPKW(default); -CSHARPKW(delegate); -CSHARPKW(do); -CSHARPKW(double); -CSHARPKW(else); -CSHARPKW(enum); -CSHARPKW(event); -CSHARPKW(explicit); -CSHARPKW(extern); -CSHARPKW(false); -CSHARPKW(finally); -CSHARPKW(fixed); -CSHARPKW(float); -CSHARPKW(for); -CSHARPKW(foreach); -CSHARPKW(goto); -CSHARPKW(if); -CSHARPKW(implicit); -CSHARPKW(in); -CSHARPKW(int); -CSHARPKW(interface); -CSHARPKW(internal); -CSHARPKW(is); -CSHARPKW(lock); -CSHARPKW(long); -CSHARPKW(namespace); -CSHARPKW(new); -CSHARPKW(null); -CSHARPKW(object); -CSHARPKW(operator); -CSHARPKW(out); -CSHARPKW(override); -CSHARPKW(params); -CSHARPKW(private); -CSHARPKW(protected); -CSHARPKW(public); -CSHARPKW(readonly); -CSHARPKW(ref); -CSHARPKW(return); -CSHARPKW(sbyte); -CSHARPKW(sealed); -CSHARPKW(short); -CSHARPKW(sizeof); -CSHARPKW(stackalloc); -CSHARPKW(static); -CSHARPKW(struct); -CSHARPKW(string); -CSHARPKW(switch); -CSHARPKW(this); -CSHARPKW(throw); -CSHARPKW(true); -CSHARPKW(try); -CSHARPKW(typeof); -CSHARPKW(uint); -CSHARPKW(ulong); -CSHARPKW(unchecked); -CSHARPKW(unsafe); -CSHARPKW(ushort); -CSHARPKW(using); -CSHARPKW(virtual); -CSHARPKW(void); -CSHARPKW(volatile); -CSHARPKW(while); - -CSHARPCLASSKW(delete); - -#undef CSHARPKW - -#endif //CSHARP_CSHARPKW_SWG_ diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/director.swg b/linux/bin/swig/share/swig/4.1.0/csharp/director.swg deleted file mode 100755 index 5d2ab5d9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/director.swg +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that C# proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#if defined(DEBUG_DIRECTOR_OWNED) -#include -#endif -#include -#include - -namespace Swig { - /* Director base class - not currently used in C# directors */ - class Director { - }; - - /* Base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - - public: - DirectorException(const char *msg) : swig_msg(msg) { - } - - DirectorException(const std::string &msg) : swig_msg(msg) { - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - /* Pure virtual method exception */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; -} - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/enums.swg b/linux/bin/swig/share/swig/4.1.0/csharp/enums.swg deleted file mode 100755 index 5cc26547..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/enums.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enums.swg - * - * Include this file in order for C/C++ enums to be wrapped by proper C# enums. - * Note that the PINVOKE layer handles the enum as an int. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(cstype) const enum SWIGTYPE & "$*csclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(csdirectorin) const enum SWIGTYPE & "($*csclassname)$iminput" -%typemap(csdirectorout) const enum SWIGTYPE & "(int)$cscall" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws, canthrow=1) const enum SWIGTYPE & -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) const enum SWIGTYPE & "(int)$csinput" -%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { - $*csclassname ret = ($*csclassname)$imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ - get { - $*csclassname ret = ($*csclassname)$imcall;$excode - return ret; - } %} - - -// enum SWIGTYPE typemaps -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(cstype) enum SWIGTYPE "$csclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(csdirectorin) enum SWIGTYPE "($csclassname)$iminput" -%typemap(csdirectorout) enum SWIGTYPE "(int)$cscall" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws, canthrow=1) enum SWIGTYPE -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) enum SWIGTYPE "(int)$csinput" -%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { - $csclassname ret = ($csclassname)$imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ - get { - $csclassname ret = ($csclassname)$imcall;$excode - return ret; - } %} - -%typemap(csbase) enum SWIGTYPE "" -%typemap(csclassmodifiers) enum SWIGTYPE "public enum" -%typemap(cscode) enum SWIGTYPE "" -%typemap(csimports) enum SWIGTYPE "" -%typemap(csinterfaces) enum SWIGTYPE "" - -%typemap(csbody) enum SWIGTYPE "" - -%csenum(proper); - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/enumsimple.swg b/linux/bin/swig/share/swig/4.1.0/csharp/enumsimple.swg deleted file mode 100755 index 24e4bcf1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/enumsimple.swg +++ /dev/null @@ -1,88 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumsimple.swg - * - * This file provides backwards compatible enum wrapping. SWIG versions 1.3.21 - * and earlier wrapped global enums with constant integers in the module - * class. Enums declared within a C++ class were wrapped by constant integers - * in the C# proxy class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(cstype) const enum SWIGTYPE & "int" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(csdirectorin) const enum SWIGTYPE & "$iminput" -%typemap(csdirectorout) const enum SWIGTYPE & "$cscall" - -%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" - -%typemap(throws, canthrow=1) const enum SWIGTYPE & -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) const enum SWIGTYPE & "$csinput" -%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { - int ret = $imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ - get { - int ret = $imcall;$excode - return ret; - } %} - - -// enum SWIGTYPE typemaps -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(cstype) enum SWIGTYPE "int" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(csdirectorin) enum SWIGTYPE "$iminput" -%typemap(csdirectorout) enum SWIGTYPE "$cscall" - -%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" - -%typemap(throws, canthrow=1) enum SWIGTYPE -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) enum SWIGTYPE "$csinput" -%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { - int ret = $imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ - get { - int ret = $imcall;$excode - return ret; - } %} - -%typemap(csbase) enum SWIGTYPE "" -%typemap(csclassmodifiers) enum SWIGTYPE "" -%typemap(cscode) enum SWIGTYPE "" -%typemap(csimports) enum SWIGTYPE "" -%typemap(csinterfaces) enum SWIGTYPE "" - -%typemap(csbody) enum SWIGTYPE "" - -%csenum(simple); - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/enumtypesafe.swg b/linux/bin/swig/share/swig/4.1.0/csharp/enumtypesafe.swg deleted file mode 100755 index fd680173..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/enumtypesafe.swg +++ /dev/null @@ -1,130 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumtypesafe.swg - * - * Include this file in order for C/C++ enums to be wrapped by the so called - * typesafe enum pattern. Each enum has an equivalent C# class named after the - * enum and each enum item is a static instance of this class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(cstype) const enum SWIGTYPE & "$*csclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(csdirectorin) const enum SWIGTYPE & "$*csclassname.swigToEnum($iminput)" -%typemap(csdirectorout) const enum SWIGTYPE & "$cscall.swigValue" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws, canthrow=1) const enum SWIGTYPE & -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) const enum SWIGTYPE & "$csinput.swigValue" -%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { - $*csclassname ret = $*csclassname.swigToEnum($imcall);$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ - get { - $*csclassname ret = $*csclassname.swigToEnum($imcall);$excode - return ret; - } %} - - -// enum SWIGTYPE typemaps -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(cstype) enum SWIGTYPE "$csclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(csdirectorin) enum SWIGTYPE "$csclassname.swigToEnum($iminput)" -%typemap(csdirectorout) enum SWIGTYPE "$cscall.swigValue" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws, canthrow=1) enum SWIGTYPE -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) enum SWIGTYPE "$csinput.swigValue" -%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { - $csclassname ret = $csclassname.swigToEnum($imcall);$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ - get { - $csclassname ret = $csclassname.swigToEnum($imcall);$excode - return ret; - } %} - -%typemap(csbase) enum SWIGTYPE "" -%typemap(csclassmodifiers) enum SWIGTYPE "public sealed class" -%typemap(cscode) enum SWIGTYPE "" -%typemap(csimports) enum SWIGTYPE "" -%typemap(csinterfaces) enum SWIGTYPE "" - -/* - * The swigToEnum method is used to find the C# enum from a C++ enum integer value. The default one here takes - * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial - * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be - * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. - * The special variable, $enumvalues, is replaced with a comma separated list of all the enum values. - */ -%typemap(csbody) enum SWIGTYPE %{ - public readonly int swigValue; - - public static $csclassname swigToEnum(int swigValue) { - if (swigValue < swigValues.Length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.Length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new global::System.ArgumentOutOfRangeException("No enum $csclassname with value " + swigValue); - } - - public override string ToString() { - return swigName; - } - - private $csclassname(string swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private $csclassname(string swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private $csclassname(string swigName, $csclassname swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static $csclassname[] swigValues = { $enumvalues }; - private static int swigNext = 0; - private readonly string swigName; -%} - -%csenum(typesafe); - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_array.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_array.i deleted file mode 100755 index 6e7fe9eb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_array.i +++ /dev/null @@ -1,227 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_array.i - * - * SWIG typemaps for std::array - * C# implementation - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.IReadOnlyList<> collection. - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -#include -%} - -%include - - -%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" -%proxycode %{ - public $csclassname(global::System.Collections.ICollection c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - int end = global::System.Math.Min(this.Count, c.Count); - int i = 0; - foreach ($typemap(cstype, T) elem in c) { - if (i >= end) - break; - this[i++] = elem; - } - } - - public int Count { - get { - return (int)size(); - } - } - - public $typemap(cstype, T) this[int index] { - get { - return getitem(index); - } - set { - setitem(index, value); - } - } - - public bool IsEmpty { - get { - return empty(); - } - } - - public void CopyTo($typemap(cstype, T)[] array) - { - CopyTo(0, array, 0, this.Count); - } - - public void CopyTo($typemap(cstype, T)[] array, int arrayIndex) - { - CopyTo(0, array, arrayIndex, this.Count); - } - - public void CopyTo(int index, $typemap(cstype, T)[] array, int arrayIndex, int count) - { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (index < 0) - throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (count < 0) - throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (index+count > this.Count || arrayIndex+count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - for (int i=0; i global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator - , global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> - { - private $csclassname collectionRef; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, T) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, T))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - currentObject = collectionRef[currentIndex]; - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - array(); - array(const array &other); - - size_type size() const; - bool empty() const; - - %rename(Fill) fill; - void fill(const value_type& value); - - %rename(Swap) swap; - void swap(array& other); - - %extend { - T getitemcopy(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - const_reference getitem(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - void setitem(int index, const_reference val) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - (*$self)[index] = val; - else - throw std::out_of_range("index"); - } - void Reverse() { - std::reverse($self->begin(), $self->end()); - } - void Reverse(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - std::reverse($self->begin()+index, $self->begin()+index+count); - } - } -%enddef - - -%csmethodmodifiers std::array::empty "private" -%csmethodmodifiers std::array::getitemcopy "private" -%csmethodmodifiers std::array::getitem "private" -%csmethodmodifiers std::array::setitem "private" -%csmethodmodifiers std::array::size "private" - -namespace std { - template class array { - SWIG_STD_ARRAY_INTERNAL(T, N) - }; -} diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_auto_ptr.i deleted file mode 100755 index da15df3e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_auto_ptr.i +++ /dev/null @@ -1,38 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap (ctype) std::auto_ptr< TYPE > "void *" -%typemap (imtype, out="System.IntPtr") std::auto_ptr< TYPE > "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) std::auto_ptr< TYPE > "$typemap(cstype, TYPE)" - -%typemap(in) std::auto_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(csin) std::auto_ptr< TYPE > "$typemap(cstype, TYPE).swigRelease($csinput)" - -%typemap (out) std::auto_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(csout, excode=SWIGEXCODE) std::auto_ptr< TYPE > { - System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_common.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_complex.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_complex.i deleted file mode 100755 index 6a0cc545..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_complex.i +++ /dev/null @@ -1,95 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_complex.i - * - * Typemaps for handling std::complex and std::complex as a .NET - * System.Numerics.Complex type. Requires .NET 4 minimum. - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -%fragment("SwigSystemNumericsComplex", "header") { -extern "C" { -// Identical to the layout of System.Numerics.Complex, but does assume that it is -// LayoutKind.Sequential on the managed side -struct SwigSystemNumericsComplex { - double real; - double imag; -}; -} - -SWIGINTERN SwigSystemNumericsComplex SwigCreateSystemNumericsComplex(double real, double imag) { - SwigSystemNumericsComplex cpx; - cpx.real = real; - cpx.imag = imag; - return cpx; -} -} - -namespace std { - -%naturalvar complex; - -template -class complex -{ -public: - complex(T re = T(), T im = T()); -}; - -} - -%define SWIG_COMPLEX_TYPEMAPS(T) -%typemap(ctype, fragment="SwigSystemNumericsComplex") std::complex, const std::complex & "SwigSystemNumericsComplex" -%typemap(imtype) std::complex, const std::complex & "System.Numerics.Complex" -%typemap(cstype) std::complex, const std::complex & "System.Numerics.Complex" - -%typemap(in) std::complex -%{$1 = std::complex< double >($input.real, $input.imag);%} - -%typemap(in) const std::complex &($*1_ltype temp) -%{temp = std::complex< T >((T)$input.real, (T)$input.imag); - $1 = &temp;%} - -%typemap(out, null="SwigCreateSystemNumericsComplex(0.0, 0.0)") std::complex -%{$result = SwigCreateSystemNumericsComplex($1.real(), $1.imag());%} - -%typemap(out, null="SwigCreateSystemNumericsComplex(0.0, 0.0)") const std::complex & -%{$result = SwigCreateSystemNumericsComplex($1->real(), $1->imag());%} - -%typemap(cstype) std::complex, const std::complex & "System.Numerics.Complex" - -%typemap(csin) std::complex, const std::complex & "$csinput" - -%typemap(csout, excode=SWIGEXCODE) std::complex, const std::complex & { - System.Numerics.Complex ret = $imcall;$excode - return ret; - } - -%typemap(csvarin, excode=SWIGEXCODE2) const std::complex & %{ - set { - $imcall;$excode - } - %} - -%typemap(csvarout, excode=SWIGEXCODE2) const std::complex & %{ - get { - System.Numerics.Complex ret = $imcall;$excode - return ret; - } - %} - -%template() std::complex; -%enddef - -// By default, typemaps for both std::complex and std::complex -// are defined, but one of them can be disabled by predefining the -// corresponding symbol before including this file. -#ifndef SWIG_NO_STD_COMPLEX_DOUBLE -SWIG_COMPLEX_TYPEMAPS(double) -#endif - -#ifndef SWIG_NO_STD_COMPLEX_FLOAT -SWIG_COMPLEX_TYPEMAPS(float) -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_deque.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_except.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_except.i deleted file mode 100755 index c983bd0f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_except.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. These typemaps are - * used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws, canthrow=1) std::bad_cast "SWIG_CSharpSetPendingException(SWIG_CSharpInvalidCastException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::bad_exception "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::domain_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::exception "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::invalid_argument "SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentException, $1.what(), \"\");\n return $null;" -%typemap(throws, canthrow=1) std::length_error "SWIG_CSharpSetPendingException(SWIG_CSharpIndexOutOfRangeException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::logic_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::out_of_range "SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::overflow_error "SWIG_CSharpSetPendingException(SWIG_CSharpOverflowException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::range_error "SWIG_CSharpSetPendingException(SWIG_CSharpIndexOutOfRangeException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::runtime_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::underflow_error "SWIG_CSharpSetPendingException(SWIG_CSharpOverflowException, $1.what());\n return $null;" - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_list.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_list.i deleted file mode 100755 index cf6f2023..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_list.i +++ /dev/null @@ -1,519 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list - * C# implementation - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.LinkedList<> collection. - * - * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with - * C++ std::list wrappers. The ICollection<> interface is also implemented to provide enhanced functionality - * whenever we are confident that the required C++ operator== is available. This is the case for when - * T is a primitive type or a pointer. If T does define an operator==, then use the SWIG_STD_LIST_ENHANCED - * macro to obtain this enhanced functionality, for example: - * - * SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass) - * %template(ListKlass) std::list; - * ----------------------------------------------------------------------------- */ - -%include - -// MACRO for use within the std::list class body -%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" - -%apply void *VOID_INT_PTR { std::list< CTYPE >::iterator * }; - -%proxycode %{ - public $csclassname(global::System.Collections.IEnumerable c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - foreach ($typemap(cstype, CTYPE) element in c) { - this.AddLast(element); - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public int Count { - get { - return (int)size(); - } - } - - public $csclassnameNode First { - get { - if (Count == 0) - return null; - return new $csclassnameNode(getFirstIter(), this); - } - } - - public $csclassnameNode Last { - get { - if (Count == 0) - return null; - return new $csclassnameNode(getLastIter(), this); - } - } - - public $csclassnameNode AddFirst($typemap(cstype, CTYPE) value) { - push_front(value); - return new $csclassnameNode(getFirstIter(), this); - } - - public void AddFirst($csclassnameNode newNode) { - ValidateNewNode(newNode); - if (!newNode.inlist) { - push_front(newNode.csharpvalue); - newNode.iter = getFirstIter(); - newNode.inlist = true; - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public $csclassnameNode AddLast($typemap(cstype, CTYPE) value) { - push_back(value); - return new $csclassnameNode(getLastIter(), this); - } - - public void AddLast($csclassnameNode newNode) { - ValidateNewNode(newNode); - if (!newNode.inlist) { - push_back(newNode.csharpvalue); - newNode.iter = getLastIter(); - newNode.inlist = true; - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public $csclassnameNode AddBefore($csclassnameNode node, $typemap(cstype, CTYPE) value) { - return new $csclassnameNode(insertNode(node.iter, value), this); - } - - public void AddBefore($csclassnameNode node, $csclassnameNode newNode) { - ValidateNode(node); - ValidateNewNode(newNode); - if (!newNode.inlist) { - newNode.iter = insertNode(node.iter, newNode.csharpvalue); - newNode.inlist = true; - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public $csclassnameNode AddAfter($csclassnameNode node, $typemap(cstype, CTYPE) value) { - node = node.Next; - return new $csclassnameNode(insertNode(node.iter, value), this); - } - - public void AddAfter($csclassnameNode node, $csclassnameNode newNode) { - ValidateNode(node); - ValidateNewNode(newNode); - if (!newNode.inlist) { - if (node == this.Last) - AddLast(newNode); - else - { - node = node.Next; - newNode.iter = insertNode(node.iter, newNode.csharpvalue); - newNode.inlist = true; - } - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public void Add($typemap(cstype, CTYPE) value) { - AddLast(value); - } - - public void Remove($csclassnameNode node) { - ValidateNode(node); - eraseIter(node.iter); - } - - public void CopyTo($typemap(cstype, CTYPE)[] array, int index) { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (index < 0 || index > array.Length) - throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - $csclassnameNode node = this.First; - if (node != null) { - do { - array[index++] = node.Value; - node = node.Next; - } while (node != null); - } - } - - internal void ValidateNode($csclassnameNode node) { - if (node == null) { - throw new System.ArgumentNullException("node"); - } - if (!node.inlist || node.list != this) { - throw new System.InvalidOperationException("node"); - } - } - - internal void ValidateNewNode($csclassnameNode node) { - if (node == null) { - throw new System.ArgumentNullException("node"); - } - } - - global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, - global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> - { - private $csclassname collectionRef; - private $csclassnameNode currentNode; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - currentNode = collection.First; - currentIndex = 0; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, CTYPE) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, CTYPE))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - if (currentNode == null) { - currentIndex = collectionRef.Count + 1; - return false; - } - ++currentIndex; - currentObject = currentNode.Value; - currentNode = currentNode.Next; - return true; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } - - public sealed class $csclassnameNode { - internal $csclassname list; - internal System.IntPtr iter; - internal $typemap(cstype, CTYPE) csharpvalue; - internal bool inlist; - - public $csclassnameNode($typemap(cstype, CTYPE) value) { - csharpvalue = value; - inlist = false; - } - - internal $csclassnameNode(System.IntPtr iter, $csclassname list) { - this.list = list; - this.iter = iter; - inlist = true; - } - - public $csclassname List { - get { - return this.list; - } - } - - public $csclassnameNode Next { - get { - if (list.getNextIter(iter) == System.IntPtr.Zero) - return null; - return new $csclassnameNode(list.getNextIter(iter), list); - } - } - - public $csclassnameNode Previous { - get { - if (list.getPrevIter(iter) == System.IntPtr.Zero) - return null; - return new $csclassnameNode(list.getPrevIter(iter), list); - } - } - - public $typemap(cstype, CTYPE) Value { - get { - return list.getItem(this.iter); - } - set { - list.setItem(this.iter, value); - } - } - - public static bool operator==($csclassnameNode node1, $csclassnameNode node2) { - if (object.ReferenceEquals(node1, null) && object.ReferenceEquals(node2, null)) - return true; - if (object.ReferenceEquals(node1, null) || object.ReferenceEquals(node2, null)) - return false; - return node1.Equals(node2); - } - - public static bool operator!=($csclassnameNode node1, $csclassnameNode node2) { - if (node1 == null && node2 == null) - return false; - if (node1 == null || node2 == null) - return true; - return !node1.Equals(node2); - } - - public bool Equals($csclassnameNode node) { - if (node == null) - return false; - if (!node.inlist || !this.inlist) - return object.ReferenceEquals(this, node); - return list.equals(this.iter, node.iter); - } - - public override bool Equals(object node) { - return Equals(($csclassnameNode)node); - } - - public override int GetHashCode() { - int hash = 13; - if (inlist) { - hash = (hash * 7) + this.list.GetHashCode(); - hash = (hash * 7) + this.Value.GetHashCode(); - hash = (hash * 7) + this.list.getNextIter(this.iter).GetHashCode(); - hash = (hash * 7) + this.list.getPrevIter(this.iter).GetHashCode(); - } else { - hash = (hash * 7) + this.csharpvalue.GetHashCode(); - } - return hash; - } - - public void Dispose() { - list.deleteIter(this.iter); - } - } -%} - -public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - class iterator; - - void push_front(CTYPE const& x); - void push_back(CTYPE const& x); - %rename(RemoveFirst) pop_front; - void pop_front(); - %rename(RemoveLast) pop_back; - void pop_back(); - size_type size() const; - %rename(Clear) clear; - void clear(); - %extend { - const_reference getItem(iterator *iter) { - return **iter; - } - - void setItem(iterator *iter, CTYPE const& val) { - *(*iter) = val; - } - - iterator *getFirstIter() { - if ($self->size() == 0) - return NULL; - return new std::list< CTYPE >::iterator($self->begin()); - } - - iterator *getLastIter() { - if ($self->size() == 0) - return NULL; - return new std::list< CTYPE >::iterator(--$self->end()); - } - - iterator *getNextIter(iterator *iter) { - std::list< CTYPE >::iterator it = *iter; - if (std::distance(it, --$self->end()) != 0) { - std::list< CTYPE >::iterator* itnext = new std::list< CTYPE >::iterator(++it); - return itnext; - } - return NULL; - } - - iterator *getPrevIter(iterator *iter) { - std::list< CTYPE >::iterator it = *iter; - if (std::distance($self->begin(), it) != 0) { - std::list< CTYPE >::iterator* itprev = new std::list< CTYPE >::iterator(--it); - return itprev; - } - return NULL; - } - - iterator *insertNode(iterator *iter, CTYPE const& value) { - std::list< CTYPE >::iterator it = $self->insert(*iter, value); - return new std::list< CTYPE >::iterator(it); - } - - void eraseIter(iterator *iter) { - std::list< CTYPE >::iterator it = *iter; - $self->erase(it); - } - - void deleteIter(iterator *iter) { - delete iter; - } - - bool equals(iterator *iter1, iterator *iter2) { - if (iter1 == NULL && iter2 == NULL) - return true; - std::list< CTYPE >::iterator it1 = *iter1; - std::list< CTYPE >::iterator it2 = *iter2; - return it1 == it2; - } - } -%enddef - -// Extra methods added to the collection class if operator== is defined for the class being wrapped -// The class will then implement ICollection<>, which adds extra functionality -%define SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE...) - %extend { - bool Contains(CTYPE const& value) { - return std::find($self->begin(), $self->end(), value) != $self->end(); - } - - bool Remove(CTYPE const& value) { - std::list< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); - if (it != $self->end()) { - $self->erase(it); - return true; - } - return false; - } - - iterator *find(CTYPE const& value) { - if (std::find($self->begin(), $self->end(), value) != $self->end()) { - return new std::list< CTYPE >::iterator(std::find($self->begin(), $self->end(), value)); - } - return NULL; - } - } -%proxycode %{ - public $csclassnameNode Find($typemap(cstype, CTYPE) value) { - System.IntPtr tmp = find(value); - if (tmp != System.IntPtr.Zero) { - return new $csclassnameNode(tmp, this); - } - return null; - } -%} -%enddef - -// Macros for std::list class specializations/enhancements -%define SWIG_STD_LIST_ENHANCED(CTYPE...) -namespace std { - template<> class list< CTYPE > { - SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, %arg(CTYPE)); - SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE) - }; -} -%enddef - - -%{ -#include -#include -#include -%} - -%csmethodmodifiers std::list::size "private" -%csmethodmodifiers std::list::getItem "private" -%csmethodmodifiers std::list::setItem "private" -%csmethodmodifiers std::list::push_front "private" -%csmethodmodifiers std::list::push_back "private" -%csmethodmodifiers std::list::getFirstIter "private" -%csmethodmodifiers std::list::getNextIter "private" -%csmethodmodifiers std::list::getPrevIter "private" -%csmethodmodifiers std::list::getLastIter "private" -%csmethodmodifiers std::list::find "private" -%csmethodmodifiers std::list::deleteIter "private" - -namespace std { - // primary (unspecialized) class template for std::list - // does not require operator== to be defined - template - class list { - SWIG_STD_LIST_MINIMUM_INTERNAL(IEnumerable, T) - }; - // specialization for pointers - template - class list { - SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, T *) - SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(T *) - }; -} - -// template specializations for std::list -// these provide extra collections methods as operator== is defined -SWIG_STD_LIST_ENHANCED(char) -SWIG_STD_LIST_ENHANCED(signed char) -SWIG_STD_LIST_ENHANCED(unsigned char) -SWIG_STD_LIST_ENHANCED(short) -SWIG_STD_LIST_ENHANCED(unsigned short) -SWIG_STD_LIST_ENHANCED(int) -SWIG_STD_LIST_ENHANCED(unsigned int) -SWIG_STD_LIST_ENHANCED(long) -SWIG_STD_LIST_ENHANCED(unsigned long) -SWIG_STD_LIST_ENHANCED(long long) -SWIG_STD_LIST_ENHANCED(unsigned long long) -SWIG_STD_LIST_ENHANCED(float) -SWIG_STD_LIST_ENHANCED(double) -SWIG_STD_LIST_ENHANCED(std::string) // also requires a %include -SWIG_STD_LIST_ENHANCED(std::wstring) // also requires a %include diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_map.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_map.i deleted file mode 100755 index 7a118569..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_map.i +++ /dev/null @@ -1,312 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map< K, T, C > - * - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.IDictionary<>. - * - * Using this wrapper is fairly simple. For example, to create a map from integers to doubles use: - * - * %include - * %template(MapIntDouble) std::map - * - * Notes: - * 1) IEnumerable<> is implemented in the proxy class which is useful for using LINQ with - * C++ std::map wrappers. - * - * Warning: heavy macro usage in this file. Use swig -E to get a sane view on the real file contents! - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -#include -%} - -/* K is the C++ key type, T is the C++ value type */ -%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" -%proxycode %{ - - public $typemap(cstype, T) this[$typemap(cstype, K) key] { - get { - return getitem(key); - } - - set { - setitem(key, value); - } - } - - public bool TryGetValue($typemap(cstype, K) key, out $typemap(cstype, T) value) { - if (this.ContainsKey(key)) { - value = this[key]; - return true; - } - value = default($typemap(cstype, T)); - return false; - } - - public int Count { - get { - return (int)size(); - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public global::System.Collections.Generic.ICollection<$typemap(cstype, K)> Keys { - get { - global::System.Collections.Generic.ICollection<$typemap(cstype, K)> keys = new global::System.Collections.Generic.List<$typemap(cstype, K)>(); - int size = this.Count; - if (size > 0) { - global::System.IntPtr iter = create_iterator_begin(); - for (int i = 0; i < size; i++) { - keys.Add(get_next_key(iter)); - } - destroy_iterator(iter); - } - return keys; - } - } - - public global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Values { - get { - global::System.Collections.Generic.ICollection<$typemap(cstype, T)> vals = new global::System.Collections.Generic.List<$typemap(cstype, T)>(); - foreach (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> pair in this) { - vals.Add(pair.Value); - } - return vals; - } - } - - public void Add(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { - Add(item.Key, item.Value); - } - - public bool Remove(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { - if (Contains(item)) { - return Remove(item.Key); - } else { - return false; - } - } - - public bool Contains(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { - if (this[item.Key] == item.Value) { - return true; - } else { - return false; - } - } - - public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array) { - CopyTo(array, 0); - } - - public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array, int arrayIndex) { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (arrayIndex+this.Count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - - global::System.Collections.Generic.IList<$typemap(cstype, K)> keyList = new global::System.Collections.Generic.List<$typemap(cstype, K)>(this.Keys); - for (int i = 0; i < keyList.Count; i++) { - $typemap(cstype, K) currentKey = keyList[i]; - array.SetValue(new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, this[currentKey]), arrayIndex+i); - } - } - - global::System.Collections.Generic.IEnumerator> global::System.Collections.Generic.IEnumerable>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, - global::System.Collections.Generic.IEnumerator> - { - private $csclassname collectionRef; - private global::System.Collections.Generic.IList<$typemap(cstype, K)> keyCollection; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - keyCollection = new global::System.Collections.Generic.List<$typemap(cstype, K)>(collection.Keys); - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>)currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - $typemap(cstype, K) currentKey = keyCollection[currentIndex]; - currentObject = new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, collectionRef[currentKey]); - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } - -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - size_type size() const; - bool empty() const; - %rename(Clear) clear; - void clear(); - %extend { - const mapped_type& getitem(const key_type& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator iter = $self->find(key); - if (iter != $self->end()) - return iter->second; - else - throw std::out_of_range("key not found"); - } - - void setitem(const key_type& key, const mapped_type& x) { - (*$self)[key] = x; - } - - bool ContainsKey(const key_type& key) { - std::map< K, T, C >::iterator iter = $self->find(key); - return iter != $self->end(); - } - - void Add(const key_type& key, const mapped_type& value) throw (std::out_of_range) { - std::map< K, T, C >::iterator iter = $self->find(key); - if (iter != $self->end()) - throw std::out_of_range("key already exists"); - $self->insert(std::pair< K, T >(key, value)); - } - - bool Remove(const key_type& key) { - std::map< K, T, C >::iterator iter = $self->find(key); - if (iter != $self->end()) { - $self->erase(iter); - return true; - } - return false; - } - - // create_iterator_begin(), get_next_key() and destroy_iterator work together to provide a collection of keys to C# - %apply void *VOID_INT_PTR { std::map< K, T, C >::iterator *create_iterator_begin } - %apply void *VOID_INT_PTR { std::map< K, T, C >::iterator *swigiterator } - - std::map< K, T, C >::iterator *create_iterator_begin() { - return new std::map< K, T, C >::iterator($self->begin()); - } - - const key_type& get_next_key(std::map< K, T, C >::iterator *swigiterator) { - std::map< K, T, C >::iterator iter = *swigiterator; - (*swigiterator)++; - return (*iter).first; - } - - void destroy_iterator(std::map< K, T, C >::iterator *swigiterator) { - delete swigiterator; - } - } - - -%enddef - -%csmethodmodifiers std::map::size "private" -%csmethodmodifiers std::map::getitem "private" -%csmethodmodifiers std::map::setitem "private" -%csmethodmodifiers std::map::create_iterator_begin "private" -%csmethodmodifiers std::map::get_next_key "private" -%csmethodmodifiers std::map::destroy_iterator "private" - -// Default implementation -namespace std { - template > class map { - SWIG_STD_MAP_INTERNAL(K, T, C) - }; -} - - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_pair.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_set.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_set.i deleted file mode 100755 index 01215226..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_set.i +++ /dev/null @@ -1,311 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_set.i - * - * SWIG typemaps for std::set. - * - * Note that ISet<> used here requires .NET 4 or later. - * - * The C# wrapper implements ISet<> interface and shares performance - * characteristics of C# System.Collections.Generic.SortedSet<> class, but - * doesn't provide quite all of its methods. - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -#include -%} - -%csmethodmodifiers std::set::size "private" -%csmethodmodifiers std::set::getitem "private" -%csmethodmodifiers std::set::create_iterator_begin "private" -%csmethodmodifiers std::set::get_next "private" -%csmethodmodifiers std::set::destroy_iterator "private" - -namespace std { - -// TODO: Add support for comparator and allocator template parameters. -template -class set { - -%typemap(csinterfaces) std::set "global::System.IDisposable, global::System.Collections.Generic.ISet<$typemap(cstype, T)>\n" -%proxycode %{ - 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); - } - - public bool TryGetValue($typemap(cstype, T) equalValue, out $typemap(cstype, T) actualValue) { - try { - actualValue = getitem(equalValue); - return true; - } catch { - actualValue = default($typemap(cstype, T)); - return false; - } - } - - public int Count { - get { - return (int)size(); - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public void CopyTo($typemap(cstype, T)[] array) { - CopyTo(array, 0); - } - - public void CopyTo($typemap(cstype, T)[] array, int arrayIndex) { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (arrayIndex+this.Count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - - foreach ($typemap(cstype, T) item in this) { - array.SetValue(item, arrayIndex++); - } - } - - public void ExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - Remove(item); - } - } - - public void IntersectWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - $csclassname old = new $csclassname(this); - - Clear(); - foreach ($typemap(cstype, T) item in other) { - if (old.Contains(item)) - Add(item); - } - } - - private static int count_enum(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - int count = 0; - foreach ($typemap(cstype, T) item in other) { - count++; - } - - return count; - } - - public bool IsProperSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - return IsSubsetOf(other) && Count < count_enum(other); - } - - public bool IsProperSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - return IsSupersetOf(other) && Count > count_enum(other); - } - - public bool IsSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - int countContained = 0; - - foreach ($typemap(cstype, T) item in other) { - if (Contains(item)) - countContained++; - } - - return countContained == Count; - } - - public bool IsSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - if (!Contains(item)) - return false; - } - - return true; - } - - public bool Overlaps(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - if (Contains(item)) - return true; - } - - return false; - } - - public bool SetEquals(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - return IsSupersetOf(other) && Count == count_enum(other); - } - - public void SymmetricExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - if (!Remove(item)) - Add(item); - } - } - - public void UnionWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - Add(item); - } - } - - private global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Items { - get { - global::System.Collections.Generic.ICollection<$typemap(cstype, T)> items = new global::System.Collections.Generic.List<$typemap(cstype, T)>(); - int size = this.Count; - if (size > 0) { - global::System.IntPtr iter = create_iterator_begin(); - for (int i = 0; i < size; i++) { - items.Add(get_next(iter)); - } - destroy_iterator(iter); - } - return items; - } - } - - global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, - global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> - { - private $csclassname collectionRef; - private global::System.Collections.Generic.IList<$typemap(cstype, T)> ItemsCollection; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - ItemsCollection = new global::System.Collections.Generic.List<$typemap(cstype, T)>(collection.Items); - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, T) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, T))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - currentObject = ItemsCollection[currentIndex]; - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } - -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T key_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - set(); - set(const set& other); - size_type size() const; - bool empty() const; - %rename(Clear) clear; - void clear(); - %extend { - bool Add(const value_type& item) { - return $self->insert(item).second; - } - - bool Contains(const value_type& item) { - return $self->count(item) != 0; - } - - bool Remove(const value_type& item) { - return $self->erase(item) != 0; - } - - const value_type& getitem(const value_type& item) throw (std::out_of_range) { - std::set::iterator iter = $self->find(item); - if (iter == $self->end()) - throw std::out_of_range("item not found"); - - return *iter; - } - - // create_iterator_begin(), get_next() and destroy_iterator work together to provide a collection of items to C# - %apply void *VOID_INT_PTR { std::set::iterator *create_iterator_begin } - %apply void *VOID_INT_PTR { std::set::iterator *swigiterator } - - std::set::iterator *create_iterator_begin() { - return new std::set::iterator($self->begin()); - } - - const key_type& get_next(std::set::iterator *swigiterator) { - std::set::iterator iter = *swigiterator; - (*swigiterator)++; - return *iter; - } - - void destroy_iterator(std::set::iterator *swigiterator) { - delete swigiterator; - } - } -}; - -} diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_string.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_string.i deleted file mode 100755 index c8920c09..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_string.i +++ /dev/null @@ -1,111 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a C# String and are passed around by value. - * - * To use non-const std::string references use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -// string -%typemap(ctype) string "const char *" -%typemap(imtype) string "string" -%typemap(cstype) string "string" - -%typemap(csdirectorin) string "$iminput" -%typemap(csdirectorout) string "$cscall" - -%typemap(in, canthrow=1) string -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - $1.assign($input); %} -%typemap(out) string %{ $result = SWIG_csharp_string_callback($1.c_str()); %} - -%typemap(directorout, canthrow=1) string -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - $result.assign($input); %} - -%typemap(directorin) string %{ $input = $1.c_str(); %} - -%typemap(csin) string "$csinput" -%typemap(csout, excode=SWIGEXCODE) string { - string ret = $imcall;$excode - return ret; - } - -%typemap(typecheck) string = char *; - -%typemap(throws, canthrow=1) string -%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str()); - return $null; %} - -// const string & -%typemap(ctype) const string & "const char *" -%typemap(imtype) const string & "string" -%typemap(cstype) const string & "string" - -%typemap(csdirectorin) const string & "$iminput" -%typemap(csdirectorout) const string & "$cscall" - -%typemap(in, canthrow=1) const string & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - $*1_ltype $1_str($input); - $1 = &$1_str; %} -%typemap(out) const string & %{ $result = SWIG_csharp_string_callback($1->c_str()); %} - -%typemap(csin) const string & "$csinput" -%typemap(csout, excode=SWIGEXCODE) const string & { - string ret = $imcall;$excode - return ret; - } - -%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - /* possible thread/reentrant code problem */ - static $*1_ltype $1_str; - $1_str = $input; - $result = &$1_str; %} - -%typemap(directorin) const string & %{ $input = $1.c_str(); %} - -%typemap(csvarin, excode=SWIGEXCODE2) const string & %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) const string & %{ - get { - string ret = $imcall;$excode - return ret; - } %} - -%typemap(typecheck) const string & = char *; - -%typemap(throws, canthrow=1) const string & -%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str()); - return $null; %} - -} - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_unique_ptr.i deleted file mode 100755 index 0a4caafb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_unique_ptr.i +++ /dev/null @@ -1,38 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap (ctype) std::unique_ptr< TYPE > "void *" -%typemap (imtype, out="System.IntPtr") std::unique_ptr< TYPE > "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) std::unique_ptr< TYPE > "$typemap(cstype, TYPE)" - -%typemap(in) std::unique_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(csin) std::unique_ptr< TYPE > "$typemap(cstype, TYPE).swigRelease($csinput)" - -%typemap (out) std::unique_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(csout, excode=SWIGEXCODE) std::unique_ptr< TYPE > { - System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_vector.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_vector.i deleted file mode 100755 index a2add584..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_vector.i +++ /dev/null @@ -1,418 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector - * C# implementation - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.List<> collection. - * - * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with - * C++ std::vector wrappers. The IList<> interface is also implemented to provide enhanced functionality - * whenever we are confident that the required C++ operator== is available. This is the case for when - * T is a primitive type or a pointer. If T does define an operator==, then use the SWIG_STD_VECTOR_ENHANCED - * macro to obtain this enhanced functionality, for example: - * - * SWIG_STD_VECTOR_ENHANCED(SomeNamespace::Klass) - * %template(VectKlass) std::vector; - * ----------------------------------------------------------------------------- */ - -%include - -// MACRO for use within the std::vector class body -%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" -%proxycode %{ - public $csclassname(global::System.Collections.IEnumerable c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - foreach ($typemap(cstype, CTYPE) element in c) { - this.Add(element); - } - } - - public $csclassname(global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)> c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - foreach ($typemap(cstype, CTYPE) element in c) { - this.Add(element); - } - } - - public bool IsFixedSize { - get { - return false; - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public $typemap(cstype, CTYPE) this[int index] { - get { - return getitem(index); - } - set { - setitem(index, value); - } - } - - public int Capacity { - get { - return (int)capacity(); - } - set { - if (value < 0 || ($typemap(cstype, size_t))value < size()) - throw new global::System.ArgumentOutOfRangeException("Capacity"); - reserve(($typemap(cstype, size_t))value); - } - } - - public int Count { - get { - return (int)size(); - } - } - - public bool IsSynchronized { - get { - return false; - } - } - - public void CopyTo($typemap(cstype, CTYPE)[] array) - { - CopyTo(0, array, 0, this.Count); - } - - public void CopyTo($typemap(cstype, CTYPE)[] array, int arrayIndex) - { - CopyTo(0, array, arrayIndex, this.Count); - } - - public void CopyTo(int index, $typemap(cstype, CTYPE)[] array, int arrayIndex, int count) - { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (index < 0) - throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (count < 0) - throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (index+count > this.Count || arrayIndex+count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - for (int i=0; i global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator - , global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> - { - private $csclassname collectionRef; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, CTYPE) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, CTYPE))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - currentObject = collectionRef[currentIndex]; - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - %rename(Clear) clear; - void clear(); - %rename(Add) push_back; - void push_back(CTYPE const& x); - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %newobject GetRange(int index, int count); - %newobject Repeat(CTYPE const& value, int count); - - vector(); - vector(const vector &other); - - %extend { - vector(int capacity) throw (std::out_of_range) { - std::vector< CTYPE >* pv = 0; - if (capacity >= 0) { - pv = new std::vector< CTYPE >(); - pv->reserve(capacity); - } else { - throw std::out_of_range("capacity"); - } - return pv; - } - CTYPE getitemcopy(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - CONST_REFERENCE getitem(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - void setitem(int index, CTYPE const& val) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - (*$self)[index] = val; - else - throw std::out_of_range("index"); - } - // Takes a deep copy of the elements unlike ArrayList.AddRange - void AddRange(const std::vector< CTYPE >& values) { - $self->insert($self->end(), values.begin(), values.end()); - } - // Takes a deep copy of the elements unlike ArrayList.GetRange - std::vector< CTYPE > *GetRange(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - return new std::vector< CTYPE >($self->begin()+index, $self->begin()+index+count); - } - void Insert(int index, CTYPE const& x) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()+1) - $self->insert($self->begin()+index, x); - else - throw std::out_of_range("index"); - } - // Takes a deep copy of the elements unlike ArrayList.InsertRange - void InsertRange(int index, const std::vector< CTYPE >& values) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()+1) - $self->insert($self->begin()+index, values.begin(), values.end()); - else - throw std::out_of_range("index"); - } - void RemoveAt(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - $self->erase($self->begin() + index); - else - throw std::out_of_range("index"); - } - void RemoveRange(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - $self->erase($self->begin()+index, $self->begin()+index+count); - } - static std::vector< CTYPE > *Repeat(CTYPE const& value, int count) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("count"); - return new std::vector< CTYPE >(count, value); - } - void Reverse() { - std::reverse($self->begin(), $self->end()); - } - void Reverse(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - std::reverse($self->begin()+index, $self->begin()+index+count); - } - // Takes a deep copy of the elements unlike ArrayList.SetRange - void SetRange(int index, const std::vector< CTYPE >& values) throw (std::out_of_range) { - if (index < 0) - throw std::out_of_range("index"); - if (index+values.size() > $self->size()) - throw std::out_of_range("index"); - std::copy(values.begin(), values.end(), $self->begin()+index); - } - } -%enddef - -// Extra methods added to the collection class if operator== is defined for the class being wrapped -// The class will then implement IList<>, which adds extra functionality -%define SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE...) - %extend { - bool Contains(CTYPE const& value) { - return std::find($self->begin(), $self->end(), value) != $self->end(); - } - int IndexOf(CTYPE const& value) { - int index = -1; - std::vector< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); - if (it != $self->end()) - index = (int)(it - $self->begin()); - return index; - } - int LastIndexOf(CTYPE const& value) { - int index = -1; - std::vector< CTYPE >::reverse_iterator rit = std::find($self->rbegin(), $self->rend(), value); - if (rit != $self->rend()) - index = (int)($self->rend() - 1 - rit); - return index; - } - bool Remove(CTYPE const& value) { - std::vector< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); - if (it != $self->end()) { - $self->erase(it); - return true; - } - return false; - } - } -%enddef - -// Macros for std::vector class specializations/enhancements -%define SWIG_STD_VECTOR_ENHANCED(CTYPE...) -namespace std { - template<> class vector< CTYPE > { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, %arg(CTYPE)) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE) - }; -} -%enddef - -// Legacy macros -%define SWIG_STD_VECTOR_SPECIALIZE(CSTYPE, CTYPE...) -#warning SWIG_STD_VECTOR_SPECIALIZE macro deprecated, please see csharp/std_vector.i and switch to SWIG_STD_VECTOR_ENHANCED -SWIG_STD_VECTOR_ENHANCED(CTYPE) -%enddef - -%define SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(CSTYPE, CTYPE...) -#warning SWIG_STD_VECTOR_SPECIALIZE_MINIMUM macro deprecated, it is no longer required -%enddef - -%{ -#include -#include -#include -%} - -%csmethodmodifiers std::vector::getitemcopy "private" -%csmethodmodifiers std::vector::getitem "private" -%csmethodmodifiers std::vector::setitem "private" -%csmethodmodifiers std::vector::size "private" -%csmethodmodifiers std::vector::capacity "private" -%csmethodmodifiers std::vector::reserve "private" - -namespace std { - // primary (unspecialized) class template for std::vector - // does not require operator== to be defined - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IEnumerable, const value_type&, T) - }; - // specialization for pointers - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, T *) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *) - }; - // bool is specialized in the C++ standard - const_reference in particular - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, bool, bool) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(bool) - }; -} - -// template specializations for std::vector -// these provide extra collections methods as operator== is defined -SWIG_STD_VECTOR_ENHANCED(char) -SWIG_STD_VECTOR_ENHANCED(signed char) -SWIG_STD_VECTOR_ENHANCED(unsigned char) -SWIG_STD_VECTOR_ENHANCED(short) -SWIG_STD_VECTOR_ENHANCED(unsigned short) -SWIG_STD_VECTOR_ENHANCED(int) -SWIG_STD_VECTOR_ENHANCED(unsigned int) -SWIG_STD_VECTOR_ENHANCED(long) -SWIG_STD_VECTOR_ENHANCED(unsigned long) -SWIG_STD_VECTOR_ENHANCED(long long) -SWIG_STD_VECTOR_ENHANCED(unsigned long long) -SWIG_STD_VECTOR_ENHANCED(float) -SWIG_STD_VECTOR_ENHANCED(double) -SWIG_STD_VECTOR_ENHANCED(std::string) // also requires a %include -SWIG_STD_VECTOR_ENHANCED(std::wstring) // also requires a %include - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/std_wstring.i b/linux/bin/swig/share/swig/4.1.0/csharp/std_wstring.i deleted file mode 100755 index 1d10ca80..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/std_wstring.i +++ /dev/null @@ -1,146 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_wstring.i - * - * Typemaps for std::wstring and const std::wstring& - * std::wstring is mapped to a C# Unicode string (UTF16) and is passed around by value. - * std::wstring support includes wchar_t as a 2 byte type (Windows) and a 4 byte type - * (most Unix systems). - * - * To use non-const std::wstring references use the following %apply. Note - * that they are passed by value. - * %apply const std::wstring & {std::wstring &}; - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -%} - -%fragment("Swig_csharp_UTF16ToWString", "header") %{ -/* For converting from .NET UTF16 (2 byte unicode) strings. wchar_t is 2 bytes on Windows, 4 bytes on Linux. */ -static std::wstring Swig_csharp_UTF16ToWString(const unsigned short *str) { - if (sizeof(wchar_t) == 2) { - return std::wstring((wchar_t *)str); - } else { - const unsigned short *pBegin(str); - const unsigned short *ptr(pBegin); - - while (*ptr != 0) - ++ptr; - - std::wstring result; - result.reserve(ptr - pBegin); - while(pBegin != ptr) - result.push_back(*pBegin++); - - return result; - } -} -%} - -namespace std { - -%naturalvar wstring; - -class wstring; - -// wstring -%typemap(ctype, out="void *") wstring "unsigned short *" -%typemap(imtype, - inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directorinattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directoroutattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]" - ) wstring "string" -%typemap(cstype) wstring "string" -%typemap(csdirectorin) wstring "$iminput" -%typemap(csdirectorout) wstring "$cscall" - -%typemap(in, canthrow=1, fragment="Swig_csharp_UTF16ToWString") wstring -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - $1 = Swig_csharp_UTF16ToWString($input); %} -%typemap(out) wstring %{ $result = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} - -%typemap(directorout, canthrow=1) wstring -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - $result = Swig_csharp_UTF16ToWString($input); %} - -%typemap(directorin) wstring %{ $input = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} - -%typemap(csin) wstring "$csinput" -%typemap(csout, excode=SWIGEXCODE) wstring { - string ret = $imcall;$excode - return ret; - } - -%typemap(typecheck) wstring = wchar_t *; - -%typemap(throws, canthrow=1) wstring -%{ SWIG_csharp_ApplicationException_callback($1.c_str(), (int)$1.size()); - return $null; %} - -// const wstring & -%typemap(ctype, out="void *") const wstring & "unsigned short *" -%typemap(imtype, - inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directorinattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directoroutattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]" - ) const wstring & "string" -%typemap(cstype) const wstring & "string" - -%typemap(csdirectorin) const wstring & "$iminput" -%typemap(csdirectorout) const wstring & "$cscall" - -%typemap(in, canthrow=1, fragment="Swig_csharp_UTF16ToWString") const wstring & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - std::wstring $1_str(Swig_csharp_UTF16ToWString($input)); - $1 = &$1_str; %} -%typemap(out) const wstring & %{ $result = SWIG_csharp_wstring_with_length_callback($1->c_str(), (int)$1->size()); %} - -%typemap(csin) const wstring & "$csinput" -%typemap(csout, excode=SWIGEXCODE) const wstring & { - string ret = $imcall;$excode - return ret; - } - -%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - /* possible thread/reentrant code problem */ - static std::wstring $1_str; - $1_str = Swig_csharp_UTF16ToWString($input); - $result = &$1_str; %} - -%typemap(directorin) const wstring & %{ $input = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} - -%typemap(csvarin, excode=SWIGEXCODE2) const wstring & %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) const wstring & %{ - get { - string ret = $imcall;$excode - return ret; - } %} - -%typemap(typecheck) const wstring & = wchar_t *; - -%typemap(throws, canthrow=1) const wstring & -%{ SWIG_csharp_ApplicationException_callback($1.c_str(), (int)$1.size()); - return $null; %} - -} - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/stl.i b/linux/bin/swig/share/swig/4.1.0/csharp/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/swiginterface.i b/linux/bin/swig/share/swig/4.1.0/csharp/swiginterface.i deleted file mode 100755 index e5bfd23a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/swiginterface.i +++ /dev/null @@ -1,63 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swiginterface.i - * - * SWIG interface feature and typemaps implementation providing: - * %interface - * %interface_impl - * %interface_custom - * ----------------------------------------------------------------------------- */ - -%define INTERFACE_TYPEMAPS(CTYPE...) -%typemap(cstype) CTYPE "$&csinterfacename" -%typemap(cstype) CTYPE *, CTYPE [], CTYPE & "$csinterfacename" -%typemap(cstype) CTYPE *const& "$*csinterfacename" -%typemap(csin) CTYPE, CTYPE & "$csinput.GetInterfaceCPtr()" -%typemap(csin) CTYPE *, CTYPE *const&, CTYPE [] "$csinput == null ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : $csinput.GetInterfaceCPtr()" -%typemap(csout, excode=SWIGEXCODE) CTYPE { - $&csclassname ret = new $&csclassname($imcall, true);$excode - return ($&csinterfacename)ret; - } -%typemap(csout, excode=SWIGEXCODE) CTYPE & { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ($csinterfacename)ret; - } -%typemap(csout, excode=SWIGEXCODE) CTYPE *, CTYPE [] { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode - return ($csinterfacename)ret; - } -%typemap(csout, excode=SWIGEXCODE) CTYPE *const& { - global::System.IntPtr cPtr = $imcall; - $*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode - return ($*csinterfacename)ret; - } -%typemap(csdirectorin) CTYPE "($&csinterfacename)new $&csclassname($iminput, true)" -%typemap(csdirectorin) CTYPE & "($csinterfacename)new $csclassname($iminput, false)" -%typemap(csdirectorin) CTYPE *, CTYPE [] "($iminput == global::System.IntPtr.Zero) ? null : ($csinterfacename)new $csclassname($iminput, false)" -%typemap(csdirectorin) CTYPE *const& "($iminput == global::System.IntPtr.Zero) ? null : ($*csinterfacename)new $*csclassname($iminput, false)" -%typemap(csdirectorout) CTYPE, CTYPE *, CTYPE *const&, CTYPE [], CTYPE & "$cscall.GetInterfaceCPtr()" -%typemap(csinterfacecode, declaration=" [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n global::System.Runtime.InteropServices.HandleRef GetInterfaceCPtr();\n", cptrmethod="$interfacename_GetInterfaceCPtr") CTYPE %{ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - global::System.Runtime.InteropServices.HandleRef $interfacename.GetInterfaceCPtr() { - return new global::System.Runtime.InteropServices.HandleRef(this, $imclassname.$csclazzname$interfacename_GetInterfaceCPtr(swigCPtr.Handle)); - } -%} -%enddef - -%define %interface(CTYPE...) -%feature("interface", name="%sSwigInterface") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_impl(CTYPE...) -%rename("%sSwigImpl") CTYPE; -%feature("interface", name="%(rstrip:[SwigImpl])s") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_custom(PROXY, INTERFACE, CTYPE...) -%rename(PROXY) CTYPE; -%feature("interface", name=INTERFACE) CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/swigmove.i b/linux/bin/swig/share/swig/4.1.0/csharp/swigmove.i deleted file mode 100755 index 2f21bd6f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/swigmove.i +++ /dev/null @@ -1,16 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, canthrow=1, fragment="") SWIGTYPE MOVE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - SwigValueWrapper< $1_ltype >::reset($1, argp); %} - -%typemap(csin) SWIGTYPE MOVE "$&csclassname.swigRelease($csinput)" diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/swigtype_inout.i b/linux/bin/swig/share/swig/4.1.0/csharp/swigtype_inout.i deleted file mode 100755 index e7312e8f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/swigtype_inout.i +++ /dev/null @@ -1,34 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigtype_inout.i - * - * Pointer pointer and pointer reference handling typemap library for non-primitive types - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointer references and pointer to pointers. - * - * These are named typemaps (OUTPUT) and can be used like any named typemap. - * Alternatively they can be made the default by using %apply: - * %apply SWIGTYPE *& OUTPUT { SWIGTYPE *& } - * ----------------------------------------------------------------------------- */ - -/* - * OUTPUT typemaps. Example usage wrapping: - * - * void f(XXX *& x) { x = new XXX(111); } - * - * would be: - * - * XXX x = null; - * f(out x); - * // use x - * x.Dispose(); // manually clear memory or otherwise leave out and leave it to the garbage collector - */ -%typemap(ctype) SWIGTYPE *& OUTPUT "void **" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE *& OUTPUT "out global::System.IntPtr" -%typemap(cstype) SWIGTYPE *& OUTPUT "out $*csclassname" -%typemap(csin, - pre=" global::System.IntPtr cPtr_$csinput = global::System.IntPtr.Zero;", - post=" $csinput = (cPtr_$csinput == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr_$csinput, true);", - cshin="out $csinput") SWIGTYPE *& OUTPUT "out cPtr_$csinput" -%typemap(in) SWIGTYPE *& OUTPUT %{ $1 = ($1_ltype)$input; %} -%typemap(freearg) SWIGTYPE *& OUTPUT "" diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/typemaps.i b/linux/bin/swig/share/swig/4.1.0/csharp/typemaps.i deleted file mode 100755 index b6f9bddb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/typemaps.i +++ /dev/null @@ -1,253 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps are used for pointer/reference parameters that are input only -and are mapped to a C# input parameter. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In C# you could then use it like this: - double answer = modulename.fadd(10.0, 20.0); -*/ - -%define INPUT_TYPEMAP(TYPE, CTYPE, CSTYPE) -%typemap(ctype, out="void *") TYPE *INPUT, TYPE &INPUT "CTYPE" -%typemap(imtype, out="global::System.IntPtr") TYPE *INPUT, TYPE &INPUT "CSTYPE" -%typemap(cstype, out="$csclassname") TYPE *INPUT, TYPE &INPUT "CSTYPE" -%typemap(csin) TYPE *INPUT, TYPE &INPUT "$csinput" - -%typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(typecheck) TYPE *INPUT = TYPE; -%typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, unsigned int, bool) -//INPUT_TYPEMAP(char, char, char) -INPUT_TYPEMAP(signed char, signed char, sbyte) -INPUT_TYPEMAP(unsigned char, unsigned char, byte) -INPUT_TYPEMAP(short, short, short) -INPUT_TYPEMAP(unsigned short, unsigned short, ushort) -INPUT_TYPEMAP(int, int, int) -INPUT_TYPEMAP(unsigned int, unsigned int, uint) -INPUT_TYPEMAP(long, long, int) -INPUT_TYPEMAP(unsigned long, unsigned long, uint) -INPUT_TYPEMAP(long long, long long, long) -INPUT_TYPEMAP(unsigned long long, unsigned long long, ulong) -INPUT_TYPEMAP(float, float, float) -INPUT_TYPEMAP(double, double, double) - -#undef INPUT_TYPEMAP - -/* -OUTPUT typemaps ---------------- - -These typemaps are used for pointer/reference parameters that are output only and -are mapped to a C# output parameter. - -The following typemaps can be applied to turn a pointer or reference into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In C#, the 'out' keyword is -used when passing the parameter to a function that takes an output parameter. - - bool *OUTPUT, bool &OUTPUT - signed char *OUTPUT, signed char &OUTPUT - unsigned char *OUTPUT, unsigned char &OUTPUT - short *OUTPUT, short &OUTPUT - unsigned short *OUTPUT, unsigned short &OUTPUT - int *OUTPUT, int &OUTPUT - unsigned int *OUTPUT, unsigned int &OUTPUT - long *OUTPUT, long &OUTPUT - unsigned long *OUTPUT, unsigned long &OUTPUT - long long *OUTPUT, long long &OUTPUT - unsigned long long *OUTPUT, unsigned long long &OUTPUT - float *OUTPUT, float &OUTPUT - double *OUTPUT, double &OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters): - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The C# output of the function would be the function return value and the -value returned in the second output parameter. In C# you would use it like this: - - double dptr; - double fraction = modulename.modf(5, out dptr); -*/ - -%define OUTPUT_TYPEMAP(TYPE, CTYPE, CSTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *OUTPUT, TYPE &OUTPUT "CTYPE *" -%typemap(imtype, out="global::System.IntPtr") TYPE *OUTPUT, TYPE &OUTPUT "out CSTYPE" -%typemap(cstype, out="$csclassname") TYPE *OUTPUT, TYPE &OUTPUT "out CSTYPE" -%typemap(csin) TYPE *OUTPUT, TYPE &OUTPUT "out $csinput" - -%typemap(in) TYPE *OUTPUT, TYPE &OUTPUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *OUTPUT, TYPE &OUTPUT "" -%enddef - -OUTPUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//OUTPUT_TYPEMAP(char, char, char, CHAR_PTR) -OUTPUT_TYPEMAP(signed char, signed char, sbyte, INT8_PTR) -OUTPUT_TYPEMAP(unsigned char, unsigned char, byte, UINT8_PTR) -OUTPUT_TYPEMAP(short, short, short, INT16_PTR) -OUTPUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -OUTPUT_TYPEMAP(int, int, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long, long, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long long, long long, long, INT64_PTR) -OUTPUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -OUTPUT_TYPEMAP(float, float, float, FLOAT_PTR) -OUTPUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -#undef OUTPUT_TYPEMAP - -%typemap(in) bool *OUTPUT, bool &OUTPUT -%{ *$input = 0; - $1 = ($1_ltype)$input; %} - - -/* -INOUT typemaps --------------- - -These typemaps are for pointer/reference parameters that are both input and -output and are mapped to a C# reference parameter. - -The following typemaps can be applied to turn a pointer or reference into a -reference parameters, that is the parameter is both an input and an output. -In C#, the 'ref' keyword is used for reference parameters. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -The C# output of the function would be the new value returned by the -reference parameter. In C# you would use it like this: - - - double x = 5.0; - neg(ref x); - -The implementation of the OUTPUT and INOUT typemaps is different to the scripting -languages in that the scripting languages will return the output value as part -of the function return value. - -*/ - -%define INOUT_TYPEMAP(TYPE, CTYPE, CSTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *INOUT, TYPE &INOUT "CTYPE *" -%typemap(imtype, out="global::System.IntPtr") TYPE *INOUT, TYPE &INOUT "ref CSTYPE" -%typemap(cstype, out="$csclassname") TYPE *INOUT, TYPE &INOUT "ref CSTYPE" -%typemap(csin) TYPE *INOUT, TYPE &INOUT "ref $csinput" - -%typemap(in) TYPE *INOUT, TYPE &INOUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *INOUT, TYPE &INOUT "" -%enddef - -INOUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//INOUT_TYPEMAP(char, char, char, CHAR_PTR) -INOUT_TYPEMAP(signed char, signed char, sbyte, INT8_PTR) -INOUT_TYPEMAP(unsigned char, unsigned char, byte, UINT8_PTR) -INOUT_TYPEMAP(short, short, short, INT16_PTR) -INOUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -INOUT_TYPEMAP(int, int, int, INT32_PTR) -INOUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -INOUT_TYPEMAP(long, long, int, INT32_PTR) -INOUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) -INOUT_TYPEMAP(long long, long long, long, INT64_PTR) -INOUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -INOUT_TYPEMAP(float, float, float, FLOAT_PTR) -INOUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -#undef INOUT_TYPEMAP - diff --git a/linux/bin/swig/share/swig/4.1.0/csharp/wchar.i b/linux/bin/swig/share/swig/4.1.0/csharp/wchar.i deleted file mode 100755 index f1e0d5a2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/csharp/wchar.i +++ /dev/null @@ -1,335 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wchar.i - * - * Typemaps for the wchar_t type - * wchar_t * is mapped to a C# Unicode string (UTF16) and is passed around by value. - * wchar_t * support includes wchar_t as a 2 byte type (Windows) and a 4 byte type - * (most Unix systems). - * - * Support code for wide strings can be turned off by defining SWIG_CSHARP_NO_WSTRING_HELPER - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_CSHARP_NO_WSTRING_HELPER) -#if !defined(SWIG_CSHARP_WSTRING_HELPER_) -#define SWIG_CSHARP_WSTRING_HELPER_ - -%fragment(""); // TODO: %fragment("") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) (new wchar_t[wcslen((const wchar_t *)$input)+1]); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,fragment="") wchar_t * { - delete [] $1; - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) (new wchar_t[wcslen((const wchar_t *)$input)+1]); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,warning=SWIGWARN_TYPEMAP_WCHARLEAK_MSG,fragment="") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) (new wchar_t[wcslen((const wchar_t *)$input)+1]); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -#else -%typemap(memberin,fragment="") wchar_t * { - free($1); - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(memberin,warning=SWIGWARN_TYPEMAP_WCHARLEAK_MSG,fragment="") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,fragment="") wchar_t * { - free($1); - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,warning=SWIGWARN_TYPEMAP_WCHARLEAK_MSG,fragment="") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/cstring.i b/linux/bin/swig/share/swig/4.1.0/cstring.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/cwstring.i b/linux/bin/swig/share/swig/4.1.0/cwstring.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/d/boost_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/d/boost_shared_ptr.i deleted file mode 100755 index 6d85c5ae..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/boost_shared_ptr.i +++ /dev/null @@ -1,293 +0,0 @@ -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ((*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\"))) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - argp = ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0; - if (!argp) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -%typemap(directorin) CONST TYPE -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (new $1_ltype(SWIG_STD_MOVE($1))); %} - -%typemap(directorout) CONST TYPE -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg->get(); -%} - -// plain pointer -%typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - $result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -%typemap(directorin) CONST TYPE * -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) CONST TYPE * %{ -#error "typemaps for $1_type not available" -%} - -// plain reference -%typemap(in, canthrow=1) CONST TYPE & %{ - $1 = ($1_ltype)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - if (!$1) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "$1_type reference is null"); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) CONST TYPE & -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (&$1 SWIG_NO_NULL_DELETER_0); %} - -%typemap(directorout) CONST TYPE & %{ -#error "typemaps for $1_type not available" -%} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = (TYPE *)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) TYPE *CONST& -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) TYPE *CONST& %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) $1 = *($&1_ltype)$input; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $result = $1 ? new $1_ltype($1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg; - } -%} - -// shared_ptr by reference -%typemap(in, canthrow=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $result = *$1 ? new $*1_ltype(*$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out, fragment="SWIG_null_deleter") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; - if ($owner) delete $1; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) -%{ temp = $input ? *($1_ltype)&$input : &tempnull; - $1 = &temp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "typemaps for $1_type not available" -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void *" -%typemap (imtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void*" -%typemap (dtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(dtype, TYPE)" - -%typemap(din) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(dtype, TYPE).swigGetCPtr($dinput)" - -%typemap(ddirectorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(dtype, TYPE).swigGetCPtr($dcall)" - -%typemap(ddirectorin) CONST TYPE, - CONST TYPE *, - CONST TYPE &, - TYPE *CONST& "($winput is null) ? null : new $typemap(dtype, TYPE)($winput, true)" - -%typemap(ddirectorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "($winput is null) ? null : new $typemap(dtype, TYPE)($winput, true)" - - -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - - -%typemap(dout, excode=SWIGEXCODE) CONST TYPE { - auto ret = new $typemap(dtype, TYPE)($imcall, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) CONST TYPE & { - auto ret = new $typemap(dtype, TYPE)($imcall, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) CONST TYPE * { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) TYPE *CONST& { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - -// Proxy classes (base classes, ie, not derived classes) -%typemap(dbody) SWIGTYPE %{ -private void* swigCPtr; -private bool swigCMemOwn; - -public this(void* cObject, bool ownCObject) { - swigCPtr = cObject; - swigCMemOwn = ownCObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} -%} - -// Derived proxy classes -%typemap(dbody_derived) SWIGTYPE %{ -private void* swigCPtr; -private bool swigCMemOwn; - -public this(void* cObject, bool ownCObject) { - super($imdmodule.$dclazznameSmartPtrUpcast(cObject), ownCObject); - swigCPtr = cObject; - swigCMemOwn = ownCObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} -%} - -%typemap(ddispose, methodname="dispose", methodmodifiers="public") TYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - } - } -} - -%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public") TYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - super.dispose(); - } - } -} - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/d/carrays.i b/linux/bin/swig/share/swig/4.1.0/d/carrays.i deleted file mode 100755 index f2803ea4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/carrays.i +++ /dev/null @@ -1,111 +0,0 @@ -/* ----------------------------------------------------------------------------- - * carrays.i - * - * D-specific version of ../carrays.i. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * %array_functions(TYPE,NAME) - * - * Generates functions for creating and accessing elements of a C array - * (as pointers). Creates the following functions: - * - * TYPE *new_NAME(int nelements) - * void delete_NAME(TYPE *); - * TYPE NAME_getitem(TYPE *, int index); - * void NAME_setitem(TYPE *, int index, TYPE value); - * - * ----------------------------------------------------------------------------- */ - -%define %array_functions(TYPE,NAME) -%{ -static TYPE *new_##NAME(int nelements) { %} -#ifdef __cplusplus -%{ return new TYPE[nelements](); %} -#else -%{ return (TYPE *) calloc(nelements,sizeof(TYPE)); %} -#endif -%{} - -static void delete_##NAME(TYPE *ary) { %} -#ifdef __cplusplus -%{ delete [] ary; %} -#else -%{ free(ary); %} -#endif -%{} - -static TYPE NAME##_getitem(TYPE *ary, int index) { - return ary[index]; -} -static void NAME##_setitem(TYPE *ary, int index, TYPE value) { - ary[index] = value; -} -%} - -TYPE *new_##NAME(int nelements); -void delete_##NAME(TYPE *ary); -TYPE NAME##_getitem(TYPE *ary, int index); -void NAME##_setitem(TYPE *ary, int index, TYPE value); - -%enddef - - -/* ----------------------------------------------------------------------------- - * %array_class(TYPE,NAME) - * - * Generates a class wrapper around a C array. The class has the following - * interface: - * - * struct NAME { - * NAME(int nelements); - * ~NAME(); - * TYPE getitem(int index); - * void setitem(int index, TYPE value); - * TYPE * ptr(); - * static NAME *frompointer(TYPE *t); - * } - * - * ----------------------------------------------------------------------------- */ - -%define %array_class(TYPE,NAME) -%{ -typedef TYPE NAME; -%} - -typedef struct {} NAME; - -%extend NAME { -#ifdef __cplusplus - NAME(int nelements) { - return new TYPE[nelements](); - } - ~NAME() { - delete [] self; - } -#else - NAME(int nelements) { - return (TYPE *) calloc(nelements,sizeof(TYPE)); - } - ~NAME() { - free(self); - } -#endif - - TYPE getitem(int index) { - return self[index]; - } - void setitem(int index, TYPE value) { - self[index] = value; - } - TYPE * ptr() { - return self; - } - static NAME *frompointer(TYPE *t) { - return (NAME *) t; - } -}; - -%types(NAME = TYPE); - -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/d/cpointer.i b/linux/bin/swig/share/swig/4.1.0/d/cpointer.i deleted file mode 100755 index da3084b7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/cpointer.i +++ /dev/null @@ -1,171 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cpointer.i - * - * D-specific version of ../cpointer.i. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * %pointer_class(type,name) - * - * Places a simple proxy around a simple type like 'int', 'float', or whatever. - * The proxy provides this interface: - * - * class type { - * public: - * type(); - * ~type(); - * type value(); - * void assign(type value); - * }; - * - * Example: - * - * %pointer_class(int, intp); - * - * int add(int *x, int *y) { return *x + *y; } - * - * In python (with proxies) - * - * >>> a = intp() - * >>> a.assign(10) - * >>> a.value() - * 10 - * >>> b = intp() - * >>> b.assign(20) - * >>> print add(a,b) - * 30 - * - * As a general rule, this macro should not be used on class/structures that - * are already defined in the interface. - * ----------------------------------------------------------------------------- */ - - -%define %pointer_class(TYPE, NAME) -%{ -typedef TYPE NAME; -%} - -typedef struct { -} NAME; - -%extend NAME { -#ifdef __cplusplus -NAME() { - return new TYPE(); -} -~NAME() { - delete self; -} -#else -NAME() { - return (TYPE *) calloc(1,sizeof(TYPE)); -} -~NAME() { - free(self); -} -#endif -} - -%extend NAME { - -void assign(TYPE value) { - *self = value; -} -TYPE value() { - return *self; -} -TYPE * ptr() { - return self; -} -static NAME * frompointer(TYPE *t) { - return (NAME *) t; -} - -} - -%types(NAME = TYPE); - -%enddef - -/* ----------------------------------------------------------------------------- - * %pointer_functions(type,name) - * - * Create functions for allocating/deallocating pointers. This can be used - * if you don't want to create a proxy class or if the pointer is complex. - * - * %pointer_functions(int, intp) - * - * int add(int *x, int *y) { return *x + *y; } - * - * In python (with proxies) - * - * >>> a = copy_intp(10) - * >>> intp_value(a) - * 10 - * >>> b = new_intp() - * >>> intp_assign(b,20) - * >>> print add(a,b) - * 30 - * >>> delete_intp(a) - * >>> delete_intp(b) - * - * ----------------------------------------------------------------------------- */ - -%define %pointer_functions(TYPE,NAME) -%{ -static TYPE *new_##NAME() { %} -#ifdef __cplusplus -%{ return new TYPE(); %} -#else -%{ return (TYPE *) calloc(1,sizeof(TYPE)); %} -#endif -%{} - -static TYPE *copy_##NAME(TYPE value) { %} -#ifdef __cplusplus -%{ return new TYPE(value); %} -#else -%{ TYPE *self = (TYPE *) calloc(1,sizeof(TYPE)); - *self = value; - return self; %} -#endif -%{} - -static void delete_##NAME(TYPE *self) { %} -#ifdef __cplusplus -%{ delete self; %} -#else -%{ free(self); %} -#endif -%{} - -static void NAME ##_assign(TYPE *self, TYPE value) { - *self = value; -} - -static TYPE NAME ##_value(TYPE *self) { - return *self; -} -%} - -TYPE *new_##NAME(); -TYPE *copy_##NAME(TYPE value); -void delete_##NAME(TYPE *self); -void NAME##_assign(TYPE *self, TYPE value); -TYPE NAME##_value(TYPE *self); - -%enddef - -/* ----------------------------------------------------------------------------- - * %pointer_cast(type1,type2,name) - * - * Generates a pointer casting function. - * ----------------------------------------------------------------------------- */ - -%define %pointer_cast(TYPE1,TYPE2,NAME) -%inline %{ -TYPE2 NAME(TYPE1 x) { - return (TYPE2) x; -} -%} -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/d/d.swg b/linux/bin/swig/share/swig/4.1.0/d/d.swg deleted file mode 100755 index f5bb4596..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/d.swg +++ /dev/null @@ -1,46 +0,0 @@ -/* ----------------------------------------------------------------------------- - * d.swg - * - * Main library file for the D language module. See the D chapter in the SWIG - * manual for explanation on the typemaps, pragmas, etc. used. - * ----------------------------------------------------------------------------- */ - -// Typemaps for exception handling. -%include - -// Typemaps for primitive types. -%include - -// Typemaps for non-primitive types (C/C++ classes and structs). -%include - -// Typemaps for enumeration types. -%include - -// Typemaps for member function pointers. -%include - -// Typemaps for wrapping pointers to/arrays of C chars as D strings. -%include - -// Typemaps for handling void function return types and empty parameter lists. -%include - -// Typemaps containing D code used when generating D proxy classes. -%include - -// Mapping of C++ operator overloading methods to D. -%include - -// Helper code string and exception handling. -%include - -// Wrapper loader code for dynamically linking the C wrapper library from the D -// wrapper module. -%include - -// List of all reserved D keywords. -%include - -// D-specific directives. -%include diff --git a/linux/bin/swig/share/swig/4.1.0/d/dclassgen.swg b/linux/bin/swig/share/swig/4.1.0/d/dclassgen.swg deleted file mode 100755 index e4ff8d5f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/dclassgen.swg +++ /dev/null @@ -1,172 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dclassgen.swg - * - * Typemaps containing D code used when generating D proxy classes. - * ----------------------------------------------------------------------------- */ - -%typemap(dbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "class" -%typemap(dcode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dinterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dinterfaces_derived) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" - -// See . -%typemap(dclassmodifiers) enum SWIGTYPE "enum" -%typemap(dcode) enum SWIGTYPE "" - - -/* - * Proxy classes. - */ - -%typemap(dconstructor, excode=SWIGEXCODE,directorconnect="\n swigDirectorConnect();") SWIGTYPE { - this($imcall, true);$excode$directorconnect -} - -%typemap(ddestructor) SWIGTYPE %{ -~this() { - dispose(); -} -%} - -// We do not use »override« attribute for generated dispose() methods to stay -// somewhat compatible to Phobos and older Tango versions where Object.dispose() -// does not exist. -%typemap(ddispose, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - } - } -} - -%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - super.dispose(); - } - } -} - - -// Unfortunately, the »package« visibility attribute does not work in D when the -// module in question is in the root package (happens if no -package is specified -// at the SWIG command line), so we are stuck with public visibility for -// swigGetCPtr(). -%typemap(dbody) SWIGTYPE %{ -private void* swigCPtr; -protected bool swigCMemOwn; - -public this(void* cObject, bool ownCObject) { - swigCPtr = cObject; - swigCMemOwn = ownCObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -public static void* swigRelease(typeof(this) obj) { - if (obj !is null) { - if (!obj.swigCMemOwn) - throw new Exception("Cannot release ownership as memory is not owned"); - void* ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.dispose(); - return ptr; - } else { - return null; - } -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} - - -%typemap(dbody_derived) SWIGTYPE %{ -private void* swigCPtr; - -public this(void* cObject, bool ownCObject) { - super($imdmodule.$dclazznameUpcast(cObject), ownCObject); - swigCPtr = cObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -public static void* swigRelease(typeof(this) obj) { - if (obj !is null) { - if (!obj.swigCMemOwn) - throw new Exception("Cannot release ownership as memory is not owned"); - void* ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.dispose(); - return ptr; - } else { - return null; - } -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} - - -/* - * Type wrapper classes. - */ - -%typemap(dbody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] %{ -private void* swigCPtr; - -public this(void* cObject, bool futureUse) { - swigCPtr = cObject; -} - -protected this() { - swigCPtr = null; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -public static void* swigRelease(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} - - -/* - * Member function pointer wrapper classes (see ). - */ - -%typemap(dbody) SWIGTYPE (CLASS::*) %{ -private char* swigCPtr; - -public this(char* cMemberPtr, bool futureUse) { - swigCPtr = cMemberPtr; -} - -protected this() { - swigCPtr = null; -} - -package static char* swigGetCMemberPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} diff --git a/linux/bin/swig/share/swig/4.1.0/d/ddirectives.swg b/linux/bin/swig/share/swig/4.1.0/d/ddirectives.swg deleted file mode 100755 index 145cf01f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/ddirectives.swg +++ /dev/null @@ -1,11 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ddirectives.swg - * - * D-specifiv directives. - * ----------------------------------------------------------------------------- */ - -#define %dmanifestconst %feature("d:manifestconst") -#define %dconstvalue(value) %feature("d:constvalue",value) -#define %dmethodmodifiers %feature("d:methodmodifiers") -#define %dnothrowexception %feature("except") -#define %proxycode %insert("proxycode") diff --git a/linux/bin/swig/share/swig/4.1.0/d/denums.swg b/linux/bin/swig/share/swig/4.1.0/d/denums.swg deleted file mode 100755 index 3f812466..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/denums.swg +++ /dev/null @@ -1,60 +0,0 @@ -/* ----------------------------------------------------------------------------- - * denums.swg - * - * Typemaps for enumerations. - * ----------------------------------------------------------------------------- */ - - -/* - * Typemaps for enumeration types. - */ - -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(dtype, cprimitive="1") enum SWIGTYPE "$dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(ddirectorin) enum SWIGTYPE "cast($dclassname)$winput" -%typemap(ddirectorout) enum SWIGTYPE "cast(int)$dcall" - -%typemap(din) enum SWIGTYPE "cast(int)$dinput" -%typemap(dout, excode=SWIGEXCODE) enum SWIGTYPE { - $dclassname ret = cast($dclassname)$imcall;$excode - return ret; -} - - -/* - * Typemaps for (const) references to enumeration types. - */ - -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(dtype) const enum SWIGTYPE & "$*dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} - -%typemap(ddirectorin) const enum SWIGTYPE & "cast($*dclassname)$winput" -%typemap(ddirectorout) const enum SWIGTYPE & "cast(int)$dcall" - -%typemap(din) const enum SWIGTYPE & "cast(int)$dinput" -%typemap(dout, excode=SWIGEXCODE) const enum SWIGTYPE & { - $*dclassname ret = cast($*dclassname)$imcall;$excode - return ret; -} diff --git a/linux/bin/swig/share/swig/4.1.0/d/dexception.swg b/linux/bin/swig/share/swig/4.1.0/d/dexception.swg deleted file mode 100755 index 1aadbaad..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/dexception.swg +++ /dev/null @@ -1,30 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dexception.swg - * - * Typemaps used for propagating C++ exceptions to D. - * ----------------------------------------------------------------------------- */ - -// Code which is inserted into the dout typemaps and class constructors via -// excode if exceptions can be thrown. -%define SWIGEXCODE "\n if ($imdmodule.SwigPendingException.isPending) throw $imdmodule.SwigPendingException.retrieve();" %enddef - -%typemap(throws, canthrow=1) int, - long, - short, - unsigned int, - unsigned long, - unsigned short -%{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_DSetPendingException(SWIG_DException, error_msg); - return $null; %} - -%typemap(throws, canthrow=1) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [ANY], - enum SWIGTYPE, const enum SWIGTYPE & -%{ (void)$1; - SWIG_DSetPendingException(SWIG_DException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(throws, canthrow=1) char * -%{ SWIG_DSetPendingException(SWIG_DException, $1); - return $null; %} diff --git a/linux/bin/swig/share/swig/4.1.0/d/dhead.swg b/linux/bin/swig/share/swig/4.1.0/d/dhead.swg deleted file mode 100755 index 1ef1e416..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/dhead.swg +++ /dev/null @@ -1,298 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dhead.swg - * - * Support code for exceptions if the SWIG_D_NO_EXCEPTION_HELPER is not defined - * Support code for strings if the SWIG_D_NO_STRING_HELPER is not defined - * - * Support code for function pointers. ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ -#include -#include -#include - -/* Contract support. */ -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_DSetPendingException(SWIG_DException, msg); return nullreturn; } } while (0) -%} - - -/* - * Exception support code. - */ - -#if !defined(SWIG_D_NO_EXCEPTION_HELPER) -%insert(runtime) %{ -// Support for throwing D exceptions from C/C++. -typedef enum { - SWIG_DException = 0, - SWIG_DIllegalArgumentException, - SWIG_DIllegalElementException, - SWIG_DIOException, - SWIG_DNoSuchElementException -} SWIG_DExceptionCodes; - -typedef void (* SWIG_DExceptionCallback_t)(const char *); - -typedef struct { - SWIG_DExceptionCodes code; - SWIG_DExceptionCallback_t callback; -} SWIG_DException_t; - -static SWIG_DException_t SWIG_d_exceptions[] = { - { SWIG_DException, NULL }, - { SWIG_DIllegalArgumentException, NULL }, - { SWIG_DIllegalElementException, NULL }, - { SWIG_DIOException, NULL }, - { SWIG_DNoSuchElementException, NULL } -}; - -static void SWIGUNUSED SWIG_DSetPendingException(SWIG_DExceptionCodes code, const char *msg) { - if ((size_t)code < sizeof(SWIG_d_exceptions)/sizeof(SWIG_DException_t)) { - SWIG_d_exceptions[code].callback(msg); - } else { - SWIG_d_exceptions[SWIG_DException].callback(msg); - } -} - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGRegisterExceptionCallbacks_$module( - SWIG_DExceptionCallback_t exceptionCallback, - SWIG_DExceptionCallback_t illegalArgumentCallback, - SWIG_DExceptionCallback_t illegalElementCallback, - SWIG_DExceptionCallback_t ioCallback, - SWIG_DExceptionCallback_t noSuchElementCallback) { - SWIG_d_exceptions[SWIG_DException].callback = exceptionCallback; - SWIG_d_exceptions[SWIG_DIllegalArgumentException].callback = illegalArgumentCallback; - SWIG_d_exceptions[SWIG_DIllegalElementException].callback = illegalElementCallback; - SWIG_d_exceptions[SWIG_DIOException].callback = ioCallback; - SWIG_d_exceptions[SWIG_DNoSuchElementException].callback = noSuchElementCallback; -} -%} - -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports=%{ -// Exception throwing support currently requires Tango, but there is no reason -// why it could not support Phobos. -static import tango.core.Exception; -static import tango.core.Thread; -static import tango.stdc.stringz; -%} - -%pragma(d) imdmodulecode=%{ -private class SwigExceptionHelper { - static this() { - swigRegisterExceptionCallbacks$module( - &setException, - &setIllegalArgumentException, - &setIllegalElementException, - &setIOException, - &setNoSuchElementException); - } - - static void setException(char* message) { - auto exception = new object.Exception(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIllegalArgumentException(char* message) { - auto exception = new tango.core.Exception.IllegalArgumentException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIllegalElementException(char* message) { - auto exception = new tango.core.Exception.IllegalElementException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIOException(char* message) { - auto exception = new tango.core.Exception.IOException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setNoSuchElementException(char* message) { - auto exception = new tango.core.Exception.NoSuchElementException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } -} - -package class SwigPendingException { -public: - static this() { - m_sPendingException = new ThreadLocalData(null); - } - - static bool isPending() { - return m_sPendingException.val !is null; - } - - static void set(object.Exception e) { - auto pending = m_sPendingException.val; - if (pending !is null) { - e.next = pending; - throw new object.Exception("FATAL: An earlier pending exception from C/C++ " ~ - "code was missed and thus not thrown (" ~ pending.classinfo.name ~ ": " ~ - pending.msg ~ ")!", e); - } - m_sPendingException.val = e; - } - - static object.Exception retrieve() { - auto e = m_sPendingException.val; - m_sPendingException.val = null; - return e; - } - -private: - // The reference to the pending exception (if any) is stored thread-local. - alias tango.core.Thread.ThreadLocal!(object.Exception) ThreadLocalData; - static ThreadLocalData m_sPendingException; -} -alias void function(char* message) SwigExceptionCallback; -%} -#else -%pragma(d) imdmoduleimports=%{ -static import std.conv; -%} - -%pragma(d) imdmodulecode=%{ -private class SwigExceptionHelper { - static this() { - // The D1/Tango version maps C++ exceptions to multiple exception types. - swigRegisterExceptionCallbacks$module( - &setException, - &setException, - &setException, - &setException, - &setException - ); - } - - static void setException(const char* message) { - auto exception = new object.Exception(std.conv.to!string(message)); - SwigPendingException.set(exception); - } -} - -package struct SwigPendingException { -public: - static this() { - m_sPendingException = null; - } - - static bool isPending() { - return m_sPendingException !is null; - } - - static void set(object.Exception e) { - if (m_sPendingException !is null) { - e.next = m_sPendingException; - throw new object.Exception("FATAL: An earlier pending exception from C/C++ code " ~ - "was missed and thus not thrown (" ~ m_sPendingException.classinfo.name ~ - ": " ~ m_sPendingException.msg ~ ")!", e); - } - - m_sPendingException = e; - } - - static object.Exception retrieve() { - auto e = m_sPendingException; - m_sPendingException = null; - return e; - } - -private: - // The reference to the pending exception (if any) is stored thread-local. - static object.Exception m_sPendingException; -} -alias void function(const char* message) SwigExceptionCallback; -%} -#endif -// Callback registering function in wrapperloader.swg. -#endif // SWIG_D_NO_EXCEPTION_HELPER - - -/* - * String support code. - */ - -#if !defined(SWIG_D_NO_STRING_HELPER) -%insert(runtime) %{ -// Callback for returning strings to D without leaking memory. -typedef char * (* SWIG_DStringHelperCallback)(const char *); -static SWIG_DStringHelperCallback SWIG_d_string_callback = NULL; - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGRegisterStringCallback_$module(SWIG_DStringHelperCallback callback) { - SWIG_d_string_callback = callback; -} -%} - -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports = "static import tango.stdc.stringz;"; - -%pragma(d) imdmodulecode = %{ -private class SwigStringHelper { - static this() { - swigRegisterStringCallback$module(&createString); - } - - static char* createString(char* cString) { - // We are effectively dup'ing the string here. - return tango.stdc.stringz.toStringz(tango.stdc.stringz.fromStringz(cString)); - } -} -alias char* function(char* cString) SwigStringCallback; -%} -#else -%pragma(d) imdmoduleimports = %{ -static import std.conv; -static import std.string; -%} - -%pragma(d) imdmodulecode = %{ -private class SwigStringHelper { - static this() { - swigRegisterStringCallback$module(&createString); - } - - static const(char)* createString(const(char*) cString) { - // We are effectively dup'ing the string here. - // TODO: Is this also correct for D2/Phobos? - return std.string.toStringz(std.conv.to!string(cString)); - } -} -alias const(char)* function(const(char*) cString) SwigStringCallback; -%} -#endif -// Callback registering function in wrapperloader.swg. -#endif // SWIG_D_NO_STRING_HELPER - - -/* - * Function pointer support code. - */ -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmodulecode = %{ -template SwigExternC(T) { - static if (is(typeof(*(T.init)) R == return)) { - static if (is(typeof(*(T.init)) P == function)) { - alias extern(C) R function(P) SwigExternC; - } - } -} -%} -#else -%pragma(d) imdmodulecode = %{ -template SwigExternC(T) if (is(typeof(*(T.init)) P == function)) { - static if (is(typeof(*(T.init)) R == return)) { - static if (is(typeof(*(T.init)) P == function)) { - alias extern(C) R function(P) SwigExternC; - } - } -} -%} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/d/director.swg b/linux/bin/swig/share/swig/4.1.0/d/director.swg deleted file mode 100755 index 02da0e0a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/director.swg +++ /dev/null @@ -1,49 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that D proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#if defined(DEBUG_DIRECTOR_OWNED) -#include -#endif -#include -#include - -namespace Swig { - - // Director base class – not used in D directors. - class Director { - }; - - // Base class for director exceptions. - class DirectorException : public std::exception { - protected: - std::string swig_msg; - - public: - DirectorException(const std::string &msg) : swig_msg(msg) { - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - // Exception which is thrown when attempting to call a pure virtual method - // from D code through the director layer. - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg) : DirectorException(std::string("Attempted to invoke pure virtual method ") + msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; -} - diff --git a/linux/bin/swig/share/swig/4.1.0/d/dkw.swg b/linux/bin/swig/share/swig/4.1.0/d/dkw.swg deleted file mode 100755 index 2a189ed6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/dkw.swg +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef D_DKW_SWG_ -#define D_DKW_SWG_ - -/* Warnings for D keywords */ -#define DKEYWORD(x) %keywordwarn("'" `x` "' is a D keyword",rename="_%s") `x` - -// Source: http://www.digitalmars.com/d/{1.0,2.0}/lex.html and -DKEYWORD(Error); -DKEYWORD(Exception); -DKEYWORD(Object); -DKEYWORD(__FILE__); -DKEYWORD(__LINE__); -DKEYWORD(__gshared); -DKEYWORD(__thread); -DKEYWORD(__traits); -DKEYWORD(abstract); -DKEYWORD(alias); -DKEYWORD(align); -DKEYWORD(asm); -DKEYWORD(assert); -DKEYWORD(auto); -DKEYWORD(body); -DKEYWORD(bool); -DKEYWORD(break); -DKEYWORD(byte); -DKEYWORD(case); -DKEYWORD(cast); -DKEYWORD(catch); -DKEYWORD(cdouble); -DKEYWORD(cent); -DKEYWORD(cfloat); -DKEYWORD(char); -DKEYWORD(class); -DKEYWORD(const); -DKEYWORD(continue); -DKEYWORD(creal); -DKEYWORD(dchar); -DKEYWORD(debug); -DKEYWORD(default); -DKEYWORD(delegate); -DKEYWORD(delete); -DKEYWORD(deprecated); -DKEYWORD(do); -DKEYWORD(double); -DKEYWORD(dstring); -DKEYWORD(else); -DKEYWORD(enum); -DKEYWORD(export); -DKEYWORD(extern); -DKEYWORD(false); -DKEYWORD(final); -DKEYWORD(finally); -DKEYWORD(float); -DKEYWORD(for); -DKEYWORD(foreach); -DKEYWORD(foreach_reverse); -DKEYWORD(function); -DKEYWORD(goto); -DKEYWORD(idouble); -DKEYWORD(if); -DKEYWORD(ifloat); -DKEYWORD(immutable); -DKEYWORD(import); -DKEYWORD(in); -DKEYWORD(inout); -DKEYWORD(int); -DKEYWORD(interface); -DKEYWORD(invariant); -DKEYWORD(ireal); -DKEYWORD(is); -DKEYWORD(lazy); -DKEYWORD(long); -DKEYWORD(macro); -DKEYWORD(mixin); -DKEYWORD(module); -DKEYWORD(new); -DKEYWORD(nothrow); -DKEYWORD(null); -DKEYWORD(out); -DKEYWORD(override); -DKEYWORD(package); -DKEYWORD(pragma); -DKEYWORD(private); -DKEYWORD(protected); -DKEYWORD(public); -DKEYWORD(pure); -DKEYWORD(real); -DKEYWORD(ref); -DKEYWORD(return); -DKEYWORD(scope); -DKEYWORD(shared); -DKEYWORD(short); -DKEYWORD(static); -DKEYWORD(string); -DKEYWORD(struct); -DKEYWORD(super); -DKEYWORD(switch); -DKEYWORD(synchronized); -DKEYWORD(template); -DKEYWORD(this); -DKEYWORD(throw); -DKEYWORD(true); -DKEYWORD(try); -DKEYWORD(typedef); -DKEYWORD(typeid); -DKEYWORD(typeof); -DKEYWORD(ubyte); -DKEYWORD(ucent); -DKEYWORD(uint); -DKEYWORD(ulong); -DKEYWORD(union); -DKEYWORD(unittest); -DKEYWORD(ushort); -DKEYWORD(version); -DKEYWORD(void); -DKEYWORD(volatile); -DKEYWORD(wchar); -DKEYWORD(while); -DKEYWORD(with); -DKEYWORD(wstring); - -// Not really a keyword, but dispose() methods are generated in proxy classes -// and it's a special method name for D1/Tango. -DKEYWORD(dispose); - -#undef DKEYWORD - -#endif //D_DKW_SWG_ diff --git a/linux/bin/swig/share/swig/4.1.0/d/dmemberfunctionpointers.swg b/linux/bin/swig/share/swig/4.1.0/d/dmemberfunctionpointers.swg deleted file mode 100755 index a07d0a5d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/dmemberfunctionpointers.swg +++ /dev/null @@ -1,94 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dmemberfunctionpointers.swg - * - * Typemaps for member function pointers. - * ----------------------------------------------------------------------------- */ - - -%typemap(ctype) SWIGTYPE (CLASS::*) "char *" -%typemap(imtype) SWIGTYPE (CLASS::*) "char*" -%typemap(dtype) SWIGTYPE (CLASS::*) "$dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE (CLASS::*) - "" - - -/* - * Conversion generation typemaps. - */ - -%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) %{ - SWIG_UnpackData($input, (void *)&$1, sizeof($1)); -%} -%typemap(out, fragment="SWIG_PackData") SWIGTYPE (CLASS::*) %{ - char buf[128]; - char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); - *data = '\0'; - $result = SWIG_d_string_callback(buf); -%} - -%typemap(directorin) SWIGTYPE (CLASS::*) "$input = (void *) $1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) - "$result = ($1_ltype)$input;" - -%typemap(ddirectorin) SWIGTYPE (CLASS::*) - "($winput is null) ? null : new $dclassname($winput, false)" -%typemap(ddirectorout) SWIGTYPE (CLASS::*) "$dclassname.swigGetCPtr($dcall)" - -%typemap(din) SWIGTYPE (CLASS::*) "$dclassname.swigGetCMemberPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE (CLASS::*) { - char* cMemberPtr = $imcall; - $dclassname ret = (cMemberPtr is null) ? null : new $dclassname(cMemberPtr, $owner);$excode - return ret; -} - -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* - * Helper functions to pack/unpack arbitrary binary data (member function - * pointers in this case) into a string. - */ - -%fragment("SWIG_PackData", "header") { -/* Pack binary data into a string */ -SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} -} - -%fragment("SWIG_UnPackData", "header") { -/* Unpack binary data from a string */ -SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/d/doperators.swg b/linux/bin/swig/share/swig/4.1.0/d/doperators.swg deleted file mode 100755 index 0a82a6cb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/doperators.swg +++ /dev/null @@ -1,259 +0,0 @@ -/* ----------------------------------------------------------------------------- - * doperators.swg - * - * Mapping of C++ operator overloading methods to D. - * ----------------------------------------------------------------------------- */ - -#if (SWIG_D_VERSION == 1) - -%pragma(d) imdmodulecode=%{ -template SwigOperatorDefinitions() { - public override int opEquals(Object o) { - if (auto rhs = cast(typeof(this))o) { - if (swigCPtr == rhs.swigCPtr) return 1; - static if (is(typeof(swigOpEquals(rhs)))) { - return swigOpEquals(rhs) ? 1 : 0; - } else { - return 0; - } - } - return super.opEquals(o); - } -%} -// opEquals is emitted in pure C mode as well to define two proxy classes -// pointing to the same struct as equal. - -#ifdef __cplusplus -%rename(opPos) *::operator+(); -%rename(opPos) *::operator+() const; -%rename(opNeg) *::operator-(); -%rename(opNeg) *::operator-() const; -%rename(opCom) *::operator~(); -%rename(opCom) *::operator~() const; - -%rename(opAdd) *::operator+; -%rename(opAddAssign) *::operator+=; -%rename(opSub) *::operator-; -%rename(opSubAssign) *::operator-=; -%rename(opMul) *::operator*; -%rename(opMulAssign) *::operator*=; -%rename(opDiv) *::operator/; -%rename(opDivAssign) *::operator/=; -%rename(opMod) *::operator%; -%rename(opModAssign) *::operator%=; -%rename(opAnd) *::operator&; -%rename(opAndAssign) *::operator&=; -%rename(opOr) *::operator|; -%rename(opOrAssign) *::operator|=; -%rename(opXor) *::operator^; -%rename(opXorAssign) *::operator^=; -%rename(opShl) *::operator<<; -%rename(opShlAssign) *::operator<<=; -%rename(opShr) *::operator>>; -%rename(opShrAssign) *::operator>>=; - -%rename(opIndex) *::operator[](unsigned) const; -// opIndexAssign is not currently generated, it needs more extensive support -// mechanisms. - -%rename(opCall) *::operator(); - -// !a is not overridable in D1. -%ignoreoperator(LNOT) operator!; - -// opCmp is used in D. -%rename(swigOpEquals) *::operator==; -%rename(swigOpLt) *::operator<; -%rename(swigOpLtEquals) *::operator<=; -%rename(swigOpGt) *::operator>; -%rename(swigOpGtEquals) *::operator>=; - -// a != b is rewritten as !a.opEquals(b) in D. -%ignoreoperator(NOTEQUAL) operator!=; - -// The logic operators are not overridable in D. -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; - -// ++/--a is rewritten as a +/-= 1 in D1,so ignore the prefix operators. -%ignoreoperator(PLUSPLUS) *::operator++(); -%ignoreoperator(MINUSMINUS) *::operator--(); -%rename(swigOpInc) *::operator++(int); -%rename(swigOpDec) *::operator--(int); - -// The C++ assignment operator does not translate well to D where the proxy -// classes have reference semantics. -%ignoreoperator(EQ) operator=; - -%pragma(d) imdmodulecode=%{ - public override int opCmp(Object o) { - static if (is(typeof(swigOpLt(typeof(this).init) && - swigOpEquals(typeof(this).init)))) { - if (auto rhs = cast(typeof(this))o) { - if (swigOpLt(rhs)) { - return -1; - } else if (swigOpEquals(rhs)) { - return 0; - } else { - return 1; - } - } - } - return super.opCmp(o); - } - - public typeof(this) opPostInc(T = int)(T unused = 0) { - static assert( - is(typeof(swigOpInc(int.init))), - "opPostInc called on " ~ typeof(this).stringof ~ ", but no postfix " ~ - "increment operator exists in the corresponding C++ class." - ); - return swigOpInc(int.init); - } - - public typeof(this) opPostDec(T = int)(T unused = 0) { - static assert( - is(typeof(swigOpDec(int.init))), - "opPostInc called on " ~ typeof(this).stringof ~ ", but no postfix " ~ - "decrement operator exists in the corresponding C++ class." - ); - return swigOpDec(int.init); - } -%} -#endif - -%pragma(d) imdmodulecode=%{ -} -%} - -#else -%pragma(d) imdmodulecode=%{ -mixin template SwigOperatorDefinitions() { - public override bool opEquals(Object o) { - if (auto rhs = cast(typeof(this))o) { - if (swigCPtr == rhs.swigCPtr) return true; - static if (is(typeof(swigOpEquals(rhs)))) { - return swigOpEquals(rhs); - } else { - return false; - } - } - return super.opEquals(o); - } -%} -// opEquals is emitted in pure C mode as well to define two proxy classes -// pointing to the same struct as equal. - -#ifdef __cplusplus -%rename(swigOpPos) *::operator+(); -%rename(swigOpPos) *::operator+() const; -%rename(swigOpNeg) *::operator-(); -%rename(swigOpNeg) *::operator-() const; -%rename(swigOpCom) *::operator~(); -%rename(swigOpCom) *::operator~() const; -%rename(swigOpInc) *::operator++(); -%rename(swigOpDec) *::operator--(); -%ignoreoperator(PLUSPLUS) *::operator++(int); -%ignoreoperator(MINUSMINUS) *::operator--(int); -// The postfix increment/decrement operators are ignored because they are -// rewritten to (auto t = e, ++e, t) in D2. The unary * operator (used for -// pointer dereferencing in C/C++) isn't mapped to opUnary("*") by default, -// despite this would be possible in D2 – the difference in member access -// semantics would only lead to confusion in most cases. - -%rename(swigOpAdd) *::operator+; -%rename(swigOpSub) *::operator-; -%rename(swigOpMul) *::operator*; -%rename(swigOpDiv) *::operator/; -%rename(swigOpMod) *::operator%; -%rename(swigOpAnd) *::operator&; -%rename(swigOpOr) *::operator|; -%rename(swigOpXor) *::operator^; -%rename(swigOpShl) *::operator<<; -%rename(swigOpShr) *::operator>>; - -%rename(swigOpAddAssign) *::operator+=; -%rename(swigOpSubAssign) *::operator-=; -%rename(swigOpMulAssign) *::operator*=; -%rename(swigOpDivAssign) *::operator/=; -%rename(swigOpModAssign) *::operator%=; -%rename(swigOpAndAssign) *::operator&=; -%rename(swigOpOrAssign) *::operator|=; -%rename(swigOpXorAssign) *::operator^=; -%rename(swigOpShlAssign) *::operator<<=; -%rename(swigOpShrAssign) *::operator>>=; - -%rename(opIndex) *::operator[]; -// opIndexAssign is not currently generated, it needs more extensive support -// mechanisms. - -%rename(opCall) *::operator(); - -%rename(swigOpEquals) *::operator==; -%rename(swigOpLt) *::operator<; -%rename(swigOpLtEquals) *::operator<=; -%rename(swigOpGt) *::operator>; -%rename(swigOpGtEquals) *::operator>=; - -// a != b is rewritten as !a.opEquals(b) in D. -%ignoreoperator(NOTEQUAL) operator!=; - -// The logic operators are not overridable in D. -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; - -// The C++ assignment operator does not translate well to D where the proxy -// classes have reference semantics. -%ignoreoperator(EQ) operator=; - -%pragma(d) imdmodulecode=%{ - public override int opCmp(Object o) { - static if (__traits(compiles, swigOpLt(typeof(this).init) && - swigOpEquals(typeof(this).init))) { - if (auto rhs = cast(typeof(this))o) { - if (swigOpLt(rhs)) { - return -1; - } else if (swigOpEquals(rhs)) { - return 0; - } else { - return 1; - } - } - } - return super.opCmp(o); - } - - private template swigOpBinary(string operator, string name) { - enum swigOpBinary = `public void opOpAssign(string op, T)(T rhs) if (op == "` ~ operator ~ - `" && __traits(compiles, swigOp` ~ name ~ `Assign(rhs))) { swigOp` ~ name ~ `Assign(rhs);}` ~ - `public auto opBinary(string op, T)(T rhs) if (op == "` ~ operator ~ - `" && __traits(compiles, swigOp` ~ name ~ `(rhs))) { return swigOp` ~ name ~ `(rhs);}`; - } - mixin(swigOpBinary!("+", "Add")); - mixin(swigOpBinary!("-", "Sub")); - mixin(swigOpBinary!("*", "Mul")); - mixin(swigOpBinary!("/", "Div")); - mixin(swigOpBinary!("%", "Mod")); - mixin(swigOpBinary!("&", "And")); - mixin(swigOpBinary!("|", "Or")); - mixin(swigOpBinary!("^", "Xor")); - mixin(swigOpBinary!("<<", "Shl")); - mixin(swigOpBinary!(">>", "Shr")); - - private template swigOpUnary(string operator, string name) { - enum swigOpUnary = `public auto opUnary(string op)() if (op == "` ~ operator ~ - `" && __traits(compiles, swigOp` ~ name ~ `())) { return swigOp` ~ name ~ `();}`; - } - mixin(swigOpUnary!("+", "Pos")); - mixin(swigOpUnary!("-", "Neg")); - mixin(swigOpUnary!("~", "Com")); - mixin(swigOpUnary!("++", "Inc")); - mixin(swigOpUnary!("--", "Dec")); -%} -#endif - -%pragma(d) imdmodulecode=%{ -} -%} - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/d/dprimitives.swg b/linux/bin/swig/share/swig/4.1.0/d/dprimitives.swg deleted file mode 100755 index eaee816d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/dprimitives.swg +++ /dev/null @@ -1,171 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dprimitves.swg - * - * Typemaps for primitive types. - * ----------------------------------------------------------------------------- */ - -// C long/ulong width depends on the target arch, use stdlib aliases for them. -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports = "static import tango.stdc.config;" -%pragma(d) globalproxyimports = "static import tango.stdc.config;" -#define SWIG_LONG_DTYPE tango.stdc.config.c_long -#define SWIG_ULONG_DTYPE tango.stdc.config.c_ulong -#else -%pragma(d) imdmoduleimports = "static import core.stdc.config;" -%pragma(d) globalproxyimports = "static import core.stdc.config;" -#define SWIG_LONG_DTYPE core.stdc.config.c_long -#define SWIG_ULONG_DTYPE core.stdc.config.c_ulong -#endif - -/* - * The SWIG_D_PRIMITIVE macro is used to define the typemaps for the primitive - * types, because are more or less the same for all of them. The few special - * cases are handled below. - */ -%define SWIG_D_PRIMITIVE(TYPE, DTYPE) -%typemap(ctype) TYPE, const TYPE & "TYPE" -%typemap(imtype) TYPE, const TYPE & "DTYPE" -%typemap(dtype, cprimitive="1") TYPE, const TYPE & "DTYPE" - -%typemap(in) TYPE "$1 = ($1_ltype)$input;" -%typemap(out) TYPE "$result = $1;" -%typemap(directorin) TYPE "$input = $1;" -%typemap(directorout) TYPE "$result = ($1_ltype)$input;" -%typemap(ddirectorin) TYPE "$winput" -%typemap(ddirectorout) TYPE "$dcall" - -%typemap(in) const TYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const TYPE & "$result = *$1;" -%typemap(directorin) const TYPE & "$input = $1;" -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const TYPE & -%{ static $*1_ltype temp; - temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(ddirectorin) const TYPE & "$winput" -%typemap(ddirectorout) const TYPE & "$dcall" - -%typemap(din) TYPE, const TYPE & "$dinput" -%typemap(dout, excode=SWIGEXCODE) TYPE, const TYPE & { - auto ret = $imcall;$excode - return ret; -} -%enddef - - -SWIG_D_PRIMITIVE(bool, bool) -SWIG_D_PRIMITIVE(char, char) -SWIG_D_PRIMITIVE(signed char, byte) -SWIG_D_PRIMITIVE(unsigned char, ubyte) -SWIG_D_PRIMITIVE(short, short) -SWIG_D_PRIMITIVE(unsigned short, ushort) -SWIG_D_PRIMITIVE(int, int) -SWIG_D_PRIMITIVE(unsigned int, uint) -SWIG_D_PRIMITIVE(long, SWIG_LONG_DTYPE) -SWIG_D_PRIMITIVE(unsigned long, SWIG_ULONG_DTYPE) -SWIG_D_PRIMITIVE(size_t, size_t) -SWIG_D_PRIMITIVE(long long, long) -SWIG_D_PRIMITIVE(unsigned long long, ulong) -SWIG_D_PRIMITIVE(float, float) -SWIG_D_PRIMITIVE(double, double) - - -// The C++ boolean type needs some special casing since it is not part of the -// C standard and is thus represented as unsigned int in the C wrapper layer. -%typemap(ctype) bool, const bool & "unsigned int" -%typemap(imtype) bool, const bool & "uint" - -%typemap(in) bool "$1 = $input ? true : false;" -%typemap(in) const bool & ($*1_ltype temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(directorout) bool - "$result = $input ? true : false;" -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & -%{ static $*1_ltype temp; - temp = $input ? true : false; - $result = &temp; %} - -%typemap(ddirectorin) bool "($winput ? true : false)" - -%typemap(dout, excode=SWIGEXCODE) bool, const bool & { - bool ret = $imcall ? true : false;$excode - return ret; -} - - -// Judging from the history of the C# module, the explicit casts are needed for -// certain versions of VC++. -%typemap(out) unsigned long "$result = (unsigned long)$1;" -%typemap(out) const unsigned long & "$result = (unsigned long)*$1;" - - -/* - * Typecheck typemaps. - */ - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_UINT8) - unsigned char, - const unsigned char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) - short, - const short & - "" - -%typecheck(SWIG_TYPECHECK_UINT16) - unsigned short, - const unsigned short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) - int, - long, - const int &, - const long & - "" - -%typecheck(SWIG_TYPECHECK_UINT32) - unsigned int, - unsigned long, - const unsigned int &, - const unsigned long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) - long long, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_UINT64) - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) - double, - const double & - "" diff --git a/linux/bin/swig/share/swig/4.1.0/d/dstrings.swg b/linux/bin/swig/share/swig/4.1.0/d/dstrings.swg deleted file mode 100755 index 02895c15..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/dstrings.swg +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dstrings.swg - * - * Typemaps for wrapping pointers to/arrays of C chars as D strings. - * ----------------------------------------------------------------------------- */ - -%define SWIGD_STRING_TYPEMAPS(DW_STRING_TYPE, DP_STRING_TYPE, FROM_STRINGZ, TO_STRINGZ) -%typemap(ctype) char *, char *&, char[ANY], char[] "char *" -%typemap(imtype) char *, char *&, char[ANY], char[] #DW_STRING_TYPE -%typemap(dtype) char *, char *&, char[ANY], char[] #DP_STRING_TYPE - - -/* - * char* typemaps. - */ - -%typemap(in) char * %{ $1 = ($1_ltype)$input; %} -%typemap(out) char * %{ $result = SWIG_d_string_callback((const char *)$1); %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char * %{ $input = SWIG_d_string_callback((const char *)$1); %} -%typemap(ddirectorin) char * "FROM_STRINGZ($winput)" -%typemap(ddirectorout) char * "TO_STRINGZ($dcall)" - - -/* - * char*& typemaps. - */ - -%typemap(in) char *& ($*1_ltype temp = 0) %{ - temp = ($*1_ltype)$input; - $1 = &temp; -%} -%typemap(out) char *& %{ if ($1) $result = SWIG_d_string_callback((const char *)*$1); %} - - -/* - * char array typemaps. - */ - -%typemap(in) char[ANY], char[] %{ $1 = ($1_ltype)$input; %} -%typemap(out) char[ANY], char[] %{ $result = SWIG_d_string_callback((const char *)$1); %} - -%typemap(directorout) char[ANY], char[] %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char[ANY], char[] %{ $input = SWIG_d_string_callback((const char *)$1); %} - -%typemap(ddirectorin) char[ANY], char[] "$winput" -%typemap(ddirectorout) char[ANY], char[] "$dcall" - - -%typemap(din) char *, char *&, char[ANY], char[] "($dinput ? TO_STRINGZ($dinput) : null)" -%typemap(dout, excode=SWIGEXCODE) char *, char *&, char[ANY], char[] { - DP_STRING_TYPE ret = FROM_STRINGZ ## ($imcall);$excode - return ret; -} - -%typecheck(SWIG_TYPECHECK_STRING) - char *, - char *&, - char[ANY], - char[] - "" -%enddef - - -// We need to have the \0-terminated string conversion functions available in -// the D proxy modules. -#if (SWIG_D_VERSION == 1) -// Could be easily extended to support Phobos as well. -SWIGD_STRING_TYPEMAPS(char*, char[], tango.stdc.stringz.fromStringz, tango.stdc.stringz.toStringz) - -%pragma(d) globalproxyimports = "static import tango.stdc.stringz;"; -#else -SWIGD_STRING_TYPEMAPS(const(char)*, string, std.conv.to!string, std.string.toStringz) - -%pragma(d) globalproxyimports = %{ -static import std.conv; -static import std.string; -%} -#endif -#undef SWIGD_STRING_TYPEMAPS diff --git a/linux/bin/swig/share/swig/4.1.0/d/dswigtype.swg b/linux/bin/swig/share/swig/4.1.0/d/dswigtype.swg deleted file mode 100755 index c227519e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/dswigtype.swg +++ /dev/null @@ -1,241 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dswigtype.swg - * - * Typemaps for non-primitive types (C/C++ classes and structs). - * ----------------------------------------------------------------------------- */ - -%typemap(ctype) SWIGTYPE "void *" -%typemap(imtype) SWIGTYPE "void*" -%typemap(dtype) SWIGTYPE "$&dclassname" - -%typemap(ctype) SWIGTYPE [] "void *" -%typemap(imtype) SWIGTYPE [] "void*" -%typemap(dtype) SWIGTYPE [] "$dclassname" - -%typemap(ctype) SWIGTYPE * "void *" -%typemap(imtype) SWIGTYPE * "void*" -%typemap(dtype, nativepointer="$dtype") SWIGTYPE * "$dclassname" - -%typemap(ctype) SWIGTYPE & "void *" -%typemap(imtype) SWIGTYPE & "void*" -%typemap(dtype, nativepointer="$dtype") SWIGTYPE & "$dclassname" - -%typemap(ctype) SWIGTYPE && "void *" -%typemap(imtype) SWIGTYPE && "void*" -%typemap(dtype, nativepointer="$dtype") SWIGTYPE && "$dclassname" - -%typemap(ctype) SWIGTYPE *const& "void *" -%typemap(imtype) SWIGTYPE *const& "void*" -%typemap(dtype) SWIGTYPE *const& "$*dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [], - SWIGTYPE *const& - "" - - -/* - * By-value conversion typemaps (parameter is converted to a pointer). - */ - -%typemap(in, canthrow=1) SWIGTYPE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ $result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - $result = $1ptr; -} -#endif - -%typemap(directorin) SWIGTYPE - "$input = (void *)new $1_ltype(SWIG_STD_MOVE($1));" -%typemap(directorout) SWIGTYPE -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *($&1_ltype)$input; %} - -%typemap(ddirectorin) SWIGTYPE "new $&dclassname($winput, true)" -%typemap(ddirectorout) SWIGTYPE "$&dclassname.swigGetCPtr($dcall)" - -%typemap(din) SWIGTYPE "$&dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE { - $&dclassname ret = new $&dclassname($imcall, true);$excode - return ret; -} - - -/* - * Pointer conversion typemaps. - */ - -%typemap(in) SWIGTYPE * "$1 = ($1_ltype)$input;" -%typemap(out) SWIGTYPE * "$result = (void *)$1;" - -%typemap(directorin) SWIGTYPE * - "$input = (void *) $1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * - "$result = ($1_ltype)$input;" - -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE * "($winput is null) ? null : new $dclassname($winput, false)" - -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE * "$dclassname.swigGetCPtr($dcall)" - -%typemap(din, - nativepointer="cast(void*)$dinput" -) SWIGTYPE * "$dclassname.swigGetCPtr($dinput)" - -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}" -) SWIGTYPE * { - void* cPtr = $imcall; - $dclassname ret = (cPtr is null) ? null : new $dclassname(cPtr, $owner);$excode - return ret; -} - -// Use the same typemaps for const pointers. -%apply SWIGTYPE * { SWIGTYPE *const } - - -/* - * Reference conversion typemaps. - */ - -%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "$1_type is null"); - return $null; - } %} -%typemap(out) SWIGTYPE & "$result = (void *)$1;" - -%typemap(directorin) SWIGTYPE & - "$input = ($1_ltype) &$1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Unexpected null return for type $1_type"); - return $null; - } - $result = ($1_ltype)$input; %} - -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE & "new $dclassname($winput, false)" -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE & "$dclassname.swigGetCPtr($dcall)" - -%typemap(din, - nativepointer="cast(void*)$dinput" -) SWIGTYPE & "$dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}") SWIGTYPE & { - $dclassname ret = new $dclassname($imcall, $owner);$excode - return ret; -} - - -/* - * Rvalue reference conversion typemaps. - */ - -%typemap(in, canthrow=1, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "$1_type is null"); - return $null; - } - rvrdeleter.reset($1); %} -%typemap(out) SWIGTYPE && "$result = (void *)$1;" - -%typemap(directorin) SWIGTYPE && - "$input = ($1_ltype) &$1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE && -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Unexpected null return for type $1_type"); - return $null; - } - $result = ($1_ltype)$input; %} - -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE && "new $dclassname($winput, false)" -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE && "$dclassname.swigGetCPtr($dcall)" - -%typemap(din, - nativepointer="cast(void*)$dinput" -) SWIGTYPE && "$dclassname.swigRelease($dinput)" -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}") SWIGTYPE && { - $dclassname ret = new $dclassname($imcall, $owner);$excode - return ret; -} - - -/* - * Array conversion typemaps. - */ - -%typemap(in) SWIGTYPE [] %{ $1 = ($1_ltype)$input; %} -%typemap(out) SWIGTYPE [] %{ $result = $1; %} - -%typemap(din) SWIGTYPE [] "$dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE [] { - void* cPtr = $imcall; - $dclassname ret = (cPtr is null) ? null : new $dclassname(cPtr, $owner);$excode - return ret; -} - -// Treat references to arrays like references to a single element. -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - - -/* - * Pointer reference conversion typemaps. - */ - -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)$input; - $1 = ($1_ltype)&temp; %} -%typemap(out) SWIGTYPE *const& -%{ $result = (void *)*$1; %} - -%typemap(din) SWIGTYPE *const& "$*dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE *const& { - void* cPtr = $imcall; - $*dclassname ret = (cPtr is null) ? null : new $*dclassname(cPtr, $owner);$excode - return ret; -} -%typemap(directorin) SWIGTYPE *const& - "$input = (void *) $1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = ($*1_ltype)$input; - $result = &swig_temp; %} -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE *const& "($winput is null) ? null : new $*dclassname($winput, false)" -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE *const& "$*dclassname.swigGetCPtr($dcall)" - diff --git a/linux/bin/swig/share/swig/4.1.0/d/dvoid.swg b/linux/bin/swig/share/swig/4.1.0/d/dvoid.swg deleted file mode 100755 index 805f1e71..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/dvoid.swg +++ /dev/null @@ -1,18 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dvoid.swg - * - * Typemaps for handling void function return types and empty parameter lists. - * ----------------------------------------------------------------------------- */ - -%typemap(ctype) void "void" -%typemap(imtype) void "void" -%typemap(dtype, cprimitive="1") void "void" - -%typemap(out, null="") void "" -%typemap(ddirectorin) void "$winput" -%typemap(ddirectorout) void "$dcall" -%typemap(directorin) void "" - -%typemap(dout, excode=SWIGEXCODE) void { - $imcall;$excode -} diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/d/std_auto_ptr.i deleted file mode 100755 index 500b6115..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_auto_ptr.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap (ctype) std::auto_ptr< TYPE > "void *" -%typemap (imtype) std::auto_ptr< TYPE > "void*" -%typemap (dtype) std::auto_ptr< TYPE > "$typemap(dtype, TYPE)" - -%typemap(in) std::auto_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(din, - nativepointer="cast(void*)$dinput" -) std::auto_ptr< TYPE > "$typemap(dtype, TYPE).swigRelease($dinput)" - -%typemap (out) std::auto_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}" -) std::auto_ptr< TYPE > { - void* cPtr = $imcall; - $typemap(dtype, TYPE) ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_common.i b/linux/bin/swig/share/swig/4.1.0/d/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_deque.i b/linux/bin/swig/share/swig/4.1.0/d/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_except.i b/linux/bin/swig/share/swig/4.1.0/d/std_except.i deleted file mode 100755 index fbfd6c33..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_except.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. These typemaps are - * used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws, canthrow=1) std::bad_cast "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::bad_exception "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::domain_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::exception "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::invalid_argument "SWIG_DSetPendingException(SWIG_DIllegalArgumentException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::length_error "SWIG_DSetPendingException(SWIG_DNoSuchElementException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::logic_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::out_of_range "SWIG_DSetPendingException(SWIG_DNoSuchElementException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::overflow_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::range_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::runtime_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::underflow_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" - diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_map.i b/linux/bin/swig/share/swig/4.1.0/d/std_map.i deleted file mode 100755 index c5e03d06..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_map.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -namespace std { - template > class map { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; -} diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_pair.i b/linux/bin/swig/share/swig/4.1.0/d/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/d/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_string.i b/linux/bin/swig/share/swig/4.1.0/d/std_string.i deleted file mode 100755 index 8d75d23e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_string.i +++ /dev/null @@ -1,98 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a D char[] and are passed around by value. - * - * To use non-const std::string references, use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -%define SWIGD_STD_STRING_TYPEMAPS(DW_STRING_TYPE, DP_STRING_TYPE, FROM_STRINGZ, TO_STRINGZ) -// string -%typemap(ctype) string, const string & "char *" -%typemap(imtype) string, const string & #DW_STRING_TYPE -%typemap(dtype) string, const string & #DP_STRING_TYPE - -%typemap(in, canthrow=1) string, const string & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - $1.assign($input); %} -%typemap(in, canthrow=1) const string & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - $*1_ltype $1_str($input); - $1 = &$1_str; %} - -%typemap(out) string %{ $result = SWIG_d_string_callback($1.c_str()); %} -%typemap(out) const string & %{ $result = SWIG_d_string_callback($1->c_str()); %} - -%typemap(din) string, const string & "($dinput ? TO_STRINGZ($dinput) : null)" -%typemap(dout, excode=SWIGEXCODE) string, const string & { - DP_STRING_TYPE ret = FROM_STRINGZ($imcall);$excode - return ret; -} - -%typemap(directorin) string, const string & %{ $input = SWIG_d_string_callback($1.c_str()); %} - -%typemap(directorout, canthrow=1) string -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - $result.assign($input); %} - -%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - /* possible thread/reentrant code problem */ - static $*1_ltype $1_str; - $1_str = $input; - $result = &$1_str; %} - -%typemap(ddirectorin) string, const string & "FROM_STRINGZ($winput)" -%typemap(ddirectorout) string, const string & "TO_STRINGZ($dcall)" - -%typemap(throws, canthrow=1) string, const string & -%{ SWIG_DSetPendingException(SWIG_DException, $1.c_str()); - return $null; %} - -%typemap(typecheck) string, const string & = char *; -%enddef - -// We need to have the \0-terminated string conversion functions available in -// the D proxy modules. -#if (SWIG_D_VERSION == 1) -// Could be easily extended to support Phobos as well. -SWIGD_STD_STRING_TYPEMAPS(char*, char[], tango.stdc.stringz.fromStringz, tango.stdc.stringz.toStringz) - -%pragma(d) globalproxyimports = "static import tango.stdc.stringz;"; -#else -SWIGD_STD_STRING_TYPEMAPS(const(char)*, string, std.conv.to!string, std.string.toStringz) - -%pragma(d) globalproxyimports = %{ -static import std.conv; -static import std.string; -%} -#endif - -#undef SWIGD_STD_STRING_TYPEMAPS - -} // namespace std diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/d/std_unique_ptr.i deleted file mode 100755 index 9317a7e0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_unique_ptr.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap (ctype) std::unique_ptr< TYPE > "void *" -%typemap (imtype) std::unique_ptr< TYPE > "void*" -%typemap (dtype) std::unique_ptr< TYPE > "$typemap(dtype, TYPE)" - -%typemap(in) std::unique_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(din, - nativepointer="cast(void*)$dinput" -) std::unique_ptr< TYPE > "$typemap(dtype, TYPE).swigRelease($dinput)" - -%typemap (out) std::unique_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}" -) std::unique_ptr< TYPE > { - void* cPtr = $imcall; - $typemap(dtype, TYPE) ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/d/std_vector.i b/linux/bin/swig/share/swig/4.1.0/d/std_vector.i deleted file mode 100755 index fb8f7d2e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/std_vector.i +++ /dev/null @@ -1,605 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector, D implementation. - * - * The D wrapper is made to loosely resemble a tango.util.container.more.Vector - * and to provide built-in array-like access. - * - * If T does define an operator==, then use the SWIG_STD_VECTOR_ENHANCED - * macro to obtain enhanced functionality (none yet), for example: - * - * SWIG_STD_VECTOR_ENHANCED(SomeNamespace::Klass) - * %template(VectKlass) std::vector; - * - * Warning: heavy macro usage in this file. Use swig -E to get a sane view on - * the real file contents! - * ----------------------------------------------------------------------------- */ - -// Warning: Use the typemaps here in the expectation that the macros they are in will change name. - -%include - -// MACRO for use within the std::vector class body -%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CONST_REFERENCE, CTYPE...) -#if (SWIG_D_VERSION == 1) -%typemap(dimports) std::vector< CTYPE > "static import tango.core.Exception;" -%proxycode %{ -public this($typemap(dtype, CTYPE)[] values) { - this(); - append(values); -} - -alias push_back add; -alias push_back push; -alias push_back opCatAssign; -alias size length; -alias opSlice slice; - -public $typemap(dtype, CTYPE) opIndexAssign($typemap(dtype, CTYPE) value, size_t index) { - if (index >= size()) { - throw new tango.core.Exception.NoSuchElementException("Tried to assign to element out of vector bounds."); - } - setElement(index, value); - return value; -} - -public $typemap(dtype, CTYPE) opIndex(size_t index) { - if (index >= size()) { - throw new tango.core.Exception.NoSuchElementException("Tried to read from element out of vector bounds."); - } - return getElement(index); -} - -public void append($typemap(dtype, CTYPE)[] value...) { - foreach (v; value) { - add(v); - } -} - -public $typemap(dtype, CTYPE)[] opSlice() { - $typemap(dtype, CTYPE)[] array = new $typemap(dtype, CTYPE)[size()]; - foreach (i, ref value; array) { - value = getElement(i); - } - return array; -} - -public int opApply(int delegate(ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - result = dg(value); - setElement(i, value); - } - return result; -} - -public int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - - // Workaround for http://d.puremagic.com/issues/show_bug.cgi?id=2443. - auto index = i; - - result = dg(index, value); - setElement(i, value); - } - return result; -} - -public void capacity(size_t value) { - if (value < size()) { - throw new tango.core.Exception.IllegalArgumentException("Tried to make the capacity of a vector smaller than its size."); - } - - reserve(value); -} -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - void clear(); - void push_back(CTYPE const& x); - size_type size() const; - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - - vector(); - vector(const vector &other); - - %extend { - vector(size_type capacity) throw (std::length_error) { - std::vector< CTYPE >* pv = 0; - pv = new std::vector< CTYPE >(); - - // Might throw std::length_error. - pv->reserve(capacity); - - return pv; - } - - size_type unused() const { - return $self->capacity() - $self->size(); - } - - const_reference remove() throw (std::out_of_range) { - if ($self->empty()) { - throw std::out_of_range("Tried to remove last element from empty vector."); - } - - std::vector< CTYPE >::const_reference value = $self->back(); - $self->pop_back(); - return value; - } - - const_reference remove(size_type index) throw (std::out_of_range) { - if (index >= $self->size()) { - throw std::out_of_range("Tried to remove element with invalid index."); - } - - std::vector< CTYPE >::iterator it = $self->begin() + index; - std::vector< CTYPE >::const_reference value = *it; - $self->erase(it); - return value; - } - } - - // Wrappers for setting/getting items with the possibly thrown exception - // specified (important for SWIG wrapper generation). - %extend { - const_reference getElement(size_type index) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to get value of element with invalid index."); - } - return (*$self)[index]; - } - } - - // Use CTYPE const& instead of const_reference to work around SWIG code - // generation issue when using const pointers as vector elements (like - // std::vector< const int* >). - %extend { - void setElement(size_type index, CTYPE const& val) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to set value of element with invalid index."); - } - (*$self)[index] = val; - } - } - -%dmethodmodifiers std::vector::getElement "private" -%dmethodmodifiers std::vector::setElement "private" -%dmethodmodifiers std::vector::reserve "private" - -#else - -%typemap(dimports) std::vector< CTYPE > %{ -static import std.algorithm; -static import std.exception; -static import std.range; -static import std.traits; -%} -%proxycode %{ -alias size_t KeyType; -alias $typemap(dtype, CTYPE) ValueType; - -this(ValueType[] values...) { - this(); - reserve(values.length); - foreach (e; values) { - this ~= e; - } -} - -struct Range { - private $typemap(dtype, std::vector< CTYPE >) _outer; - private size_t _a, _b; - - this($typemap(dtype, std::vector< CTYPE >) data, size_t a, size_t b) { - _outer = data; - _a = a; - _b = b; - } - - @property bool empty() const { - assert((cast($typemap(dtype, std::vector< CTYPE >))_outer).length >= _b); - return _a >= _b; - } - - @property Range save() { - return this; - } - - @property ValueType front() { - std.exception.enforce(!empty); - return _outer[_a]; - } - - @property void front(ValueType value) { - std.exception.enforce(!empty); - _outer[_a] = std.algorithm.move(value); - } - - void popFront() { - std.exception.enforce(!empty); - ++_a; - } - - void opIndexAssign(ValueType value, size_t i) { - i += _a; - std.exception.enforce(i < _b && _b <= _outer.length); - _outer[i] = value; - } - - void opIndexOpAssign(string op)(ValueType value, size_t i) { - std.exception.enforce(_outer && _a + i < _b && _b <= _outer.length); - auto element = _outer[i]; - mixin("element "~op~"= value;"); - _outer[i] = element; - } -} - -// TODO: dup? - -Range opSlice() { - return Range(this, 0, length); -} - -Range opSlice(size_t a, size_t b) { - std.exception.enforce(a <= b && b <= length); - return Range(this, a, b); -} - -size_t opDollar() const { - return length; -} - -@property ValueType front() { - std.exception.enforce(!empty); - return getElement(0); -} - -@property void front(ValueType value) { - std.exception.enforce(!empty); - setElement(0, value); -} - -@property ValueType back() { - std.exception.enforce(!empty); - return getElement(length - 1); -} - -@property void back(ValueType value) { - std.exception.enforce(!empty); - setElement(length - 1, value); -} - -ValueType opIndex(size_t i) { - return getElement(i); -} - -void opIndexAssign(ValueType value, size_t i) { - setElement(i, value); -} - -void opIndexOpAssign(string op)(ValueType value, size_t i) { - auto element = this[i]; - mixin("element "~op~"= value;"); - this[i] = element; -} - -ValueType[] opBinary(string op, Stuff)(Stuff stuff) if (op == "~") { - ValueType[] result; - result ~= this[]; - assert(result.length == length); - result ~= stuff[]; - return result; -} - -void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~") { - static if (is(typeof(insertBack(stuff)))) { - insertBack(stuff); - } else if (is(typeof(insertBack(stuff[])))) { - insertBack(stuff[]); - } else { - static assert(false, "Cannot append " ~ Stuff.stringof ~ " to " ~ typeof(this).stringof); - } -} - -alias size length; - -alias remove removeAny; -alias removeAny stableRemoveAny; - -size_t insertBack(Stuff)(Stuff stuff) -if (std.traits.isImplicitlyConvertible!(Stuff, ValueType)){ - push_back(stuff); - return 1; -} -size_t insertBack(Stuff)(Stuff stuff) -if (std.range.isInputRange!Stuff && - std.traits.isImplicitlyConvertible!(std.range.ElementType!Stuff, ValueType)) { - size_t itemCount; - foreach(item; stuff) { - insertBack(item); - ++itemCount; - } - return itemCount; -} -alias insertBack insert; - -alias pop_back removeBack; -alias pop_back stableRemoveBack; - -size_t insertBefore(Stuff)(Range r, Stuff stuff) -if (std.traits.isImplicitlyConvertible!(Stuff, ValueType)) { - std.exception.enforce(r._outer.swigCPtr == swigCPtr && r._a < length); - insertAt(r._a, stuff); - return 1; -} - -size_t insertBefore(Stuff)(Range r, Stuff stuff) -if (std.range.isInputRange!Stuff && std.traits.isImplicitlyConvertible!(ElementType!Stuff, ValueType)) { - std.exception.enforce(r._outer.swigCPtr == swigCPtr && r._a <= length); - - size_t insertCount; - foreach(i, item; stuff) { - insertAt(r._a + i, item); - ++insertCount; - } - - return insertCount; -} - -size_t insertAfter(Stuff)(Range r, Stuff stuff) { - // TODO: optimize - immutable offset = r._a + r.length; - std.exception.enforce(offset <= length); - auto result = insertBack(stuff); - std.algorithm.bringToFront(this[offset .. length - result], - this[length - result .. length]); - return result; -} - -size_t replace(Stuff)(Range r, Stuff stuff) -if (std.range.isInputRange!Stuff && - std.traits.isImplicitlyConvertible!(ElementType!Stuff, ValueType)) { - immutable offset = r._a; - std.exception.enforce(offset <= length); - size_t result; - for (; !stuff.empty; stuff.popFront()) { - if (r.empty) { - // append the rest - return result + insertBack(stuff); - } - r.front = stuff.front; - r.popFront(); - ++result; - } - // Remove remaining stuff in r - remove(r); - return result; -} - -size_t replace(Stuff)(Range r, Stuff stuff) -if (std.traits.isImplicitlyConvertible!(Stuff, ValueType)) -{ - if (r.empty) - { - insertBefore(r, stuff); - } - else - { - r.front = stuff; - r.popFront(); - remove(r); - } - return 1; -} - -Range linearRemove(Range r) { - std.exception.enforce(r._a <= r._b && r._b <= length); - immutable tailLength = length - r._b; - linearRemove(r._a, r._b); - return this[length - tailLength .. length]; -} -alias remove stableLinearRemove; - -int opApply(int delegate(ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - result = dg(value); - setElement(i, value); - } - return result; -} - -int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - - // Workaround for http://d.puremagic.com/issues/show_bug.cgi?id=2443. - auto index = i; - - result = dg(index, value); - setElement(i, value); - } - return result; -} -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - bool empty() const; - void clear(); - void push_back(CTYPE const& x); - void pop_back(); - size_type size() const; - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - - vector(); - vector(const vector &other); - - %extend { - vector(size_type capacity) throw (std::length_error) { - std::vector< CTYPE >* pv = 0; - pv = new std::vector< CTYPE >(); - - // Might throw std::length_error. - pv->reserve(capacity); - - return pv; - } - - const_reference remove() throw (std::out_of_range) { - if ($self->empty()) { - throw std::out_of_range("Tried to remove last element from empty vector."); - } - - std::vector< CTYPE >::const_reference value = $self->back(); - $self->pop_back(); - return value; - } - - const_reference remove(size_type index) throw (std::out_of_range) { - if (index >= $self->size()) { - throw std::out_of_range("Tried to remove element with invalid index."); - } - - std::vector< CTYPE >::iterator it = $self->begin() + index; - std::vector< CTYPE >::const_reference value = *it; - $self->erase(it); - return value; - } - - void removeBack(size_type how_many) throw (std::out_of_range) { - std::vector< CTYPE >::iterator end = $self->end(); - std::vector< CTYPE >::iterator start = end - how_many; - $self->erase(start, end); - } - - void linearRemove(size_type start_index, size_type end_index) throw (std::out_of_range) { - std::vector< CTYPE >::iterator start = $self->begin() + start_index; - std::vector< CTYPE >::iterator end = $self->begin() + end_index; - $self->erase(start, end); - } - - void insertAt(size_type index, CTYPE const& x) throw (std::out_of_range) { - std::vector< CTYPE >::iterator it = $self->begin() + index; - $self->insert(it, x); - } - } - - // Wrappers for setting/getting items with the possibly thrown exception - // specified (important for SWIG wrapper generation). - %extend { - const_reference getElement(size_type index) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to get value of element with invalid index."); - } - return (*$self)[index]; - } - } - // Use CTYPE const& instead of const_reference to work around SWIG code - // generation issue when using const pointers as vector elements (like - // std::vector< const int* >). - %extend { - void setElement(size_type index, CTYPE const& val) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to set value of element with invalid index."); - } - (*$self)[index] = val; - } - } - -%dmethodmodifiers std::vector::getElement "private" -%dmethodmodifiers std::vector::setElement "private" -#endif -%enddef - -// Extra methods added to the collection class if operator== is defined for the class being wrapped -// The class will then implement IList<>, which adds extra functionality -%define SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE...) - %extend { - } -%enddef - -// For vararg handling in macros, from swigmacros.swg -#define %arg(X...) X - -// Macros for std::vector class specializations/enhancements -%define SWIG_STD_VECTOR_ENHANCED(CTYPE...) -namespace std { - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, %arg(CTYPE)) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE) - }; -} -%enddef - -%{ -#include -#include -%} - -namespace std { - // primary (unspecialized) class template for std::vector - // does not require operator== to be defined - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T) - }; - // specializations for pointers - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T *) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *) - }; - // bool is a bit different in the C++ standard - const_reference in particular - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(bool, bool) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(bool) - }; -} - -// template specializations for std::vector -// these provide extra collections methods as operator== is defined -SWIG_STD_VECTOR_ENHANCED(char) -SWIG_STD_VECTOR_ENHANCED(signed char) -SWIG_STD_VECTOR_ENHANCED(unsigned char) -SWIG_STD_VECTOR_ENHANCED(short) -SWIG_STD_VECTOR_ENHANCED(unsigned short) -SWIG_STD_VECTOR_ENHANCED(int) -SWIG_STD_VECTOR_ENHANCED(unsigned int) -SWIG_STD_VECTOR_ENHANCED(long) -SWIG_STD_VECTOR_ENHANCED(unsigned long) -SWIG_STD_VECTOR_ENHANCED(long long) -SWIG_STD_VECTOR_ENHANCED(unsigned long long) -SWIG_STD_VECTOR_ENHANCED(float) -SWIG_STD_VECTOR_ENHANCED(double) -SWIG_STD_VECTOR_ENHANCED(std::string) // also requires a %include diff --git a/linux/bin/swig/share/swig/4.1.0/d/stl.i b/linux/bin/swig/share/swig/4.1.0/d/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/d/swigmove.i b/linux/bin/swig/share/swig/4.1.0/d/swigmove.i deleted file mode 100755 index e2eb8340..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/swigmove.i +++ /dev/null @@ -1,16 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, canthrow=1) SWIGTYPE MOVE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - SwigValueWrapper< $1_ltype >::reset($1, argp); %} - -%typemap(din) SWIGTYPE MOVE "$dclassname.swigRelease($dinput)" diff --git a/linux/bin/swig/share/swig/4.1.0/d/typemaps.i b/linux/bin/swig/share/swig/4.1.0/d/typemaps.i deleted file mode 100755 index 4f1b5997..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/typemaps.i +++ /dev/null @@ -1,261 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps are used for pointer/reference parameters that are input only -and are mapped to a D input parameter. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In D you could then use it like this: - double answer = fadd(10.0, 20.0); -*/ - -%define INPUT_TYPEMAP(TYPE, CTYPE, DTYPE) -%typemap(ctype, out="void *") TYPE *INPUT, TYPE &INPUT "CTYPE" -%typemap(imtype, out="void*") TYPE *INPUT, TYPE &INPUT "DTYPE" -%typemap(dtype, out="DTYPE*") TYPE *INPUT, TYPE &INPUT "DTYPE" -%typemap(din) TYPE *INPUT, TYPE &INPUT "$dinput" - -%typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(typecheck) TYPE *INPUT = TYPE; -%typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, unsigned int, bool) -//INPUT_TYPEMAP(char, char, char) // Why was this commented out? -INPUT_TYPEMAP(signed char, signed char, byte) -INPUT_TYPEMAP(unsigned char, unsigned char, ubyte) -INPUT_TYPEMAP(short, short, short) -INPUT_TYPEMAP(unsigned short, unsigned short, ushort) -INPUT_TYPEMAP(int, int, int) -INPUT_TYPEMAP(unsigned int, unsigned int, uint) -INPUT_TYPEMAP(long, long, SWIG_LONG_DTYPE) -INPUT_TYPEMAP(unsigned long, unsigned long, SWIG_ULONG_DTYPE) -INPUT_TYPEMAP(long long, long long, long) -INPUT_TYPEMAP(unsigned long long, unsigned long long, ulong) -INPUT_TYPEMAP(float, float, float) -INPUT_TYPEMAP(double, double, double) - -INPUT_TYPEMAP(enum SWIGTYPE, unsigned int, int) -%typemap(dtype) enum SWIGTYPE *INPUT, enum SWIGTYPE &INPUT "$*dclassname" - -#undef INPUT_TYPEMAP - - -/* -OUTPUT typemaps ---------------- - -These typemaps are used for pointer/reference parameters that are output only and -are mapped to a D output parameter. - -The following typemaps can be applied to turn a pointer or reference into an -"output" value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In D, the 'out' keyword is -used when passing the parameter to a function that takes an output parameter. - - bool *OUTPUT, bool &OUTPUT - signed char *OUTPUT, signed char &OUTPUT - unsigned char *OUTPUT, unsigned char &OUTPUT - short *OUTPUT, short &OUTPUT - unsigned short *OUTPUT, unsigned short &OUTPUT - int *OUTPUT, int &OUTPUT - unsigned int *OUTPUT, unsigned int &OUTPUT - long *OUTPUT, long &OUTPUT - unsigned long *OUTPUT, unsigned long &OUTPUT - long long *OUTPUT, long long &OUTPUT - unsigned long long *OUTPUT, unsigned long long &OUTPUT - float *OUTPUT, float &OUTPUT - double *OUTPUT, double &OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters): - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The D output of the function would be the function return value and the -value returned in the second output parameter. In D you would use it like this: - - double dptr; - double fraction = modf(5, dptr); -*/ - -%define OUTPUT_TYPEMAP(TYPE, CTYPE, DTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *OUTPUT, TYPE &OUTPUT "CTYPE *" -%typemap(imtype, out="void*") TYPE *OUTPUT, TYPE &OUTPUT "out DTYPE" -%typemap(dtype, out="DTYPE*") TYPE *OUTPUT, TYPE &OUTPUT "out DTYPE" -%typemap(din) TYPE *OUTPUT, TYPE &OUTPUT "$dinput" - -%typemap(in) TYPE *OUTPUT, TYPE &OUTPUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *OUTPUT, TYPE &OUTPUT "" -%enddef - -OUTPUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//OUTPUT_TYPEMAP(char, char, char, CHAR_PTR) // Why was this commented out? -OUTPUT_TYPEMAP(signed char, signed char, byte, INT8_PTR) -OUTPUT_TYPEMAP(unsigned char, unsigned char, ubyte, UINT8_PTR) -OUTPUT_TYPEMAP(short, short, short, INT16_PTR) -OUTPUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -OUTPUT_TYPEMAP(int, int, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long, long, SWIG_LONG_DTYPE,INT32_PTR) -OUTPUT_TYPEMAP(unsigned long, unsigned long, SWIG_ULONG_DTYPE,UINT32_PTR) -OUTPUT_TYPEMAP(long long, long long, long, INT64_PTR) -OUTPUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -OUTPUT_TYPEMAP(float, float, float, FLOAT_PTR) -OUTPUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -OUTPUT_TYPEMAP(enum SWIGTYPE, unsigned int, int, INT32_PTR) -%typemap(dtype) enum SWIGTYPE *OUTPUT, enum SWIGTYPE &OUTPUT "out $*dclassname" - -#undef OUTPUT_TYPEMAP - -%typemap(in) bool *OUTPUT, bool &OUTPUT -%{ *$input = 0; - $1 = ($1_ltype)$input; %} - - -/* -INOUT typemaps --------------- - -These typemaps are for pointer/reference parameters that are both input and -output and are mapped to a D reference parameter. - -The following typemaps can be applied to turn a pointer or reference into a -reference parameters, that is the parameter is both an input and an output. -In D, the 'ref' keyword is used for reference parameters. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -The D output of the function would be the new value returned by the -reference parameter. In D you would use it like this: - - - double x = 5.0; - neg(x); - -The implementation of the OUTPUT and INOUT typemaps is different to the scripting -languages in that the scripting languages will return the output value as part -of the function return value. -*/ - -%define INOUT_TYPEMAP(TYPE, CTYPE, DTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *INOUT, TYPE &INOUT "CTYPE *" -%typemap(imtype, out="void*") TYPE *INOUT, TYPE &INOUT "ref DTYPE" -%typemap(dtype, out="DTYPE*") TYPE *INOUT, TYPE &INOUT "ref DTYPE" -%typemap(din) TYPE *INOUT, TYPE &INOUT "$dinput" - -%typemap(in) TYPE *INOUT, TYPE &INOUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *INOUT, TYPE &INOUT "" -%enddef - -INOUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//INOUT_TYPEMAP(char, char, char, CHAR_PTR) -INOUT_TYPEMAP(signed char, signed char, byte, INT8_PTR) -INOUT_TYPEMAP(unsigned char, unsigned char, ubyte, UINT8_PTR) -INOUT_TYPEMAP(short, short, short, INT16_PTR) -INOUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -INOUT_TYPEMAP(int, int, int, INT32_PTR) -INOUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -INOUT_TYPEMAP(long, long, SWIG_LONG_DTYPE,INT32_PTR) -INOUT_TYPEMAP(unsigned long, unsigned long, SWIG_ULONG_DTYPE,UINT32_PTR) -INOUT_TYPEMAP(long long, long long, long, INT64_PTR) -INOUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -INOUT_TYPEMAP(float, float, float, FLOAT_PTR) -INOUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -INOUT_TYPEMAP(enum SWIGTYPE, unsigned int, int, INT32_PTR) -%typemap(dtype) enum SWIGTYPE *INOUT, enum SWIGTYPE &INOUT "ref $*dclassname" - -#undef INOUT_TYPEMAP diff --git a/linux/bin/swig/share/swig/4.1.0/d/wrapperloader.swg b/linux/bin/swig/share/swig/4.1.0/d/wrapperloader.swg deleted file mode 100755 index 67e03bfc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/d/wrapperloader.swg +++ /dev/null @@ -1,309 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wrapperloader.swg - * - * Support code for dynamically linking the C wrapper library from the D - * wrapper module. - * - * The loading code was adapted from the Derelict project and is used with - * permission from Michael Parker, the original author. - * ----------------------------------------------------------------------------- */ - -%pragma(d) wrapperloadercode = %{ -private { - version(linux) { - version = Nix; - } else version(darwin) { - version = Nix; - } else version(OSX) { - version = Nix; - } else version(FreeBSD) { - version = Nix; - version = freebsd; - } else version(freebsd) { - version = Nix; - } else version(Unix) { - version = Nix; - } else version(Posix) { - version = Nix; - } - - version(Tango) { - static import tango.stdc.string; - static import tango.stdc.stringz; - - version (PhobosCompatibility) { - } else { - alias char[] string; - alias wchar[] wstring; - alias dchar[] dstring; - } - } else { - version(D_Version2) { - static import std.conv; - } else { - static import std.c.string; - } - static import std.string; - } - - version(D_Version2) { - mixin("alias const(char)* CCPTR;"); - } else { - alias char* CCPTR; - } - - CCPTR swigToCString(string str) { - version(Tango) { - return tango.stdc.stringz.toStringz(str); - } else { - return std.string.toStringz(str); - } - } - - string swigToDString(CCPTR cstr) { - version(Tango) { - return tango.stdc.stringz.fromStringz(cstr); - } else { - version(D_Version2) { - mixin("return std.conv.to!string(cstr);"); - } else { - return std.c.string.toString(cstr); - } - } - } -} - -class SwigSwigSharedLibLoadException : Exception { - this(in string[] libNames, in string[] reasons) { - string msg = "Failed to load one or more shared libraries:"; - foreach(i, n; libNames) { - msg ~= "\n\t" ~ n ~ " - "; - if(i < reasons.length) - msg ~= reasons[i]; - else - msg ~= "Unknown"; - } - super(msg); - } -} - -class SwigSymbolLoadException : Exception { - this(string SwigSharedLibName, string symbolName) { - super("Failed to load symbol " ~ symbolName ~ " from shared library " ~ SwigSharedLibName); - _symbolName = symbolName; - } - - string symbolName() { - return _symbolName; - } - -private: - string _symbolName; -} - -private { - version(Nix) { - version(freebsd) { - // the dl* functions are in libc on FreeBSD - } - else { - pragma(lib, "dl"); - } - - version(Tango) { - import tango.sys.Common; - } else version(linux) { - import core.sys.posix.dlfcn; - } else { - extern(C) { - const RTLD_NOW = 2; - - void *dlopen(CCPTR file, int mode); - int dlclose(void* handle); - void *dlsym(void* handle, CCPTR name); - CCPTR dlerror(); - } - } - - alias void* SwigSharedLibHandle; - - SwigSharedLibHandle swigLoadSharedLib(string libName) { - return dlopen(swigToCString(libName), RTLD_NOW); - } - - void swigUnloadSharedLib(SwigSharedLibHandle hlib) { - dlclose(hlib); - } - - void* swigGetSymbol(SwigSharedLibHandle hlib, string symbolName) { - return dlsym(hlib, swigToCString(symbolName)); - } - - string swigGetErrorStr() { - CCPTR err = dlerror(); - if (err is null) { - return "Unknown Error"; - } - return swigToDString(err); - } - } else version(Windows) { - alias ushort WORD; - alias uint DWORD; - alias CCPTR LPCSTR; - alias void* HMODULE; - alias void* HLOCAL; - alias int function() FARPROC; - struct VA_LIST {} - - extern (Windows) { - HMODULE LoadLibraryA(LPCSTR); - FARPROC GetProcAddress(HMODULE, LPCSTR); - void FreeLibrary(HMODULE); - DWORD GetLastError(); - DWORD FormatMessageA(DWORD, in void*, DWORD, DWORD, LPCSTR, DWORD, VA_LIST*); - HLOCAL LocalFree(HLOCAL); - } - - DWORD MAKELANGID(WORD p, WORD s) { - return (((cast(WORD)s) << 10) | cast(WORD)p); - } - - enum { - LANG_NEUTRAL = 0, - SUBLANG_DEFAULT = 1, - FORMAT_MESSAGE_ALLOCATE_BUFFER = 256, - FORMAT_MESSAGE_IGNORE_INSERTS = 512, - FORMAT_MESSAGE_FROM_SYSTEM = 4096 - } - - alias HMODULE SwigSharedLibHandle; - - SwigSharedLibHandle swigLoadSharedLib(string libName) { - return LoadLibraryA(swigToCString(libName)); - } - - void swigUnloadSharedLib(SwigSharedLibHandle hlib) { - FreeLibrary(hlib); - } - - void* swigGetSymbol(SwigSharedLibHandle hlib, string symbolName) { - return GetProcAddress(hlib, swigToCString(symbolName)); - } - - string swigGetErrorStr() { - DWORD errcode = GetLastError(); - - LPCSTR msgBuf; - DWORD i = FormatMessageA( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - null, - errcode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - cast(LPCSTR)&msgBuf, - 0, - null); - - string text = swigToDString(msgBuf); - LocalFree(cast(HLOCAL)msgBuf); - - if (i >= 2) { - i -= 2; - } - return text[0 .. i]; - } - } else { - static assert(0, "Operating system not supported by the wrapper loading code."); - } - - final class SwigSharedLib { - void load(string[] names) { - if (_hlib !is null) return; - - string[] failedLibs; - string[] reasons; - - foreach(n; names) { - _hlib = swigLoadSharedLib(n); - if (_hlib is null) { - failedLibs ~= n; - reasons ~= swigGetErrorStr(); - continue; - } - _name = n; - break; - } - - if (_hlib is null) { - throw new SwigSwigSharedLibLoadException(failedLibs, reasons); - } - } - - void* loadSymbol(string symbolName, bool doThrow = true) { - void* sym = swigGetSymbol(_hlib, symbolName); - if(doThrow && (sym is null)) { - throw new SwigSymbolLoadException(_name, symbolName); - } - return sym; - } - - void unload() { - if(_hlib !is null) { - swigUnloadSharedLib(_hlib); - _hlib = null; - } - } - - private: - string _name; - SwigSharedLibHandle _hlib; - } -} - -static this() { - string[] possibleFileNames; - version (Posix) { - version (OSX) { - possibleFileNames ~= ["lib$wraplibrary.dylib", "lib$wraplibrary.bundle"]; - } - possibleFileNames ~= ["lib$wraplibrary.so"]; - } else version (Windows) { - possibleFileNames ~= ["$wraplibrary.dll", "lib$wraplibrary.so"]; - } else { - static assert(false, "Operating system not supported by the wrapper loading code."); - } - - auto library = new SwigSharedLib; - library.load(possibleFileNames); - - string bindCode(string functionPointer, string symbol) { - return functionPointer ~ " = cast(typeof(" ~ functionPointer ~ - "))library.loadSymbol(`" ~ symbol ~ "`);"; - } - - //#if !defined(SWIG_D_NO_EXCEPTION_HELPER) - mixin(bindCode("swigRegisterExceptionCallbacks$module", "SWIGRegisterExceptionCallbacks_$module")); - //#endif // SWIG_D_NO_EXCEPTION_HELPER - //#if !defined(SWIG_D_NO_STRING_HELPER) - mixin(bindCode("swigRegisterStringCallback$module", "SWIGRegisterStringCallback_$module")); - //#endif // SWIG_D_NO_STRING_HELPER - $wrapperloaderbindcode -} - -//#if !defined(SWIG_D_NO_EXCEPTION_HELPER) -extern(C) void function( - SwigExceptionCallback exceptionCallback, - SwigExceptionCallback illegalArgumentCallback, - SwigExceptionCallback illegalElementCallback, - SwigExceptionCallback ioCallback, - SwigExceptionCallback noSuchElementCallback) swigRegisterExceptionCallbacks$module; -//#endif // SWIG_D_NO_EXCEPTION_HELPER - -//#if !defined(SWIG_D_NO_STRING_HELPER) -extern(C) void function(SwigStringCallback callback) swigRegisterStringCallback$module; -//#endif // SWIG_D_NO_STRING_HELPER -%} - -%pragma(d) wrapperloaderbindcommand = %{ - mixin(bindCode("$function", "$symbol"));%} diff --git a/linux/bin/swig/share/swig/4.1.0/director_common.swg b/linux/bin/swig/share/swig/4.1.0/director_common.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/exception.i b/linux/bin/swig/share/swig/4.1.0/exception.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/go/cdata.i b/linux/bin/swig/share/swig/4.1.0/go/cdata.i deleted file mode 100755 index b4411af9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/cdata.i +++ /dev/null @@ -1,97 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cdata.i - * - * SWIG library file containing macros for manipulating raw C data as strings. - * ----------------------------------------------------------------------------- */ - -%{ -typedef struct SWIGCDATA { - char *data; - intgo len; -} SWIGCDATA; -%} - -%fragment("cdata", "header") %{ -struct swigcdata { - intgo size; - void *data; -}; -%} - -%typemap(gotype) SWIGCDATA "[]byte" - -%typemap(imtype) SWIGCDATA "uint64" - -%typemap(out, fragment="cdata") SWIGCDATA(struct swigcdata *swig_out) %{ - swig_out = (struct swigcdata *)malloc(sizeof(*swig_out)); - if (swig_out) { - swig_out->size = $1.len; - swig_out->data = malloc(swig_out->size); - if (swig_out->data) { - memcpy(swig_out->data, $1.data, swig_out->size); - } - } - $result = *(long long *)(void **)&swig_out; -%} - -%typemap(goout) SWIGCDATA %{ - { - type swigcdata struct { size int; data uintptr } - p := (*swigcdata)(unsafe.Pointer(uintptr($1))) - if p == nil || p.data == 0 { - $result = nil - } else { - b := make([]byte, p.size) - a := (*[0x7fffffff]byte)(unsafe.Pointer(p.data))[:p.size] - copy(b, a) - Swig_free(p.data) - Swig_free(uintptr(unsafe.Pointer(p))) - $result = b - } - } -%} - -/* ----------------------------------------------------------------------------- - * %cdata(TYPE [, NAME]) - * - * Convert raw C data to a binary string. - * ----------------------------------------------------------------------------- */ - -%define %cdata(TYPE,NAME...) - -%insert("header") { -#if #NAME == "" -static SWIGCDATA cdata_##TYPE(TYPE *ptr, int nelements) { -#else -static SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements) { -#endif - SWIGCDATA d; - d.data = (char *) ptr; -#if #TYPE != "void" - d.len = nelements*sizeof(TYPE); -#else - d.len = nelements; -#endif - return d; -} -} - -%typemap(default) int nelements "$1 = 1;" - -#if #NAME == "" -SWIGCDATA cdata_##TYPE(TYPE *ptr, int nelements); -#else -SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements); -#endif -%enddef - -%typemap(default) int nelements; - -%rename(cdata) ::cdata_void(void *ptr, int nelements); - -%cdata(void); - -/* Memory move function. Due to multi-argument typemaps this appears - to be wrapped as - void memmove(void *data, const char *s); */ -void memmove(void *data, char *indata, int inlen); diff --git a/linux/bin/swig/share/swig/4.1.0/go/director.swg b/linux/bin/swig/share/swig/4.1.0/go/director.swg deleted file mode 100755 index 103ba22a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/director.swg +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Go proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#include -#include - -namespace Swig { - - class DirectorException : public std::exception { - }; -} - -/* Handle memory management for directors. */ - -namespace { - struct GCItem { - virtual ~GCItem() {} - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem* operator->() { - return _item; - } - - private: - GCItem *_item; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; -} - -class Swig_memory { -public: - template - void swig_acquire_pointer(Type* vptr) { - if (vptr) { - swig_owner[vptr] = new GCItem_T(vptr); - } - } -private: - typedef std::map swig_ownership_map; - swig_ownership_map swig_owner; -}; - -template -static void swig_acquire_pointer(Swig_memory** pmem, Type* ptr) { - if (!pmem) { - *pmem = new Swig_memory; - } - (*pmem)->swig_acquire_pointer(ptr); -} diff --git a/linux/bin/swig/share/swig/4.1.0/go/exception.i b/linux/bin/swig/share/swig/4.1.0/go/exception.i deleted file mode 100755 index 5abd306a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/exception.i +++ /dev/null @@ -1,7 +0,0 @@ -%typemap(throws,noblock=1) (...) { - SWIG_exception(SWIG_RuntimeError,"unknown exception"); -} - -%insert("runtime") %{ -#define SWIG_exception(code, msg) _swig_gopanic(msg) -%} diff --git a/linux/bin/swig/share/swig/4.1.0/go/go.swg b/linux/bin/swig/share/swig/4.1.0/go/go.swg deleted file mode 100755 index 348ae5f0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/go.swg +++ /dev/null @@ -1,744 +0,0 @@ -/* ------------------------------------------------------------ - * go.swg - * - * Go configuration module. - * ------------------------------------------------------------ */ - -%include - -/* Code insertion directives */ -#define %go_import(...) %insert(go_imports) %{__VA_ARGS__%} - -/* Basic types */ - -%typemap(gotype) bool, const bool & "bool" -%typemap(gotype) char, const char & "byte" -%typemap(gotype) signed char, const signed char & "int8" -%typemap(gotype) unsigned char, const unsigned char & "byte" -%typemap(gotype) short, const short & "int16" -%typemap(gotype) unsigned short, const unsigned short & "uint16" -%typemap(gotype) int, const int & "int" -%typemap(gotype) unsigned int, const unsigned int & "uint" -%typemap(gotype) long, const long & "int64" -%typemap(gotype) unsigned long, const unsigned long & "uint64" -%typemap(gotype) long long, const long long & "int64" -%typemap(gotype) unsigned long long, const unsigned long long & "uint64" -%typemap(gotype) float, const float & "float32" -%typemap(gotype) double, const double & "float64" - -%typemap(in) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $1 = ($1_ltype)$input; %} - -%typemap(in) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ $1 = ($1_ltype)&$input; %} - -%typemap(in) const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = ($1_ltype)&temp; %} - -%typemap(out) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $result = $1; %} - -%typemap(goout) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -"" - -%typemap(out) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ $result = ($*1_ltype)*$1; %} - -%typemap(goout) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -"" - -%typemap(out) void "" - -%typemap(goout) void "" - -%typemap(directorin) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $input = ($1_ltype)$1; %} - -%typemap(godirectorin) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -"" - -%typemap(directorin) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ $input = ($*1_ltype)$1; %} - -%typemap(godirectorin) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -"" - -%typemap(directorout) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $result = ($1_ltype)$input; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ - $result = new $*1_ltype($input); - swig_acquire_pointer(&swig_mem, $result); -%} - -/* The size_t type. */ - -%typemap(gotype) size_t, const size_t & %{int64%} - -%typemap(in) size_t -%{ $1 = (size_t)$input; %} - -%typemap(in) const size_t & -%{ $1 = ($1_ltype)&$input; %} - -%typemap(out) size_t -%{ $result = $1; %} - -%typemap(goout) size_t "" - -%typemap(out) const size_t & -%{ $result = ($*1_ltype)*$1; %} - -%typemap(goout) const size_t & "" - -%typemap(directorin) size_t -%{ $input = (size_t)$1; %} - -%typemap(godirectorin) size_t "" - -%typemap(directorin) const size_t & -%{ $input = ($*1_ltype)$1; %} - -%typemap(godirectorin) const size_t & "" - -%typemap(directorout) size_t -%{ $result = ($1_ltype)$input; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) const size_t & -%{ - $result = new $*1_ltype($input); - swig_acquire_pointer(&swig_mem, $result); -%} - -/* Member pointers. */ - -%typemap(gotype) SWIGTYPE (CLASS::*) -%{$gotypename%} - -%typemap(in) SWIGTYPE (CLASS::*) -%{ $1 = *($&1_ltype)$input; %} - -%typemap(out) SWIGTYPE (CLASS::*) -%{ - struct swig_out_type { intgo size; void* val; } *swig_out; - swig_out = (struct swig_out_type*)malloc(sizeof(*swig_out)); - if (swig_out) { - swig_out->size = sizeof($1_ltype); - swig_out->val = malloc(swig_out->size); - if (swig_out->val) { - *($&1_ltype)(swig_out->val) = $1; - } - } - $result = swig_out; -%} - -%typemap(goout) SWIGTYPE (CLASS::*) -%{ - { - type swig_out_type struct { size int; val uintptr } - p := (*swig_out_type)(unsafe.Pointer($1)) - if p == nil || p.val == 0 { - $result = nil - } else { - m := make([]byte, p.size) - a := (*[1024]byte)(unsafe.Pointer(p.val))[:p.size] - copy(m, a) - Swig_free(p.val) - Swig_free(uintptr(unsafe.Pointer(p))) - $result = &m[0] - } - } -%} - -%typemap(directorin) SWIGTYPE (CLASS::*) -%{ $input = *($&1_ltype)$1; %} - -%typemap(godirectorin) SWIGTYPE (CLASS::*) "" - -%typemap(directorout) SWIGTYPE (CLASS::*) -%{ - $result = new $1_ltype($input); - swig_acquire_pointer(&swig_mem, $result); -%} - -/* Pointers. */ - -/* We can't translate pointers using a typemap, so that is handled in - the C++ code. */ -%typemap(gotype) SWIGTYPE * -%{$gotypename%} - -%typemap(in) SWIGTYPE * -%{ $1 = *($&1_ltype)&$input; %} - -%typemap(out) SWIGTYPE * -%{ *($&1_ltype)&$result = ($1_ltype)$1; %} - -%typemap(goout) SWIGTYPE * "" - -%typemap(directorin) SWIGTYPE * -%{ *($&1_ltype)&$input = ($1_ltype)$1; %} - -%typemap(godirectorin) SWIGTYPE * "" - -%typemap(directorout) SWIGTYPE * -%{ $result = *($&1_ltype)&$input; %} - -/* Pointer references. */ - -%typemap(gotype) SWIGTYPE *const& -%{$gotypename%} - -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ - temp = *($1_ltype)&$input; - $1 = ($1_ltype)&temp; -%} - -%typemap(out) SWIGTYPE *const& -%{ *($1_ltype)&$result = *$1; %} - -%typemap(goout) SWIGTYPE *const& "" - -/* References. */ - -/* Converting a C++ reference to Go has to be handled in the C++ - code. */ -%typemap(gotype) SWIGTYPE & -%{$gotypename%} - -%typemap(in) SWIGTYPE & -%{ $1 = *($&1_ltype)&$input; %} - -%typemap(out) SWIGTYPE & -%{ *($&1_ltype)&$result = $1; %} - -%typemap(goout) SWIGTYPE & "" - -%typemap(directorin) SWIGTYPE & -%{ $input = ($1_ltype)&$1; %} - -%typemap(godirectorin) SWIGTYPE & "" - -%typemap(directorout) SWIGTYPE & -%{ *($&1_ltype)&$result = $input; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = *($1_ltype)&$input; - $result = &swig_temp; %} - -%typemap(gotype) SWIGTYPE && -%{$gotypename%} - -%typemap(in, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) -%{ $1 = *($&1_ltype)&$input; -rvrdeleter.reset($1); %} - -%typemap(out) SWIGTYPE && -%{ *($&1_ltype)&$result = $1; %} - -%typemap(goout) SWIGTYPE && "" - -%typemap(directorin) SWIGTYPE && -%{ $input = ($1_ltype)&$1_name; %} - -%typemap(godirectorin) SWIGTYPE && "" - -%typemap(directorout) SWIGTYPE && -%{ *($&1_ltype)&$result = $input; %} - -/* C arrays turn into Go pointers. If we know the length we can use a - slice. */ - -%typemap(gotype) SWIGTYPE [] -%{$gotypename%} - -%typemap(in) SWIGTYPE [] -%{ $1 = *($&1_ltype)&$input; %} - -%typemap(out) SWIGTYPE [] -%{ *($&1_ltype)&$result = $1; %} - -%typemap(goout) SWIGTYPE [] "" - -%typemap(directorin) SWIGTYPE [] -%{ $input = *($1_ltype)&$1; %} - -%typemap(godirectorin) SWIGTYPE [] "" - -%typemap(directorout) SWIGTYPE [] -%{ *($&1_ltype)&$result = $input; %} - -/* Strings. */ - -%typemap(gotype) - char *, char *&, char[ANY], char[] "string" - -/* Needed to avoid confusion with the way the go module handles - references. */ -%typemap(gotype) char&, unsigned char& "*byte" -%typemap(gotype) signed char& "*int8" - -%typemap(in) - char *, char[ANY], char[] -%{ - $1 = ($1_ltype)malloc($input.n + 1); - memcpy($1, $input.p, $input.n); - $1[$input.n] = '\0'; -%} - -%typemap(in) char *& (char *temp) -%{ - temp = (char *)malloc($input.n + 1); - memcpy(temp, $input.p, $input.n); - temp[$input.n] = '\0'; - $1 = ($1_ltype)&temp; -%} - -%typemap(freearg) - char *, char[ANY], char[] -%{ free($1); %} - -%typemap(freearg) char *& -%{ free(temp$argnum); %} - -%typemap(out,fragment="AllocateString") - char *, char *&, char[ANY], char[] -%{ $result = Swig_AllocateString((char*)$1, $1 ? strlen((char*)$1) : 0); %} - -%typemap(goout,fragment="CopyString") - char *, char *&, char[ANY], char[] -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") - char *, char *&, char[ANY], char[] -%{ - $input = Swig_AllocateString((char*)$1, $1 ? strlen((char*)$1) : 0); -%} - -%typemap(godirectorin,fragment="CopyString") - char *, char *&, char[ANY], char[] -%{ - $result = swigCopyString($input) -%} - -%typemap(godirectorout) - char *, char *&, char[ANY], char[] -%{ - { - p := Swig_malloc(len($input) + 1) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len($input) + 1] - copy(s, $input) - s[len($input)] = 0 - $result = *(*string)(unsafe.Pointer(&s)) - } -%} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) - char *, char *&, char[ANY], char[] -%{ $result = ($1_ltype)$input.p; %} - -/* String & length */ - -%typemap(gotype) (char *STRING, size_t LENGTH) "string" - -%typemap(in) (char *STRING, size_t LENGTH) -%{ - $1 = ($1_ltype)$input.p; - $2 = ($2_ltype)$input.n; -%} - -%typemap(out,fragment="AllocateString") (char *STRING, size_t LENGTH) -%{ $result = Swig_AllocateString((char*)$1, (size_t)$2); %} - -%typemap(goout,fragment="CopyString") (char *STRING, size_t LENGTH) -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") (char *STRING, size_t LENGTH) -%{ $input = Swig_AllocateString((char*)$1, $2); %} - -%typemap(godirectorin,fragment="CopyString") (char *STRING, size_t LENGTH) -%{ $result = swigCopyString($input) %} - -%typemap(directorout) (char *STRING, size_t LENGTH) -%{ - $1 = ($1_ltype)$input.p; - $2 = ($2_ltype)$input.n; -%} - -/* The int & type needs to convert to intgo. */ - -%typemap(gotype) int & "*int" - -%typemap(in) int & (int e) -%{ - e = (int)*$input; - $1 = &e; -%} - -%typemap(out) int & -%{ $result = new intgo(*$1); %} - -%typemap(argout) int & -%{ *$input = (intgo)e$argnum; %} - -%typemap(goout) int & "" - -%typemap(directorin) int & (intgo e) -%{ - e = (intgo)$1; - $input = &e; -%} - -%typemap(godirectorin) int & "" - -%typemap(directorout) int & -%{ - $*1_ltype f = ($*1_ltype)*$input; - $result = ($1_ltype)&f; -%} - -%typemap(directorargout) int & -%{ $1 = (int)*$input; %} - -%typemap(argout) const int & "" -%typemap(directorargout) const int & "" - -/* Enums. We can't do the right thing for enums in typemap(gotype) so - we deliberately don't define them. The right thing would be to - capitalize the name. This is instead done in go.cxx. */ - -%typemap(gotype) enum SWIGTYPE -%{$gotypename%} - -%typemap(in) enum SWIGTYPE -%{ $1 = ($1_ltype)$input; %} - -%typemap(out) enum SWIGTYPE -%{ $result = (intgo)$1; %} - -%typemap(goout) enum SWIGTYPE "" - -%typemap(directorin) enum SWIGTYPE -%{ $input = (intgo)$1; %} - -%typemap(godirectorin) enum SWIGTYPE "" - -%typemap(directorout) enum SWIGTYPE -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin) enum SWIGTYPE & (intgo e) -%{ - e = (intgo)$1; - $input = ($1_ltype)&e; -%} - -%typemap(godirectorin) enum SWIGTYPE & "" - -%typemap(directorout) enum SWIGTYPE & -%{ $result = $input; %} - -/* Arbitrary type. This is a type passed by value in the C/C++ code. - We convert it to a pointer for the Go code. Note that all basic - types are explicitly handled above. */ - -%typemap(gotype) SWIGTYPE -%{$gotypename%} - -%typemap(in) SWIGTYPE ($&1_type argp) -%{ - argp = ($&1_ltype)$input; - if (argp == NULL) { - _swig_gopanic("Attempt to dereference null $1_type"); - } - $1 = ($1_ltype)*argp; -%} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ *($&1_ltype*)&$result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype)malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - *($&1_ltype*)&$result = $1ptr; -} -#endif - -%typemap(goout) SWIGTYPE "" - -%typemap(directorin) SWIGTYPE -%{ $input = new $1_ltype(SWIG_STD_MOVE($1)); %} - -%typemap(godirectorin) SWIGTYPE "" - -%typemap(directorout) SWIGTYPE -%{ $result = *($&1_ltype)$input; %} - -/* Exception handling */ - -%typemap(throws) char * -%{ _swig_gopanic($1); %} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] -%{ - (void)$1; - _swig_gopanic("C++ $1_type exception thrown"); -%} - -/* Typecheck typemaps. The purpose of these is merely to issue a - warning for overloaded C++ functions that cannot be overloaded in - Go as more than one C++ type maps to a single Go type. */ - -%typecheck(SWIG_TYPECHECK_BOOL) /* Go bool */ - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) /* Go byte */ - char, - const char &, - unsigned char, - const unsigned char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) /* Go int8 */ - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Go int16 */ - short, - const short & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Go uint16 */ - unsigned short, - const unsigned short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Go int */ - int, - const int & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Go uint */ - unsigned int, - const unsigned int & - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Go int64 */ - long, - const long &, - long long, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Go uint64 */ - unsigned long, - const unsigned long &, - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) /* Go float32 */ - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) /* Go float64 */ - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) /* Go string */ - char *, - char *&, - char[ANY], - char [], - signed char *, - signed char *&, - signed char[ANY], - signed char [], - unsigned char *, - unsigned char *&, - unsigned char[ANY], - unsigned char [] - "" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE *const&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* Go keywords. */ -%include - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/go/gokw.swg b/linux/bin/swig/share/swig/4.1.0/go/gokw.swg deleted file mode 100755 index 35428300..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/gokw.swg +++ /dev/null @@ -1,33 +0,0 @@ -/* Rename keywords. */ - -#define GOKW(x) %keywordwarn("'" `x` "' is a Go keyword",rename="X%s") `x` -#define GOBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in Go") "::"`x` - -GOKW(break); -GOKW(case); -GOKW(chan); -GOKW(const); -GOKW(continue); -GOKW(default); -GOKW(defer); -GOKW(else); -GOKW(fallthrough); -GOKW(for); -GOKW(func); -GOKW(go); -GOKW(goto); -GOKW(if); -GOKW(import); -GOKW(interface); -GOKW(package); -GOKW(range); -GOKW(return); -GOKW(select); -GOKW(struct); -GOKW(switch); -GOKW(type); -GOKW(var); - -GOBN(map); - -#undef GOKW diff --git a/linux/bin/swig/share/swig/4.1.0/go/goruntime.swg b/linux/bin/swig/share/swig/4.1.0/go/goruntime.swg deleted file mode 100755 index 7bf083bd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/goruntime.swg +++ /dev/null @@ -1,217 +0,0 @@ -/* ------------------------------------------------------------ - * goruntime.swg - * - * Go runtime code for the various generated files. - * ------------------------------------------------------------ */ - -%inline %{ -static void Swig_free(void* p) { - free(p); -} - -static void* Swig_malloc(int c) { - return malloc(c); -} -%} - -%insert(runtime) %{ -#include -#include -#include -#include -#include - -%} - -%insert(cgo_comment_typedefs) %{ -#include -#include -%} - -#if SWIGGO_INTGO_SIZE == 32 -%insert(runtime) %{ -typedef int intgo; -typedef unsigned int uintgo; -%} -%insert(cgo_comment_typedefs) %{ -typedef int intgo; -typedef unsigned int uintgo; -%} -#elif SWIGGO_INTGO_SIZE == 64 -%insert(runtime) %{ -typedef long long intgo; -typedef unsigned long long uintgo; -%} -%insert(cgo_comment_typedefs) %{ -typedef long long intgo; -typedef unsigned long long uintgo; -%} -#else -%insert(runtime) %{ -typedef ptrdiff_t intgo; -typedef size_t uintgo; -%} -%insert(cgo_comment_typedefs) %{ -typedef ptrdiff_t intgo; -typedef size_t uintgo; -%} -#endif - -#ifndef SWIGGO_GCCGO -// Set the host compiler struct attribute that will be -// used to match gc's struct layout. For example, on 386 Windows, -// gcc wants to 8-align int64s, but gc does not. -// Use __gcc_struct__ to work around http://gcc.gnu.org/PR52991 on x86, -// and https://golang.org/issue/5603. -// See: https://github.com/golang/go/blob/fcbf04f9b93b4cd8addd05c2ed784118eb50a46c/src/cmd/cgo/out.go#L663 -%insert(runtime) %{ -# if !defined(__clang__) && (defined(__i386__) || defined(__x86_64__)) -# define SWIGSTRUCTPACKED __attribute__((__packed__, __gcc_struct__)) -# else -# define SWIGSTRUCTPACKED __attribute__((__packed__)) -# endif -%} -#else -# define SWIGSTRUCTPACKED -#endif - -%insert(runtime) %{ - -typedef struct { char *p; intgo n; } _gostring_; -typedef struct { void* array; intgo len; intgo cap; } _goslice_; - -%} - -%insert(cgo_comment_typedefs) %{ - -typedef struct { char *p; intgo n; } _gostring_; -typedef struct { void* array; intgo len; intgo cap; } _goslice_; - -%} - -#ifdef SWIGGO_GCCGO - -/* Boilerplate for C/C++ code when using gccgo. */ -%insert(runtime) %{ -#define SWIGGO_GCCGO - -#ifdef __cplusplus -extern "C" { -#endif -extern void *_cgo_allocate(size_t); -extern void _cgo_panic(const char *); -#ifdef __cplusplus -} -#endif - -#define _swig_goallocate _cgo_allocate -#define _swig_gopanic _cgo_panic -%} - -#endif - -#ifndef SWIGGO_GCCGO - -%go_import("unsafe", _ "runtime/cgo") - -#else - -%go_import("syscall", "unsafe") - -%insert(go_header) %{ - -type _ syscall.Sockaddr - -%} - -#endif - -%insert(go_header) %{ - -type _ unsafe.Pointer - -%} - -/* Swig_always_false is used to conditionally assign parameters to - Swig_escape_val so that the compiler thinks that they escape. We - only assign them if Swig_always_false is true, which it never is. - We export the variable so that the compiler doesn't realize that it - is never set. */ -%insert(go_header) %{ -var Swig_escape_always_false bool -var Swig_escape_val interface{} -%} - -/* Function pointers are translated by the code in go.cxx into - _swig_fnptr. Member pointers are translated to _swig_memberptr. */ - -%insert(go_header) %{ -type _swig_fnptr *byte -type _swig_memberptr *byte -%} - -/* Convert a Go interface value into a C++ pointer. */ - -%insert(go_header) %{ -func getSwigcptr(v interface { Swigcptr() uintptr }) uintptr { - if v == nil { - return 0 - } - return v.Swigcptr() -} -%} - -/* For directors we need C++ to track a Go pointer. Since we can't - pass a Go pointer into C++, we use a map to track the pointers on - the Go side. */ - -%go_import("sync") - -%insert(go_header) %{ -type _ sync.Mutex -%} - -%insert(go_director) %{ - -var swigDirectorTrack struct { - sync.Mutex - m map[int]interface{} - c int -} - -func swigDirectorAdd(v interface{}) int { - swigDirectorTrack.Lock() - defer swigDirectorTrack.Unlock() - if swigDirectorTrack.m == nil { - swigDirectorTrack.m = make(map[int]interface{}) - } - swigDirectorTrack.c++ - ret := swigDirectorTrack.c - swigDirectorTrack.m[ret] = v - return ret -} - -func swigDirectorLookup(c int) interface{} { - swigDirectorTrack.Lock() - defer swigDirectorTrack.Unlock() - ret := swigDirectorTrack.m[c] - if ret == nil { - panic("C++ director pointer not found (possible use-after-free)") - } - return ret -} - -func swigDirectorDelete(c int) { - swigDirectorTrack.Lock() - defer swigDirectorTrack.Unlock() - if swigDirectorTrack.m[c] == nil { - if c > swigDirectorTrack.c { - panic("C++ director pointer invalid (possible memory corruption") - } else { - panic("C++ director pointer not found (possible use-after-free)") - } - } - delete(swigDirectorTrack.m, c) -} - -%} diff --git a/linux/bin/swig/share/swig/4.1.0/go/gostring.swg b/linux/bin/swig/share/swig/4.1.0/go/gostring.swg deleted file mode 100755 index 44cbbb8e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/gostring.swg +++ /dev/null @@ -1,29 +0,0 @@ -/* ------------------------------------------------------------ - * gostring.swg - * - * Support for returning strings from C to Go. - * ------------------------------------------------------------ */ - -// C/C++ code to convert a memory buffer into a Go string allocated in -// C/C++ memory. -%fragment("AllocateString", "runtime") %{ -static _gostring_ Swig_AllocateString(const char *p, size_t l) { - _gostring_ ret; - ret.p = (char*)malloc(l); - memcpy(ret.p, p, l); - ret.n = l; - return ret; -} -%} - -// Go code to convert a string allocated in C++ memory to one -// allocated in Go memory. -%fragment("CopyString", "go_runtime") %{ -type swig_gostring struct { p uintptr; n int } -func swigCopyString(s string) string { - p := *(*swig_gostring)(unsafe.Pointer(&s)) - r := string((*[0x7fffffff]byte)(unsafe.Pointer(p.p))[:p.n]) - Swig_free(p.p) - return r -} -%} diff --git a/linux/bin/swig/share/swig/4.1.0/go/std_array.i b/linux/bin/swig/share/swig/4.1.0/go/std_array.i deleted file mode 100755 index 36c790e3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/std_array.i +++ /dev/null @@ -1,43 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_array.i - * ----------------------------------------------------------------------------- */ - -%include - -namespace std { - - template class array { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - array(); - array(const array& other); - - size_type size() const; - %rename(isEmpty) empty; - bool empty() const; - void fill(const T& u); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; diff --git a/linux/bin/swig/share/swig/4.1.0/go/std_deque.i b/linux/bin/swig/share/swig/4.1.0/go/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/go/std_except.i b/linux/bin/swig/share/swig/4.1.0/go/std_except.i deleted file mode 100755 index 4f021a12..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/std_except.i +++ /dev/null @@ -1,31 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. - * These typemaps are used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws) std::bad_cast %{_swig_gopanic($1.what());%} -%typemap(throws) std::bad_exception %{_swig_gopanic($1.what());%} -%typemap(throws) std::domain_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::exception %{_swig_gopanic($1.what());%} -%typemap(throws) std::invalid_argument %{_swig_gopanic($1.what());%} -%typemap(throws) std::length_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::logic_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::out_of_range %{_swig_gopanic($1.what());%} -%typemap(throws) std::overflow_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::range_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::runtime_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::underflow_error %{_swig_gopanic($1.what());%} diff --git a/linux/bin/swig/share/swig/4.1.0/go/std_list.i b/linux/bin/swig/share/swig/4.1.0/go/std_list.i deleted file mode 100755 index ff6f7001..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/std_list.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std { - - template - class list { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - list(); - list(const list& other); - - size_type size() const; - bool empty() const; - %rename(isEmpty) empty; - void clear(); - void push_front(const value_type& x); - void pop_front(); - void push_back(const value_type& x); - void pop_back(); - void remove(value_type x); - void reverse(); - void unique(); - void sort(); - void merge(list& x); - }; - -} diff --git a/linux/bin/swig/share/swig/4.1.0/go/std_map.i b/linux/bin/swig/share/swig/4.1.0/go/std_map.i deleted file mode 100755 index 773b6d0c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/std_map.i +++ /dev/null @@ -1,66 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; -} diff --git a/linux/bin/swig/share/swig/4.1.0/go/std_pair.i b/linux/bin/swig/share/swig/4.1.0/go/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/go/std_string.i b/linux/bin/swig/share/swig/4.1.0/go/std_string.i deleted file mode 100755 index 35b4a5e4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/std_string.i +++ /dev/null @@ -1,162 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a Go string and are passed around by value. - * - * To use non-const std::string references use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -%typemap(gotype) string, const string & "string" - -%typemap(in) string -%{ $1.assign($input.p, $input.n); %} - -%typemap(godirectorout) string -%{ - { - p := Swig_malloc(len($input)) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len($input)] - copy(s, $input) - $result = *(*string)(unsafe.Pointer(&s)) - } -%} - -%typemap(directorout) string -%{ - $result.assign($input.p, $input.n); - free($input.p); -%} - -%typemap(out,fragment="AllocateString") string -%{ $result = Swig_AllocateString($1.data(), $1.length()); %} - -%typemap(goout,fragment="CopyString") string -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") string -%{ $input = Swig_AllocateString($1.data(), $1.length()); %} - -%typemap(godirectorin,fragment="CopyString") string -%{ $result = swigCopyString($input) %} - -%typemap(throws) string -%{ _swig_gopanic($1.c_str()); %} - -%typemap(in) const string & -%{ - $*1_ltype $1_str($input.p, $input.n); - $1 = &$1_str; -%} - -%typemap(godirectorout) const string & -%{ - { - p := Swig_malloc(len($input)) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len($input)] - copy(s, $input) - $result = *(*string)(unsafe.Pointer(&s)) - } -%} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ - static $*1_ltype $1_str; - $1_str.assign($input.p, $input.n); - free($input.p); - $result = &$1_str; -%} - -%typemap(out,fragment="AllocateString") const string & -%{ $result = Swig_AllocateString((*$1).data(), (*$1).length()); %} - -%typemap(goout,fragment="CopyString") const string & -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") const string & -%{ $input = Swig_AllocateString($1.data(), $1.length()); %} - -%typemap(godirectorin,fragment="CopyString") const string & -%{ $result = swigCopyString($input) %} - -%typemap(throws) const string & -%{ _swig_gopanic($1.c_str()); %} - - -%typemap(gotype) string * "*string" - -%typemap(in) string * (string temp) -%{ - if ($input) { - temp.assign($input->p, $input->n); - $1 = &temp; - } else - $1 = 0; -%} - -%typemap(godirectorout) string * -%{ - if $input != nil { - p := Swig_malloc(len(*$input)) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len(*$input)] - copy(s, *$input) - $result = (*string)(unsafe.Pointer(&s)) - } else { - $result = nil - } -%} - -%typemap(directorout) string * (string temp) -%{ - temp.assign($input->p, $input->n); - $result = &temp; - free($input.p); -%} - -%typemap(out,fragment="AllocateString") string * (_gostring_ temp) -%{ - temp = Swig_AllocateString($1->data(), $1->length()); - $result = &temp; -%} - -%typemap(goout,fragment="CopyString") string * -%{ *$result = swigCopyString(*$1) %} - -%typemap(directorin,fragment="AllocateString") string * (_gostring_ temp) -%{ - if ($1) { - temp = Swig_AllocateString($1->data(), $1->length()); - $input = &temp; - } else - $input = 0; -%} - -%typemap(godirectorin,fragment="CopyString") string * -%{ *$result = swigCopyString(*$input); %} - -%typemap(argout,fragment="AllocateString") string * -%{ - if ($1) - *$input = Swig_AllocateString($1->data(), $1->length()); -%} - -%typemap(goargout,fragment="CopyString") string * -%{ - if $input != nil { - *$1 = swigCopyString(*$input) - } -%} - -} diff --git a/linux/bin/swig/share/swig/4.1.0/go/std_vector.i b/linux/bin/swig/share/swig/4.1.0/go/std_vector.i deleted file mode 100755 index 679c7075..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/std_vector.i +++ /dev/null @@ -1,92 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/go/swigmove.i b/linux/bin/swig/share/swig/4.1.0/go/swigmove.i deleted file mode 100755 index e1984b6e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/swigmove.i +++ /dev/null @@ -1,15 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in) SWIGTYPE MOVE ($&1_type argp) -%{ - argp = ($&1_ltype)$input; - if (argp == NULL) { - _swig_gopanic("Attempt to dereference null $1_type"); - } - SwigValueWrapper< $1_ltype >::reset($1, argp); -%} diff --git a/linux/bin/swig/share/swig/4.1.0/go/typemaps.i b/linux/bin/swig/share/swig/4.1.0/go/typemaps.i deleted file mode 100755 index d2e60d37..00000000 --- a/linux/bin/swig/share/swig/4.1.0/go/typemaps.i +++ /dev/null @@ -1,298 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps remap a C pointer or C++ reference to be an "INPUT" value which is -passed by value instead of reference. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In Go you could then use it like this: - answer := modulename.Fadd(10.0, 20.0) - -There are no char *INPUT typemaps, however you can apply the signed -char * typemaps instead: - %include - %apply signed char *INPUT {char *input}; - void f(char *input); -*/ - -%define INPUT_TYPEMAP(TYPE, GOTYPE) -%typemap(gotype) TYPE *INPUT, TYPE &INPUT "GOTYPE" - - %typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(out) TYPE *INPUT, TYPE &INPUT "" - -%typemap(goout) TYPE *INPUT, TYPE &INPUT "" - -%typemap(freearg) TYPE *INPUT, TYPE &INPUT "" - -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" - -// %typemap(typecheck) TYPE *INPUT = TYPE; -// %typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, bool); -INPUT_TYPEMAP(signed char, int8); -INPUT_TYPEMAP(char, byte); -INPUT_TYPEMAP(unsigned char, byte); -INPUT_TYPEMAP(short, int16); -INPUT_TYPEMAP(unsigned short, uint16); -INPUT_TYPEMAP(int, int); -INPUT_TYPEMAP(unsigned int, uint); -INPUT_TYPEMAP(long, int64); -INPUT_TYPEMAP(unsigned long, uint64); -INPUT_TYPEMAP(long long, int64); -INPUT_TYPEMAP(unsigned long long, uint64); -INPUT_TYPEMAP(float, float32); -INPUT_TYPEMAP(double, float64); - -#undef INPUT_TYPEMAP - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. An array replaces the c pointer or reference parameter. -// The output value is returned in this array passed in. - -/* -OUTPUT typemaps ---------------- - -The following typemaps can be applied to turn a pointer or reference -into an "output" value. When calling a function, no input value would -be given for a parameter, but an output value would be returned. This -works by a Go slice being passed as a parameter where a c pointer or -reference is required. As with any Go function, the array is passed -by reference so that any modifications to the array will be picked up -in the calling function. Note that the array passed in MUST have at -least one element, but as the c function does not require any input, -the value can be set to anything. - - bool *OUTPUT, bool &OUTPUT - signed char *OUTPUT, signed char &OUTPUT - unsigned char *OUTPUT, unsigned char &OUTPUT - short *OUTPUT, short &OUTPUT - unsigned short *OUTPUT, unsigned short &OUTPUT - int *OUTPUT, int &OUTPUT - unsigned int *OUTPUT, unsigned int &OUTPUT - long *OUTPUT, long &OUTPUT - unsigned long *OUTPUT, unsigned long &OUTPUT - long long *OUTPUT, long long &OUTPUT - unsigned long long *OUTPUT, unsigned long long &OUTPUT - float *OUTPUT, float &OUTPUT - double *OUTPUT, double &OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters): - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Go output of the function would be the function return value and the -value in the single element array. In Go you would use it like this: - - ptr := []float64{0.0} - fraction := modulename.Modf(5.0,ptr) - -There are no char *OUTPUT typemaps, however you can apply the signed -char * typemaps instead: - %include - %apply signed char *OUTPUT {char *output}; - void f(char *output); -*/ - -%define OUTPUT_TYPEMAP(TYPE, GOTYPE) -%typemap(gotype) TYPE *OUTPUT, TYPE &OUTPUT %{[]GOTYPE%} - -%typemap(in) TYPE *OUTPUT($*1_ltype temp), TYPE &OUTPUT($*1_ltype temp) -{ - if ($input.len == 0) { - _swig_gopanic("array must contain at least 1 element"); - } - $1 = &temp; -} - -%typemap(out) TYPE *OUTPUT, TYPE &OUTPUT "" - -%typemap(goout) TYPE *INPUT, TYPE &INPUT "" - -%typemap(freearg) TYPE *OUTPUT, TYPE &OUTPUT "" - -%typemap(argout) TYPE *OUTPUT, TYPE &OUTPUT -{ - TYPE* a = (TYPE *) $input.array; - a[0] = temp$argnum; -} - -%enddef - -OUTPUT_TYPEMAP(bool, bool); -OUTPUT_TYPEMAP(signed char, int8); -OUTPUT_TYPEMAP(char, byte); -OUTPUT_TYPEMAP(unsigned char, byte); -OUTPUT_TYPEMAP(short, int16); -OUTPUT_TYPEMAP(unsigned short, uint16); -OUTPUT_TYPEMAP(int, int); -OUTPUT_TYPEMAP(unsigned int, uint); -OUTPUT_TYPEMAP(long, int64); -OUTPUT_TYPEMAP(unsigned long, uint64); -OUTPUT_TYPEMAP(long long, int64); -OUTPUT_TYPEMAP(unsigned long long, uint64); -OUTPUT_TYPEMAP(float, float32); -OUTPUT_TYPEMAP(double, float64); - -#undef OUTPUT_TYPEMAP - -/* -INOUT typemaps --------------- - -Mappings for a parameter that is both an input and an output parameter - -The following typemaps can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" typemaps described earlier. Output values are -returned as an element in a Go slice. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -This works similarly to C in that the mapping directly modifies the -input value - the input must be an array with a minimum of one element. -The element in the array is the input and the output is the element in -the array. - - x := []float64{5.0} - Neg(x); - -The implementation of the OUTPUT and INOUT typemaps is different to -other languages in that other languages will return the output value -as part of the function return value. This difference is due to Go -being a typed language. - -There are no char *INOUT typemaps, however you can apply the signed -char * typemaps instead: - %include - %apply signed char *INOUT {char *inout}; - void f(char *inout); -*/ - -%define INOUT_TYPEMAP(TYPE, GOTYPE) -%typemap(gotype) TYPE *INOUT, TYPE &INOUT %{[]GOTYPE%} - -%typemap(in) TYPE *INOUT, TYPE &INOUT { - if ($input.len == 0) { - _swig_gopanic("array must contain at least 1 element"); - } - $1 = ($1_ltype) $input.array; -} - -%typemap(out) TYPE *INOUT, TYPE &INOUT "" - -%typemap(goout) TYPE *INOUT, TYPE &INOUT "" - -%typemap(freearg) TYPE *INOUT, TYPE &INOUT "" - -%typemap(argout) TYPE *INOUT, TYPE &INOUT "" - -%enddef - -INOUT_TYPEMAP(bool, bool); -INOUT_TYPEMAP(signed char, int8); -INOUT_TYPEMAP(char, byte); -INOUT_TYPEMAP(unsigned char, byte); -INOUT_TYPEMAP(short, int16); -INOUT_TYPEMAP(unsigned short, uint16); -INOUT_TYPEMAP(int, int); -INOUT_TYPEMAP(unsigned int, uint); -INOUT_TYPEMAP(long, int64); -INOUT_TYPEMAP(unsigned long, uint64); -INOUT_TYPEMAP(long long, int64); -INOUT_TYPEMAP(unsigned long long, uint64); -INOUT_TYPEMAP(float, float32); -INOUT_TYPEMAP(double, float64); - -#undef INOUT_TYPEMAP diff --git a/linux/bin/swig/share/swig/4.1.0/guile/Makefile b/linux/bin/swig/share/swig/4.1.0/guile/Makefile deleted file mode 100755 index fba7fd5d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/Makefile +++ /dev/null @@ -1,3 +0,0 @@ - -co: - co RCS/*.i* RCS/*.swg* diff --git a/linux/bin/swig/share/swig/4.1.0/guile/common.scm b/linux/bin/swig/share/swig/4.1.0/guile/common.scm deleted file mode 100755 index 17c9ab58..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/common.scm +++ /dev/null @@ -1,70 +0,0 @@ -;;;************************************************************************ -;;;*common.scm -;;;* -;;;* This file contains generic SWIG GOOPS classes for generated -;;;* GOOPS file support -;;;************************************************************************ - -(define-module (Swig swigrun)) - -(define-module (Swig common) - #:use-module (oop goops) - #:use-module (Swig swigrun)) - -(define-class () - (new-function #:init-value #f)) - -(define-method (initialize (class ) initargs) - (slot-set! class 'new-function (get-keyword #:new-function initargs #f)) - (next-method)) - -(define-class () - (swig-smob #:init-value #f) - #:metaclass -) - -(define-method (initialize (obj ) initargs) - (next-method) - (slot-set! obj 'swig-smob - (let ((arg (get-keyword #:init-smob initargs #f))) - (if arg - arg - (let ((ret (apply (slot-ref (class-of obj) 'new-function) (get-keyword #:args initargs '())))) - ;; if the class is registered with runtime environment, - ;; new-Function will return a goops class. In that case, extract the smob - ;; from that goops class and set it as the current smob. - (if (slot-exists? ret 'swig-smob) - (slot-ref ret 'swig-smob) - ret)))))) - -(define (display-address o file) - (display (number->string (object-address o) 16) file)) - -(define (display-pointer-address o file) - ;; Don't fail if the function SWIG-PointerAddress is not present. - (let ((address (false-if-exception (SWIG-PointerAddress o)))) - (if address - (begin - (display " @ " file) - (display (number->string address 16) file))))) - -(define-method (write (o ) file) - ;; We display _two_ addresses to show the object's identity: - ;; * first the address of the GOOPS proxy object, - ;; * second the pointer address. - ;; The reason is that proxy objects are created and discarded on the - ;; fly, so different proxy objects for the same C object will appear. - (let ((class (class-of o))) - (if (slot-bound? class 'name) - (begin - (display "#<" file) - (display (class-name class) file) - (display #\space file) - (display-address o file) - (display-pointer-address o file) - (display ">" file)) - (next-method)))) - -(export ) - -;;; common.scm ends here diff --git a/linux/bin/swig/share/swig/4.1.0/guile/cplusplus.i b/linux/bin/swig/share/swig/4.1.0/guile/cplusplus.i deleted file mode 100755 index d5d65efa..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/cplusplus.i +++ /dev/null @@ -1,22 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cplusplus.i - * - * SWIG typemaps for C++ - * ----------------------------------------------------------------------------- */ - -%typemap(guile,out) string, std::string { - $result = SWIG_str02scm(const_cast($1.c_str())); -} -%typemap(guile,in) string, std::string { - $1 = SWIG_scm2str($input); -} - -%typemap(guile,out) complex, complex, std::complex { - $result = scm_make_rectangular( scm_from_double ($1.real ()), - scm_from_double ($1.imag ()) ); -} -%typemap(guile,in) complex, complex, std::complex { - $1 = std::complex( scm_to_double (scm_real_part ($input)), - scm_to_double (scm_imag_part ($input)) ); -} - diff --git a/linux/bin/swig/share/swig/4.1.0/guile/extra-install.list b/linux/bin/swig/share/swig/4.1.0/guile/extra-install.list deleted file mode 100755 index 05d2c0c4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/extra-install.list +++ /dev/null @@ -1,2 +0,0 @@ -# see top-level Makefile.in -common.scm diff --git a/linux/bin/swig/share/swig/4.1.0/guile/guile.i b/linux/bin/swig/share/swig/4.1.0/guile/guile.i deleted file mode 100755 index ef270d74..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/guile.i +++ /dev/null @@ -1,33 +0,0 @@ -/* ----------------------------------------------------------------------------- - * guile.i - * - * SWIG Configuration File for Guile. - * ----------------------------------------------------------------------------- */ - -/* Macro for inserting Scheme code into the stub */ -#define %scheme %insert("scheme") -#define %goops %insert("goops") - -/* Return-styles */ -%pragma(guile) return_nothing_doc = "Returns unspecified." -%pragma(guile) return_one_doc = "Returns $values." - -%define %values_as_list - %pragma(guile) beforereturn = "" - %pragma(guile) return_multi_doc = "Returns a list of $num_values values: $values." -%enddef -%values_as_list /* the default style */ - -%define %values_as_vector - %pragma(guile) beforereturn = "GUILE_MAYBE_VECTOR" - %pragma(guile) return_multi_doc = "Returns a vector of $num_values values: $values." -%enddef - -%define %multiple_values - %pragma(guile) beforereturn = "GUILE_MAYBE_VALUES" - %pragma(guile) return_multi_doc = "Returns $num_values values: $values." -%enddef - -#define GUILE_APPEND_RESULT SWIG_APPEND_VALUE - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/guile/guile_scm.swg b/linux/bin/swig/share/swig/4.1.0/guile/guile_scm.swg deleted file mode 100755 index 16dc8aa9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/guile_scm.swg +++ /dev/null @@ -1,46 +0,0 @@ -/* ----------------------------------------------------------------------------- - * guile_scm.swg - * - * This SWIG interface file is processed if the Guile module is run - * with SCM_ flavor. - * ----------------------------------------------------------------------------- */ - -#define SWIGGUILE_SCM - -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors - -%runtime "guile_scm_run.swg" -%include - -%runtime %{ - -#define GUILE_MAYBE_VALUES \ - if (gswig_list_p) gswig_result = scm_values(gswig_result); - -#define GUILE_MAYBE_VECTOR \ - if (gswig_list_p) gswig_result = scm_vector(gswig_result); - -#define SWIG_APPEND_VALUE(object) \ - if (gswig_result == SCM_UNSPECIFIED) \ - gswig_result = object; \ - else { \ - if (!gswig_list_p) { \ - gswig_list_p = 1; \ - gswig_result = scm_list_n(gswig_result, object, SCM_UNDEFINED); \ - } \ - else \ - gswig_result = scm_append(scm_list_n(gswig_result, scm_list_n(object, SCM_UNDEFINED), SCM_UNDEFINED)); \ - } - -%} - -%insert(init) "swiginit.swg" - -%init %{ -SWIG_GUILE_INIT_STATIC void -SWIG_init(void) -{ - SWIG_InitializeModule(0); - SWIG_PropagateClientData(); -%} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/guile_scm_run.swg b/linux/bin/swig/share/swig/4.1.0/guile/guile_scm_run.swg deleted file mode 100755 index 689a1060..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/guile_scm_run.swg +++ /dev/null @@ -1,532 +0,0 @@ -/* ----------------------------------------------------------------------------- - * guile_scm_run.swg - * ----------------------------------------------------------------------------- */ - -#if __GNUC__ >= 10 -#if defined(__cplusplus) -#pragma GCC diagnostic ignored "-Wvolatile" /* For 'volatile SCM *' in at least Guile 3.0 and earlier */ -#endif -#endif - -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/* In the code below, use guile 2.0 compatible functions where possible. - Functions that don't exist in older versions will be mapped to - a deprecated equivalent for those versions only */ -#if defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION < 2) - -static SCM -scm_module_variable (SCM module, SCM sym) -{ - return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F); -} - -#define scm_to_utf8_string scm_to_locale_string -#define scm_from_utf8_string scm_from_locale_string -#endif - -#if SCM_MAJOR_VERSION >= 2 -/* scm_c_define_gsubr takes a different parameter type depending on the guile version */ - -typedef scm_t_subr swig_guile_proc; -#else -typedef SCM (*swig_guile_proc)(); -#endif -typedef SCM (*guile_destructor)(SCM); - -typedef struct swig_guile_clientdata { - guile_destructor destroy; - SCM goops_class; -} swig_guile_clientdata; - -#define SWIG_scm2str(s) \ - SWIG_Guile_scm2newstr(s, NULL) -#define SWIG_str02scm(str) \ - str ? scm_from_utf8_string(str) : SCM_BOOL_F -# define SWIG_malloc(size) \ - scm_malloc(size) -# define SWIG_free(mem) \ - free(mem) -#define SWIG_ConvertPtr(s, result, type, flags) \ - SWIG_Guile_ConvertPtr(s, result, type, flags) -#define SWIG_MustGetPtr(s, type, argnum, flags) \ - SWIG_Guile_MustGetPtr(s, type, argnum, flags, FUNC_NAME) -#define SWIG_NewPointerObj(ptr, type, owner) \ - SWIG_Guile_NewPointerObj((void*)ptr, type, owner) -#define SWIG_PointerAddress(object) \ - SWIG_Guile_PointerAddress(object) -#define SWIG_PointerType(object) \ - SWIG_Guile_PointerType(object) -#define SWIG_IsPointerOfType(object, type) \ - SWIG_Guile_IsPointerOfType(object, type) -#define SWIG_IsPointer(object) \ - SWIG_Guile_IsPointer(object) -#define SWIG_contract_assert(expr, msg) \ - do { \ - if (!(expr)) \ - scm_error(scm_from_locale_symbol("swig-contract-assertion-failed"), \ - (char *) FUNC_NAME, (char *) msg, \ - SCM_EOL, SCM_BOOL_F); \ - } while (0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) \ - SWIG_Guile_ConvertMember(obj, ptr, sz, ty, FUNC_NAME) -#define SWIG_NewMemberObj(ptr, sz, type) \ - SWIG_Guile_NewMemberObj(ptr, sz, type, FUNC_NAME) - -/* Runtime API */ -static swig_module_info *SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata)); -#define SWIG_GetModule(clientdata) SWIG_Guile_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer) - -SWIGINTERN char * -SWIG_Guile_scm2newstr(SCM str, size_t *len) { -#define FUNC_NAME "SWIG_Guile_scm2newstr" - char *ret; - - SCM_ASSERT (scm_is_string(str), str, 1, FUNC_NAME); - - ret = scm_to_utf8_string(str); - if (!ret) return NULL; - - if (len) *len = strlen(ret) - 1; - return ret; -#undef FUNC_NAME -} - -static int swig_initialized = 0; -static scm_t_bits swig_tag = 0; -static scm_t_bits swig_collectable_tag = 0; -static scm_t_bits swig_finalized_tag = 0; -static scm_t_bits swig_destroyed_tag = 0; -static scm_t_bits swig_member_function_tag = 0; -static SCM swig_make_func = SCM_EOL; -static SCM swig_keyword = SCM_EOL; -static SCM swig_symbol = SCM_EOL; - -#define SWIG_Guile_GetSmob(x) \ - ( !scm_is_null(x) && SCM_INSTANCEP(x) && scm_is_true(scm_slot_exists_p(x, swig_symbol)) \ - ? scm_slot_ref(x, swig_symbol) : (x) ) - -SWIGINTERN void SWIG_Guile_MarkPointerNoncollectable(SCM s); - -SWIGINTERN SCM -SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner) -{ - if (ptr == NULL) - return SCM_EOL; - else { - SCM smob; - swig_guile_clientdata *cdata = (swig_guile_clientdata *) type->clientdata; - if (owner) - SCM_NEWSMOB2(smob, swig_collectable_tag, ptr, (void *) type); - else - SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); - - if (!cdata || scm_is_null(cdata->goops_class) || swig_make_func == SCM_EOL ) { - return smob; - } else { - /* the scm_make() C function only handles the creation of gf, - methods and classes (no instances) the (make ...) function is - later redefined in goops.scm. So we need to call that - Scheme function. */ - return scm_apply(swig_make_func, - scm_list_3(cdata->goops_class, - swig_keyword, - smob), - SCM_EOL); - } - } -} - -SWIGINTERN unsigned long -SWIG_Guile_PointerAddress(SCM object) -{ - SCM smob = SWIG_Guile_GetSmob(object); - if (scm_is_null(smob)) return 0; - else if (SCM_SMOB_PREDICATE(swig_tag, smob) - || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) - || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { - return (unsigned long) (void *) SCM_CELL_WORD_1(smob); - } - else scm_wrong_type_arg("SWIG-Guile-PointerAddress", 1, object); -} - -SWIGINTERN swig_type_info * -SWIG_Guile_PointerType(SCM object) -{ - SCM smob = SWIG_Guile_GetSmob(object); - if (scm_is_null(smob)) return NULL; - else if (SCM_SMOB_PREDICATE(swig_tag, smob) - || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) - || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { - return (swig_type_info *) SCM_CELL_WORD_2(smob); - } - else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object); -} - -SWIGINTERN int -SWIG_Guile_IsValidSmob(SCM smob) -{ - /* We do not accept smobs representing destroyed pointers, but we have to - allow finalized smobs because Guile >= 2.0.12 sets all smob instances - to the 'finalized' type before calling their 'free' function. This change - was introduced to Guile in commit 8dff3af087c6eaa83ae0d72aa8b22aef5c65d65d */ - return SCM_SMOB_PREDICATE(swig_tag, smob) - || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) - || SCM_SMOB_PREDICATE(swig_finalized_tag, smob); -} - -SWIGINTERN int -SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags) -{ - swig_cast_info *cast; - swig_type_info *from; - SCM smob = SWIG_Guile_GetSmob(s); - int ret = SWIG_ERROR; - - if (scm_is_null(smob)) { - *result = NULL; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; -#if SCM_MAJOR_VERSION >= 2 - } else if (SCM_POINTER_P(s)) { - *result = SCM_POINTER_VALUE(s); - return SWIG_OK; -#endif /* if SCM_MAJOR_VERSION >= 2 */ - } else if (SWIG_Guile_IsValidSmob(smob)) { - from = (swig_type_info *) SCM_CELL_WORD_2(smob); - if (!from) return SWIG_ERROR; - - if ((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) { - if ((SCM_CELL_TYPE(smob) == swig_collectable_tag && SCM_CELL_WORD_1(smob) == 0) || SCM_CELL_TYPE(smob) == swig_tag) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - } - - if (type) { - cast = SWIG_TypeCheckStruct(from, type); - if (cast) { - int newmemory = 0; - *result = SWIG_TypeCast(cast, (void *) SCM_CELL_WORD_1(smob), &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - ret = SWIG_OK; - } else { - return SWIG_ERROR; - } - } else { - *result = (void *) SCM_CELL_WORD_1(smob); - ret = SWIG_OK; - } - - if (flags & SWIG_POINTER_DISOWN) { - SWIG_Guile_MarkPointerNoncollectable(smob); - } - if (flags & SWIG_POINTER_CLEAR) { - SCM_SET_CELL_WORD_1(smob, 0); - } - } - return ret; -} - -SWIGINTERNINLINE void * -SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type, - int argnum, int flags, const char *func_name) -{ - void *result; - int res = SWIG_Guile_ConvertPtr(s, &result, type, flags); - if (!SWIG_IsOK(res)) { - /* type mismatch */ - scm_wrong_type_arg((char *) func_name, argnum, s); - } - return result; -} - -SWIGINTERNINLINE int -SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type) -{ - void *result; - if (SWIG_Guile_ConvertPtr(s, &result, type, 0)) { - /* type mismatch */ - return 0; - } - else return 1; -} - -SWIGINTERNINLINE int -SWIG_Guile_IsPointer (SCM s) -{ - /* module might not be initialized yet, so initialize it */ - SWIG_GetModule(0); - return SWIG_Guile_IsPointerOfType (s, NULL); -} - -/* Mark a pointer object non-collectable */ -SWIGINTERN void -SWIG_Guile_MarkPointerNoncollectable(SCM s) -{ - SCM smob = SWIG_Guile_GetSmob(s); - if (!scm_is_null(smob)) { - if (SWIG_Guile_IsValidSmob(smob)) { - SCM_SET_CELL_TYPE(smob, swig_tag); - } - else scm_wrong_type_arg(NULL, 0, s); - } -} - -/* Mark a pointer object destroyed */ -SWIGINTERN void -SWIG_Guile_MarkPointerDestroyed(SCM s) -{ - SCM smob = SWIG_Guile_GetSmob(s); - if (!scm_is_null(smob)) { - if (SWIG_Guile_IsValidSmob(smob)) { - SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); - } - else scm_wrong_type_arg(NULL, 0, s); - } -} - -/* Member functions */ - -SWIGINTERN SCM -SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type, - const char *func_name) -{ - SCM smob; - void *copy = malloc(sz); - memcpy(copy, ptr, sz); - SCM_NEWSMOB2(smob, swig_member_function_tag, copy, (void *) type); - return smob; -} - -SWIGINTERN int -SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type, - const char *func_name) -{ - swig_cast_info *cast; - swig_type_info *from; - - if (SCM_SMOB_PREDICATE(swig_member_function_tag, smob)) { - from = (swig_type_info *) SCM_CELL_WORD_2(smob); - if (!from) return SWIG_ERROR; - if (type) { - cast = SWIG_TypeCheckStruct(from, type); - if (!cast) return SWIG_ERROR; - } - memcpy(ptr, (void *) SCM_CELL_WORD_1(smob), sz); - return SWIG_OK; - } - return SWIG_ERROR; -} - - -/* Init */ - -SWIGINTERN int -print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate, - const char *attribute) -{ - swig_type_info *type; - - type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); - if (type) { - scm_puts((char *) "#<", port); - scm_puts((char *) attribute, port); - scm_puts((char *) "swig-pointer ", port); - scm_puts((char *) SWIG_TypePrettyName(type), port); - scm_puts((char *) " ", port); - scm_intprint((long) SCM_CELL_WORD_1(swig_smob), 16, port); - scm_puts((char *) ">", port); - /* non-zero means success */ - return 1; - } else { - return 0; - } -} - - -SWIGINTERN int -print_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - return print_swig_aux(swig_smob, port, pstate, ""); -} - -SWIGINTERN int -print_collectable_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - return print_swig_aux(swig_smob, port, pstate, "collectable-"); -} - -SWIGINTERN int -print_destroyed_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - return print_swig_aux(swig_smob, port, pstate, "destroyed-"); -} - -SWIGINTERN int -print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - swig_type_info *type; - type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); - if (type) { - scm_puts((char *) "#<", port); - scm_puts((char *) "swig-member-function-pointer ", port); - scm_puts((char *) SWIG_TypePrettyName(type), port); - scm_puts((char *) " >", port); - /* non-zero means success */ - return 1; - } else { - return 0; - } -} - -SWIGINTERN SCM -equalp_swig (SCM A, SCM B) -{ - if (SCM_CELL_WORD_0(A) == SCM_CELL_WORD_0(B) && SCM_CELL_WORD_1(A) == SCM_CELL_WORD_1(B) - && SCM_CELL_WORD_2(A) == SCM_CELL_WORD_2(B)) - return SCM_BOOL_T; - else return SCM_BOOL_F; -} - -SWIGINTERN size_t -free_swig(SCM A) -{ - swig_type_info *type = (swig_type_info *) SCM_CELL_WORD_2(A); - if (type) { - if (type->clientdata && ((swig_guile_clientdata *)type->clientdata)->destroy) - ((swig_guile_clientdata *)type->clientdata)->destroy(A); - } - return 0; -} - -SWIGINTERN size_t -free_swig_member_function(SCM A) -{ - free((swig_type_info *) SCM_CELL_WORD_1(A)); - return 0; -} - -SWIGINTERN int -ensure_smob_tag(SCM swig_module, - scm_t_bits *tag_variable, - const char *smob_name, - const char *scheme_variable_name) -{ - SCM variable = scm_module_variable(swig_module, - scm_from_locale_symbol(scheme_variable_name)); - if (scm_is_false(variable)) { - *tag_variable = scm_make_smob_type((char*)scheme_variable_name, 0); - scm_c_module_define(swig_module, scheme_variable_name, - scm_from_ulong(*tag_variable)); - return 1; - } - else { - *tag_variable = scm_to_ulong(SCM_VARIABLE_REF(variable)); - return 0; - } -} - -SWIGINTERN SCM -SWIG_Guile_Init () -{ - static SCM swig_module; - - if (swig_initialized) return swig_module; - swig_initialized = 1; - - swig_module = scm_c_resolve_module("Swig swigrun"); - if (ensure_smob_tag(swig_module, &swig_tag, - "swig-pointer", "swig-pointer-tag")) { - scm_set_smob_print(swig_tag, print_swig); - scm_set_smob_equalp(swig_tag, equalp_swig); - } - if (ensure_smob_tag(swig_module, &swig_collectable_tag, - "collectable-swig-pointer", "collectable-swig-pointer-tag")) { - scm_set_smob_print(swig_collectable_tag, print_collectable_swig); - scm_set_smob_equalp(swig_collectable_tag, equalp_swig); - scm_set_smob_free(swig_collectable_tag, free_swig); - /* For Guile >= 2.0.12. See libguile/smob.c:clear_smobnum */ - swig_finalized_tag = swig_collectable_tag & ~0xff00; - } - if (ensure_smob_tag(swig_module, &swig_destroyed_tag, - "destroyed-swig-pointer", "destroyed-swig-pointer-tag")) { - scm_set_smob_print(swig_destroyed_tag, print_destroyed_swig); - scm_set_smob_equalp(swig_destroyed_tag, equalp_swig); - } - if (ensure_smob_tag(swig_module, &swig_member_function_tag, - "swig-member-function-pointer", "swig-member-function-pointer-tag")) { - scm_set_smob_print(swig_member_function_tag, print_member_function_swig); - scm_set_smob_free(swig_member_function_tag, free_swig_member_function); - } - swig_make_func = scm_permanent_object( - scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make"))); - swig_keyword = scm_permanent_object(scm_from_locale_keyword((char*) "init-smob")); - swig_symbol = scm_permanent_object(scm_from_locale_symbol("swig-smob")); -#ifdef SWIG_INIT_RUNTIME_MODULE - SWIG_INIT_RUNTIME_MODULE -#endif - - return swig_module; -} - -SWIGINTERN swig_module_info * -SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata)) -{ - SCM module = SWIG_Guile_Init(); - SCM variable = scm_module_variable(module, scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME)); - if (scm_is_false(variable)) { - return NULL; - } else { - return (swig_module_info *) scm_to_ulong(SCM_VARIABLE_REF(variable)); - } -} - -SWIGINTERN void -SWIG_Guile_SetModule(swig_module_info *swig_module) -{ - SCM module = SWIG_Guile_Init(); - scm_module_define(module, - scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME), - scm_from_ulong((unsigned long) swig_module)); -} - -SWIGINTERN int -SWIG_Guile_GetArgs (SCM *dest, SCM rest, - int reqargs, int optargs, - const char *procname) -{ - int i; - int num_args_passed = 0; - for (i = 0; i - -#ifdef __cplusplus -extern "C" { -#endif - -static void -inner_main(void *closure, int argc, char **argv) -{ -#ifdef SWIGINIT - SWIGINIT -#else - SWIG_init(); /* SWIG init function */ -#endif - scm_shell(argc, argv); /* scheme interpreter */ - /* never reached: scm_shell will perform an exit */ -} - -#ifdef __cplusplus -} -#endif - -int -main(int argc, char **argv) -{ - /* put any default initialisation code here: e.g. exit handlers */ - scm_boot_guile(argc, argv, inner_main, 0); /* make a stack entry for the - garbage collector */ - return 0; /* never reached, but avoids a warning */ -} -%} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/interpreter.i b/linux/bin/swig/share/swig/4.1.0/guile/interpreter.i deleted file mode 100755 index 524e0694..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/interpreter.i +++ /dev/null @@ -1,59 +0,0 @@ -/* ----------------------------------------------------------------------------- - * interpreter.i - * - * SWIG file for a simple Guile interpreter - * ----------------------------------------------------------------------------- */ - -%{ - -#include -GSCM_status guile_init(); - -int main(int argc, char **argv) { - GSCM_status status; - GSCM_top_level toplev; - char *eval_answer; - char input_str[16384]; - int done; - - /* start a scheme interpreter */ - status = gscm_run_scm(argc, argv, 0, stdout, stderr, guile_init, 0, "#t"); - if (status != GSCM_OK) { - fputs(gscm_error_msg(status), stderr); - fputc('\n', stderr); - printf("Error in startup.\n"); - exit(1); - } - - /* create the top level environment */ - status = gscm_create_top_level(&toplev); - if (status != GSCM_OK) { - fputs(gscm_error_msg(status), stderr); - fputc('\n', stderr); - exit(1); - } - - /* now sit in a scheme eval loop: I input the expressions, have guile - * evaluate them, and then get another expression. - */ - done = 0; - fprintf(stdout,"Guile > "); - while (!done) { - if (fgets(input_str,16384,stdin) == NULL) { - exit(1); - } else { - if (strncmp(input_str,"quit",4) == 0) exit(1); - status = gscm_eval_str(&eval_answer, toplev, input_str); - fprintf(stdout,"%s\n", eval_answer); - fprintf(stdout,"Guile > "); - } - } - - /* now clean up and quit */ - gscm_destroy_top_level(toplev); -} - -%} - - - diff --git a/linux/bin/swig/share/swig/4.1.0/guile/list-vector.i b/linux/bin/swig/share/swig/4.1.0/guile/list-vector.i deleted file mode 100755 index 82405259..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/list-vector.i +++ /dev/null @@ -1,488 +0,0 @@ -/* ----------------------------------------------------------------------------- - * list_vector.i - * - * Guile typemaps for converting between arrays and Scheme lists or vectors - * ----------------------------------------------------------------------------- */ - -/* Here is a macro that will define typemaps for converting between C - arrays and Scheme lists or vectors when passing arguments to the C - function. - - TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - - Supported calling conventions: - - func(int VECTORLENINPUT, [const] C_TYPE *VECTORINPUT) - - Scheme wrapper will take one argument, a vector. A temporary C - array of elements of type C_TYPE will be allocated and filled - with the elements of the vectors, converted to C with the - SCM_TO_C function. Length and address of the array are passed - to the C function. - - SCM_TYPE is used to describe the Scheme type of the elements in - the Guile procedure documentation. - - func(int LISTLENINPUT, [const] C_TYPE *LISTINPUT) - - Likewise, but the Scheme wrapper will take one argument, a list. - - func(int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - - Scheme wrapper will take no arguments. Addresses of an integer - and a C_TYPE * variable will be passed to the C function. The - C function is expected to return address and length of a - freshly allocated array of elements of type C_TYPE through - these pointers. The elements of this array are converted to - Scheme with the C_TO_SCM function and returned as a Scheme - vector. - - If the function has a void return value, the vector constructed - by this typemap becomes the return value of the Scheme wrapper. - Otherwise, the function returns multiple values. (See - the documentation on how to deal with multiple values.) - - func(int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - - Likewise, but the Scheme wrapper will return a list instead of - a vector. - - It is also allowed to use "size_t LISTLENINPUT" rather than "int - LISTLENINPUT". */ - -%define TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - - /* input */ - - /* We make use of the new multi-dispatch typemaps here. */ - - %typemap(in, doc="$NAME is a vector of " #SCM_TYPE " values") - (int VECTORLENINPUT, C_TYPE *VECTORINPUT), - (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT) - { - SCM_VALIDATE_VECTOR($argnum, $input); - $1 = scm_c_vector_length($input); - if ($1 > 0) { - $1_ltype i; - $2 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * $1); - for (i = 0; i<$1; i++) { - SCM swig_scm_value = scm_vector_ref($input, scm_from_long(i)); - $2[i] = SCM_TO_C_EXPR; - } - } - else $2 = NULL; - } - - %typemap(in, doc="$NAME is a list of " #SCM_TYPE " values") - (int LISTLENINPUT, C_TYPE *LISTINPUT), - (size_t LISTLENINPUT, C_TYPE *LISTINPUT) - { - SCM_VALIDATE_LIST($argnum, $input); - $1 = scm_to_ulong(scm_length($input)); - if ($1 > 0) { - $1_ltype i; - SCM rest; - $2 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * $1); - for (i = 0, rest = $input; - i<$1; - i++, rest = SCM_CDR(rest)) { - SCM swig_scm_value = SCM_CAR(rest); - $2[i] = SCM_TO_C_EXPR; - } - } - else $2 = NULL; - } - - /* Do not check for NULL pointers (override checks). */ - - %typemap(check) (int VECTORLENINPUT, C_TYPE *VECTORINPUT), - (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT), - (int LISTLENINPUT, C_TYPE *LISTINPUT), - (size_t LISTLENINPUT, C_TYPE *LISTINPUT) - "/* no check for NULL pointer */"; - - /* Discard the temporary array after the call. */ - - %typemap(freearg) (int VECTORLENINPUT, C_TYPE *VECTORINPUT), - (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT), - (int LISTLENINPUT, C_TYPE *LISTINPUT), - (size_t LISTLENINPUT, C_TYPE *LISTINPUT) - {SWIG_free($2);} - -%enddef - - /* output */ - -%define TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) - - /* First we make temporary variables ARRAYLENTEMP and ARRAYTEMP, - whose addresses we pass to the C function. We ignore both - arguments for Scheme. */ - - %typemap(in,numinputs=0) (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - (int arraylentemp, C_TYPE *arraytemp), - (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - (int arraylentemp, C_TYPE *arraytemp), - (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - (size_t arraylentemp, C_TYPE *arraytemp), - (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - (size_t arraylentemp, C_TYPE *arraytemp) - %{ - $1 = &arraylentemp; - $2 = &arraytemp; - %} - - /* In the ARGOUT typemaps, we convert the array into a vector or - a list and append it to the results. */ - - %typemap(argout, doc="$NAME (a vector of " #SCM_TYPE " values)") - (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - { - $*1_ltype i; - SCM res = scm_make_vector(scm_from_long(*$1), - SCM_BOOL_F); - for (i = 0; i<*$1; i++) { - C_TYPE swig_c_value = (*$2)[i]; - SCM elt = C_TO_SCM_EXPR; - scm_vector_set_x(res, scm_from_long(i), elt); - } - SWIG_APPEND_VALUE(res); - } - - %typemap(argout, doc="$NAME (a list of " #SCM_TYPE " values)") - (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT), - (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - { - int i; - SCM res = SCM_EOL; - for (i = ((int)(*$1)) - 1; i>=0; i--) { - C_TYPE swig_c_value = (*$2)[i]; - SCM elt = C_TO_SCM_EXPR; - res = scm_cons(elt, res); - } - SWIG_APPEND_VALUE(res); - } - - /* In the FREEARG typemaps, get rid of the C vector. - (This can be overridden if you want to keep the C vector.) */ - - %typemap(freearg) - (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), - (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT), - (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - { - free(*$2); - } - -%enddef - -%define TYPEMAP_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_TYPE) - TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) -%enddef - -%define TYPEMAP_LIST_VECTOR_INPUT(C_TYPE, SCM_TO_C, SCM_TYPE) - TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), SCM_TYPE) -%enddef - -%define TYPEMAP_LIST_VECTOR_OUTPUT(C_TYPE, C_TO_SCM, SCM_TYPE) - TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR - (C_TYPE, C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -%define TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - TYPEMAP_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -/* We use the macro to define typemaps for some standard types. */ - -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(bool, scm_is_true, scm_from_bool, boolean); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(int, scm_to_int, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(short, scm_to_int, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(long, scm_to_long, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(ptrdiff_t, scm_to_long, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned int, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned short, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned long, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(size_t, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(float, scm_to_double, scm_from_double, real); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(double, scm_to_double, scm_from_double, real); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(char *, SWIG_scm2str, SWIG_str02scm, string); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(const char *, SWIG_scm2str, SWIG_str02scm, string); - -/* For the char *, free all strings after converting */ - - %typemap(freearg) - (int *VECTORLENOUTPUT, char ***VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, char ***VECTOROUTPUT), - (int *LISTLENOUTPUT, char ***LISTOUTPUT), - (size_t *LISTLENOUTPUT, char ***LISTOUTPUT), - (int *VECTORLENOUTPUT, const char ***VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, const char ***VECTOROUTPUT), - (int *LISTLENOUTPUT, const char ***LISTOUTPUT), - (size_t *LISTLENOUTPUT, const char ***LISTOUTPUT) - { - if ((*$2)!=NULL) { - int i; - for (i = 0; i < *$1; i++) { - free((*$2)[i]); - } - free(*$2); - } - } - -%typemap(freearg) (int VECTORLENINPUT, char **VECTORINPUT), - (size_t VECTORLENINPUT, char **VECTORINPUT), - (int LISTLENINPUT, char **LISTINPUT), - (size_t LISTLENINPUT, char **LISTINPUT), - (int VECTORLENINPUT, const char **VECTORINPUT), - (size_t VECTORLENINPUT, const char **VECTORINPUT), - (int LISTLENINPUT, const char **LISTINPUT), - (size_t LISTLENINPUT, const char **LISTINPUT) -{ - if (($2)!=NULL) { - int i; - for (i = 0; i< $1; i++) - free(($2)[i]); - free($2); - } -} - - -/* Following is a macro that emits typemaps that are much more - flexible. (They are also messier.) It supports multiple parallel - lists and vectors (sharing one length argument each). - - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - - Supported calling conventions: - - func(int PARALLEL_VECTORLENINPUT, [const] C_TYPE *PARALLEL_VECTORINPUT, ...) or - func([const] C_TYPE *PARALLEL_VECTORINPUT, ..., int PARALLEL_VECTORLENINPUT) - - func(int PARALLEL_LISTLENINPUT, [const] C_TYPE *PARALLEL_LISTINPUT, ...) or - func([const] C_TYPE *PARALLEL_LISTINPUT, ..., int PARALLEL_LISTLENINPUT) - - func(int *PARALLEL_VECTORLENOUTPUT, C_TYPE **PARALLEL_VECTOROUTPUT, ...) or - func(C_TYPE **PARALLEL_VECTOROUTPUT, int *PARALLEL_VECTORLENOUTPUT, ...) - - func(int *PARALLEL_LISTLENOUTPUT, C_TYPE **PARALLEL_LISTOUTPUT) or - func(C_TYPE **PARALLEL_LISTOUTPUT, int *PARALLEL_LISTLENOUTPUT) - - It is also allowed to use "size_t PARALLEL_LISTLENINPUT" rather than "int - PARALLEL_LISTLENINPUT". */ - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - - /* input */ - - /* Passing data is a little complicated here; just remember: - IGNORE typemaps come first, then IN, then CHECK. But if - IGNORE is given, IN won't be used for this type. - - We need to "ignore" one of the parameters because there shall - be only one argument on the Scheme side. Here we only - initialize the array length to 0 but save its address for a - later change. */ - - %typemap(in,numinputs=0) int PARALLEL_VECTORLENINPUT (int *_global_vector_length), - size_t PARALLEL_VECTORLENINPUT (size_t *_global_vector_length) - { - $1 = 0; - _global_vector_length = &$1; - } - - %typemap(in,numinputs=0) int PARALLEL_LISTLENINPUT (int *_global_list_length), - size_t PARALLEL_LISTLENINPUT (size_t *_global_list_length) - { - $1 = 0; - _global_list_length = &$1; - } - - /* All the work is done in IN. */ - - %typemap(in, doc="$NAME is a vector of " #SCM_TYPE " values") - C_TYPE *PARALLEL_VECTORINPUT, - const C_TYPE *PARALLEL_VECTORINPUT - { - SCM_VALIDATE_VECTOR($argnum, $input); - *_global_vector_length = scm_c_vector_length($input); - if (*_global_vector_length > 0) { - int i; - $1 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) - * (*_global_vector_length)); - for (i = 0; i<*_global_vector_length; i++) { - SCM swig_scm_value = scm_vector_ref($input, scm_from_long(i)); - $1[i] = SCM_TO_C_EXPR; - } - } - else $1 = NULL; - } - - %typemap(in, doc="$NAME is a list of " #SCM_TYPE " values") - C_TYPE *PARALLEL_LISTINPUT, - const C_TYPE *PARALLEL_LISTINPUT - { - SCM_VALIDATE_LIST($argnum, $input); - *_global_list_length = scm_to_ulong(scm_length($input)); - if (*_global_list_length > 0) { - int i; - SCM rest; - $1 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) - * (*_global_list_length)); - for (i = 0, rest = $input; - i<*_global_list_length; - i++, rest = SCM_CDR(rest)) { - SCM swig_scm_value = SCM_CAR(rest); - $1[i] = SCM_TO_C_EXPR; - } - } - else $1 = NULL; - } - - /* Don't check for NULL pointers (override checks). */ - - %typemap(check) C_TYPE *PARALLEL_VECTORINPUT, - const C_TYPE *PARALLEL_VECTORINPUT, - C_TYPE *PARALLEL_LISTINPUT, - const C_TYPE *PARALLEL_LISTINPUT - "/* no check for NULL pointer */"; - - /* Discard the temporary array after the call. */ - - %typemap(freearg) C_TYPE *PARALLEL_VECTORINPUT, - const C_TYPE *PARALLEL_VECTORINPUT, - C_TYPE *PARALLEL_LISTINPUT, - const C_TYPE *PARALLEL_LISTINPUT - {SWIG_free($1);} - -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) - - /* output */ - - /* First we make a temporary variable ARRAYLENTEMP, use its - address as the ...LENOUTPUT argument for the C function and - "ignore" the ...LENOUTPUT argument for Scheme. */ - - %typemap(in,numinputs=0) int *PARALLEL_VECTORLENOUTPUT (int _global_arraylentemp), - size_t *PARALLEL_VECTORLENOUTPUT (size_t _global_arraylentemp), - int *PARALLEL_LISTLENOUTPUT (int _global_arraylentemp), - size_t *PARALLEL_LISTLENOUTPUT (size_t _global_arraylentemp) - "$1 = &_global_arraylentemp;"; - - /* We also need to ignore the ...OUTPUT argument. */ - - %typemap(in,numinputs=0) C_TYPE **PARALLEL_VECTOROUTPUT (C_TYPE *arraytemp), - C_TYPE **PARALLEL_LISTOUTPUT (C_TYPE *arraytemp) - "$1 = &arraytemp;"; - - /* In the ARGOUT typemaps, we convert the array into a vector or - a list and append it to the results. */ - - %typemap(argout, doc="$NAME (a vector of " #SCM_TYPE " values)") - C_TYPE **PARALLEL_VECTOROUTPUT - { - int i; - SCM res = scm_make_vector(scm_from_long(_global_arraylentemp), - SCM_BOOL_F); - for (i = 0; i<_global_arraylentemp; i++) { - C_TYPE swig_c_value = (*$1)[i]; - SCM elt = C_TO_SCM_EXPR; - scm_vector_set_x(res, scm_from_long(i), elt); - } - SWIG_APPEND_VALUE(res); - } - - %typemap(argout, doc="$NAME (a list of " #SCM_TYPE " values)") - C_TYPE **PARALLEL_LISTOUTPUT - { - int i; - SCM res = SCM_EOL; - if (_global_arraylentemp > 0) { - for (i = _global_arraylentemp - 1; i>=0; i--) { - C_TYPE swig_c_value = (*$1)[i]; - SCM elt = C_TO_SCM_EXPR; - res = scm_cons(elt, res); - } - } - SWIG_APPEND_VALUE(res); - } - - /* In the FREEARG typemaps, get rid of the C vector. - (This can be overridden if you want to keep the C vector.) */ - - %typemap(freearg) C_TYPE **PARALLEL_VECTOROUTPUT, - C_TYPE **PARALLEL_LISTOUTPUT - { - free(*$1); - } - -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT(C_TYPE, SCM_TO_C, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), SCM_TYPE) -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT(C_TYPE, C_TO_SCM, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR - (C_TYPE, C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -/* We use the macro to define typemaps for some standard types. */ - -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(bool, scm_is_true, scm_from_bool, boolean); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(int, scm_to_int, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(short, scm_to_int, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(long, scm_to_long, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(ptrdiff_t, scm_to_long, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned int, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned short, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned long, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(size_t, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(float, scm_to_double, scm_from_double, real); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(double, scm_to_double, scm_from_double, real); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(char *, SWIG_scm2str, SWIG_str02scm, string); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(const char *, SWIG_scm2str, SWIG_str02scm, string); - -%typemap(freearg) char **PARALLEL_LISTINPUT, char **PARALLEL_VECTORINPUT, - const char **PARALLEL_LISTINPUT, const char **PARALLEL_VECTORINPUT -{ - if (($1)!=NULL) { - int i; - for (i = 0; i<*_global_list_length; i++) - SWIG_free(($1)[i]); - SWIG_free($1); - } -} - -%typemap(freearg) char ***PARALLEL_LISTOUTPUT, char ***PARALLEL_VECTOROUTPUT, - const char ***PARALLEL_LISTOUTPUT, const char ***PARALLEL_VECTOROUTPUT -{ - if ((*$1)!=NULL) { - int i; - for (i = 0; i<_global_arraylentemp; i++) - free((*$1)[i]); - free(*$1); - } -} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/pointer-in-out.i b/linux/bin/swig/share/swig/4.1.0/guile/pointer-in-out.i deleted file mode 100755 index d8a631ca..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/pointer-in-out.i +++ /dev/null @@ -1,102 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pointer-in-out.i - * - * Guile typemaps for passing pointers indirectly - * ----------------------------------------------------------------------------- */ - -/* Here is a macro that will define typemaps for passing C pointers indirectly. - - TYPEMAP_POINTER_INPUT_OUTPUT(PTRTYPE, SCM_TYPE) - - Supported calling conventions (in this example, PTRTYPE is int *): - - func(int **INPUT) - - Scheme wrapper will take one argument, a wrapped C pointer. - The address of a variable containing this pointer will be - passed to the function. - - func(int **INPUT_CONSUMED) - - Likewise, but mark the pointer object as not garbage - collectable. - - func(int **INPUT_DESTROYED) - - Likewise, but mark the pointer object as destroyed. - - func(int **OUTPUT) - - Scheme wrapper will take no arguments. The address of an int * - variable will be passed to the function. The function is - expected to modify the variable; its value is wrapped and - becomes an extra return value. (See the documentation on how - to deal with multiple values.) - - func(int **OUTPUT_NONCOLLECTABLE) - - Likewise, but make the pointer object not garbage collectable. - - func(int **BOTH) - func(int **INOUT) - - This annotation combines INPUT and OUTPUT. - -*/ - -%define TYPEMAP_POINTER_INPUT_OUTPUT(PTRTYPE, SCM_TYPE) - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE ">") PTRTYPE *INPUT(PTRTYPE temp) -{ - if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); - } - $1 = &temp; -} - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE "> and is consumed by the function") PTRTYPE *INPUT_CONSUMED(PTRTYPE temp) -{ - if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); - } - SWIG_Guile_MarkPointerNoncollectable($input); - $1 = &temp; -} - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE "> and is consumed by the function") PTRTYPE *INPUT_DESTROYED(PTRTYPE temp) -{ - if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); - } - SWIG_Guile_MarkPointerDestroyed($input); - $1 = &temp; -} - -%typemap(in, numinputs=0) PTRTYPE *OUTPUT(PTRTYPE temp), - PTRTYPE *OUTPUT_NONCOLLECTABLE(PTRTYPE temp) - "$1 = &temp;"; - -%typemap(argout, doc="<" #SCM_TYPE ">") PTRTYPE *OUTPUT - "SWIG_APPEND_VALUE(SWIG_NewPointerObj(*$1, $*descriptor, 1));"; - -%typemap(argout, doc="<" #SCM_TYPE ">") PTRTYPE *OUTPUT_NONCOLLECTABLE - "SWIG_APPEND_VALUE(SWIG_NewPointerObj(*$1, $*descriptor, 0));"; - -%typemap(in) PTRTYPE *BOTH = PTRTYPE *INPUT; -%typemap(argout) PTRTYPE *BOTH = PTRTYPE *OUTPUT; -%typemap(in) PTRTYPE *INOUT = PTRTYPE *INPUT; -%typemap(argout) PTRTYPE *INOUT = PTRTYPE *OUTPUT; - -/* As a special convenience measure, also attach docs involving - SCM_TYPE to the standard pointer typemaps */ - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE ">") PTRTYPE { - if (SWIG_ConvertPtr($input, (void **) &$1, $descriptor, 0)) - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); -} - -%typemap(out, doc="<" #SCM_TYPE ">") PTRTYPE { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/guile/ports.i b/linux/bin/swig/share/swig/4.1.0/guile/ports.i deleted file mode 100755 index 7691d3e3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/ports.i +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ports.i - * - * Guile typemaps for handling ports - * ----------------------------------------------------------------------------- */ - -%{ - #ifndef _POSIX_SOURCE - /* This is needed on Solaris for fdopen(). */ - # define _POSIX_SOURCE 199506L - #endif - #include - #include - #include -%} - -/* This typemap for FILE * accepts - (1) FILE * pointer objects, - (2) Scheme file ports. In this case, it creates a temporary C stream - which reads or writes from a dup'ed file descriptor. - */ - -%typemap(in, doc="$NAME is a file port or a FILE * pointer") FILE * -{ - if (SWIG_ConvertPtr($input, (void**) &($1), $1_descriptor, 0) != 0) { - if (!(SCM_FPORTP($input))) { - scm_wrong_type_arg("$symname", $argnum, $input); - } else { - int fd; - if (SCM_OUTPUT_PORT_P($input)) { - scm_force_output($input); - } - fd=dup(SCM_FPORT_FDES($input)); - if (fd==-1) { - scm_misc_error("$symname", strerror(errno), SCM_EOL); - } - $1=fdopen(fd, SCM_OUTPUT_PORT_P($input) ? (SCM_INPUT_PORT_P($input) ? "r+" : "w") : "r"); - if ($1==NULL) { - scm_misc_error("$symname", strerror(errno), SCM_EOL); - } - } - } -} - -%typemap(freearg) FILE* { - if ($1) { - fclose($1); - } -} - diff --git a/linux/bin/swig/share/swig/4.1.0/guile/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/guile/std_auto_ptr.i deleted file mode 100755 index 59d5c0ed..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scm_misc_error(FUNC_NAME, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'", SCM_EOL); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/std_common.i b/linux/bin/swig/share/swig/4.1.0/guile/std_common.i deleted file mode 100755 index 97974497..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/std_common.i +++ /dev/null @@ -1,25 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; - -#define SWIG_bool2scm(b) scm_from_bool(b ? 1 : 0) -#define SWIG_string2scm(s) SWIG_str02scm(s.c_str()) - -%{ -#include - -SWIGINTERNINLINE -std::string SWIG_scm2string(SCM x) { - char* temp; - temp = SWIG_scm2str(x); - std::string s(temp); - SWIG_free(temp); - return s; -} -%} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/std_deque.i b/linux/bin/swig/share/swig/4.1.0/guile/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/guile/std_except.i b/linux/bin/swig/share/swig/4.1.0/guile/std_except.i deleted file mode 100755 index 6c30a319..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/std_except.i +++ /dev/null @@ -1,13 +0,0 @@ -// TODO: STL exception handling -// Note that the generic std_except.i file did not work -%{ -#include -#include -%} - -namespace std { - %ignore exception; - struct exception { - }; -} - diff --git a/linux/bin/swig/share/swig/4.1.0/guile/std_map.i b/linux/bin/swig/share/swig/4.1.0/guile/std_map.i deleted file mode 100755 index f84e78bc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/std_map.i +++ /dev/null @@ -1,1370 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// -// The aim of all that follows would be to integrate std::map with -// Guile as much as possible, namely, to allow the user to pass and -// be returned Scheme association lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::map), f(const std::map&), f(const std::map*): -// the parameter being read-only, either a Scheme alist or a -// previously wrapped std::map can be passed. -// -- f(std::map&), f(std::map*): -// the parameter must be modified; therefore, only a wrapped std::map -// can be passed. -// -- std::map f(): -// the map is returned by copy; therefore, a Scheme alist -// is returned which is most easily used in other Scheme functions -// -- std::map& f(), std::map* f(), const std::map& f(), -// const std::map* f(): -// the map is returned by reference; therefore, a wrapped std::map -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[*k] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[*k] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - K* key = new K(i->first); - T* val = new T(i->second); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - /* native sequence? */ - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - K* k; - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - /* native sequence? */ - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - K* k; - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, const T& x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scm_cons(k,result); - } - return result; - } - } - }; - - - // specializations for built-ins - - %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) - - template class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[CONVERT_FROM(key)] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[CONVERT_FROM(key)] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - T* val = new T(i->second); - SCM k = CONVERT_TO(i->first); - SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, const T& x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - SCM k = CONVERT_TO(i->first); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) - template class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[*k] = CONVERT_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[*k] = CONVERT_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - SCM x = CONVERT_TO(i->second); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - K* k; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - K* k; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, T x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, - T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) - template<> class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[CONVERT_K_FROM(key)] = - CONVERT_T_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - SCM k = CONVERT_K_TO(i->first); - SCM x = CONVERT_T_TO(i->second); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, T x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - SCM k = CONVERT_K_TO(i->first); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - - specialize_std_map_on_key(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_key(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_key(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_key(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_map_on_value(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_value(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_value(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_value(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); -} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/std_pair.i b/linux/bin/swig/share/swig/4.1.0/guile/std_pair.i deleted file mode 100755 index 050d4880..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/std_pair.i +++ /dev/null @@ -1,867 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// -// See std_vector.i for the rationale of typemap application -// ------------------------------------------------------------------------ - -%{ -#include -%} - -// exported class - -namespace std { - - template struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(*x,*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = new std::pair< T, U >(*x,*y); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - T* x = new T($1.first); - U* y = new U($1.second); - SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scm_cons(first,second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - - // specializations for built-ins - - %define specialize_std_pair_on_first(T,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(CONVERT_FROM(first),*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = new std::pair< T, U >(CONVERT_FROM(first),*y); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - U* y = new U($1.second); - SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scm_cons(CONVERT_TO($1.first),second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_second(U,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - T* x; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = std::make_pair(*x,CONVERT_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - T* x; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = new std::pair< T, U >(*x,CONVERT_FROM(second)); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - T* x = new T($1.first); - SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - $result = scm_cons(first,CONVERT_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_both(T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO, - U,CHECK_U,CONVERT_U_FROM,CONVERT_U_TO) - template<> struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = std::make_pair(CONVERT_T_FROM(first), - CONVERT_U_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = new std::pair< T, U >(CONVERT_T_FROM(first), CONVERT_U_FROM(second)); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - $result = scm_cons(CONVERT_T_TO($1.first), - CONVERT_U_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - - specialize_std_pair_on_first(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_first(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_first(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_first(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_first(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_first(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_first(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_first(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_first(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_first(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_pair_on_second(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_second(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_second(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_second(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_second(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_second(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_second(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_second(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_second(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_second(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); -} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/std_string.i b/linux/bin/swig/share/swig/4.1.0/guile/std_string.i deleted file mode 100755 index c49bfcb0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/std_string.i +++ /dev/null @@ -1,95 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - %typemap(typecheck) string = char *; - %typemap(typecheck) const string & = char *; - - %typemap(in) string (char * tempptr) { - if (scm_is_string($input)) { - tempptr = SWIG_scm2str($input); - $1.assign(tempptr); - SWIG_free(tempptr); - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(in) const string & ($*1_ltype temp, char *tempptr) { - if (scm_is_string($input)) { - tempptr = SWIG_scm2str($input); - temp.assign(tempptr); - SWIG_free(tempptr); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(in) string * (char *tempptr) { - if (scm_is_string($input)) { - tempptr = SWIG_scm2str($input); - $1 = new $*1_ltype(tempptr); - SWIG_free(tempptr); - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(out) string { - $result = SWIG_str02scm($1.c_str()); - } - - %typemap(out) const string & { - $result = SWIG_str02scm($1->c_str()); - } - - %typemap(out) string * { - $result = SWIG_str02scm($1->c_str()); - } - - %typemap(varin) string { - if (scm_is_string($input)) { - char *tempptr = SWIG_scm2str($input); - $1.assign(tempptr); - SWIG_free(tempptr); - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(varout) string { - $result = SWIG_str02scm($1.c_str()); - } - - %typemap(throws) string { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); - } - - %typemap(throws) const string & { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); - } -} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/guile/std_unique_ptr.i deleted file mode 100755 index 6f907e90..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scm_misc_error(FUNC_NAME, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'", SCM_EOL); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/std_vector.i b/linux/bin/swig/share/swig/4.1.0/guile/std_vector.i deleted file mode 100755 index 42bad849..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/std_vector.i +++ /dev/null @@ -1,424 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Guile as much as possible, namely, to allow the user to pass and -// be returned Guile vectors or lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a Guile sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a Guile vector of T:s -// is returned which is most easily used in other Guile functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - $1 = std::vector< T >(size); - for (unsigned long i=0; i(); - } else if (scm_is_pair($input)) { - SCM head, tail; - $1 = std::vector< T >(); - tail = $input; - while (!scm_is_null(tail)) { - head = SCM_CAR(tail); - tail = SCM_CDR(tail); - $1.push_back(*((T*)SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const vector& (std::vector temp), - const vector* (std::vector temp) { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - temp = std::vector< T >(size); - $1 = &temp; - for (unsigned long i=0; i(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::vector< T >(); - $1 = &temp; - SCM head, tail; - tail = $input; - while (!scm_is_null(tail)) { - head = SCM_CAR(tail); - tail = SCM_CDR(tail); - temp.push_back(*((T*) SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) vector { - $result = scm_make_vector(scm_from_long($1.size()),SCM_UNSPECIFIED); - for (unsigned int i=0; i<$1.size(); i++) { - T* x = new T((($1_type &)$1)[i]); - scm_vector_set_x($result,scm_from_long(i), - SWIG_NewPointerObj(x, $descriptor(T *), 1)); - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - T* x; - if (SWIG_ConvertPtr(o,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - T* x; - SCM head = SCM_CAR($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - if (SWIG_ConvertPtr(o,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - T* x; - SCM head = SCM_CAR($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - const T& ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - $1 = std::vector< T >(size); - for (unsigned long i=0; i(); - } else if (scm_is_pair($input)) { - SCM v = scm_vector($input); - unsigned long size = scm_c_vector_length(v); - $1 = std::vector< T >(size); - for (unsigned long i=0; i& (std::vector temp), - const vector* (std::vector temp) { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - temp = std::vector< T >(size); - $1 = &temp; - for (unsigned long i=0; i(); - $1 = &temp; - } else if (scm_is_pair($input)) { - SCM v = scm_vector($input); - unsigned long size = scm_c_vector_length(v); - temp = std::vector< T >(size); - $1 = &temp; - for (unsigned long i=0; i { - $result = scm_make_vector(scm_from_long($1.size()),SCM_UNSPECIFIED); - for (unsigned int i=0; i<$1.size(); i++) { - SCM x = CONVERT_TO((($1_type &)$1)[i]); - scm_vector_set_x($result,scm_from_long(i),x); - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - $1 = CHECK(o) ? 1 : 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - SCM head = SCM_CAR($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) ? 1 : 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - $1 = CHECK(o) ? 1 : 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - SCM head = SCM_CAR($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) ? 1 : 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/guile/swigmove.i b/linux/bin/swig/share/swig/4.1.0/guile/swigmove.i deleted file mode 100755 index 87ab91ea..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/swigmove.i +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "$1_type", $symname, $argnum); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/linux/bin/swig/share/swig/4.1.0/guile/swigrun.i b/linux/bin/swig/share/swig/4.1.0/guile/swigrun.i deleted file mode 100755 index e4573eb3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/swigrun.i +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- mode: c -*- */ - -%module swigrun - -#ifdef SWIGGUILE_SCM - -%runtime %{ -/* Hook the runtime module initialization - into the shared initialization function SWIG_Guile_Init. */ -#include -#ifdef __cplusplus -extern "C" -#endif -SCM scm_init_Swig_swigrun_module (void); -#define SWIG_INIT_RUNTIME_MODULE scm_init_Swig_swigrun_module(); -%} - -/* The runtime type system from common.swg */ - -typedef struct swig_type_info swig_type_info; - -const char * -SWIG_TypeName(const swig_type_info *type); - -const char * -SWIG_TypePrettyName(const swig_type_info *type); - -swig_type_info * -SWIG_TypeQuery(const char *); - -/* Language-specific stuff */ - -%apply bool { int }; - -int -SWIG_IsPointer(SCM object); - -int -SWIG_IsPointerOfType(SCM object, swig_type_info *type); - -unsigned long -SWIG_PointerAddress(SCM object); - -swig_type_info * -SWIG_PointerType(SCM object); - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/guile/typemaps.i b/linux/bin/swig/share/swig/4.1.0/guile/typemaps.i deleted file mode 100755 index 45a2208f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/guile/typemaps.i +++ /dev/null @@ -1,501 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Guile-specific typemaps - * ----------------------------------------------------------------------------- */ - -/* These are defined with a view to eventually merging with those defined for other target languages in swigtypemaps.swg and exception.swg */ -#define %set_output(obj) $result = obj -#define %set_varoutput(obj) $result = obj -#define %argument_fail(_code, _type, _name, _argn) scm_wrong_type_arg((char *) FUNC_NAME, _argn, $input) -#define %as_voidptr(ptr) (void*)(ptr) -#define %argument_nullref(_type, _name, _argn) scm_misc_error(FUNC_NAME, "invalid null reference for argument " #_argn " of type '" _type "'", SCM_EOL) -#define %releasenotowned_fail(_code, _type, _name, _argn) scm_misc_error(FUNC_NAME, "cannot release ownership as memory is not owned for argument " #_argn " of type '" _type "'", SCM_EOL) - -/* Pointers */ - -%typemap(in) SWIGTYPE *, SWIGTYPE [] { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} -%typemap(in) SWIGTYPE & ($1_ltype argp) { - argp = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - $1 = argp; -} -%typemap(in, noblock=1, fragment="") SWIGTYPE && (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) { - res = SWIG_ConvertPtr($input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "$1_type", $symname, $argnum); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -} -%typemap(freearg) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] "" - -%typemap(in) void * { - $1 = ($1_ltype)SWIG_MustGetPtr($input, NULL, $argnum, 0); -} -%typemap(freearg) void * "" - -%typemap(varin) SWIGTYPE * { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0); -} - -%typemap(varin) SWIGTYPE & { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE && { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE [] { - scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); -} - -%typemap(varin) SWIGTYPE [ANY] { - void *temp; - int ii; - $1_basetype *b = 0; - temp = SWIG_MustGetPtr($input, $1_descriptor, 1, 0); - b = ($1_basetype *) $1; - for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii); -} - -%typemap(varin) void * { - $1 = SWIG_MustGetPtr($input, NULL, 1, 0); -} - -%typemap(out) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj ($1, ty, $owner); -} - -%typemap(varout) SWIGTYPE *, SWIGTYPE [] { - $result = SWIG_NewPointerObj ($1, $descriptor, 0); -} - -%typemap(varout) SWIGTYPE & { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -%typemap(varout) SWIGTYPE && { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -%typemap(throws) SWIGTYPE { - $<ype temp = new $ltype($1); - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj(temp, $&descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE & { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj(&$1, $descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE && { - scm_throw(gh_symbol2scm((char *) "swig-exception"), - gh_list(SWIG_NewPointerObj(&$1, $descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE * { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj($1, $descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE [] { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj($1, $descriptor, 1), - SCM_UNDEFINED)); -} - -/* Change of object ownership, and interaction of destructor-like functions and the - garbage-collector */ - -%typemap(in, doc="$NAME is of type <$type> and gets destroyed by the function") SWIGTYPE *DESTROYED { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} - -%typemap(freearg) SWIGTYPE *DESTROYED { - SWIG_Guile_MarkPointerDestroyed($input); -} - -%typemap(in, doc="$NAME is of type <$type> and is consumed by the function") SWIGTYPE *CONSUMED { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); - SWIG_Guile_MarkPointerNoncollectable($input); -} - -/* Pass-by-value */ - -%typemap(in) SWIGTYPE ($&1_ltype argp) { - argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0); - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - $1 = *argp; -} - -%typemap(varin) SWIGTYPE { - $&1_ltype argp; - argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, 1, 0); - $1 = *argp; -} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype($1); - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 1); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1); -} -#endif - -%typemap(varout) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr = ($&1_ltype)&$1; - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 0); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0); -} -#endif - -/* Enums */ - -%typemap(in) enum SWIGTYPE { $1 = ($1_type) scm_to_int($input); } -/* The complicated construction below needed to deal with anonymous - enums, which cannot be cast to. */ -%typemap(varin) enum SWIGTYPE { - if (sizeof(int) != sizeof($1)) { - scm_error(scm_from_locale_symbol("swig-error"), - (char *) FUNC_NAME, - (char *) "enum variable '$name' cannot be set", - SCM_EOL, SCM_BOOL_F); - } - * (int *) &($1) = scm_to_int($input); -} -%typemap(out) enum SWIGTYPE { $result = scm_from_long((int)$1); } -%typemap(varout) enum SWIGTYPE { $result = scm_from_long((int)$1); } -%typemap(throws) enum SWIGTYPE { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(scm_from_long((int)$1), SCM_UNDEFINED)); -} - -/* The SIMPLE_MAP_WITH_EXPR macro below defines the whole set of - typemaps needed for simple types. - -- SCM_TO_C_EXPR is a C expression that translates the Scheme value - "swig_scm_value" to a C value. - -- C_TO_SCM_EXPR is a C expression that translates the C value - "swig_c_value" to a Scheme value. */ - -%define SIMPLE_MAP_WITH_EXPR(C_NAME, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_NAME) - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">") C_NAME - { SCM swig_scm_value = $input; - $1 = SCM_TO_C_EXPR; } - %typemap (varin, doc="NEW-VALUE is of type <" #SCM_NAME ">") C_NAME - { SCM swig_scm_value = $input; - $1 = SCM_TO_C_EXPR; } - %typemap (out, doc="<" #SCM_NAME ">") C_NAME - { C_NAME swig_c_value = $1; - $result = C_TO_SCM_EXPR; } - %typemap (varout, doc="<" #SCM_NAME ">") C_NAME - { C_NAME swig_c_value = $1; - $result = C_TO_SCM_EXPR; } - /* INPUT and OUTPUT */ - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">)") - C_NAME *INPUT(C_NAME temp) { - SCM swig_scm_value = $input; - temp = (C_NAME) SCM_TO_C_EXPR; $1 = &temp; } - %typemap (in,numinputs=0) C_NAME *OUTPUT (C_NAME temp) - {$1 = &temp;} - %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT - { C_NAME swig_c_value = *$1; - SWIG_APPEND_VALUE(C_TO_SCM_EXPR); } - %typemap (in) C_NAME *BOTH = C_NAME *INPUT; - %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; - %typemap (in) C_NAME *INOUT = C_NAME *INPUT; - %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; - /* Const primitive references. Passed by value */ - %typemap(in, doc="$NAME is of type <" #SCM_NAME ">") const C_NAME & (C_NAME temp) - { SCM swig_scm_value = $input; - temp = SCM_TO_C_EXPR; - $1 = &temp; } - %typemap(out, doc="<" #SCM_NAME ">") const C_NAME & - { C_NAME swig_c_value = *$1; - $result = C_TO_SCM_EXPR; } - /* Throw typemap */ - %typemap(throws) C_NAME { - C_NAME swig_c_value = $1; - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(C_TO_SCM_EXPR, SCM_UNDEFINED)); - } -%enddef - -/* The SIMPLE_MAP macro below defines the whole set of typemaps needed - for simple types. It generates slightly simpler code than the - macro above, but it is only suitable for very simple conversion - expressions. */ - -%define SIMPLE_MAP(C_NAME, SCM_TO_C, C_TO_SCM, SCM_NAME) - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">") - C_NAME {$1 = ($1_ltype) SCM_TO_C($input);} - %typemap (varin, doc="NEW-VALUE is of type <" #SCM_NAME ">") - C_NAME {$1 = ($1_ltype) SCM_TO_C($input);} - %typemap (out, doc="<" #SCM_NAME ">") - C_NAME {$result = C_TO_SCM($1);} - %typemap (varout, doc="<" #SCM_NAME ">") - C_NAME {$result = C_TO_SCM($1);} - /* INPUT and OUTPUT */ - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">)") - C_NAME *INPUT(C_NAME temp), C_NAME &INPUT(C_NAME temp) { - temp = (C_NAME) SCM_TO_C($input); $1 = &temp; - } - %typemap (in,numinputs=0) C_NAME *OUTPUT (C_NAME temp), C_NAME &OUTPUT(C_NAME temp) - {$1 = &temp;} - %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT, C_NAME &OUTPUT - {SWIG_APPEND_VALUE(C_TO_SCM(*$1));} - %typemap (in) C_NAME *BOTH = C_NAME *INPUT; - %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; - %typemap (in) C_NAME *INOUT = C_NAME *INPUT; - %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; - %typemap (in) C_NAME &INOUT = C_NAME &INPUT; - %typemap (argout) C_NAME &INOUT = C_NAME &OUTPUT; - /* Const primitive references. Passed by value */ - %typemap(in, doc="$NAME is of type <" #SCM_NAME ">") const C_NAME & (C_NAME temp) { - temp = SCM_TO_C($input); - $1 = ($1_ltype) &temp; - } - %typemap(out, doc="<" #SCM_NAME ">") const C_NAME & { - $result = C_TO_SCM(*$1); - } - /* Throw typemap */ - %typemap(throws) C_NAME { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(C_TO_SCM($1), SCM_UNDEFINED)); - } -%enddef - - SIMPLE_MAP(bool, scm_is_true, scm_from_bool, boolean); - SIMPLE_MAP(char, SCM_CHAR, SCM_MAKE_CHAR, char); - SIMPLE_MAP(unsigned char, SCM_CHAR, SCM_MAKE_CHAR, char); - SIMPLE_MAP(signed char, SCM_CHAR, SCM_MAKE_CHAR, char); - SIMPLE_MAP(int, scm_to_int, scm_from_long, integer); - SIMPLE_MAP(short, scm_to_short, scm_from_long, integer); - SIMPLE_MAP(long, scm_to_long, scm_from_long, integer); - SIMPLE_MAP(ptrdiff_t, scm_to_long, scm_from_long, integer); - SIMPLE_MAP(unsigned int, scm_to_uint, scm_from_ulong, integer); - SIMPLE_MAP(unsigned short, scm_to_ushort, scm_from_ulong, integer); - SIMPLE_MAP(unsigned long, scm_to_ulong, scm_from_ulong, integer); - SIMPLE_MAP(size_t, scm_to_ulong, scm_from_ulong, integer); - SIMPLE_MAP(float, scm_to_double, scm_from_double, real); - SIMPLE_MAP(double, scm_to_double, scm_from_double, real); -// SIMPLE_MAP(char *, SWIG_scm2str, SWIG_str02scm, string); -// SIMPLE_MAP(const char *, SWIG_scm2str, SWIG_str02scm, string); - -/* Define long long typemaps -- uses functions that are only defined - in recent versions of Guile, availability also depends on Guile's - configuration. */ - -SIMPLE_MAP(long long, scm_to_long_long, scm_from_long_long, integer); -SIMPLE_MAP(unsigned long long, scm_to_ulong_long, scm_from_ulong_long, integer); - -/* Strings */ - - %typemap (in, doc="$NAME is a string") char *(int must_free = 0) { - $1 = ($1_ltype)SWIG_scm2str($input); - must_free = 1; - } - %typemap (varin, doc="NEW-VALUE is a string") char * {$1 = ($1_ltype)SWIG_scm2str($input);} - %typemap (out, doc="") char * {$result = SWIG_str02scm((const char *)$1);} - %typemap (varout, doc="") char * {$result = SWIG_str02scm($1);} - %typemap (in, doc="$NAME is a string") char **INPUT(char * temp, int must_free = 0) { - temp = (char *) SWIG_scm2str($input); $1 = &temp; - must_free = 1; - } - %typemap (in,numinputs=0) char **OUTPUT (char * temp) - {$1 = &temp;} - %typemap (argout,doc="$NAME (a string)") char **OUTPUT - {SWIG_APPEND_VALUE(SWIG_str02scm(*$1));} - %typemap (in) char **BOTH = char **INPUT; - %typemap (argout) char **BOTH = char **OUTPUT; - %typemap (in) char **INOUT = char **INPUT; - %typemap (argout) char **INOUT = char **OUTPUT; - -/* SWIG_scm2str makes a malloc'ed copy of the string, so get rid of it after - the function call. */ - -%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 **OUTPUT "SWIG_free(*$1);" - -/* But this shall not apply if we try to pass a single char by - reference. */ - -%typemap (freearg) char *OUTPUT, char *BOTH "" - -/* If we set a string variable, delete the old result first, unless const. */ - -%typemap (varin) char * { - free($1); - $1 = ($1_ltype) SWIG_scm2str($input); -} - -%typemap (varin) const char * { - $1 = ($1_ltype) SWIG_scm2str($input); -} - -%typemap(throws) char * { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_str02scm($1), SCM_UNDEFINED)); -} - -/* Void */ - -%typemap (out,doc="") void "gswig_result = SCM_UNSPECIFIED;" - -/* SCM is passed through */ - -typedef unsigned long SCM; -%typemap (in) SCM "$1=$input;" -%typemap (out) SCM "$result=$1;" -%typecheck(SWIG_TYPECHECK_POINTER) SCM "$1=1;"; - -/* ------------------------------------------------------------ - * String & length - * ------------------------------------------------------------ */ - -%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) { - size_t temp; - $1 = ($1_ltype) SWIG_Guile_scm2newstr($input, &temp); - $2 = ($2_ltype) temp; -} - -/* ------------------------------------------------------------ - * CLASS::* (member function pointer) typemaps - * taken from typemaps/swigtype.swg - * ------------------------------------------------------------ */ - -%typemap(in) SWIGTYPE (CLASS::*) { - int res = SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($1), $descriptor); - if (!SWIG_IsOK(res)) { - %argument_fail(res,"$type",$symname, $argnum); - } -} - -%typemap(out,noblock=1) SWIGTYPE (CLASS::*) { - %set_output(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($1), $descriptor)); -} - -%typemap(varin) SWIGTYPE (CLASS::*) { - int res = SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($1), $descriptor); - if (!SWIG_IsOK(res)) { - scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); - } -} - -%typemap(varout,noblock=1) SWIGTYPE (CLASS::*) { - %set_varoutput(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($1), $descriptor)); -} - -/* ------------------------------------------------------------ - * Typechecking rules - * ------------------------------------------------------------ */ - -/* adapted from python.swg */ - -%typecheck(SWIG_TYPECHECK_INTEGER) - int, short, long, - unsigned int, unsigned short, unsigned long, - signed char, unsigned char, - long long, unsigned long long, - size_t, ptrdiff_t, - std::size_t, std::ptrdiff_t, - const int &, const short &, const long &, - const unsigned int &, const unsigned short &, const unsigned long &, - const long long &, const unsigned long long &, - const size_t &, const ptrdiff_t &, - const std::size_t &, const std::ptrdiff_t &, - enum SWIGTYPE -{ - $1 = scm_is_true(scm_integer_p($input)) && scm_is_true(scm_exact_p($input))? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, bool&, const bool& -{ - $1 = scm_is_bool($input) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) - float, double, - const float &, const double & -{ - $1 = scm_is_true(scm_real_p($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_CHAR) char { - $1 = SCM_CHARP($input) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - $1 = scm_is_string($input) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $1_descriptor, 0); - $1 = SWIG_CheckState(res); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE &, SWIGTYPE && { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $1_descriptor, SWIG_POINTER_NO_NULL); - $1 = SWIG_CheckState(res); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $&descriptor, SWIG_POINTER_NO_NULL); - $1 = SWIG_CheckState(res); -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, 0, 0); - $1 = SWIG_CheckState(res); -} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* typemaps.i ends here */ diff --git a/linux/bin/swig/share/swig/4.1.0/intrusive_ptr.i b/linux/bin/swig/share/swig/4.1.0/intrusive_ptr.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/inttypes.i b/linux/bin/swig/share/swig/4.1.0/inttypes.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/java/arrays_java.i b/linux/bin/swig/share/swig/4.1.0/java/arrays_java.i deleted file mode 100755 index a57da64b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/arrays_java.i +++ /dev/null @@ -1,392 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_java.i - * - * These typemaps give more natural support for arrays. The typemaps are not efficient - * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from Java and vice versa. The Java array is expected to be the same size as the C array. - * An exception is thrown if they are not. - * - * Example usage: - * Wrapping: - * - * %include - * %inline %{ - * short FiddleSticks[3]; - * %} - * - * Use from Java like this: - * - * short[] fs = new short[] {10, 11, 12}; - * example.setFiddleSticks(fs); - * fs = example.getFiddleSticks(); - * ----------------------------------------------------------------------------- */ - -/* Primitive array support is a combination of SWIG macros and functions in order to reduce - * code bloat and aid maintainability. The SWIG preprocessor expands the macros into functions - * for inclusion in the generated code. */ - -/* Array support functions declarations macro */ -%define JAVA_ARRAYS_DECL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) -%{ -static int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input); -static void SWIG_JavaArrayArgout##JFUNCNAME (JNIEnv *jenv, JNITYPE *jarr, CTYPE *carr, JNITYPE##Array input); -static JNITYPE##Array SWIG_JavaArrayOut##JFUNCNAME (JNIEnv *jenv, CTYPE *result, jsize sz); -%} -%enddef - -/* Array support functions macro */ -%define JAVA_ARRAYS_IMPL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) -%{ -/* CTYPE[] support */ -static int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = JCALL1(GetArrayLength, jenv, input); - *jarr = JCALL2(Get##JAVATYPE##ArrayElements, jenv, input, 0); - if (!*jarr) - return 0; %} -#ifdef __cplusplus -%{ *carr = new CTYPE[sz]; %} -#else -%{ *carr = (CTYPE*) malloc(sz * sizeof(CTYPE)); %} -#endif -%{ if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; i - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -%typemap(in) CONST TYPE ($&1_type argp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain value - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") CONST TYPE %{ - //plain value(out) - $1_ltype* resultp = new $1_ltype($1); - intrusive_ptr_add_ref(resultp); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(resultp, SWIG_intrusive_deleter< CONST TYPE >()); -%} - -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain pointer - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE * %{ - //plain pointer(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in) CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain reference - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if(!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - return $null; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE & %{ - //plain reference(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain pointer by reference - temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") TYPE *CONST& %{ - // plain pointer by reference(out) - #if ($owner) - if (*$1) { - intrusive_ptr_add_ref(*$1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_0); - #endif -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > ($&1_type argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by value - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if (smartarg) { - $1 = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ - if ($1) { - intrusive_ptr_add_ref(result.get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(result.get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by reference - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - delete &($1); - if ($self) { - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * temp = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); - $1 = *temp; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - if (*$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - delete $1; - if ($self) $1 = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - if ($1 && *$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - if ($owner) delete $1; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& (SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > temp, $*1_ltype tempp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer reference - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if ($input) { - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } - tempp = &temp; - $1 = &tempp; -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if ($self) $1 = *$input; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if (*$1 && **$1) { - intrusive_ptr_add_ref((*$1)->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >((*$1)->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (jni) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "jlong" -%typemap (jtype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "long" -%typemap (jstype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(jstype, TYPE)" -%typemap(javain) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(jstype, TYPE).getCPtr($javainput)" - -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - - -%typemap(javaout) CONST TYPE { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE & { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) TYPE *CONST& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnBase; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { - if(swigCPtr != 0 && swigCMemOwnBase) { - swigCMemOwnBase = false; - $jnicall; - } - swigCPtr = 0; - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { - if(swigCPtr != 0 && swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $jnicall; - } - swigCPtr = 0; - super.delete(); - } - -// CONST version needed ???? also for C# -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "long" -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "long" - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%template() SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; -%enddef - - -///////////////////////////////////////////////////////////////////// - - -%include - -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - - -// plain value -%typemap(in) CONST TYPE ($&1_type argp = 0) %{ - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -// plain pointer -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -// plain reference -%typemap(in) CONST TYPE & %{ - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (jni) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "jlong" -%typemap (jtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "long" -%typemap (jstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE)" -%typemap (javain) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE).getCPtr($javainput)" -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(javaout) CONST TYPE { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE & { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) TYPE *CONST& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnBase; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $jnicall; - } - swigCPtr = 0; - } - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $jnicall; - } - swigCPtr = 0; - } - super.delete(); - } - -// CONST version needed ???? also for C# -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "long" -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "long" - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef - diff --git a/linux/bin/swig/share/swig/4.1.0/java/boost_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/java/boost_shared_ptr.i deleted file mode 100755 index ce00162d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/boost_shared_ptr.i +++ /dev/null @@ -1,337 +0,0 @@ -// Users can provide their own SWIG_SHARED_PTR_TYPEMAPS macro before including this file to change the -// visibility of the constructor and getCPtr method if desired to public if using multiple modules. -#ifndef SWIG_SHARED_PTR_TYPEMAPS -#define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(protected, protected, CONST, TYPE) -#endif - -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE ($&1_type argp = 0) %{ - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -%typemap(directorin,descriptor="L$packagepath/$&javaclassname;") CONST TYPE -%{ $input = 0; - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (new $1_ltype(SWIG_STD_MOVE($1))); %} - -%typemap(directorout) CONST TYPE -%{ if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $result = *smartarg->get(); - %} - -// plain pointer -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") CONST TYPE * -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($1 SWIG_NO_NULL_DELETER_0); - } %} - -%typemap(directorout) CONST TYPE * %{ -#error "typemaps for $1_type not available" -%} - -// plain reference -%typemap(in) CONST TYPE & %{ - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") CONST TYPE & -%{ $input = 0; - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (&$1 SWIG_NO_NULL_DELETER_0); %} - -%typemap(directorout) CONST TYPE & %{ -#error "typemaps for $1_type not available" -%} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = (TYPE *)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin,descriptor="L$packagepath/$*javaclassname;") TYPE *CONST& -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($1 SWIG_NO_NULL_DELETER_0); - } %} - -%typemap(directorout) TYPE *CONST& %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (argp) $1 = *argp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) { - $&1_type smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $result = *smartarg; - } %} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) -%{ $1 = $input ? *($&1_ltype)&$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ *($&1_ltype)&$result = *$1 ? new $*1_ltype(*$1) : 0; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) -%{ $1 = $input ? *($&1_ltype)&$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ *($&1_ltype)&$result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; - if ($owner) delete $1; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $input = 0; - if ($1 && *$1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) -%{ temp = $input ? *($1_ltype)&$input : &tempnull; - $1 = &temp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ $input = 0; - if ($1 && *$1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "typemaps for $1_type not available" -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (jni) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "jlong" -%typemap (jtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "long" -%typemap (jstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(jstype, TYPE)" - -%typemap(javain) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(jstype, TYPE).getCPtr($javainput)" - -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - - -%typemap(javaout) CONST TYPE { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE & { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) TYPE *CONST& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(javadirectorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE).getCPtr($javacall)" - -%typemap(javadirectorin) CONST TYPE, - CONST TYPE *, - CONST TYPE &, - TYPE *CONST& "($jniinput == 0) ? null : new $typemap(jstype, TYPE)($jniinput, true)" - -%typemap(javadirectorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "($jniinput == 0) ? null : new $typemap(jstype, TYPE)($jniinput, true)" - -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwn; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY void swigSetCMemOwn(boolean own) { - swigCMemOwn = own; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY void swigSetCMemOwn(boolean own) { - swigCMemOwnDerived = own; - super.swigSetCMemOwn(own); - } -%} - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - $jnicall; - } - swigCPtr = 0; - } - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $jnicall; - } - swigCPtr = 0; - } - super.delete(); - } - -%typemap(directordisconnect, methodname="swigDirectorDisconnect") TYPE %{ - protected void $methodname() { - swigSetCMemOwn(false); - $jnicall; - } -%} - -%typemap(directorowner_release, methodname="swigReleaseOwnership") TYPE %{ - public void $methodname() { - swigSetCMemOwn(false); - $jnicall; - } -%} - -%typemap(directorowner_take, methodname="swigTakeOwnership") TYPE %{ - public void $methodname() { - swigSetCMemOwn(true); - $jnicall; - } -%} - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef - diff --git a/linux/bin/swig/share/swig/4.1.0/java/director.swg b/linux/bin/swig/share/swig/4.1.0/java/director.swg deleted file mode 100755 index 53651355..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/director.swg +++ /dev/null @@ -1,541 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Java proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#if defined(DEBUG_DIRECTOR_OWNED) || defined(DEBUG_DIRECTOR_EXCEPTION) || defined(DEBUG_DIRECTOR_THREAD_NAME) -#include -#endif - -#include - -#if defined(SWIG_JAVA_USE_THREAD_NAME) - -#if !defined(SWIG_JAVA_GET_THREAD_NAME) -namespace Swig { - SWIGINTERN int GetThreadName(char *name, size_t len); -} - -#if defined(__linux__) - -#include -SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { - (void)len; -#if defined(PR_GET_NAME) - return prctl(PR_GET_NAME, (unsigned long)name, 0, 0, 0); -#else - (void)name; - return 1; -#endif -} - -#elif defined(__unix__) || defined(__APPLE__) - -#include -SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { - return pthread_getname_np(pthread_self(), name, len); -} - -#else - -SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { - (void)len; - (void)name; - return 1; -} -#endif - -#endif - -#endif - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) -#include -#endif - -namespace Swig { - - /* Java object wrapper */ - class JObjectWrapper { - public: - JObjectWrapper() : jthis_(NULL), weak_global_(true) { - } - - ~JObjectWrapper() { - jthis_ = NULL; - weak_global_ = true; - } - - bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) { - if (!jthis_) { - weak_global_ = weak_global || !mem_own; // hold as weak global if explicitly requested or not owned - if (jobj) - jthis_ = weak_global_ ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj); -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl; -#endif - return true; - } else { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl; -#endif - return false; - } - } - - jobject get(JNIEnv *jenv) const { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::get("; - if (jthis_) - std::cout << jthis_; - else - std::cout << "null"; - std::cout << ") -> return new local ref" << std::endl; -#endif - return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_); - } - - void release(JNIEnv *jenv) { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl; -#endif - if (jthis_) { - if (weak_global_) { - if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE) - jenv->DeleteWeakGlobalRef((jweak)jthis_); - } else - jenv->DeleteGlobalRef(jthis_); - } - - jthis_ = NULL; - weak_global_ = true; - } - - /* Only call peek if you know what you are doing wrt to weak/global references */ - jobject peek() { - return jthis_; - } - - /* Java proxy releases ownership of C++ object, C++ object is now - responsible for destruction (creates NewGlobalRef to pin Java proxy) */ - void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { - if (take_or_release) { /* Java takes ownership of C++ object's lifetime. */ - if (!weak_global_) { - jenv->DeleteGlobalRef(jthis_); - jthis_ = jenv->NewWeakGlobalRef(jself); - weak_global_ = true; - } - } else { - /* Java releases ownership of C++ object's lifetime */ - if (weak_global_) { - jenv->DeleteWeakGlobalRef((jweak)jthis_); - jthis_ = jenv->NewGlobalRef(jself); - weak_global_ = false; - } - } - } - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) - static void detach(void *jvm) { - static_cast(jvm)->DetachCurrentThread(); - } - - static void make_detach_key() { - pthread_key_create(&detach_key_, detach); - } - - /* thread-local key to register a destructor */ - static pthread_key_t detach_key_; -#endif - - private: - /* pointer to Java object */ - jobject jthis_; - /* Local or global reference flag */ - bool weak_global_; - }; - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) - pthread_key_t JObjectWrapper::detach_key_; -#endif - - /* Local JNI reference deleter */ - class LocalRefGuard { - JNIEnv *jenv_; - jobject jobj_; - - // non-copyable - LocalRefGuard(const LocalRefGuard &); - LocalRefGuard &operator=(const LocalRefGuard &); - public: - LocalRefGuard(JNIEnv *jenv, jobject jobj): jenv_(jenv), jobj_(jobj) {} - ~LocalRefGuard() { - if (jobj_) - jenv_->DeleteLocalRef(jobj_); - } - }; - - /* director base class */ - class Director { - /* pointer to Java virtual machine */ - JavaVM *swig_jvm_; - - protected: -#if defined (_MSC_VER) && (_MSC_VER<1300) - class JNIEnvWrapper; - friend class JNIEnvWrapper; -#endif - /* Utility class for managing the JNI environment */ - class JNIEnvWrapper { - const Director *director_; - JNIEnv *jenv_; - int env_status; - public: - JNIEnvWrapper(const Director *director) : director_(director), jenv_(0), env_status(0) { -#if defined(__ANDROID__) - JNIEnv **jenv = &jenv_; -#else - void **jenv = (void **)&jenv_; -#endif - env_status = director_->swig_jvm_->GetEnv((void **)&jenv_, JNI_VERSION_1_2); - JavaVMAttachArgs args; - args.version = JNI_VERSION_1_2; - args.group = NULL; - args.name = NULL; -#if defined(SWIG_JAVA_USE_THREAD_NAME) - char thread_name[64]; // MAX_TASK_COMM_LEN=16 is hard-coded in the Linux kernel and MacOS has MAXTHREADNAMESIZE=64. - if (Swig::GetThreadName(thread_name, sizeof(thread_name)) == 0) { - args.name = thread_name; -#if defined(DEBUG_DIRECTOR_THREAD_NAME) - std::cout << "JNIEnvWrapper: thread name: " << thread_name << std::endl; - } else { - std::cout << "JNIEnvWrapper: Couldn't set Java thread name" << std::endl; -#endif - } -#endif -#if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON) - // Attach a daemon thread to the JVM. Useful when the JVM should not wait for - // the thread to exit upon shutdown. Only for jdk-1.4 and later. - director_->swig_jvm_->AttachCurrentThreadAsDaemon(jenv, &args); -#else - director_->swig_jvm_->AttachCurrentThread(jenv, &args); -#endif - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) - // At least on Android 6, detaching after every call causes a memory leak. - // Instead, register a thread desructor and detach only when the thread ends. - // See https://developer.android.com/training/articles/perf-jni#threads - static pthread_once_t once = PTHREAD_ONCE_INIT; - - pthread_once(&once, JObjectWrapper::make_detach_key); - pthread_setspecific(JObjectWrapper::detach_key_, director->swig_jvm_); -#endif - } - ~JNIEnvWrapper() { -#if !defined(SWIG_JAVA_DETACH_ON_THREAD_END) && !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD) - // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call. - // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak. - if (env_status == JNI_EDETACHED) - director_->swig_jvm_->DetachCurrentThread(); -#endif - } - JNIEnv *getJNIEnv() const { - return jenv_; - } - }; - - struct SwigDirectorMethod { - const char *name; - const char *desc; - jmethodID methid; - SwigDirectorMethod(JNIEnv *jenv, jclass baseclass, const char *name, const char *desc) : name(name), desc(desc) { - methid = jenv->GetMethodID(baseclass, name, desc); - } - }; - - /* Java object wrapper */ - JObjectWrapper swig_self_; - - /* Disconnect director from Java object */ - void swig_disconnect_director_self(const char *disconn_method) { - JNIEnvWrapper jnienv(this) ; - JNIEnv *jenv = jnienv.getJNIEnv() ; - jobject jobj = swig_self_.get(jenv); - LocalRefGuard ref_deleter(jenv, jobj); -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl; -#endif - if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) { - jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V"); - if (disconn_meth) { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl; -#endif - jenv->CallVoidMethod(jobj, disconn_meth); - } - } - } - - jclass swig_new_global_ref(JNIEnv *jenv, const char *classname) { - jclass clz = jenv->FindClass(classname); - return clz ? (jclass)jenv->NewGlobalRef(clz) : 0; - } - - public: - Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() { - /* Acquire the Java VM pointer */ - jenv->GetJavaVM(&swig_jvm_); - } - - virtual ~Director() { - JNIEnvWrapper jnienv(this) ; - JNIEnv *jenv = jnienv.getJNIEnv() ; - swig_self_.release(jenv); - } - - bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global) { - return swig_self_.set(jenv, jself, mem_own, weak_global); - } - - jobject swig_get_self(JNIEnv *jenv) const { - return swig_self_.get(jenv); - } - - // Change C++ object's ownership, relative to Java - void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { - swig_self_.java_change_ownership(jenv, jself, take_or_release); - } - }; - - // Zero initialized bool array - template class BoolArray { - bool array_[N]; - public: - BoolArray() { - memset(array_, 0, sizeof(array_)); - } - bool& operator[](size_t n) { - return array_[n]; - } - bool operator[](size_t n) const { - return array_[n]; - } - }; - - // Utility classes and functions for exception handling. - - // Simple holder for a Java string during exception handling, providing access to a c-style string - class JavaString { - public: - JavaString(JNIEnv *jenv, jstring jstr) : jenv_(jenv), jstr_(jstr), cstr_(0) { - if (jenv_ && jstr_) - cstr_ = (const char *) jenv_->GetStringUTFChars(jstr_, NULL); - } - - ~JavaString() { - if (jenv_ && jstr_ && cstr_) - jenv_->ReleaseStringUTFChars(jstr_, cstr_); - } - - const char *c_str(const char *null_string = "null JavaString") const { - return cstr_ ? cstr_ : null_string; - } - - private: - // non-copyable - JavaString(const JavaString &); - JavaString &operator=(const JavaString &); - - JNIEnv *jenv_; - jstring jstr_; - const char *cstr_; - }; - - // Helper class to extract the exception message from a Java throwable - class JavaExceptionMessage { - public: - JavaExceptionMessage(JNIEnv *jenv, jthrowable throwable) : message_(jenv, exceptionMessageFromThrowable(jenv, throwable)) { - } - - // Return a C string of the exception message in the jthrowable passed in the constructor - // If no message is available, null_string is return instead - const char *message(const char *null_string = "Could not get exception message in JavaExceptionMessage") const { - return message_.c_str(null_string); - } - - private: - // non-copyable - JavaExceptionMessage(const JavaExceptionMessage &); - JavaExceptionMessage &operator=(const JavaExceptionMessage &); - - // Get exception message by calling Java method Throwable.getMessage() - static jstring exceptionMessageFromThrowable(JNIEnv *jenv, jthrowable throwable) { - jstring jmsg = NULL; - if (jenv && throwable) { - jenv->ExceptionClear(); // Cannot invoke methods with any pending exceptions - jclass throwclz = jenv->GetObjectClass(throwable); - if (throwclz) { - // All Throwable classes have a getMessage() method, so call it to extract the exception message - jmethodID getMessageMethodID = jenv->GetMethodID(throwclz, "getMessage", "()Ljava/lang/String;"); - if (getMessageMethodID) - jmsg = (jstring)jenv->CallObjectMethod(throwable, getMessageMethodID); - } - if (jmsg == NULL && jenv->ExceptionCheck()) - jenv->ExceptionClear(); - } - return jmsg; - } - - JavaString message_; - }; - - // C++ Exception class for handling Java exceptions thrown during a director method Java upcall - class DirectorException : public std::exception { - public: - - // Construct exception from a Java throwable - DirectorException(JNIEnv *jenv, jthrowable throwable) : jenv_(jenv), throwable_(throwable), classname_(0), msg_(0) { - - // Call Java method Object.getClass().getName() to obtain the throwable's class name (delimited by '/') - if (jenv && throwable) { - jenv->ExceptionClear(); // Cannot invoke methods with any pending exceptions - jclass throwclz = jenv->GetObjectClass(throwable); - if (throwclz) { - jclass clzclz = jenv->GetObjectClass(throwclz); - if (clzclz) { - jmethodID getNameMethodID = jenv->GetMethodID(clzclz, "getName", "()Ljava/lang/String;"); - if (getNameMethodID) { - jstring jstr_classname = (jstring)(jenv->CallObjectMethod(throwclz, getNameMethodID)); - // Copy strings, since there is no guarantee that jenv will be active when handled - if (jstr_classname) { - JavaString jsclassname(jenv, jstr_classname); - const char *classname = jsclassname.c_str(0); - if (classname) - classname_ = copypath(classname); - } - } - } - } - } - - JavaExceptionMessage exceptionmsg(jenv, throwable); - msg_ = copystr(exceptionmsg.message(0)); - } - - // More general constructor for handling as a java.lang.RuntimeException - DirectorException(const char *msg) : jenv_(0), throwable_(0), classname_(0), msg_(msg ? copystr(msg) : 0) { - } - - ~DirectorException() throw() { - delete[] classname_; - delete[] msg_; - } - - const char *what() const throw() { - return msg_ ? msg_ : "Unspecified DirectorException message"; - } - - // Reconstruct and raise/throw the Java Exception that caused the DirectorException - // Note that any error in the JNI exception handling results in a Java RuntimeException - void throwException(JNIEnv *jenv) const { - if (jenv) { - if (jenv == jenv_ && throwable_) { - // Throw original exception if not already pending - jthrowable throwable = jenv->ExceptionOccurred(); - if (throwable && jenv->IsSameObject(throwable, throwable_) == JNI_FALSE) { - jenv->ExceptionClear(); - throwable = 0; - } - if (!throwable) - jenv->Throw(throwable_); - } else { - // Try and reconstruct original exception, but original stacktrace is not reconstructed - jenv->ExceptionClear(); - - jmethodID ctorMethodID = 0; - jclass throwableclass = 0; - if (classname_) { - throwableclass = jenv->FindClass(classname_); - if (throwableclass) - ctorMethodID = jenv->GetMethodID(throwableclass, "", "(Ljava/lang/String;)V"); - } - - if (ctorMethodID) { - jenv->ThrowNew(throwableclass, what()); - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, what()); - } - } - } - } - - // Deprecated - use throwException - void raiseJavaException(JNIEnv *jenv) const { - throwException(jenv); - } - - // Create and throw the DirectorException - static void raise(JNIEnv *jenv, jthrowable throwable) { - throw DirectorException(jenv, throwable); - } - - private: - static char *copypath(const char *srcmsg) { - char *target = copystr(srcmsg); - for (char *c=target; *c; ++c) { - if ('.' == *c) - *c = '/'; - } - return target; - } - - static char *copystr(const char *srcmsg) { - char *target = 0; - if (srcmsg) { - size_t msglen = strlen(srcmsg) + 1; - target = new char[msglen]; - strncpy(target, srcmsg, msglen); - } - return target; - } - - JNIEnv *jenv_; - jthrowable throwable_; - const char *classname_; - const char *msg_; - }; - - // Helper method to determine if a Java throwable matches a particular Java class type - // Note side effect of clearing any pending exceptions - SWIGINTERN bool ExceptionMatches(JNIEnv *jenv, jthrowable throwable, const char *classname) { - bool matches = false; - - if (throwable && jenv && classname) { - // Exceptions need to be cleared for correct behavior. - // The caller of ExceptionMatches should restore pending exceptions if desired - - // the caller already has the throwable. - jenv->ExceptionClear(); - - jclass clz = jenv->FindClass(classname); - if (clz) { - jclass classclz = jenv->GetObjectClass(clz); - jmethodID isInstanceMethodID = jenv->GetMethodID(classclz, "isInstance", "(Ljava/lang/Object;)Z"); - if (isInstanceMethodID) { - matches = jenv->CallBooleanMethod(clz, isInstanceMethodID, throwable) != 0; - } - } - -#if defined(DEBUG_DIRECTOR_EXCEPTION) - if (jenv->ExceptionCheck()) { - // Typically occurs when an invalid classname argument is passed resulting in a ClassNotFoundException - JavaExceptionMessage exc(jenv, jenv->ExceptionOccurred()); - std::cout << "Error: ExceptionMatches: class '" << classname << "' : " << exc.message() << std::endl; - } -#endif - } - return matches; - } -} - diff --git a/linux/bin/swig/share/swig/4.1.0/java/enums.swg b/linux/bin/swig/share/swig/4.1.0/java/enums.swg deleted file mode 100755 index 81fe5787..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/enums.swg +++ /dev/null @@ -1,116 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enums.swg - * - * Include this file in order for C/C++ enums to be wrapped by proper Java enums. - * Note that the JNI layer handles the enum as an int. The Java enum has extra - * code generated to store the C++ int value. This is required for C++ enums that - * specify a value for the enum item, as native Java enums do not support this. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "$*javaclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$*javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) const enum SWIGTYPE & "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput.swigValue()" -%typemap(javaout) const enum SWIGTYPE & { - return $*javaclassname.swigToEnum($jnicall); - } - - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "$javaclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="L$packagepath/$javaclassname;") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) enum SWIGTYPE "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -%typemap(javaclassmodifiers) enum SWIGTYPE "public enum" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" - -/* - * SwigNext static inner class used instead of a static int as static fields cannot be accessed from enum initialisers. - * The swigToEnum method is used to find the Java enum from a C++ enum integer value. The default one here takes - * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial - * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be - * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. - */ -%typemap(javabody) enum SWIGTYPE %{ - public final int swigValue() { - return swigValue; - } - - public static $javaclassname swigToEnum(int swigValue) { - $javaclassname[] swigValues = $javaclassname.class.getEnumConstants(); - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for ($javaclassname swigEnum : swigValues) - if (swigEnum.swigValue == swigValue) - return swigEnum; - throw new IllegalArgumentException("No enum " + $javaclassname.class + " with value " + swigValue); - } - - @SuppressWarnings("unused") - private $javaclassname() { - this.swigValue = SwigNext.next++; - } - - @SuppressWarnings("unused") - private $javaclassname(int swigValue) { - this.swigValue = swigValue; - SwigNext.next = swigValue+1; - } - - @SuppressWarnings("unused") - private $javaclassname($javaclassname swigEnum) { - this.swigValue = swigEnum.swigValue; - SwigNext.next = this.swigValue+1; - } - - private final int swigValue; - - private static class SwigNext { - private static int next = 0; - } -%} - -%javaenum(proper); - diff --git a/linux/bin/swig/share/swig/4.1.0/java/enumsimple.swg b/linux/bin/swig/share/swig/4.1.0/java/enumsimple.swg deleted file mode 100755 index c270149b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/enumsimple.swg +++ /dev/null @@ -1,71 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumsimple.swg - * - * This file provides backwards compatible enum wrapping. SWIG versions 1.3.21 - * and earlier wrapped global enums with constant integers in the module class - * or Constants interface. Enums declared within a C++ class were wrapped by - * constant integers in the Java proxy class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "int" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$jniinput" -%typemap(javadirectorout) const enum SWIGTYPE & "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput" -%typemap(javaout) const enum SWIGTYPE & { - return $jnicall; - } - - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "int" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$jniinput" -%typemap(javadirectorout) enum SWIGTYPE "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput" -%typemap(javaout) enum SWIGTYPE { - return $jnicall; - } - -%typemap(javaclassmodifiers) enum SWIGTYPE "" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" -%typemap(javabody) enum SWIGTYPE "" - -%javaenum(simple); - diff --git a/linux/bin/swig/share/swig/4.1.0/java/enumtypesafe.swg b/linux/bin/swig/share/swig/4.1.0/java/enumtypesafe.swg deleted file mode 100755 index c2012f56..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/enumtypesafe.swg +++ /dev/null @@ -1,117 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumtypesafe.swg - * - * Include this file in order for C/C++ enums to be wrapped by the so called - * typesafe enum pattern. Each enum has an equivalent Java class named after the - * enum and each enum item is a static instance of this class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "$*javaclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$*javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) const enum SWIGTYPE & "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput.swigValue()" -%typemap(javaout) const enum SWIGTYPE & { - return $*javaclassname.swigToEnum($jnicall); - } - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "$javaclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="L$packagepath/$javaclassname;") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) enum SWIGTYPE "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -// '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not -%typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" - -/* - * The swigToEnum method is used to find the Java enum from a C++ enum integer value. The default one here takes - * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial - * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be - * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. - * The special variable, $enumvalues, is replaced with a comma separated list of all the enum values. - */ -%typemap(javabody) enum SWIGTYPE %{ - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static $javaclassname swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + $javaclassname.class + " with value " + swigValue); - } - - private $javaclassname(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private $javaclassname(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private $javaclassname(String swigName, $javaclassname swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static $javaclassname[] swigValues = { $enumvalues }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -%} - -%javaenum(typesafe); - diff --git a/linux/bin/swig/share/swig/4.1.0/java/enumtypeunsafe.swg b/linux/bin/swig/share/swig/4.1.0/java/enumtypeunsafe.swg deleted file mode 100755 index 31fb8a79..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/enumtypeunsafe.swg +++ /dev/null @@ -1,72 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumtypeunsafe.swg - * - * Include this file in order for C/C++ enums to be wrapped by integers values. - * Each enum has an equivalent class named after the enum and the enum items are - * wrapped by constant integers within this class. The enum items are not - * typesafe as they are all integers. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "int" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$jniinput" -%typemap(javadirectorout) const enum SWIGTYPE & "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput" -%typemap(javaout) const enum SWIGTYPE & { - return $jnicall; - } - - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "int" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$jniinput" -%typemap(javadirectorout) enum SWIGTYPE "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput" -%typemap(javaout) enum SWIGTYPE { - return $jnicall; - } - -// '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not -%typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" -%typemap(javabody) enum SWIGTYPE "" - -%javaenum(typeunsafe); - diff --git a/linux/bin/swig/share/swig/4.1.0/java/java.swg b/linux/bin/swig/share/swig/4.1.0/java/java.swg deleted file mode 100755 index 8719818b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/java.swg +++ /dev/null @@ -1,1458 +0,0 @@ -/* ----------------------------------------------------------------------------- - * java.swg - * - * Java typemaps - * ----------------------------------------------------------------------------- */ - -%include - -/* The jni, jtype and jstype typemaps work together and so there should be one of each. - * The jni typemap contains the JNI type used in the JNI (C/C++) code. - * The jtype typemap contains the Java type used in the JNI intermediary class. - * The jstype typemap contains the Java type used in the Java proxy classes, type wrapper classes and module class. */ - -/* Fragments */ -%fragment("SWIG_PackData", "header") { -/* Pack binary data into a string */ -SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} -} - -%fragment("SWIG_UnPackData", "header") { -/* Unpack binary data from a string */ -SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} -} - -%fragment("SWIG_JavaIntFromSize_t", "header") { -/* Check for overflow converting to Java int (always signed 32-bit) from (unsigned variable-bit) size_t */ -SWIGINTERN jint SWIG_JavaIntFromSize_t(size_t size) { - static const jint JINT_MAX = 0x7FFFFFFF; - return (size > (size_t)JINT_MAX) ? -1 : (jint)size; -} -} - -/* Primitive types */ -%typemap(jni) bool, const bool & "jboolean" -%typemap(jni) char, const char & "jchar" -%typemap(jni) signed char, const signed char & "jbyte" -%typemap(jni) unsigned char, const unsigned char & "jshort" -%typemap(jni) short, const short & "jshort" -%typemap(jni) unsigned short, const unsigned short & "jint" -%typemap(jni) int, const int & "jint" -%typemap(jni) unsigned int, const unsigned int & "jlong" -%typemap(jni) long, const long & "jint" -%typemap(jni) unsigned long, const unsigned long & "jlong" -%typemap(jni) long long, const long long & "jlong" -%typemap(jni) unsigned long long, const unsigned long long & "jobject" -%typemap(jni) float, const float & "jfloat" -%typemap(jni) double, const double & "jdouble" -%typemap(jni) void "void" - -%typemap(jtype) bool, const bool & "boolean" -%typemap(jtype) char, const char & "char" -%typemap(jtype) signed char, const signed char & "byte" -%typemap(jtype) unsigned char, const unsigned char & "short" -%typemap(jtype) short, const short & "short" -%typemap(jtype) unsigned short, const unsigned short & "int" -%typemap(jtype) int, const int & "int" -%typemap(jtype) unsigned int, const unsigned int & "long" -%typemap(jtype) long, const long & "int" -%typemap(jtype) unsigned long, const unsigned long & "long" -%typemap(jtype) long long, const long long & "long" -%typemap(jtype) unsigned long long, const unsigned long long & "java.math.BigInteger" -%typemap(jtype) float, const float & "float" -%typemap(jtype) double, const double & "double" -%typemap(jtype) void "void" - -%typemap(jstype) bool, const bool & "boolean" -%typemap(jstype) char, const char & "char" -%typemap(jstype) signed char, const signed char & "byte" -%typemap(jstype) unsigned char, const unsigned char & "short" -%typemap(jstype) short, const short & "short" -%typemap(jstype) unsigned short, const unsigned short & "int" -%typemap(jstype) int, const int & "int" -%typemap(jstype) unsigned int, const unsigned int & "long" -%typemap(jstype) long, const long & "int" -%typemap(jstype) unsigned long, const unsigned long & "long" -%typemap(jstype) long long, const long long & "long" -%typemap(jstype) unsigned long long, const unsigned long long & "java.math.BigInteger" -%typemap(jstype) float, const float & "float" -%typemap(jstype) double, const double & "double" -%typemap(jstype) void "void" - -%typemap(jboxtype) bool, const bool & "Boolean" -%typemap(jboxtype) char, const char & "Character" -%typemap(jboxtype) signed char, const signed char & "Byte" -%typemap(jboxtype) unsigned char, const unsigned char & "Short" -%typemap(jboxtype) short, const short & "Short" -%typemap(jboxtype) unsigned short, const unsigned short & "Integer" -%typemap(jboxtype) int, const int & "Integer" -%typemap(jboxtype) unsigned int, const unsigned int & "Long" -%typemap(jboxtype) long, const long & "Integer" -%typemap(jboxtype) unsigned long, const unsigned long & "Long" -%typemap(jboxtype) long long, const long long & "Long" -%typemap(jboxtype) unsigned long long, const unsigned long long & "java.math.BigInteger" -%typemap(jboxtype) float, const float & "Float" -%typemap(jboxtype) double, const double & "Double" - -%typemap(jni) char *, char *&, char[ANY], char[] "jstring" -%typemap(jtype) char *, char *&, char[ANY], char[] "String" -%typemap(jstype) char *, char *&, char[ANY], char[] "String" - -/* JNI types */ -%typemap(jni) jboolean "jboolean" -%typemap(jni) jchar "jchar" -%typemap(jni) jbyte "jbyte" -%typemap(jni) jshort "jshort" -%typemap(jni) jint "jint" -%typemap(jni) jlong "jlong" -%typemap(jni) jfloat "jfloat" -%typemap(jni) jdouble "jdouble" -%typemap(jni) jstring "jstring" -%typemap(jni) jobject "jobject" -%typemap(jni) jbooleanArray "jbooleanArray" -%typemap(jni) jcharArray "jcharArray" -%typemap(jni) jbyteArray "jbyteArray" -%typemap(jni) jshortArray "jshortArray" -%typemap(jni) jintArray "jintArray" -%typemap(jni) jlongArray "jlongArray" -%typemap(jni) jfloatArray "jfloatArray" -%typemap(jni) jdoubleArray "jdoubleArray" -%typemap(jni) jobjectArray "jobjectArray" - -%typemap(jtype) jboolean "boolean" -%typemap(jtype) jchar "char" -%typemap(jtype) jbyte "byte" -%typemap(jtype) jshort "short" -%typemap(jtype) jint "int" -%typemap(jtype) jlong "long" -%typemap(jtype) jfloat "float" -%typemap(jtype) jdouble "double" -%typemap(jtype) jstring "String" -%typemap(jtype) jobject "java.lang.Object" -%typemap(jtype) jbooleanArray "boolean[]" -%typemap(jtype) jcharArray "char[]" -%typemap(jtype) jbyteArray "byte[]" -%typemap(jtype) jshortArray "short[]" -%typemap(jtype) jintArray "int[]" -%typemap(jtype) jlongArray "long[]" -%typemap(jtype) jfloatArray "float[]" -%typemap(jtype) jdoubleArray "double[]" -%typemap(jtype) jobjectArray "java.lang.Object[]" - -%typemap(jstype) jboolean "boolean" -%typemap(jstype) jchar "char" -%typemap(jstype) jbyte "byte" -%typemap(jstype) jshort "short" -%typemap(jstype) jint "int" -%typemap(jstype) jlong "long" -%typemap(jstype) jfloat "float" -%typemap(jstype) jdouble "double" -%typemap(jstype) jstring "String" -%typemap(jstype) jobject "java.lang.Object" -%typemap(jstype) jbooleanArray "boolean[]" -%typemap(jstype) jcharArray "char[]" -%typemap(jstype) jbyteArray "byte[]" -%typemap(jstype) jshortArray "short[]" -%typemap(jstype) jintArray "int[]" -%typemap(jstype) jlongArray "long[]" -%typemap(jstype) jfloatArray "float[]" -%typemap(jstype) jdoubleArray "double[]" -%typemap(jstype) jobjectArray "java.lang.Object[]" - -/* Non primitive types */ -%typemap(jni) SWIGTYPE "jlong" -%typemap(jtype) SWIGTYPE "long" -%typemap(jstype) SWIGTYPE "$&javaclassname" -%typemap(jboxtype) SWIGTYPE "$typemap(jstype, $1_type)" - -%typemap(jni) SWIGTYPE [] "jlong" -%typemap(jtype) SWIGTYPE [] "long" -%typemap(jstype) SWIGTYPE [] "$javaclassname" - -%typemap(jni) SWIGTYPE * "jlong" -%typemap(jtype) SWIGTYPE * "long" -%typemap(jstype) SWIGTYPE * "$javaclassname" - -%typemap(jni) SWIGTYPE & "jlong" -%typemap(jtype) SWIGTYPE & "long" -%typemap(jstype) SWIGTYPE & "$javaclassname" - -%typemap(jni) SWIGTYPE && "jlong" -%typemap(jtype) SWIGTYPE && "long" -%typemap(jstype) SWIGTYPE && "$javaclassname" - -/* pointer to a class member */ -%typemap(jni) SWIGTYPE (CLASS::*) "jstring" -%typemap(jtype) SWIGTYPE (CLASS::*) "String" -%typemap(jstype) SWIGTYPE (CLASS::*) "$javaclassname" - -/* The following are the in, out, freearg, argout typemaps. These are the JNI code generating typemaps for converting from Java to C and visa versa. */ - -/* primitive types */ -%typemap(in) bool -%{ $1 = $input ? true : false; %} - -%typemap(directorout) bool -%{ $result = $input ? true : false; %} - -%typemap(javadirectorin) bool "$jniinput" -%typemap(javadirectorout) bool "$javacall" - -%typemap(in) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double -%{ $1 = ($1_ltype)$input; %} - -%typemap(directorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin, descriptor="Z") bool "$input = (jboolean) $1;" -%typemap(directorin, descriptor="C") char "$input = (jint) $1;" -%typemap(directorin, descriptor="B") signed char "$input = (jbyte) $1;" -%typemap(directorin, descriptor="S") unsigned char "$input = (jshort) $1;" -%typemap(directorin, descriptor="S") short "$input = (jshort) $1;" -%typemap(directorin, descriptor="I") unsigned short "$input = (jint) $1;" -%typemap(directorin, descriptor="I") int "$input = (jint) $1;" -%typemap(directorin, descriptor="J") unsigned int "$input = (jlong) $1;" -%typemap(directorin, descriptor="I") long "$input = (jint) $1;" -%typemap(directorin, descriptor="J") unsigned long "$input = (jlong) $1;" -%typemap(directorin, descriptor="J") long long "$input = (jlong) $1;" -%typemap(directorin, descriptor="F") float "$input = (jfloat) $1;" -%typemap(directorin, descriptor="D") double "$input = (jdouble) $1;" - -%typemap(javadirectorin) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double - "$jniinput" - -%typemap(javadirectorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double - "$javacall" - -%typemap(out) bool %{ $result = (jboolean)$1; %} -%typemap(out) char %{ $result = (jchar)$1; %} -%typemap(out) signed char %{ $result = (jbyte)$1; %} -%typemap(out) unsigned char %{ $result = (jshort)$1; %} -%typemap(out) short %{ $result = (jshort)$1; %} -%typemap(out) unsigned short %{ $result = (jint)$1; %} -%typemap(out) int %{ $result = (jint)$1; %} -%typemap(out) unsigned int %{ $result = (jlong)$1; %} -%typemap(out) long %{ $result = (jint)$1; %} -%typemap(out) unsigned long %{ $result = (jlong)$1; %} -%typemap(out) long long %{ $result = (jlong)$1; %} -%typemap(out) float %{ $result = (jfloat)$1; %} -%typemap(out) double %{ $result = (jdouble)$1; %} - -/* unsigned long long */ -/* Convert from BigInteger using the toByteArray member function */ -%typemap(in) unsigned long long { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, $input); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - $1 = 0; - if (sz > 0) { - $1 = ($1_type)(signed char)bae[0]; - for(i=1; i 0) { - $result = ($1_type)(signed char)bae[0]; - for(i=1; i", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)($1>>8*(8-i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - $result = bigint; -} - -/* Convert to BigInteger (see out typemap) */ -%typemap(directorin, descriptor="Ljava/math/BigInteger;", noblock=1) 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"); - jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "", "([B)V"); - jobject bigint; - int swig_i; - - bae[0] = 0; - for(swig_i=1; swig_i<9; swig_i++ ) { - bae[swig_i] = (jbyte)($1>>8*(8-swig_i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - $input = bigint; -} -Swig::LocalRefGuard $1_refguard(jenv, $input); } - -%typemap(javadirectorin) unsigned long long "$jniinput" -%typemap(javadirectorout) unsigned long long "$javacall" - -/* char * - treat as String */ -%typemap(in, noblock=1) char * { - $1 = 0; - if ($input) { - $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$1) return $null; - } -} - -%typemap(directorout, noblock=1, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * { - $1 = 0; - if ($input) { - $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$result) return $null; - } -} - -%typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char * { - $input = 0; - if ($1) { - $input = JCALL1(NewStringUTF, jenv, (const char *)$1); - if (!$input) return $null; - } - Swig::LocalRefGuard $1_refguard(jenv, $input); -} - -%typemap(freearg, noblock=1) char * { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); } -%typemap(out, noblock=1) char * { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); } -%typemap(javadirectorin) char * "$jniinput" -%typemap(javadirectorout) char * "$javacall" - -/* char *& - treat as String */ -%typemap(in, noblock=1) char *& ($*1_ltype temp = 0) { - $1 = 0; - if ($input) { - temp = ($*1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!temp) return $null; - } - $1 = &temp; -} -%typemap(freearg, noblock=1) char *& { if ($1 && *$1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)*$1); } -%typemap(out, noblock=1) char *& { if (*$1) $result = JCALL1(NewStringUTF, jenv, (const char *)*$1); } - -%typemap(out) void "" -%typemap(javadirectorin) void "$jniinput" -%typemap(javadirectorout) void "$javacall" -%typemap(directorin, descriptor="V") void "" - -/* primitive types by reference */ -%typemap(in) const bool & ($*1_ltype temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & -%{ static $*1_ltype temp; - temp = $input ? true : false; - $result = &temp; %} - -%typemap(javadirectorin) const bool & "$jniinput" -%typemap(javadirectorout) const bool & "$javacall" - -%typemap(in) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const float &, - const double & -%{ static $*1_ltype temp; - temp = ($*1_ltype)$input; - $result = &temp; %} - -%typemap(directorin, descriptor="Z") const bool & "$input = (jboolean)$1;" -%typemap(directorin, descriptor="C") const char & "$input = (jchar)$1;" -%typemap(directorin, descriptor="B") const signed char & "$input = (jbyte)$1;" -%typemap(directorin, descriptor="S") const unsigned char & "$input = (jshort)$1;" -%typemap(directorin, descriptor="S") const short & "$input = (jshort)$1;" -%typemap(directorin, descriptor="I") const unsigned short & "$input = (jint)$1;" -%typemap(directorin, descriptor="I") const int & "$input = (jint)$1;" -%typemap(directorin, descriptor="J") const unsigned int & "$input = (jlong)$1;" -%typemap(directorin, descriptor="I") const long & "$input = (jint)$1;" -%typemap(directorin, descriptor="J") const unsigned long & "$input = (jlong)$1;" -%typemap(directorin, descriptor="J") const long long & "$input = (jlong)$1;" -%typemap(directorin, descriptor="F") const float & "$input = (jfloat)$1;" -%typemap(directorin, descriptor="D") const double & "$input = (jdouble)$1;" - -%typemap(javadirectorin) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$jniinput" - -%typemap(javadirectorout) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$javacall" - - -%typemap(out) const bool & %{ $result = (jboolean)*$1; %} -%typemap(out) const char & %{ $result = (jchar)*$1; %} -%typemap(out) const signed char & %{ $result = (jbyte)*$1; %} -%typemap(out) const unsigned char & %{ $result = (jshort)*$1; %} -%typemap(out) const short & %{ $result = (jshort)*$1; %} -%typemap(out) const unsigned short & %{ $result = (jint)*$1; %} -%typemap(out) const int & %{ $result = (jint)*$1; %} -%typemap(out) const unsigned int & %{ $result = (jlong)*$1; %} -%typemap(out) const long & %{ $result = (jint)*$1; %} -%typemap(out) const unsigned long & %{ $result = (jlong)*$1; %} -%typemap(out) const long long & %{ $result = (jlong)*$1; %} -%typemap(out) const float & %{ $result = (jfloat)*$1; %} -%typemap(out) const double & %{ $result = (jdouble)*$1; %} - -/* const unsigned long long & */ -/* Similar to unsigned long long */ -%typemap(in) const unsigned long long & ($*1_ltype temp) { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, $input); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - $1 = &temp; - temp = 0; - if (sz > 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; i 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; i", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(*$1>>8*(8-i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - $result = bigint; -} - -%typemap(javadirectorin) const unsigned long long & "$jniinput" -%typemap(javadirectorout) const unsigned long long & "$javacall" - -/* Default handling. Object passed by value. Convert to a pointer */ -%typemap(in) SWIGTYPE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} - -%typemap(directorout) SWIGTYPE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *argp; %} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ *($&1_ltype*)&$result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - *($&1_ltype*)&$result = $1ptr; -} -#endif - -%typemap(directorin,descriptor="L$packagepath/$&javaclassname;") SWIGTYPE -%{ $input = 0; - *(($&1_ltype*)&$input) = new $1_ltype(SWIG_STD_MOVE($1)); %} -%typemap(javadirectorin) SWIGTYPE "new $&javaclassname($jniinput, true)" -%typemap(javadirectorout) SWIGTYPE "$&javaclassname.getCPtr($javacall)" - -/* Generic pointers and references */ -%typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)&$input; %} -%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) { - const char *temp = 0; - if ($input) { - temp = JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!temp) return $null; - } - SWIG_UnpackData(temp, (void *)&$1, sizeof($1)); -} -%typemap(in) SWIGTYPE & %{ $1 = *($&1_ltype)&$input; - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type is null"); - return $null; - } %} -%typemap(in, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ $1 = *($&1_ltype)&$input; - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type is null"); - return $null; - } - rvrdeleter.reset($1); %} -%typemap(out) SWIGTYPE * -%{ *($&1_ltype)&$result = $1; %} -%typemap(out, fragment="SWIG_PackData", noblock=1) SWIGTYPE (CLASS::*) { - char buf[128]; - char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); - *data = '\0'; - $result = JCALL1(NewStringUTF, jenv, buf); -} -%typemap(out) SWIGTYPE & -%{ *($&1_ltype)&$result = $1; %} -%typemap(out) SWIGTYPE && -%{ *($&1_ltype)&$result = $1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * -%{ $result = *($&1_ltype)&$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) -%{ $result = *($&1_ltype)&$input; %} - -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE * -%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE (CLASS::*) -%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & -%{ if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *($&1_ltype)&$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE && -%{ if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *($&1_ltype)&$input; %} -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE & -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE && -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} - -%typemap(javadirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($jniinput == 0) ? null : new $javaclassname($jniinput, false)" -%typemap(javadirectorin) SWIGTYPE & "new $javaclassname($jniinput, false)" -%typemap(javadirectorin) SWIGTYPE && "new $javaclassname($jniinput, false)" -%typemap(javadirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE &, SWIGTYPE && "$javaclassname.getCPtr($javacall)" - -/* Default array handling */ -%typemap(in) SWIGTYPE [] %{ $1 = *($&1_ltype)&$input; %} -%typemap(out) SWIGTYPE [] %{ *($&1_ltype)&$result = $1; %} -%typemap(freearg) SWIGTYPE [ANY], SWIGTYPE [] "" - -/* char arrays - treat as String */ -%typemap(in, noblock=1) char[ANY], char[] { - $1 = 0; - if ($input) { - $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$1) return $null; - } -} - -%typemap(directorout, noblock=1) char[ANY], char[] { - $1 = 0; - if ($input) { - $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$result) return $null; - } -} - -%typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char[ANY], char[] { - $input = 0; - if ($1) { - $input = JCALL1(NewStringUTF, jenv, (const char *)$1); - if (!$input) return $null; - } - Swig::LocalRefGuard $1_refguard(jenv, $input); -} - -%typemap(argout) char[ANY], char[] "" -%typemap(freearg, noblock=1) char[ANY], char[] { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); } -%typemap(out, noblock=1) char[ANY], char[] { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); } -%typemap(javadirectorin) char[ANY], char[] "$jniinput" -%typemap(javadirectorout) char[ANY], char[] "$javacall" - -/* JNI types */ -%typemap(in) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray -%{ $1 = $input; %} - -%typemap(directorout) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray -%{ $result = $input; %} - -%typemap(out) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray -%{ $result = $1; %} - -%typemap(directorin,descriptor="Z") jboolean "$input = $1;" -%typemap(directorin,descriptor="C") jchar "$input = $1;" -%typemap(directorin,descriptor="B") jbyte "$input = $1;" -%typemap(directorin,descriptor="S") jshort "$input = $1;" -%typemap(directorin,descriptor="I") jint "$input = $1;" -%typemap(directorin,descriptor="J") jlong "$input = $1;" -%typemap(directorin,descriptor="F") jfloat "$input = $1;" -%typemap(directorin,descriptor="D") jdouble "$input = $1;" -%typemap(directorin,descriptor="Ljava/lang/String;") jstring "$input = $1;" -%typemap(directorin,descriptor="Ljava/lang/Object;",nouse="1") jobject "$input = $1;" -%typemap(directorin,descriptor="[Z") jbooleanArray "$input = $1;" -%typemap(directorin,descriptor="[C") jcharArray "$input = $1;" -%typemap(directorin,descriptor="[B") jbyteArray "$input = $1;" -%typemap(directorin,descriptor="[S") jshortArray "$input = $1;" -%typemap(directorin,descriptor="[I") jintArray "$input = $1;" -%typemap(directorin,descriptor="[J") jlongArray "$input = $1;" -%typemap(directorin,descriptor="[F") jfloatArray "$input = $1;" -%typemap(directorin,descriptor="[D") jdoubleArray "$input = $1;" -%typemap(directorin,descriptor="[Ljava/lang/Object;",nouse="1") jobjectArray "$input = $1;" - -%typemap(javadirectorin) jboolean, - 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 - "$javacall" - -/* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions - * that cannot be overloaded in Java as more than one C++ type maps to a single Java type */ - -%typecheck(SWIG_TYPECHECK_BOOL) /* Java boolean */ - jboolean, - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) /* Java char */ - jchar, - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) /* Java byte */ - jbyte, - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Java short */ - jshort, - unsigned char, - short, - const unsigned char &, - const short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Java int */ - jint, - unsigned short, - int, - long, - const unsigned short &, - const int &, - const long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Java long */ - jlong, - unsigned int, - unsigned long, - long long, - const unsigned int &, - const unsigned long &, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_INT128) /* Java BigInteger */ - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) /* Java float */ - jfloat, - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) /* Java double */ - jdouble, - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) /* Java String */ - jstring, - char *, - char *&, - char[ANY], - char [] - "" - -%typecheck(SWIG_TYPECHECK_BOOL_ARRAY) /* Java boolean[] */ - jbooleanArray - "" - -%typecheck(SWIG_TYPECHECK_CHAR_ARRAY) /* Java char[] */ - jcharArray - "" - -%typecheck(SWIG_TYPECHECK_INT8_ARRAY) /* Java byte[] */ - jbyteArray - "" - -%typecheck(SWIG_TYPECHECK_INT16_ARRAY) /* Java short[] */ - jshortArray - "" - -%typecheck(SWIG_TYPECHECK_INT32_ARRAY) /* Java int[] */ - jintArray - "" - -%typecheck(SWIG_TYPECHECK_INT64_ARRAY) /* Java long[] */ - jlongArray - "" - -%typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) /* Java float[] */ - jfloatArray - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) /* Java double[] */ - jdoubleArray - "" - -%typecheck(SWIG_TYPECHECK_OBJECT_ARRAY) /* Java jobject[] */ - jobjectArray - "" - -%typecheck(SWIG_TYPECHECK_POINTER) /* Default */ - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE *const&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - - -/* Exception handling */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short -%{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, error_msg); - return $null; %} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(throws) char * -%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1); - return $null; %} - -/* For methods to raise/throw the original Java exception thrown in a director method */ -%typemap(throws) Swig::DirectorException -%{ $1.throwException(jenv); - return $null; %} - -/* Java to C++ DirectorException should already be handled. Suppress warning and do nothing in the - event a user specifies a global: %catches(Swig::DirectorException); */ -%typemap(directorthrows) Swig::DirectorException "" - -/* Typemaps for code generation in proxy classes and Java type wrapper classes */ - -/* The javain typemap is used for converting function parameter types from the type - * used in the proxy, module or type wrapper class to the type used in the JNI class. */ -%typemap(javain) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double & - "$javainput" -%typemap(javain) char *, char *&, char[ANY], char[] "$javainput" -%typemap(javain) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray - "$javainput" -%typemap(javain) SWIGTYPE "$&javaclassname.getCPtr($javainput)" -%typemap(javain) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$javaclassname.getCPtr($javainput)" -%typemap(javain) SWIGTYPE && "$javaclassname.swigRelease($javainput)" -%typemap(javain) SWIGTYPE (CLASS::*) "$javaclassname.getCMemberPtr($javainput)" - -/* The javaout typemap is used for converting function return types from the return type - * used in the JNI class to the type returned by the proxy, module or type wrapper class. */ -%typemap(javaout) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double & { - return $jnicall; - } -%typemap(javaout) char *, char *&, char[ANY], char[] { - return $jnicall; - } -%typemap(javaout) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray { - return $jnicall; - } -%typemap(javaout) void { - $jnicall; - } -%typemap(javaout) SWIGTYPE { - return new $&javaclassname($jnicall, true); - } -%typemap(javaout) SWIGTYPE & { - return new $javaclassname($jnicall, $owner); - } -%typemap(javaout) SWIGTYPE && { - return new $javaclassname($jnicall, $owner); - } -%typemap(javaout) SWIGTYPE *, SWIGTYPE [] { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner); - } -%typemap(javaout) SWIGTYPE (CLASS::*) { - String cMemberPtr = $jnicall; - return (cMemberPtr == null) ? null : new $javaclassname(cMemberPtr, $owner); - } - -/* Pointer reference typemaps */ -%typemap(jni) SWIGTYPE *const& "jlong" -%typemap(jtype) SWIGTYPE *const& "long" -%typemap(jstype) SWIGTYPE *const& "$*javaclassname" -%typemap(javain) SWIGTYPE *const& "$*javaclassname.getCPtr($javainput)" -%typemap(javaout) SWIGTYPE *const& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $*javaclassname(cPtr, $owner); - } -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ temp = *($1_ltype)&$input; - $1 = ($1_ltype)&temp; %} -%typemap(out) SWIGTYPE *const& -%{ *($1_ltype)&$result = *$1; %} -%typemap(directorin,descriptor="L$packagepath/$*javaclassname;") SWIGTYPE *const& -%{ *(($1_ltype)&$input) = ($*1_ltype) $1; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = *($1_ltype)&$input; - $result = &swig_temp; %} -%typemap(javadirectorin) SWIGTYPE *const& "($jniinput == 0) ? null : new $*javaclassname($jniinput, false)" -%typemap(javadirectorout) SWIGTYPE *const& "$*javaclassname.getCPtr($javacall)" - -/* Typemaps used for the generation of proxy and type wrapper class code */ -%typemap(javabase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javaclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class" -%typemap(javacode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javaimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javainterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javainterfacemodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public interface" - -/* javabody typemaps */ - -%define SWIG_JAVABODY_METHODS(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE) %enddef // legacy name - -%define SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY static long swigRelease($javaclassname obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGUpcast(cPtr), cMemoryOwn); - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY static long swigRelease($javaclassname obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } -%} -%enddef - -%define SWIG_JAVABODY_TYPEWRAPPER(PTRCTOR_VISIBILITY, DEFAULTCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Typewrapper classes -%typemap(javabody) TYPE *, TYPE &, TYPE &&, TYPE [] %{ - private transient long swigCPtr; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - DEFAULTCTOR_VISIBILITY $javaclassname() { - swigCPtr = 0; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY static long swigRelease($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -%typemap(javabody) TYPE (CLASS::*) %{ - private transient String swigCMemberPtr; - - PTRCTOR_VISIBILITY $javaclassname(String cMemberPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCMemberPtr = cMemberPtr; - } - - DEFAULTCTOR_VISIBILITY $javaclassname() { - swigCMemberPtr = null; - } - - CPTR_VISIBILITY static String getCMemberPtr($javaclassname obj) { - return obj.swigCMemberPtr; - } -%} -%enddef - -/* Set the default javabody typemaps to use protected visibility. - Use the macros to change to public if using multiple modules. */ -SWIG_JAVABODY_PROXY(protected, protected, SWIGTYPE) -SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE) - -%typemap(javafinalize) SWIGTYPE %{ - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } -%} - -/* - * Java constructor typemaps: - * - * The javaconstruct typemap is inserted when a proxy class's constructor is generated. - * This typemap allows control over what code is executed in the constructor as - * well as specifying who owns the underlying C/C++ object. Normally, Java has - * ownership and the underlying C/C++ object is deallocated when the Java object - * is finalized (swigCMemOwn is true.) If swigCMemOwn is false, C/C++ is - * ultimately responsible for deallocating the underlying object's memory. - * - * The SWIG_PROXY_CONSTRUCTOR macro defines the javaconstruct typemap for a proxy - * class for a particular TYPENAME. OWNERSHIP is passed as the value of - * swigCMemOwn to the pointer constructor method. WEAKREF determines which kind - * of Java object reference will be used by the C++ director class (WeakGlobalRef - * vs. GlobalRef.) - * - * The SWIG_DIRECTOR_OWNED macro sets the ownership of director-based proxy - * classes and the weak reference flag to false, meaning that the underlying C++ - * object will be reclaimed by C++. - */ - -%define SWIG_PROXY_CONSTRUCTOR(OWNERSHIP, WEAKREF, TYPENAME...) -%typemap(javaconstruct,directorconnect="\n $imclassname.$javaclazznamedirector_connect(this, swigCPtr, OWNERSHIP, WEAKREF);") TYPENAME { - this($imcall, OWNERSHIP);$directorconnect - } -%enddef - -%define SWIG_DIRECTOR_OWNED(TYPENAME...) -SWIG_PROXY_CONSTRUCTOR(true, false, TYPENAME) -%enddef - -// Set the default for SWIGTYPE: Java owns the C/C++ object. -SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - $jnicall; - } - swigCPtr = 0; - } - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - $jnicall; - } - swigCPtr = 0; - } - super.delete(); - } - -%typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{ - protected void $methodname() { - swigCMemOwn = false; - $jnicall; - } -%} - -%typemap(directorowner_release, methodname="swigReleaseOwnership") SWIGTYPE %{ - public void $methodname() { - swigCMemOwn = false; - $jnicall; - } -%} - -%typemap(directorowner_take, methodname="swigTakeOwnership") SWIGTYPE %{ - public void $methodname() { - swigCMemOwn = true; - $jnicall; - } -%} - -/* Java specific directives */ -#define %javaconst(flag) %feature("java:const","flag") -#define %javaconstvalue(value) %feature("java:constvalue",value) -#define %javaenum(wrapapproach) %feature("java:enum","wrapapproach") -#define %javamethodmodifiers %feature("java:methodmodifiers") -#define %javaexception(exceptionclasses) %feature("except",throws=exceptionclasses) -#define %nojavaexception %feature("except","0",throws="") -#define %clearjavaexception %feature("except","",throws="") -#define %proxycode %insert("proxycode") - -%pragma(java) jniclassclassmodifiers="public class" -%pragma(java) moduleclassmodifiers="public class" - -/* Some ANSI C typemaps */ - -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* String & length */ -%typemap(jni) (const char *STRING, size_t LENGTH) "jbyteArray" -%typemap(jtype) (const char *STRING, size_t LENGTH) "byte[]" -%typemap(jstype) (const char *STRING, size_t LENGTH) "byte[]" -%typemap(javain) (const char *STRING, size_t LENGTH) "$javainput" -%typemap(freearg) (const char *STRING, size_t LENGTH) "" -%typemap(in) (const char *STRING, size_t LENGTH) { - if ($input) { - $1 = ($1_ltype) JCALL2(GetByteArrayElements, jenv, $input, 0); - $2 = ($2_type) JCALL1(GetArrayLength, jenv, $input); - } else { - $1 = 0; - $2 = 0; - } -} -%typemap(argout) (const char *STRING, size_t LENGTH) { - if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, JNI_ABORT); -} -%typemap(directorin, descriptor="[B", noblock=1) (const char *STRING, size_t LENGTH) { - $input = 0; - if ($1) { - $input = JCALL1(NewByteArray, jenv, (jsize)$2); - if (!$input) return $null; - JCALL4(SetByteArrayRegion, jenv, $input, 0, (jsize)$2, (jbyte *)$1); - } - Swig::LocalRefGuard $1_refguard(jenv, $input); -} -%typemap(javadirectorin, descriptor="[B") (const char *STRING, size_t LENGTH) "$jniinput" -%apply (const char *STRING, size_t LENGTH) { (char *STRING, size_t LENGTH) } -/* Enable write-back for non-const version */ -%typemap(argout) (char *STRING, size_t LENGTH) { - if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0); -} -%typemap(directorargout, noblock=1) (char *STRING, size_t LENGTH) -{ if ($input && $1) JCALL4(GetByteArrayRegion, jenv, $input, 0, (jsize)$2, (jbyte *)$1); } -%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) } - -/* java keywords */ -%include - -// Default enum handling -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/java/javahead.swg b/linux/bin/swig/share/swig/4.1.0/java/javahead.swg deleted file mode 100755 index 758a037d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/javahead.swg +++ /dev/null @@ -1,91 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javahead.swg - * - * Java support code - * ----------------------------------------------------------------------------- */ - - -/* JNI function calls require different calling conventions for C and C++. These JCALL macros are used so - * that the same typemaps can be used for generating code for both C and C++. The SWIG preprocessor can expand - * the macros thereby generating the correct calling convention. It is thus essential that all typemaps that - * use the macros are not within %{ %} brackets as they won't be run through the SWIG preprocessor. */ -#ifdef __cplusplus -# define JCALL0(func, jenv) jenv->func() -# define JCALL1(func, jenv, ar1) jenv->func(ar1) -# define JCALL2(func, jenv, ar1, ar2) jenv->func(ar1, ar2) -# define JCALL3(func, jenv, ar1, ar2, ar3) jenv->func(ar1, ar2, ar3) -# define JCALL4(func, jenv, ar1, ar2, ar3, ar4) jenv->func(ar1, ar2, ar3, ar4) -# define JCALL5(func, jenv, ar1, ar2, ar3, ar4, ar5) jenv->func(ar1, ar2, ar3, ar4, ar5) -# define JCALL6(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6) jenv->func(ar1, ar2, ar3, ar4, ar5, ar6) -# define JCALL7(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) jenv->func(ar1, ar2, ar3, ar4, ar5, ar6, ar7) -#else -# define JCALL0(func, jenv) (*jenv)->func(jenv) -# define JCALL1(func, jenv, ar1) (*jenv)->func(jenv, ar1) -# define JCALL2(func, jenv, ar1, ar2) (*jenv)->func(jenv, ar1, ar2) -# define JCALL3(func, jenv, ar1, ar2, ar3) (*jenv)->func(jenv, ar1, ar2, ar3) -# define JCALL4(func, jenv, ar1, ar2, ar3, ar4) (*jenv)->func(jenv, ar1, ar2, ar3, ar4) -# define JCALL5(func, jenv, ar1, ar2, ar3, ar4, ar5) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5) -# define JCALL6(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5, ar6) -# define JCALL7(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) -#endif - -%insert(runtime) %{ -#include -#include -#include -%} - -%insert(runtime) %{ -/* Support for throwing Java exceptions */ -typedef enum { - SWIG_JavaOutOfMemoryError = 1, - SWIG_JavaIOException, - SWIG_JavaRuntimeException, - SWIG_JavaIndexOutOfBoundsException, - SWIG_JavaArithmeticException, - SWIG_JavaIllegalArgumentException, - SWIG_JavaNullPointerException, - SWIG_JavaDirectorPureVirtual, - SWIG_JavaUnknownError, - SWIG_JavaIllegalStateException, -} SWIG_JavaExceptionCodes; - -typedef struct { - SWIG_JavaExceptionCodes code; - const char *java_exception; -} SWIG_JavaExceptions_t; -%} - -%insert(runtime) { -static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { - jclass excep; - static const SWIG_JavaExceptions_t java_exceptions[] = { - { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, - { SWIG_JavaIOException, "java/io/IOException" }, - { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, - { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, - { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, - { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, - { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, - { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, - { SWIG_JavaUnknownError, "java/lang/UnknownError" }, - { SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" }, - { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } - }; - const SWIG_JavaExceptions_t *except_ptr = java_exceptions; - - while (except_ptr->code != code && except_ptr->code) - except_ptr++; - - JCALL0(ExceptionClear, jenv); - excep = JCALL1(FindClass, jenv, except_ptr->java_exception); - if (excep) - JCALL2(ThrowNew, jenv, excep, msg); -} -} - -%insert(runtime) %{ -/* Contract support */ - -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } } while (0) -%} diff --git a/linux/bin/swig/share/swig/4.1.0/java/javakw.swg b/linux/bin/swig/share/swig/4.1.0/java/javakw.swg deleted file mode 100755 index 8a5b76ee..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/javakw.swg +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef JAVA_JAVAKW_SWG_ -#define JAVA_JAVAKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVAKW(x) %keywordwarn("'" `x` "' is a java keyword",rename="_%s") `x` - -/* - from - http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html -*/ - -JAVAKW(abstract); -JAVAKW(double); -JAVAKW(int); -JAVAKW(strictfp); -JAVAKW(boolean); -JAVAKW(else); -JAVAKW(interface); -JAVAKW(super); -JAVAKW(break); -JAVAKW(extends); -JAVAKW(long); -JAVAKW(switch); -JAVAKW(byte); -JAVAKW(final); -JAVAKW(native); -JAVAKW(synchronized); -JAVAKW(case); -JAVAKW(finally); -JAVAKW(new); -JAVAKW(this); -JAVAKW(catch); -JAVAKW(float); -JAVAKW(package); -JAVAKW(throw); -JAVAKW(char); -JAVAKW(for); -JAVAKW(private); -JAVAKW(throws); -JAVAKW(class); -JAVAKW(goto); -JAVAKW(protected); -JAVAKW(transient); -JAVAKW(const); -JAVAKW(if); -JAVAKW(public); -JAVAKW(try); -JAVAKW(continue); -JAVAKW(implements); -JAVAKW(return); -JAVAKW(void); -JAVAKW(default); -JAVAKW(import); -JAVAKW(short); -JAVAKW(volatile); -JAVAKW(do); -JAVAKW(instanceof); -JAVAKW(static); -JAVAKW(while); - - -/* others bad names */ - -/* Note here that only *::clone() is bad, and *::clone(int) is ok */ -%namewarn("321:clone() is a java bad method name") *::clone(); - - -#undef JAVAKW - -#endif //JAVA_JAVAKW_SWG_ diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_array.i b/linux/bin/swig/share/swig/4.1.0/java/std_array.i deleted file mode 100755 index d3436cc6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_array.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_array.i - * ----------------------------------------------------------------------------- */ - -%include - -namespace std { - - template class array { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - array(); - array(const array& other); - - size_type size() const; - %rename(isEmpty) empty; - bool empty() const; - void fill(const T& u); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i "jlong" -%typemap (jtype) std::auto_ptr< TYPE > "long" -%typemap (jstype) std::auto_ptr< TYPE > "$typemap(jstype, TYPE)" - -%typemap(in) std::auto_ptr< TYPE > (TYPE *auto_temp) -%{ auto_temp = *(TYPE **)&$input; - $1.reset(auto_temp); %} - -%typemap(javain) std::auto_ptr< TYPE > "$typemap(jstype, TYPE).swigRelease($javainput)" - -%typemap (out) std::auto_ptr< TYPE > %{ - jlong lpp = 0; - *(TYPE **) &lpp = $1.release(); - $result = lpp; -%} - -%typemap(javaout) std::auto_ptr< TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_common.i b/linux/bin/swig/share/swig/4.1.0/java/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_deque.i b/linux/bin/swig/share/swig/4.1.0/java/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_except.i b/linux/bin/swig/share/swig/4.1.0/java/std_except.i deleted file mode 100755 index 91d2f92c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_except.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. - * These typemaps are used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws) std::bad_cast "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::bad_exception "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::domain_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::exception "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::invalid_argument "SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, $1.what());\n return $null;" -%typemap(throws) std::length_error "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" -%typemap(throws) std::logic_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::out_of_range "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" -%typemap(throws) std::overflow_error "SWIG_JavaThrowException(jenv, SWIG_JavaArithmeticException, $1.what());\n return $null;" -%typemap(throws) std::range_error "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" -%typemap(throws) std::runtime_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::underflow_error "SWIG_JavaThrowException(jenv, SWIG_JavaArithmeticException, $1.what());\n return $null;" - diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_list.i b/linux/bin/swig/share/swig/4.1.0/java/std_list.i deleted file mode 100755 index 1077bd0a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_list.i +++ /dev/null @@ -1,225 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list. - * The Java proxy class extends java.util.AbstractSequentialList. The std::list - * container looks and feels much like a java.util.LinkedList from Java. - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -%fragment("SWIG_ListSize", "header", fragment="SWIG_JavaIntFromSize_t") { -SWIGINTERN jint SWIG_ListSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) - throw std::out_of_range("list size is too large to fit into a Java int"); - return sz; -} -} - -%javamethodmodifiers std::list::begin "private"; -%javamethodmodifiers std::list::insert "private"; -%javamethodmodifiers std::list::doSize "private"; -%javamethodmodifiers std::list::doPreviousIndex "private"; -%javamethodmodifiers std::list::doNextIndex "private"; -%javamethodmodifiers std::list::doHasNext "private"; - -// Match Java style better: -%rename(Iterator) std::list::iterator; - -%nodefaultctor std::list::iterator; - -namespace std { - template class list { - -%typemap(javabase) std::list "java.util.AbstractSequentialList<$typemap(jboxtype, T)>" -%proxycode %{ - public $javaclassname(java.util.Collection c) { - this(); - java.util.ListIterator<$typemap(jboxtype, T)> it = listIterator(0); - // Special case the "copy constructor" here to avoid lots of cross-language calls - for (java.lang.Object o : c) { - it.add(($typemap(jboxtype, T))o); - } - } - - public int size() { - return doSize(); - } - - public boolean add($typemap(jboxtype, T) value) { - addLast(value); - return true; - } - - public java.util.ListIterator<$typemap(jboxtype, T)> listIterator(int index) { - return new java.util.ListIterator<$typemap(jboxtype, T)>() { - private Iterator pos; - private Iterator last; - - private java.util.ListIterator<$typemap(jboxtype, T)> init(int index) { - if (index < 0 || index > $javaclassname.this.size()) - throw new IndexOutOfBoundsException("Index: " + index); - pos = $javaclassname.this.begin(); - pos = pos.advance_unchecked(index); - return this; - } - - public void add($typemap(jboxtype, T) v) { - // Technically we can invalidate last here, but this makes more sense - last = $javaclassname.this.insert(pos, v); - } - - public void set($typemap(jboxtype, T) v) { - if (null == last) { - throw new IllegalStateException(); - } - last.set_unchecked(v); - } - - public void remove() { - if (null == last) { - throw new IllegalStateException(); - } - $javaclassname.this.remove(last); - last = null; - } - - public int previousIndex() { - return $javaclassname.this.doPreviousIndex(pos); - } - - public int nextIndex() { - return $javaclassname.this.doNextIndex(pos); - } - - public $typemap(jboxtype, T) previous() { - if (previousIndex() < 0) { - throw new java.util.NoSuchElementException(); - } - last = pos; - pos = pos.previous_unchecked(); - return last.deref_unchecked(); - } - - public $typemap(jboxtype, T) next() { - if (!hasNext()) { - throw new java.util.NoSuchElementException(); - } - last = pos; - pos = pos.next_unchecked(); - return last.deref_unchecked(); - } - - public boolean hasPrevious() { - // This call to previousIndex() will be much slower than the hasNext() implementation, but it's simpler like this with C++ forward iterators - return previousIndex() != -1; - } - - public boolean hasNext() { - return $javaclassname.this.doHasNext(pos); - } - }.init(index); - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - /* - * We'd actually be better off having the nested class *not* be static in the wrapper - * output, but this doesn't actually remove the $static from the nested class still. - * (This would allow us to somewhat simplify the implementation of the ListIterator - * interface and give "natural" semantics to Java users of the C++ iterator) - */ - //%typemap(javaclassmodifiers) iterator "public class" - //%typemap(javainterfaces) iterator "java.util.ListIterator<$typemap(jboxtype, T)>" - - struct iterator { - %extend { - void set_unchecked(const T &v) { - **$self = v; - } - - iterator next_unchecked() const { - std::list::iterator ret = *$self; - ++ret; - return ret; - } - - iterator previous_unchecked() const { - std::list::iterator ret = *$self; - --ret; - return ret; - } - - T deref_unchecked() const { - return **$self; - } - - iterator advance_unchecked(size_type index) const { - std::list::iterator ret = *$self; - std::advance(ret, index); - return ret; - } - } - }; - - list(); - list(const list& other); - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(remove) erase; - iterator erase(iterator pos); - %rename(removeLast) pop_back; - void pop_back(); - %rename(removeFirst) pop_front; - void pop_front(); - %rename(addLast) push_back; - void push_back(const T &value); - %rename(addFirst) push_front; - void push_front(const T &value); - iterator begin(); - iterator end(); - iterator insert(iterator pos, const T &value); - - %extend { - %fragment("SWIG_ListSize"); - - list(jint count, const T &value) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("list count must be positive"); - return new std::list(static_cast::size_type>(count), value); - } - - jint doSize() const throw (std::out_of_range) { - return SWIG_ListSize(self->size()); - } - - jint doPreviousIndex(const iterator &pos) const throw (std::out_of_range) { - return pos == self->begin() ? -1 : SWIG_ListSize(std::distance(self->begin(), static_cast::const_iterator>(pos))); - } - - jint doNextIndex(const iterator &pos) const throw (std::out_of_range) { - return pos == self->end() ? SWIG_ListSize(self->size()) : SWIG_ListSize(std::distance(self->begin(), static_cast::const_iterator>(pos))); - } - - bool doHasNext(const iterator &pos) const { - return pos != $self->end(); - } - } - }; -} diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_map.i b/linux/bin/swig/share/swig/4.1.0/java/std_map.i deleted file mode 100755 index 6d5ca1aa..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_map.i +++ /dev/null @@ -1,224 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * The Java proxy class extends java.util.AbstractMap. The std::map - * container looks and feels much like a java.util.HashMap from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_MapSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_MapSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("map size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::map::sizeImpl "private"; -%javamethodmodifiers std::map::containsImpl "private"; -%javamethodmodifiers std::map::putUnchecked "private"; -%javamethodmodifiers std::map::removeUnchecked "private"; -%javamethodmodifiers std::map::find "private"; -%javamethodmodifiers std::map::begin "private"; -%javamethodmodifiers std::map::end "private"; - -%rename(Iterator) std::map::iterator; -%nodefaultctor std::map::iterator; -%javamethodmodifiers std::map::iterator::getNextUnchecked "private"; -%javamethodmodifiers std::map::iterator::isNot "private"; -%javamethodmodifiers std::map::iterator::getKey "private"; -%javamethodmodifiers std::map::iterator::getValue "private"; -%javamethodmodifiers std::map::iterator::setValue "private"; - -namespace std { - -template > class map { - -%typemap(javabase) std::map< K, T, C > - "java.util.AbstractMap<$typemap(jboxtype, K), $typemap(jboxtype, T)>" - -%proxycode %{ - - public int size() { - return sizeImpl(); - } - - public boolean containsKey(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return false; - } - - return containsImpl(($typemap(jboxtype, K))key); - } - - public $typemap(jboxtype, T) get(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - return itr.getValue(); - } - - return null; - } - - public $typemap(jboxtype, T) put($typemap(jboxtype, K) key, $typemap(jboxtype, T) value) { - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - itr.setValue(value); - return oldValue; - } else { - putUnchecked(key, value); - return null; - } - } - - public $typemap(jboxtype, T) remove(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - removeUnchecked(itr); - return oldValue; - } else { - return null; - } - } - - public java.util.Set> entrySet() { - java.util.Set> setToReturn = - new java.util.HashSet>(); - - Iterator itr = begin(); - final Iterator end = end(); - while (itr.isNot(end)) { - setToReturn.add(new Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)>() { - private Iterator iterator; - - private Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)> init(Iterator iterator) { - this.iterator = iterator; - return this; - } - - public $typemap(jboxtype, K) getKey() { - return iterator.getKey(); - } - - public $typemap(jboxtype, T) getValue() { - return iterator.getValue(); - } - - public $typemap(jboxtype, T) setValue($typemap(jboxtype, T) newValue) { - $typemap(jboxtype, T) oldValue = iterator.getValue(); - iterator.setValue(newValue); - return oldValue; - } - }.init(itr)); - itr = itr.getNextUnchecked(); - } - - return setToReturn; - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - std::map< K, T, C >::iterator getNextUnchecked() { - std::map< K, T, C >::iterator copy = (*$self); - return ++copy; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - - K getKey() const { - return (*$self)->first; - } - - T getValue() const { - return (*$self)->second; - } - - void setValue(const T& newValue) { - (*$self)->second = newValue; - } - } - }; - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator find(const K& key); - iterator begin(); - iterator end(); - %extend { - %fragment("SWIG_MapSize"); - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_MapSize(self->size()); - } - - bool containsImpl(const K& key) { - return (self->count(key) > 0); - } - - void putUnchecked(const K& key, const T& value) { - (*self)[key] = value; - } - - void removeUnchecked(const std::map< K, T, C >::iterator itr) { - self->erase(itr); - } - } -}; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_pair.i b/linux/bin/swig/share/swig/4.1.0/java/std_pair.i deleted file mode 100755 index 75ad3031..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_pair.i +++ /dev/null @@ -1,37 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_set.i b/linux/bin/swig/share/swig/4.1.0/java/std_set.i deleted file mode 100755 index 053866bc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_set.i +++ /dev/null @@ -1,207 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_set.i - * - * SWIG typemaps for std::set - * The Java proxy class extends java.util.AbstractSet. The std::set - * container looks and feels much like a java.util.HashSet from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::set -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_SetSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_SetSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("set size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::set::sizeImpl "private"; -%javamethodmodifiers std::set::containsImpl "private"; -%javamethodmodifiers std::set::removeImpl "private"; -%javamethodmodifiers std::set::hasNextImpl "private"; -%javamethodmodifiers std::set::begin "private"; -%javamethodmodifiers std::set::end "private"; - -%rename(Iterator) std::set::iterator; -%nodefaultctor std::set::iterator; -%javamethodmodifiers std::set::iterator::incrementUnchecked "private"; -%javamethodmodifiers std::set::iterator::derefUnchecked "private"; -%javamethodmodifiers std::set::iterator::isNot "private"; - -namespace std { - -template -class set { - -%typemap(javabase) std::set "java.util.AbstractSet<$typemap(jboxtype, T)>" -%proxycode %{ - public $javaclassname(java.util.Collection collection) { - this(); - addAll(collection); - } - - public int size() { - return sizeImpl(); - } - - public boolean add($typemap(jboxtype, T) key) { - return addImpl(key); - } - - public boolean addAll(java.util.Collection collection) { - boolean didAddElement = false; - for (java.lang.Object object : collection) { - didAddElement |= add(($typemap(jboxtype, T))object); - } - - return didAddElement; - } - - public java.util.Iterator<$typemap(jboxtype, T)> iterator() { - return new java.util.Iterator<$typemap(jboxtype, T)>() { - private Iterator curr; - private Iterator end; - - private java.util.Iterator<$typemap(jboxtype, T)> init() { - curr = $javaclassname.this.begin(); - end = $javaclassname.this.end(); - return this; - } - - public $typemap(jboxtype, T) next() { - if (!hasNext()) { - throw new java.util.NoSuchElementException(); - } - - // Save the current position, increment it, - // then return the value at the position before the increment. - final $typemap(jboxtype, T) currValue = curr.derefUnchecked(); - curr.incrementUnchecked(); - return currValue; - } - - public boolean hasNext() { - return curr.isNot(end); - } - - public void remove() { - throw new java.lang.UnsupportedOperationException(); - } - }.init(); - } - - public boolean containsAll(java.util.Collection collection) { - for (java.lang.Object object : collection) { - if (!contains(object)) { - return false; - } - } - - return true; - } - - public boolean contains(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, T))) { - return false; - } - - return containsImpl(($typemap(jboxtype, T))object); - } - - public boolean removeAll(java.util.Collection collection) { - boolean didRemoveElement = false; - for (java.lang.Object object : collection) { - didRemoveElement |= remove(object); - } - - return didRemoveElement; - } - - public boolean remove(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, T))) { - return false; - } - - return removeImpl(($typemap(jboxtype, T))object); - } -%} - - public: - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - void incrementUnchecked() { - ++(*$self); - } - - T derefUnchecked() const { - return **$self; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - } - }; - - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T key_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - set(); - set(const set& other); - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator begin(); - iterator end(); - - %extend { - %fragment("SWIG_SetSize"); - - // Returns whether item was inserted. - bool addImpl(const T& key) { - return self->insert(key).second; - } - - // Returns whether set contains key. - bool containsImpl(const T& key) { - return (self->count(key) > 0); - } - - // Returns whether the item was erased. - bool removeImpl(const T& key) { - return (self->erase(key) > 0); - } - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_SetSize(self->size()); - } - - bool hasNextImpl(const iterator& itr) const { - return (itr != $self->end()); - } - } -}; - -} diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/java/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_string.i b/linux/bin/swig/share/swig/4.1.0/java/std_string.i deleted file mode 100755 index 830a8961..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_string.i +++ /dev/null @@ -1,121 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a Java String and are passed around by value. - * - * To use non-const std::string references use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -// string -%typemap(jni) string "jstring" -%typemap(jtype) string "String" -%typemap(jstype) string "String" -%typemap(javadirectorin) string "$jniinput" -%typemap(javadirectorout) string "$javacall" - -%typemap(in) string -%{ if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - $1.assign($1_pstr); - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorout) string -%{ if(!$input) { - if (!jenv->ExceptionCheck()) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - } - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - $result.assign($1_pstr); - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorin,descriptor="Ljava/lang/String;") string -%{ $input = jenv->NewStringUTF($1.c_str()); - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(out) string -%{ $result = jenv->NewStringUTF($1.c_str()); %} - -%typemap(javain) string "$javainput" - -%typemap(javaout) string { - return $jnicall; - } - -%typemap(typecheck) string = char *; - -%typemap(throws) string -%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); - return $null; %} - -// const string & -%typemap(jni) const string & "jstring" -%typemap(jtype) const string & "String" -%typemap(jstype) const string & "String" -%typemap(javadirectorin) const string & "$jniinput" -%typemap(javadirectorout) const string & "$javacall" - -%typemap(in) const string & -%{ if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - $*1_ltype $1_str($1_pstr); - $1 = &$1_str; - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - /* possible thread/reentrant code problem */ - static $*1_ltype $1_str; - $1_str = $1_pstr; - $result = &$1_str; - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorin,descriptor="Ljava/lang/String;") const string & -%{ $input = jenv->NewStringUTF($1.c_str()); - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(out) const string & -%{ $result = jenv->NewStringUTF($1->c_str()); %} - -%typemap(javain) const string & "$javainput" - -%typemap(javaout) const string & { - return $jnicall; - } - -%typemap(typecheck) const string & = char *; - -%typemap(throws) const string & -%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); - return $null; %} - -} - diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/java/std_unique_ptr.i deleted file mode 100755 index 838ca495..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_unique_ptr.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) - -%typemap (jni) std::unique_ptr< TYPE > "jlong" -%typemap (jtype) std::unique_ptr< TYPE > "long" -%typemap (jstype) std::unique_ptr< TYPE > "$typemap(jstype, TYPE)" - -%typemap(in) std::unique_ptr< TYPE > (TYPE *unique_temp) -%{ unique_temp = *(TYPE **)&$input; - $1.reset(unique_temp); %} - -%typemap(javain) std::unique_ptr< TYPE > "$typemap(jstype, TYPE).swigRelease($javainput)" - -%typemap (out) std::unique_ptr< TYPE > %{ - jlong lpp = 0; - *(TYPE **) &lpp = $1.release(); - $result = lpp; -%} - -%typemap(javaout) std::unique_ptr< TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_unordered_map.i b/linux/bin/swig/share/swig/4.1.0/java/std_unordered_map.i deleted file mode 100755 index 283a9b46..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_unordered_map.i +++ /dev/null @@ -1,211 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unordered_map.i - * - * SWIG typemaps for std::unordered_map - * The Java proxy class extends java.util.AbstractMap. The std::unordered_map - * container looks and feels much like a java.util.HashMap from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::unordered_map -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_MapSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_MapSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("map size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::unordered_map::sizeImpl "private"; -%javamethodmodifiers std::unordered_map::containsImpl "private"; -%javamethodmodifiers std::unordered_map::putUnchecked "private"; -%javamethodmodifiers std::unordered_map::removeUnchecked "private"; -%javamethodmodifiers std::unordered_map::find "private"; -%javamethodmodifiers std::unordered_map::begin "private"; -%javamethodmodifiers std::unordered_map::end "private"; - -%rename(Iterator) std::unordered_map::iterator; -%nodefaultctor std::unordered_map::iterator; -%javamethodmodifiers std::unordered_map::iterator::getNextUnchecked "private"; -%javamethodmodifiers std::unordered_map::iterator::isNot "private"; -%javamethodmodifiers std::unordered_map::iterator::getKey "private"; -%javamethodmodifiers std::unordered_map::iterator::getValue "private"; -%javamethodmodifiers std::unordered_map::iterator::setValue "private"; - -namespace std { - -template class unordered_map { - -%typemap(javabase) std::unordered_map - "java.util.AbstractMap<$typemap(jboxtype, K), $typemap(jboxtype, T)>" - -%proxycode %{ - - public int size() { - return sizeImpl(); - } - - public boolean containsKey(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return false; - } - - return containsImpl(($typemap(jboxtype, K))key); - } - - public $typemap(jboxtype, T) get(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - return itr.getValue(); - } - - return null; - } - - public $typemap(jboxtype, T) put($typemap(jboxtype, K) key, $typemap(jboxtype, T) value) { - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - itr.setValue(value); - return oldValue; - } else { - putUnchecked(key, value); - return null; - } - } - - public $typemap(jboxtype, T) remove(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - removeUnchecked(itr); - return oldValue; - } else { - return null; - } - } - - public java.util.Set> entrySet() { - java.util.Set> setToReturn = - new java.util.HashSet>(); - - Iterator itr = begin(); - final Iterator end = end(); - while (itr.isNot(end)) { - setToReturn.add(new Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)>() { - private Iterator iterator; - - private Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)> init(Iterator iterator) { - this.iterator = iterator; - return this; - } - - public $typemap(jboxtype, K) getKey() { - return iterator.getKey(); - } - - public $typemap(jboxtype, T) getValue() { - return iterator.getValue(); - } - - public $typemap(jboxtype, T) setValue($typemap(jboxtype, T) newValue) { - $typemap(jboxtype, T) oldValue = iterator.getValue(); - iterator.setValue(newValue); - return oldValue; - } - }.init(itr)); - itr = itr.getNextUnchecked(); - } - - return setToReturn; - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - unordered_map(); - unordered_map(const unordered_map& other); - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - std::unordered_map< K, T >::iterator getNextUnchecked() { - std::unordered_map< K, T >::iterator copy = (*$self); - return ++copy; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - - K getKey() const { - return (*$self)->first; - } - - T getValue() const { - return (*$self)->second; - } - - void setValue(const T& newValue) { - (*$self)->second = newValue; - } - } - }; - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator find(const K& key); - iterator begin(); - iterator end(); - %extend { - %fragment("SWIG_MapSize"); - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_MapSize(self->size()); - } - - bool containsImpl(const K& key) { - return (self->count(key) > 0); - } - - void putUnchecked(const K& key, const T& value) { - (*self)[key] = value; - } - - void removeUnchecked(const std::unordered_map< K, T >::iterator itr) { - self->erase(itr); - } - } -}; - -} diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_unordered_set.i b/linux/bin/swig/share/swig/4.1.0/java/std_unordered_set.i deleted file mode 100755 index ddcedf05..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_unordered_set.i +++ /dev/null @@ -1,203 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unordered_set.i - * - * SWIG typemaps for std::unordered_set - * The Java proxy class extends java.util.AbstractSet. The std::unordered_set - * container looks and feels much like a java.util.HashSet from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::unordered_set -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_UnorderedSetSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_UnorderedSetSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("unordered_set size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::unordered_set::sizeImpl "private"; -%javamethodmodifiers std::unordered_set::containsImpl "private"; -%javamethodmodifiers std::unordered_set::removeImpl "private"; -%javamethodmodifiers std::unordered_set::hasNextImpl "private"; -%javamethodmodifiers std::unordered_set::begin "private"; -%javamethodmodifiers std::unordered_set::end "private"; - -%rename(Iterator) std::unordered_set::iterator; -%nodefaultctor std::unordered_set::iterator; -%javamethodmodifiers std::unordered_set::iterator::incrementUnchecked "private"; -%javamethodmodifiers std::unordered_set::iterator::derefUnchecked "private"; -%javamethodmodifiers std::unordered_set::iterator::isNot "private"; - -namespace std { - -template -class unordered_set { - -%typemap(javabase) std::unordered_set "java.util.AbstractSet<$typemap(jboxtype, Key)>" -%proxycode %{ - public $javaclassname(java.util.Collection collection) { - this(); - addAll(collection); - } - - public int size() { - return sizeImpl(); - } - - public boolean addAll(java.util.Collection collection) { - boolean didAddElement = false; - for (java.lang.Object object : collection) { - didAddElement |= add(($typemap(jboxtype, Key))object); - } - - return didAddElement; - } - - public java.util.Iterator<$typemap(jboxtype, Key)> iterator() { - return new java.util.Iterator<$typemap(jboxtype, Key)>() { - private Iterator curr; - private Iterator end; - - private java.util.Iterator<$typemap(jboxtype, Key)> init() { - curr = $javaclassname.this.begin(); - end = $javaclassname.this.end(); - return this; - } - - public $typemap(jboxtype, Key) next() { - if (!hasNext()) { - throw new java.util.NoSuchElementException(); - } - - // Save the current position, increment it, - // then return the value at the position before the increment. - final $typemap(jboxtype, Key) currValue = curr.derefUnchecked(); - curr.incrementUnchecked(); - return currValue; - } - - public boolean hasNext() { - return curr.isNot(end); - } - - public void remove() { - throw new java.lang.UnsupportedOperationException(); - } - }.init(); - } - - public boolean containsAll(java.util.Collection collection) { - for (java.lang.Object object : collection) { - if (!contains(object)) { - return false; - } - } - - return true; - } - - public boolean contains(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, Key))) { - return false; - } - - return containsImpl(($typemap(jboxtype, Key))object); - } - - public boolean removeAll(java.util.Collection collection) { - boolean didRemoveElement = false; - for (java.lang.Object object : collection) { - didRemoveElement |= remove(object); - } - - return didRemoveElement; - } - - public boolean remove(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, Key))) { - return false; - } - - return removeImpl(($typemap(jboxtype, Key))object); - } -%} - - public: - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - void incrementUnchecked() { - ++(*$self); - } - - Key derefUnchecked() const { - return **$self; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - } - }; - - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef Key value_type; - typedef Key key_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - unordered_set(); - unordered_set(const unordered_set& other); - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator begin(); - iterator end(); - - %extend { - %fragment("SWIG_UnorderedSetSize"); - - // Returns whether item was inserted. - bool add(const Key& key) { - return self->insert(key).second; - } - - // Returns whether set contains key. - bool containsImpl(const Key& key) { - return (self->count(key) > 0); - } - - // Returns whether the item was erased. - bool removeImpl(const Key& key) { - return (self->erase(key) > 0); - } - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_UnorderedSetSize(self->size()); - } - - bool hasNextImpl(const iterator& itr) const { - return (itr != $self->end()); - } - } -}; - -} diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_vector.i b/linux/bin/swig/share/swig/4.1.0/java/std_vector.i deleted file mode 100755 index 60ee23eb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_vector.i +++ /dev/null @@ -1,185 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector. - * The Java proxy class extends java.util.AbstractList and implements - * java.util.RandomAccess. The std::vector container looks and feels much like a - * java.util.ArrayList from Java. - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -%fragment("SWIG_VectorSize", "header", fragment="SWIG_JavaIntFromSize_t") { -SWIGINTERN jint SWIG_VectorSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) - throw std::out_of_range("vector size is too large to fit into a Java int"); - return sz; -} -} - -%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CTYPE, CONST_REFERENCE) -%typemap(javabase) std::vector< CTYPE > "java.util.AbstractList<$typemap(jboxtype, CTYPE)>" -%typemap(javainterfaces) std::vector< CTYPE > "java.util.RandomAccess" -%proxycode %{ - public $javaclassname($typemap(jstype, CTYPE)[] initialElements) { - this(); - reserve(initialElements.length); - - for ($typemap(jstype, CTYPE) element : initialElements) { - add(element); - } - } - - public $javaclassname(Iterable<$typemap(jboxtype, CTYPE)> initialElements) { - this(); - for ($typemap(jstype, CTYPE) element : initialElements) { - add(element); - } - } - - public $typemap(jboxtype, CTYPE) get(int index) { - return doGet(index); - } - - public $typemap(jboxtype, CTYPE) set(int index, $typemap(jboxtype, CTYPE) e) { - return doSet(index, e); - } - - public boolean add($typemap(jboxtype, CTYPE) e) { - modCount++; - doAdd(e); - return true; - } - - public void add(int index, $typemap(jboxtype, CTYPE) e) { - modCount++; - doAdd(index, e); - } - - public $typemap(jboxtype, CTYPE) remove(int index) { - modCount++; - return doRemove(index); - } - - protected void removeRange(int fromIndex, int toIndex) { - modCount++; - doRemoveRange(fromIndex, toIndex); - } - - public int size() { - return doSize(); - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef CTYPE *pointer; - typedef CTYPE const *const_pointer; - typedef CTYPE &reference; - typedef CONST_REFERENCE const_reference; - - vector(); - vector(const vector &other); - - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %extend { - %fragment("SWIG_VectorSize"); - - vector(jint count, const CTYPE &value) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("vector count must be positive"); - return new std::vector< CTYPE >(static_cast::size_type>(count), value); - } - - jint doSize() const throw (std::out_of_range) { - return SWIG_VectorSize(self->size()); - } - - void doAdd(const value_type& x) { - self->push_back(x); - } - - void doAdd(jint index, const value_type& x) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (0 <= index && index <= size) { - self->insert(self->begin() + index, x); - } else { - throw std::out_of_range("vector index out of range"); - } - } - - value_type doRemove(jint index) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (0 <= index && index < size) { - CTYPE const old_value = (*self)[index]; - self->erase(self->begin() + index); - return old_value; - } else { - throw std::out_of_range("vector index out of range"); - } - } - - CONST_REFERENCE doGet(jint index) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (index >= 0 && index < size) - return (*self)[index]; - else - throw std::out_of_range("vector index out of range"); - } - - value_type doSet(jint index, const value_type& val) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (index >= 0 && index < size) { - CTYPE const old_value = (*self)[index]; - (*self)[index] = val; - return old_value; - } - else - throw std::out_of_range("vector index out of range"); - } - - void doRemoveRange(jint fromIndex, jint toIndex) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (0 <= fromIndex && fromIndex <= toIndex && toIndex <= size) { - self->erase(self->begin() + fromIndex, self->begin() + toIndex); - } else { - throw std::out_of_range("vector index out of range"); - } - } - } -%enddef - -%javamethodmodifiers std::vector::doSize "private"; -%javamethodmodifiers std::vector::doAdd "private"; -%javamethodmodifiers std::vector::doGet "private"; -%javamethodmodifiers std::vector::doSet "private"; -%javamethodmodifiers std::vector::doRemove "private"; -%javamethodmodifiers std::vector::doRemoveRange "private"; - -namespace std { - - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(T, const value_type&) - }; - - // bool specialization - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(bool, bool) - }; -} - -%define specialize_std_vector(T) -#warning "specialize_std_vector - specialization for type T no longer needed" -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/java/std_wstring.i b/linux/bin/swig/share/swig/4.1.0/java/std_wstring.i deleted file mode 100755 index efa9e63b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/std_wstring.i +++ /dev/null @@ -1,180 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_wstring.i - * - * Typemaps for std::wstring and const std::wstring& - * - * These are mapped to a Java String and are passed around by value. - * Warning: Unicode / multibyte characters are handled differently on different - * OSs so the std::wstring typemaps may not always work as intended. - * - * To use non-const std::wstring references use the following %apply. Note - * that they are passed by value. - * %apply const std::wstring & {std::wstring &}; - * ----------------------------------------------------------------------------- */ - -namespace std { - -%naturalvar wstring; - -class wstring; - -// wstring -%typemap(jni) wstring "jstring" -%typemap(jtype) wstring "String" -%typemap(jstype) wstring "String" -%typemap(javadirectorin) wstring "$jniinput" -%typemap(javadirectorout) wstring "$javacall" - -%typemap(in) wstring -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - if ($1_len) { - $1.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $1.push_back((wchar_t)$1_pstr[i]); - } - } - jenv->ReleaseStringChars($input, $1_pstr); - %} - -%typemap(directorout) wstring -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - if ($1_len) { - $result.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $result.push_back((wchar_t)$1_pstr[i]); - } - } - jenv->ReleaseStringChars($input, $1_pstr); - %} - -%typemap(directorin,descriptor="Ljava/lang/String;") wstring %{ - jsize $1_len = (jsize)$1.length(); - jchar *$1_conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - $1_conv_buf[i] = (jchar)$1[i]; - } - $input = jenv->NewString($1_conv_buf, $1_len); - Swig::LocalRefGuard $1_refguard(jenv, $input); - delete [] $1_conv_buf; -%} - -%typemap(out) wstring -%{jsize $1_len = (jsize)$1.length(); - jchar *conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - conv_buf[i] = (jchar)$1[i]; - } - $result = jenv->NewString(conv_buf, $1_len); - delete [] conv_buf; %} - -%typemap(javain) wstring "$javainput" - -%typemap(javaout) wstring { - return $jnicall; - } - -//%typemap(typecheck) wstring = wchar_t *; - -%typemap(throws) wstring -%{std::string message($1.size(), '\0'); - for (size_t i = 0; i < $1.size(); ++i) { - message[i] = (char)$1[i]; - } - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str()); - return $null; %} - -// const wstring & -%typemap(jni) const wstring & "jstring" -%typemap(jtype) const wstring & "String" -%typemap(jstype) const wstring & "String" -%typemap(javadirectorin) const wstring & "$jniinput" -%typemap(javadirectorout) const wstring & "$javacall" - -%typemap(in) const wstring & -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - std::wstring $1_str; - if ($1_len) { - $1_str.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $1_str.push_back((wchar_t)$1_pstr[i]); - } - } - $1 = &$1_str; - jenv->ReleaseStringChars($input, $1_pstr); - %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring & -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - /* possible thread/reentrant code problem */ - static std::wstring $1_str; - if ($1_len) { - $1_str.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $1_str.push_back((wchar_t)$1_pstr[i]); - } - } - $result = &$1_str; - jenv->ReleaseStringChars($input, $1_pstr); %} - -%typemap(directorin,descriptor="Ljava/lang/String;") const wstring & %{ - jsize $1_len = (jsize)$1.length(); - jchar *$1_conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - $1_conv_buf[i] = (jchar)($1)[i]; - } - $input = jenv->NewString($1_conv_buf, $1_len); - Swig::LocalRefGuard $1_refguard(jenv, $input); - delete [] $1_conv_buf; -%} - -%typemap(out) const wstring & -%{jsize $1_len = (jsize)$1->length(); - jchar *conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - conv_buf[i] = (jchar)(*$1)[i]; - } - $result = jenv->NewString(conv_buf, $1_len); - delete [] conv_buf; %} - -%typemap(javain) const wstring & "$javainput" - -%typemap(javaout) const wstring & { - return $jnicall; - } - -//%typemap(typecheck) const wstring & = wchar_t *; - -%typemap(throws) const wstring & -%{std::string message($1.size(), '\0'); - for (size_t i = 0; i < $1.size(); ++i) { - message[i] = (char)$1[i]; - } - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str()); - return $null; %} - -} - diff --git a/linux/bin/swig/share/swig/4.1.0/java/stl.i b/linux/bin/swig/share/swig/4.1.0/java/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/java/swiginterface.i b/linux/bin/swig/share/swig/4.1.0/java/swiginterface.i deleted file mode 100755 index c3ca97d3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/swiginterface.i +++ /dev/null @@ -1,74 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swiginterface.i - * - * SWIG interface feature and typemaps implementation providing: - * %interface - * %interface_impl - * %interface_custom - * ----------------------------------------------------------------------------- */ - -%define INTERFACE_TYPEMAPS(CTYPE...) -%typemap(jtype) CTYPE, CTYPE *, CTYPE *const&, CTYPE [], CTYPE & "long" -%typemap(jstype) CTYPE "$&javainterfacename" -%typemap(jstype) CTYPE *, CTYPE [], CTYPE & "$javainterfacename" -%typemap(jstype) CTYPE *const& "$*javainterfacename" -%typemap(javain) CTYPE "$javainput.$&interfacename_GetInterfaceCPtr()" -%typemap(javain) CTYPE & "$javainput.$interfacename_GetInterfaceCPtr()" -%typemap(javain) CTYPE *, CTYPE [] "($javainput == null) ? 0 : $javainput.$interfacename_GetInterfaceCPtr()" -%typemap(javain) CTYPE *const& "($javainput == null) ? 0 : $javainput.$*interfacename_GetInterfaceCPtr()" -%typemap(javaout) CTYPE { - return ($&javainterfacename)new $&javaclassname($jnicall, true); - } -%typemap(javaout) CTYPE & { - return ($javainterfacename)new $javaclassname($jnicall, $owner); - } -%typemap(javaout) CTYPE *, CTYPE [] { - long cPtr = $jnicall; - return (cPtr == 0) ? null : ($javainterfacename)new $javaclassname(cPtr, $owner); - } -%typemap(javaout) CTYPE *const& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : ($*javainterfacename)new $*javaclassname(cPtr, $owner); - } - -%typemap(javadirectorin) CTYPE "($&javainterfacename)new $&javaclassname($jniinput, true)" -%typemap(javadirectorin) CTYPE & "($javainterfacename)new $javaclassname($jniinput, false)" -%typemap(javadirectorin) CTYPE *, CTYPE [] "($jniinput == 0) ? null : ($javainterfacename)new $javaclassname($jniinput, false)" -%typemap(javadirectorin) CTYPE *const& "($jniinput == 0) ? null : ($*javainterfacename)new $*javaclassname($jniinput, false)" -%typemap(javadirectorout) CTYPE "$javacall.$&interfacename_GetInterfaceCPtr()" -%typemap(javadirectorout) CTYPE *, CTYPE [], CTYPE & "$javacall.$interfacename_GetInterfaceCPtr()" -%typemap(javadirectorout) CTYPE *const& "$javacall.$*interfacename_GetInterfaceCPtr()" -%typemap(directorin,descriptor="L$packagepath/$&javainterfacename;") CTYPE -%{ $input = 0; - *(($&1_ltype*)&$input) = new $1_ltype(SWIG_STD_MOVE($1)); %} -%typemap(directorin,descriptor="L$packagepath/$javainterfacename;") CTYPE *, CTYPE [] -%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} -%typemap(directorin,descriptor="L$packagepath/$javainterfacename;") CTYPE & -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} -%typemap(directorin,descriptor="L$packagepath/$*javainterfacename;") CTYPE *const& -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} - -%typemap(javainterfacecode, declaration=" long $interfacename_GetInterfaceCPtr();\n", cptrmethod="$interfacename_GetInterfaceCPtr") CTYPE %{ - public long $interfacename_GetInterfaceCPtr() { - return $imclassname.$javaclazzname$interfacename_GetInterfaceCPtr(swigCPtr); - } -%} -%enddef - -%define %interface(CTYPE...) -%feature("interface", name="%sSwigInterface") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_impl(CTYPE...) -%rename("%sSwigImpl") CTYPE; -%feature("interface", name="%(rstrip:[SwigImpl])s") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_custom(PROXY, INTERFACE, CTYPE...) -%rename(PROXY) CTYPE; -%feature("interface", name=INTERFACE) CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - diff --git a/linux/bin/swig/share/swig/4.1.0/java/swigmove.i b/linux/bin/swig/share/swig/4.1.0/java/swigmove.i deleted file mode 100755 index 671b988a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/swigmove.i +++ /dev/null @@ -1,16 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in) SWIGTYPE MOVE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - SwigValueWrapper< $1_ltype >::reset($1, argp); %} - -%typemap(javain) SWIGTYPE MOVE "$&javaclassname.swigRelease($javainput)" diff --git a/linux/bin/swig/share/swig/4.1.0/java/typemaps.i b/linux/bin/swig/share/swig/4.1.0/java/typemaps.i deleted file mode 100755 index e130c193..00000000 --- a/linux/bin/swig/share/swig/4.1.0/java/typemaps.i +++ /dev/null @@ -1,529 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps remap a C pointer or C++ reference to be an "INPUT" value which is -passed by value instead of reference. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In Java you could then use it like this: - double answer = modulename.fadd(10.0, 20.0); - -There are no char *INPUT typemaps, however you can apply the signed char * typemaps instead: - %include - %apply signed char *INPUT {char *input}; - void f(char *input); -*/ - -%define INPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JNIDESC) -%typemap(jni) TYPE *INPUT, TYPE &INPUT "JNITYPE" -%typemap(jtype) TYPE *INPUT, TYPE &INPUT "JTYPE" -%typemap(jstype) TYPE *INPUT, TYPE &INPUT "JTYPE" -%typemap(javain) TYPE *INPUT, TYPE &INPUT "$javainput" - -%typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(freearg) TYPE *INPUT, TYPE &INPUT "" - -%typemap(typecheck) TYPE *INPUT = TYPE; -%typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, jboolean, boolean, "Z"); -INPUT_TYPEMAP(signed char, jbyte, byte, "B"); -INPUT_TYPEMAP(unsigned char, jshort, short, "S"); -INPUT_TYPEMAP(short, jshort, short, "S"); -INPUT_TYPEMAP(unsigned short, jint, int, "I"); -INPUT_TYPEMAP(int, jint, int, "I"); -INPUT_TYPEMAP(unsigned int, jlong, long, "J"); -INPUT_TYPEMAP(long, jint, int, "I"); -INPUT_TYPEMAP(unsigned long, jlong, long, "J"); -INPUT_TYPEMAP(long long, jlong, long, "J"); -INPUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, "Ljava/math/BigInteger;"); -INPUT_TYPEMAP(float, jfloat, float, "F"); -INPUT_TYPEMAP(double, jdouble, double, "D"); - -#undef INPUT_TYPEMAP - -/* Convert from BigInteger using the toByteArray member function */ -/* Overrides the typemap in the INPUT_TYPEMAP macro */ -%typemap(in) unsigned long long *INPUT($*1_ltype temp), unsigned long long &INPUT($*1_ltype temp) { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, $input); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - temp = 0; - if (sz > 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Java output of the function would be the function return value and the -value in the single element array. In Java you would use it like this: - - double[] ptr = {0.0}; - double fraction = modulename.modf(5.0,ptr); - -There are no char *OUTPUT typemaps, however you can apply the signed char * typemaps instead: - %include - %apply signed char *OUTPUT {char *output}; - void f(char *output); -*/ - -/* Java BigInteger[] */ -%typecheck(SWIG_TYPECHECK_INT128_ARRAY) SWIGBIGINTEGERARRAY "" - -%define OUTPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE) -%typemap(jni) TYPE *OUTPUT, TYPE &OUTPUT %{JNITYPE##Array%} -%typemap(jtype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" -%typemap(jstype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" -%typemap(javain) TYPE *OUTPUT, TYPE &OUTPUT "$javainput" -%typemap(javadirectorin) TYPE *OUTPUT, TYPE &OUTPUT "$jniinput" -%typemap(javadirectorout) TYPE *OUTPUT, TYPE &OUTPUT "$javacall" - -%typemap(in) TYPE *OUTPUT($*1_ltype temp), TYPE &OUTPUT($*1_ltype temp) -{ - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - temp = ($*1_ltype)0; - $1 = &temp; -} - -%typemap(freearg) TYPE *OUTPUT, TYPE &OUTPUT "" - -%typemap(argout) TYPE *OUTPUT, TYPE &OUTPUT -{ - JNITYPE jvalue = (JNITYPE)temp$argnum; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &jvalue); -} - -%typemap(directorin,descriptor=JNIDESC) TYPE &OUTPUT %{ - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorin,descriptor=JNIDESC) TYPE *OUTPUT %{ - if ($1) { - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - } - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorargout, noblock=1) TYPE &OUTPUT -{ - JNITYPE $1_jvalue; - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = ($*1_ltype)$1_jvalue; -} - -%typemap(directorargout, noblock=1) TYPE *OUTPUT -{ - if ($result) { - JNITYPE $1_jvalue; - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = ($*1_ltype)$1_jvalue; - } -} - -%typemap(typecheck) TYPE *OUTPUT = TYPECHECKTYPE; -%typemap(typecheck) TYPE &OUTPUT = TYPECHECKTYPE; -%enddef - -OUTPUT_TYPEMAP(bool, jboolean, boolean, Boolean, "[Z", jbooleanArray); -OUTPUT_TYPEMAP(signed char, jbyte, byte, Byte, "[B", jbyteArray); -OUTPUT_TYPEMAP(unsigned char, jshort, short, Short, "[S", jshortArray); -OUTPUT_TYPEMAP(short, jshort, short, Short, "[S", jshortArray); -OUTPUT_TYPEMAP(unsigned short, jint, int, Int, "[I", jintArray); -OUTPUT_TYPEMAP(int, jint, int, Int, "[I", jintArray); -OUTPUT_TYPEMAP(unsigned int, jlong, long, Long, "[J", jlongArray); -OUTPUT_TYPEMAP(long, jint, int, Int, "[I", jintArray); -OUTPUT_TYPEMAP(unsigned long, jlong, long, Long, "[J", jlongArray); -OUTPUT_TYPEMAP(long long, jlong, long, Long, "[J", jlongArray); -OUTPUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, Object, "[Ljava/math/BigInteger;", jobjectArray); -OUTPUT_TYPEMAP(float, jfloat, float, Float, "[F", jfloatArray); -OUTPUT_TYPEMAP(double, jdouble, double, Double, "[D", jdoubleArray); - -#undef OUTPUT_TYPEMAP - -%typemap(in) bool *OUTPUT($*1_ltype temp), bool &OUTPUT($*1_ltype temp) -{ - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - temp = false; - $1 = &temp; -} - -%typemap(directorargout, noblock=1) bool &OUTPUT -{ - jboolean $1_jvalue; - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = $1_jvalue ? true : false; -} - -%typemap(directorargout, noblock=1) bool *OUTPUT -{ - if ($result) { - jboolean $1_jvalue; - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = $1_jvalue ? true : false; - } -} - - -/* Convert to BigInteger - byte array holds number in 2's complement big endian format */ -/* Use first element in BigInteger array for output */ -/* Overrides the typemap in the OUTPUT_TYPEMAP macro */ -%typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT { - jbyteArray ba = JCALL1(NewByteArray, jenv, 9); - jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger"); - jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(temp$argnum>>8*(8-i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - JCALL3(SetObjectArrayElement, jenv, $input, 0, bigint); -} - -/* -INOUT typemaps --------------- - -Mappings for a parameter that is both an input and an output parameter - -The following typemaps can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" typemaps described earlier. Output values are -returned as an element in a Java array. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -This works similarly to C in that the mapping directly modifies the -input value - the input must be an array with a minimum of one element. -The element in the array is the input and the output is the element in -the array. - - double x[] = {5.0}; - neg(x); - -The implementation of the OUTPUT and INOUT typemaps is different to other -languages in that other languages will return the output value as part -of the function return value. This difference is due to Java being a typed language. - -There are no char *INOUT typemaps, however you can apply the signed char * typemaps instead: - %include - %apply signed char *INOUT {char *inout}; - void f(char *inout); -*/ - -%define INOUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE) -%typemap(jni) TYPE *INOUT, TYPE &INOUT %{JNITYPE##Array%} -%typemap(jtype) TYPE *INOUT, TYPE &INOUT "JTYPE[]" -%typemap(jstype) TYPE *INOUT, TYPE &INOUT "JTYPE[]" -%typemap(javain) TYPE *INOUT, TYPE &INOUT "$javainput" -%typemap(javadirectorin) TYPE *INOUT, TYPE &INOUT "$jniinput" -%typemap(javadirectorout) TYPE *INOUT, TYPE &INOUT "$javacall" - -%typemap(in) TYPE *INOUT, TYPE &INOUT { - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - $1 = ($1_ltype) JCALL2(Get##JAVATYPE##ArrayElements, jenv, $input, 0); -} - -%typemap(freearg) TYPE *INOUT, TYPE &INOUT "" - -%typemap(argout) TYPE *INOUT, TYPE &INOUT -{ JCALL3(Release##JAVATYPE##ArrayElements, jenv, $input, (JNITYPE *)$1, 0); } - -%typemap(directorin,descriptor=JNIDESC) TYPE &INOUT %{ - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - JNITYPE $1_jvalue = (JNITYPE)$1; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorin,descriptor=JNIDESC) TYPE *INOUT %{ - if ($1) { - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - JNITYPE $1_jvalue = (JNITYPE)*$1; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - } - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorargout, noblock=1) TYPE &INOUT -{ - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = ($*1_ltype)$1_jvalue; -} - -%typemap(directorargout, noblock=1) TYPE *INOUT -{ - if ($result) { - JNITYPE $1_jvalue; - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = ($*1_ltype)$1_jvalue; - } -} - -%typemap(typecheck) TYPE *INOUT = TYPECHECKTYPE; -%typemap(typecheck) TYPE &INOUT = TYPECHECKTYPE; -%enddef - -INOUT_TYPEMAP(bool, jboolean, boolean, Boolean, "[Z", jbooleanArray); -INOUT_TYPEMAP(signed char, jbyte, byte, Byte, "[B", jbyteArray); -INOUT_TYPEMAP(unsigned char, jshort, short, Short, "[S", jshortArray); -INOUT_TYPEMAP(short, jshort, short, Short, "[S", jshortArray); -INOUT_TYPEMAP(unsigned short, jint, int, Int, "[I", jintArray); -INOUT_TYPEMAP(int, jint, int, Int, "[I", jintArray); -INOUT_TYPEMAP(unsigned int, jlong, long, Long, "[J", jlongArray); -INOUT_TYPEMAP(long, jint, int, Int, "[I", jintArray); -INOUT_TYPEMAP(unsigned long, jlong, long, Long, "[J", jlongArray); -INOUT_TYPEMAP(long long, jlong, long, Long, "[J", jlongArray); -INOUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, Object, "[java/math/BigInteger;", jobjectArray); -INOUT_TYPEMAP(float, jfloat, float, Float, "[F", jfloatArray); -INOUT_TYPEMAP(double, jdouble, double, Double, "[D", jdoubleArray); - -#undef INOUT_TYPEMAP - -/* Override typemaps in the INOUT_TYPEMAP macro for booleans to fix casts - as a jboolean isn't always the same size as a bool */ -%typemap(in) bool *INOUT (bool btemp, jboolean *jbtemp), bool &INOUT (bool btemp, jboolean *jbtemp) { - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - jbtemp = JCALL2(GetBooleanArrayElements, jenv, $input, 0); - btemp = (*jbtemp) ? true : false; - $1 = &btemp; -} - -%typemap(argout) bool *INOUT, bool &INOUT { - *jbtemp$argnum = btemp$argnum ? (jboolean)1 : (jboolean)0; - JCALL3(ReleaseBooleanArrayElements, jenv, $input , (jboolean *)jbtemp$argnum, 0); -} - -%typemap(directorargout, noblock=1) bool &INOUT -{ - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = $1_jvalue ? true : false; -} - -%typemap(directorargout, noblock=1) bool *INOUT -{ - if ($result) { - jboolean $1_jvalue; - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = $1_jvalue ? true : false; - } -} - - -/* Override the typemap in the INOUT_TYPEMAP macro for unsigned long long */ -%typemap(in) unsigned long long *INOUT ($*1_ltype temp), unsigned long long &INOUT ($*1_ltype temp) { - jobject bigint; - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - bigint = JCALL2(GetObjectArrayElement, jenv, $input, 0); - if (!bigint) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array element null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, bigint); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, bigint, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - temp = 0; - if (sz > 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; igetPrivateObject()->tryAllowDestroyInGC(); %} \ No newline at end of file diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_common.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_common.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_complex.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_complex.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_deque.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_deque.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_except.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_except.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_map.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_map.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_pair.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_pair.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_string.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_string.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_vector.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/std_vector.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/stl.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/stl.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/cocos/typemaps.i b/linux/bin/swig/share/swig/4.1.0/javascript/cocos/typemaps.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/arrays_javascript.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/arrays_javascript.i deleted file mode 100755 index 713b7ef2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/arrays_javascript.i +++ /dev/null @@ -1,94 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_javascript.i - * - * These typemaps give more natural support for arrays. The typemaps are not efficient - * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from JavaScript and vice versa. The JavaScript array is expected to be the same size as the C array. - * An exception is thrown if they are not. - * - * Example usage: - * Wrapping: - * - * %include - * %inline %{ - * extern int FiddleSticks[3]; - * %} - * - * Use from JavaScript like this: - * - * var fs = [10, 11, 12]; - * example.FiddleSticks = fs; - * fs = example.FiddleSticks; - * ----------------------------------------------------------------------------- */ - - -%fragment("SWIG_JSCGetIntProperty", "header", fragment=SWIG_AsVal_frag(int)) {} -%fragment("SWIG_JSCGetNumberProperty", "header", fragment=SWIG_AsVal_frag(double)) {} -%fragment("SWIG_JSCOutInt", "header", fragment=SWIG_From_frag(int)) {} -%fragment("SWIG_JSCOutNumber", "header", fragment=SWIG_From_frag(double)) {} - -%define JAVASCRIPT_ARRAYS_IN_DECL(NAME, CTYPE, ANY, ANYLENGTH) - -%typemap(in, fragment=NAME) CTYPE[ANY] { - if (JSValueIsObject(context, $input)) - { - int i; - // Convert into Array - JSObjectRef array = JSValueToObject(context, $input, NULL); - - int length = ANYLENGTH; - - $1 = ($*1_ltype *)malloc(sizeof($*1_ltype) * length); - - // Get each element from array - for (i = 0; i < length; i++) - { - JSValueRef jsvalue = JSObjectGetPropertyAtIndex(context, array, i, NULL); - $*1_ltype temp; - - // Get primitive value from JSObject - int res = SWIG_AsVal(CTYPE)(jsvalue, &temp); - if (!SWIG_IsOK(res)) - { - SWIG_exception_fail(SWIG_ERROR, "Failed to convert $input to double"); - } - arg$argnum[i] = temp; - } - } - else - { - SWIG_exception_fail(SWIG_ERROR, "$input is not JSObjectRef"); - } -} - -%typemap(freearg) CTYPE[ANY] { - free($1); -} - -%enddef - -%define JAVASCRIPT_ARRAYS_OUT_DECL(NAME, CTYPE) - -%typemap(out, fragment=NAME) CTYPE[ANY] { - int length = $1_dim0; - JSValueRef values[length]; - int i; - - for (i = 0; i < length; i++) - { - values[i] = SWIG_From(CTYPE)($1[i]); - } - - $result = JSObjectMakeArray(context, length, values, NULL); -} - -%enddef - -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, , SWIGJSC_ArrayLength(context, array)) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, ANY, $1_dim0) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, , SWIGJSC_ArrayLength(context, array)) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, ANY, $1_dim0) - -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutInt", int) -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutNumber", double) - diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/ccomplex.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/ccomplex.i deleted file mode 100755 index e58dbf71..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/ccomplex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ccomplex.i - * - * C complex typemaps - * ISO C99: 7.3 Complex arithmetic - * ----------------------------------------------------------------------------- */ - - -%include - -%{ -#include -%} - -#define complex _Complex - -/* C complex constructor */ -#define CCplxConst(r, i) ((r) + I*(i)) - -%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); - -/* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/cdata.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/complex.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/complex.i deleted file mode 100755 index 4c3b3c5e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/complex.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __cplusplus -%include -#else -%include -#endif - diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/exception.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/exception.i deleted file mode 100755 index 0246cfde..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/exception.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascript.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascript.swg deleted file mode 100755 index 3a83b649..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascript.swg +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascript.swg - * - * Javascript typemaps - * ----------------------------------------------------------------------------- */ - -%include - -%include - -%include - -%include - -%include - -%include - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcode.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcode.swg deleted file mode 100755 index 4050a6ee..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcode.swg +++ /dev/null @@ -1,429 +0,0 @@ -/* ----------------------------------------------------------------------------- - * js_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - goto fail; - fail: - return NULL; -} -%} - -/* ----------------------------------------------------------------------------- - * js_veto_ctor: a vetoing ctor for abstract classes - * - $jswrapper: name of wrapper - * - $jsname: class name - * ----------------------------------------------------------------------------- */ -%fragment ("js_veto_ctor", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, - size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - SWIG_exception(SWIG_ERROR, "Class $jsname can not be instantiated"); -fail: - return 0; -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatcher: dispatcher for overloaded constructors - * - $jswrapper: name of wrapper - * - $jsname: class name - * - $jsdispatchcases: part containing code for dispatching - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatcher", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, - size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSObjectRef thisObject = NULL; - - // switch all cases by means of series of if-returns. - $jsdispatchcases - - // default: - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of $jsname"); - - fail: - return thisObject; -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ -%fragment ("js_overloaded_ctor", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - $jscode - return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - - goto fail; - fail: - return NULL; -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatch_case: template for a dispatch case for calling an overloaded ctor. - * - $jsargcount: number of arguments of called ctor - * - $jswrapper: wrapper of called ctor - * - * Note: a try-catch-like mechanism is used to switch cases - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatch_case", "templates") -%{ - if(argc == $jsargcount) { - thisObject = $jswrapper(context, NULL, argc, argv, exception); - if(thisObject != NULL) { *exception=0; return thisObject; } /* reset exception and return */ - } -%} - - -/* ----------------------------------------------------------------------------- - * js_dtor: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtor", "templates") -%{ -static void $jswrapper(JSObjectRef thisObject) -{ - SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); - if(t) { - if (t->swigCMemOwn) { - free (($jstype)t->swigCObject); - } - JSObjectSetPrivate(thisObject, NULL); - free(t); - } -} -%} - -/* ----------------------------------------------------------------------------- - * js_dtor: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * - ${destructor_action}: The custom destructor action to invoke. - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtoroverride", "templates") -%{ -static void $jswrapper(JSObjectRef thisObject) -{ - SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); - if(t) { - if (t->swigCMemOwn) { - $jstype arg1 = ($jstype)t->swigCObject; - ${destructor_action} - } - /* remove the private data to make sure that it isn't accessed elsewhere */ - JSObjectSetPrivate(thisObject, NULL); - free(t); - } -} -%} - -/* ----------------------------------------------------------------------------- - * js_getter: template for getter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_getter", "templates") -%{ -static JSValueRef $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) -{ - $jslocals - JSValueRef jsresult; - - $jscode - return jsresult; - - goto fail; - fail: - return JSValueMakeUndefined(context); -} -%} - -/* ----------------------------------------------------------------------------- - * js_setter: template for setter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_setter", "templates") -%{ -static bool $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) -{ - $jslocals - $jscode - - return true; - - goto fail; - fail: - return false; -} -%} - -/* ----------------------------------------------------------------------------- - * js_function: template for function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function", "templates") -%{ -static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - JSValueRef jsresult; - - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - return jsresult; - - goto fail; - fail: - return JSValueMakeUndefined(context); -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatcher: template for a function dispatcher for overloaded functions - * - $jswrapper: wrapper function name - * - $jsname: name of the wrapped function - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function_dispatcher", "templates") -%{ -static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - JSValueRef jsresult; - int res; - $jscode - - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function $jsname."); - return jsresult; - - goto fail; - fail: - return JSValueMakeUndefined(context); -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_function: template for a overloaded function - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_overloaded_function", "templates") -%{ -static int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception, JSValueRef* p_result) -{ - $jslocals - JSValueRef jsresult; - - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - *p_result = jsresult; - return SWIG_OK; - - goto fail; - fail: - return SWIG_TypeError; -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatch_case: template for a case used in the function dispatcher - * - $jswrapper: wrapper function name - * - $jsargcount: number of arguments of overloaded function - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function_dispatch_case", "templates") -%{ - if(argc == $jsargcount) { - res = $jswrapper(context, function, thisObject, argc, argv, exception, &jsresult); - if(res == SWIG_OK) { *exception = 0; return jsresult; } - } -%} - -/* ----------------------------------------------------------------------------- - * jsc_variable_declaration: template for a variable table entry - * - $jsname: name of the variable - * - $jsgetter: wrapper of getter function - * - $jssetter: wrapper of setter function - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_variable_declaration", "templates") -%{ - {"$jsname", $jsgetter, $jssetter, kJSPropertyAttributeNone}, -%} - - -/* ----------------------------------------------------------------------------- - * jsc_function_declaration: template for a function table entry - * - $jsname: name of the variable - * - $jswrapper: wrapper function - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_function_declaration", "templates") -%{ - {"$jsname", $jswrapper, kJSPropertyAttributeNone}, -%} - -/* ----------------------------------------------------------------------------- - * jsc_classtemplate_declaration: template for a namespace declaration - * - $jsmangledname: mangled class name - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_declaration", "templates") -%{ -static JSClassDefinition $jsmangledname_classDefinition; - -static JSClassDefinition $jsmangledname_objectDefinition; - -static JSClassRef $jsmangledname_classRef; -%} - -/* ----------------------------------------------------------------------------- - * jsc_class_tables: template for a namespace declaration - * - $jsmangledname: mangled class name - * - $jsstaticclassvariables: list of static variable entries - * - $jsstaticclassfunctions: list of static function entries - * - $jsclassvariables: list of member variable entries - * - $jsclassfunctions: list of member function entries - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_tables", "templates") -%{ -static JSStaticValue $jsmangledname_staticValues[] = { - $jsstaticclassvariables - { 0, 0, 0, 0 } -}; - -static JSStaticFunction $jsmangledname_staticFunctions[] = { - $jsstaticclassfunctions - { 0, 0, 0 } -}; - -static JSStaticValue $jsmangledname_values[] = { - $jsclassvariables - { 0, 0, 0, 0 } -}; - -static JSStaticFunction $jsmangledname_functions[] = { - $jsclassfunctions - { 0, 0, 0 } -}; -%} - -/* ----------------------------------------------------------------------------- - * jsc_define_class_template: template for defining a class template - * - $jsmangledname: mangled class name - * - $jsmangledtype: mangled class type - * - $jsctor: wrapper of ctor - * - $jsbaseclass: mangled name of base class - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_definition", "templates") -%{ - $jsmangledname_classDefinition.staticFunctions = $jsmangledname_staticFunctions; - $jsmangledname_classDefinition.staticValues = $jsmangledname_staticValues; - $jsmangledname_classDefinition.callAsConstructor = $jsctor; - $jsmangledname_objectDefinition.finalize = $jsdtor; - $jsmangledname_objectDefinition.staticValues = $jsmangledname_values; - $jsmangledname_objectDefinition.staticFunctions = $jsmangledname_functions; - $jsclass_inheritance - $jsmangledname_classRef = JSClassCreate(&$jsmangledname_objectDefinition); - SWIGTYPE_$jsmangledtype->clientdata = $jsmangledname_classRef; -%} - -%fragment ("jsc_class_inherit", templates) -%{ - if (SWIGTYPE_p$jsbaseclassmangled != NULL) { - $jsmangledname_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p$jsbaseclassmangled->clientdata; - } -%} - -%fragment ("jsc_class_noinherit", templates) -%{ - $jsmangledname_objectDefinition.parentClass = _SwigObject_classRef; -%} - - -/* ----------------------------------------------------------------------------- - * jsc_register_class: template for registration of a class - * - $jsname: class name - * - $jsmangledname: mangled class name - * - $jsnspace: mangled name of namespace - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_registration", "templates") -%{ - JS_registerClass(context, $jsnspace_object, "$jsname", &$jsmangledname_classDefinition); -%} - - -/* ----------------------------------------------------------------------------- - * jsc_nspace_declaration: template for a namespace declaration - * - $jsnspace: mangled name of the namespace - * - $jsglobalvariables: list of variable entries - * - $jsglobalfunctions: list of function entries - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_nspace_declaration", "templates") -%{ -static JSStaticValue $jsnspace_values[] = { - $jsglobalvariables - { 0, 0, 0, 0 } -}; - -static JSStaticFunction $jsnspace_functions[] = { - $jsglobalfunctions - { 0, 0, 0 } -}; - -static JSClassDefinition $jsnspace_classDefinition; -static JSObjectRef $jsmangledname_object; -%} - -/* ----------------------------------------------------------------------------- - * jsc_nspace_definition: template for definition of a namespace object - * - $jsmangledname: mangled name of namespace - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_nspace_definition", "templates") -%{ - $jsmangledname_classDefinition.staticFunctions = $jsmangledname_functions; - $jsmangledname_classDefinition.staticValues = $jsmangledname_values; - $jsmangledname_object = JSObjectMake(context, JSClassCreate(&$jsmangledname_classDefinition), NULL); -%} - -/* ----------------------------------------------------------------------------- - * jsc_nspace_registration: template for registration of a namespace object - * - $jsname: name of namespace - * - $jsmangledname: mangled name of namespace - * - $jsparent: mangled name of parent namespace - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_nspace_registration", "templates") -%{ - JS_registerNamespace(context, $jsmangledname_object, $jsparent_object, "$jsname"); -%} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcomplex.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcomplex.swg deleted file mode 100755 index dcc205db..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcomplex.swg +++ /dev/null @@ -1,146 +0,0 @@ -/* - Defines the As/From converters for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header", - fragment=SWIG_From_frag(double)) -{ -SWIGINTERNINLINE JSObjectRef -SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) -{ - JSValueRef vals[2]; - vals[0] = SWIG_From(double)(Real(c)); - vals[1] = SWIG_From(double)(Imag(c)); - return JSObjectMakeArray(context, 2, vals, NULL); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ -SWIGINTERN int -SWIG_AsVal_dec(Type) (JSValueRef o, Type* val) -{ - if (JSValueIsObject(context, o)) { - JSObjectRef array; - JSValueRef exception, js_re, js_im; - double re, im; - int res; - - exception = 0; - res = 0; - - array = JSValueToObject(context, o, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_re = JSObjectGetPropertyAtIndex(context, array, 0, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_im = JSObjectGetPropertyAtIndex(context, array, 1, &exception); - if(exception != 0) - return SWIG_TypeError; - - res = SWIG_AsVal(double)(js_re, &re); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(js_im, &im); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if (val) *val = Constructor(re, im); - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { -SWIGINTERN int -SWIG_AsVal_dec(Type)(JSValueRef o, Type *val) -{ - if (JSValueIsObject(context, o)) { - JSObjectRef array; - JSValueRef exception, js_re, js_im; - double re, im; - int res; - - exception = 0; - res = 0; - - array = JSValueToObject(context, o, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_re = JSObjectGetPropertyAtIndex(context, array, 0, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_im = JSObjectGetPropertyAtIndex(context, array, 1, &exception); - if(exception != 0) - return SWIG_TypeError; - - res = SWIG_AsVal(double)(js_re, &re); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(js_im, &im); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0f); - return res; - } - } - return SWIG_TypeError; -} -} - -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptfragments.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptfragments.swg deleted file mode 100755 index 4778bf03..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'javascriptfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the default ones defined by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascripthelpers.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascripthelpers.swg deleted file mode 100755 index 45765433..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascripthelpers.swg +++ /dev/null @@ -1,69 +0,0 @@ -%insert(wrapper) %{ - -SWIGINTERN bool JS_registerClass(JSGlobalContextRef context, JSObjectRef parentObject, - const char* className, - JSClassDefinition* definition) { - - JSStringRef js_className = JSStringCreateWithUTF8CString(className); - JSObjectRef classObject = JSObjectMake(context, JSClassCreate(definition), NULL); - JSObjectSetProperty(context, parentObject, - js_className, classObject, - kJSPropertyAttributeNone, NULL); - JSStringRelease(js_className); - - return true; -} - -SWIGINTERN bool JS_registerNamespace(JSGlobalContextRef context, - JSObjectRef namespaceObj, JSObjectRef parentNamespace, - const char* name) -{ - JSStringRef js_name = JSStringCreateWithUTF8CString(name); - JSObjectSetProperty(context, parentNamespace, - js_name, namespaceObj, - kJSPropertyAttributeNone, NULL); - JSStringRelease(js_name); - - return true; -} - - -SWIGINTERN bool JS_registerFunction(JSGlobalContextRef context, JSObjectRef object, - const char* functionName, JSObjectCallAsFunctionCallback callback) -{ - JSStringRef js_functionName = JSStringCreateWithUTF8CString(functionName); - JSObjectSetProperty(context, object, js_functionName, - JSObjectMakeFunctionWithCallback(context, js_functionName, callback), - kJSPropertyAttributeNone, NULL); - JSStringRelease(js_functionName); - return true; -} - -SWIGINTERN bool JS_veto_set_variable(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) -{ - char buffer[256]; - char msg[512]; - int res; - - JSStringGetUTF8CString(propertyName, buffer, 256); - res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); - - if(res<0) { - SWIG_exception(SWIG_ERROR, "Tried to write read-only variable."); - } else { - SWIG_exception(SWIG_ERROR, msg); - } -fail: - return false; -} - -SWIGINTERN JSValueRef JS_CharPtrToJSValue(JSContextRef context, char* cstr) { - JSValueRef val; - - JSStringRef jsstring = JSStringCreateWithUTF8CString((char*) cstr); - val = JSValueMakeString(context, jsstring); - JSStringRelease(jsstring); - - return val; -} -%} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptinit.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptinit.swg deleted file mode 100755 index b0138b39..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptinit.swg +++ /dev/null @@ -1,112 +0,0 @@ -%insert(init) %{ -SWIGRUNTIME void -SWIG_JSC_SetModule(JSGlobalContextRef context, swig_module_info *swig_module) { - JSObjectRef globalObject; - JSStringRef moduleName; - JSClassDefinition classDef; - JSClassRef classRef; - JSObjectRef object; - - if(context == 0){ - return; - } - - globalObject = JSContextGetGlobalObject(context); - moduleName = JSStringCreateWithUTF8CString("swig_module_info_data"); - - classDef = kJSClassDefinitionEmpty; - classRef = JSClassCreate(&classDef); - - object = JSObjectMake(context, classRef, NULL); - JSObjectSetPrivate(object, (void*)swig_module); - - JSObjectSetProperty(context, globalObject, moduleName, object, kJSPropertyAttributeNone, NULL); - - JSClassRelease(classRef); - JSStringRelease(moduleName); -} -SWIGRUNTIME swig_module_info * -SWIG_JSC_GetModule(JSGlobalContextRef context) { - JSObjectRef globalObject; - JSStringRef moduleName; - JSValueRef value; - JSObjectRef object; - - if(context == 0){ - return 0; - } - - globalObject = JSContextGetGlobalObject(context); - moduleName = JSStringCreateWithUTF8CString("swig_module_info_data"); - - if(JSObjectHasProperty(context, globalObject, moduleName) == false) { - JSStringRelease(moduleName); - return 0; - } - - value = JSObjectGetProperty(context, globalObject, moduleName, NULL); - object = JSValueToObject(context, value, NULL); - JSStringRelease(moduleName); - - return (swig_module_info*)JSObjectGetPrivate(object); -} - -#define SWIG_GetModule(clientdata) SWIG_JSC_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_JSC_SetModule(clientdata, pointer) -#define SWIG_INIT_CLIENT_DATA_TYPE JSGlobalContextRef -%} - -%insert(init) "swiginit.swg" - -%fragment ("js_initializer_define", "templates") %{ -#define SWIGJSC_INIT $jsname_initialize -%} - -// Open the initializer function -%insert(init) -%{ - -#ifdef __cplusplus -extern "C" { -#endif - -bool SWIGJSC_INIT (JSGlobalContextRef context, JSObjectRef *exports) { - SWIG_InitializeModule(context); -%} - -/* ----------------------------------------------------------------------------- - * js_initializer: template for the module initializer function - * - $jsname: module name - * - $jscreatenamespaces: part with code for creating namespace objects - * - $jscreateclasses: part with code for creating classes - * - $jsregisternamespaces: part with code for registration of namespaces - * ----------------------------------------------------------------------------- */ -%fragment ("js_initializer", "templates") %{ - /* Initialize the base swig type object */ - _SwigObject_objectDefinition.staticFunctions = _SwigObject_functions; - _SwigObject_objectDefinition.staticValues = _SwigObject_values; - _SwigObject_classRef = JSClassCreate(&_SwigObject_objectDefinition); - - /* Initialize the PackedData class */ - _SwigPackedData_objectDefinition.staticFunctions = _SwigPackedData_functions; - _SwigPackedData_objectDefinition.staticValues = _SwigPackedData_values; - _SwigPackedData_objectDefinition.finalize = _wrap_SwigPackedData_delete; - _SwigPackedData_classRef = JSClassCreate(&_SwigPackedData_objectDefinition); - - /* Create objects for namespaces */ - $jscreatenamespaces - - /* Register classes */ - $jsregisterclasses - - /* Register namespaces */ - $jsregisternamespaces - - *exports = exports_object; - - return true; -} -#ifdef __cplusplus -} -#endif -%} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptkw.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptkw.swg deleted file mode 100755 index c3c11839..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptkw.swg +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef JAVASCRIPT_JAVASCRIPTKW_SWG_ -#define JAVASCRIPT_JAVASCRIPTKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVASCRIPTKW(x) %keywordwarn("'" `x` "' is a javascript keyword, renaming to '_"`x`"'",rename="_%s") `x` - -/* Taken from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words */ - -JAVASCRIPTKW(break); -JAVASCRIPTKW(case); -JAVASCRIPTKW(catch); -JAVASCRIPTKW(continue); -JAVASCRIPTKW(default); -JAVASCRIPTKW(delete); -JAVASCRIPTKW(do); -JAVASCRIPTKW(else); -JAVASCRIPTKW(finally); -JAVASCRIPTKW(for); -JAVASCRIPTKW(function); -JAVASCRIPTKW(if); -JAVASCRIPTKW(in); -JAVASCRIPTKW(instanceof); -JAVASCRIPTKW(new); -JAVASCRIPTKW(return); -JAVASCRIPTKW(switch); -JAVASCRIPTKW(this); -JAVASCRIPTKW(throw); -JAVASCRIPTKW(try); -JAVASCRIPTKW(typeof); -JAVASCRIPTKW(var); -JAVASCRIPTKW(void); -JAVASCRIPTKW(while); -JAVASCRIPTKW(with); - -/* others bad names if any*/ -// for example %namewarn("321:clone() is a javascript bad method name") *::clone(); - -#undef JAVASCRIPTKW - -#endif //JAVASCRIPT_JAVASCRIPTKW_SWG_ diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptprimtypes.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptprimtypes.swg deleted file mode 100755 index 20d575d9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptprimtypes.swg +++ /dev/null @@ -1,192 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE -JSValueRef SWIG_From_dec(bool)(bool value) -{ - return JSValueMakeBoolean(context, value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN -int SWIG_AsVal_dec(bool)(JSValueRef obj, bool *val) -{ - if(!JSValueIsBoolean(context, obj)) { - return SWIG_ERROR; - } - if (val) *val = JSValueToBoolean(context, obj); - return SWIG_OK; -} -} - -/* int */ - -%fragment(SWIG_From_frag(int),"header") { -SWIGINTERNINLINE JSValueRef - SWIG_From_dec(int)(int value) -{ - return JSValueMakeNumber(context, value); -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE JSValueRef -SWIG_From_dec(long)(long value) -{ - return JSValueMakeNumber(context, value); -} -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(long)(JSValueRef obj, long* val) -{ - if (!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - if(val) *val = (long) JSValueToNumber(context, obj, NULL); - - return SWIG_OK; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE JSValueRef -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return (value > LONG_MAX) ? - JSValueMakeNumber(context, value) : JSValueMakeNumber(context, %numeric_cast(value,long)); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(JSValueRef obj, unsigned long *val) -{ - long longVal; - if(!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - - longVal = (long) JSValueToNumber(context, obj, NULL); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -} - -/* long long */ -// Note: these are copied from 'long' and probably need fixing - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE JSValueRef -SWIG_From_dec(long long)(long long value) -{ - return JSValueMakeNumber(context, value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment=SWIG_AsVal_frag(long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(JSValueRef obj, long long* val) -{ - if (!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - if(val) *val = (long long) JSValueToNumber(context, obj, NULL); - - return SWIG_OK; -} -%#endif -} - -/* unsigned long long */ -// Note: these are copied from 'unsigned long' and probably need fixing - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment=SWIG_From_frag(long long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN JSValueRef -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return (value > LONG_MAX) ? - JSValueMakeNumber(context, value) : JSValueMakeNumber(context, %numeric_cast(value,long)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(JSValueRef obj, unsigned long long *val) -{ - long long longVal; - if(!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - - longVal = (unsigned long long) JSValueToNumber(context, obj, NULL); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERN JSValueRef -SWIG_From_dec(double) (double val) -{ - return JSValueMakeNumber(context, val); -} -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(JSValueRef obj, double *val) -{ - if(!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - if(val) *val = JSValueToNumber(context, obj, NULL); - - return SWIG_OK; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptrun.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptrun.swg deleted file mode 100755 index 4d5a9355..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptrun.swg +++ /dev/null @@ -1,369 +0,0 @@ -/* ---------------------------------------------------------------------------- - * Errors and exceptions - * - * ---------------------------------------------------------------------------*/ - -#define SWIG_Error(code, msg) SWIG_JSC_exception(context, exception, code, msg) -#define SWIG_exception(code, msg) do { SWIG_JSC_exception(context, exception, code, msg); SWIG_fail; } while (0) -#define SWIG_fail goto fail - -SWIGRUNTIME void SWIG_Javascript_Raise_ValueRef(JSContextRef context, JSValueRef *exception, JSValueRef valRef) { - JSValueRef error_arguments[1]; - JSObjectRef exception_object; - /* Converting the result to an object will let JavascriptCore add - "sourceURL" (file) and "line" (number) and "message" to the exception, - instead of just returning a raw string. This is extremely important for debugging your errors. - Using JSObjectMakeError is better than JSValueToObject because the latter only populates - "sourceURL" and "line", but not "message" or any others I don't know about. - */ - error_arguments[0] = valRef; - exception_object = JSObjectMakeError(context, 1, error_arguments, NULL); - - /* Return the exception_object */ - *exception = exception_object; -} - -SWIGRUNTIME void SWIG_Javascript_Raise(JSContextRef context, JSValueRef *exception, const char* msg) { - JSStringRef message = JSStringCreateWithUTF8CString(msg); - JSValueRef exception_value = JSValueMakeString(context, message); - - SWIG_Javascript_Raise_ValueRef(context, exception, exception_value); - - JSStringRelease(message); -} - -SWIGRUNTIME void SWIG_JSC_exception(JSContextRef context, JSValueRef *exception, int code, const char* msg) { - SWIG_Javascript_Raise(context, exception, msg); -} - -/* ---------------------------------------------------------------------------- - * The parent class of all Proxies - * - * ---------------------------------------------------------------------------*/ - -typedef struct { - bool swigCMemOwn; - void *swigCObject; - swig_type_info *info; -} SwigPrivData; - -SWIGRUNTIME JSValueRef _wrap_SwigObject_disown(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSValueRef jsresult; - - JSObjectRef obj = JSValueToObject(context, thisObject, NULL); - SwigPrivData *cdata = (SwigPrivData *) JSObjectGetPrivate(obj); - - cdata->swigCMemOwn = false; - - jsresult = JSValueMakeUndefined(context); - return jsresult; -} - -SWIGRUNTIME JSValueRef _wrap_SwigObject_getCPtr(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSValueRef jsresult; - long result; - - JSObjectRef obj = JSValueToObject(context, thisObject, NULL); - SwigPrivData *cdata = (SwigPrivData*) JSObjectGetPrivate(obj); - - result = (long) cdata->swigCObject; - jsresult = JSValueMakeNumber(context, result); - - return jsresult; -} - -SWIGRUNTIME JSValueRef _wrap_SwigObject_equals(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSValueRef jsresult; - bool result; - - JSObjectRef obj = JSValueToObject(context, thisObject, NULL); - SwigPrivData *cdata = (SwigPrivData*) JSObjectGetPrivate(obj); - - JSObjectRef obj2 = JSValueToObject(context, argv[0], NULL); - SwigPrivData *cdata2 = (SwigPrivData*) JSObjectGetPrivate(obj2); - - result = (cdata->swigCObject == cdata2->swigCObject); - jsresult = JSValueMakeBoolean(context, result); - - return jsresult; -} - -SWIGRUNTIME JSStaticValue _SwigObject_values[] = { - { - 0, 0, 0, 0 - } -}; - -SWIGRUNTIME JSStaticFunction _SwigObject_functions[] = { - { - "disown",_wrap_SwigObject_disown, kJSPropertyAttributeNone - }, - { - "equals",_wrap_SwigObject_equals, kJSPropertyAttributeNone - }, - { - "getCPtr",_wrap_SwigObject_getCPtr, kJSPropertyAttributeNone - }, - { - 0, 0, 0 - } -}; - -SWIGRUNTIME JSClassDefinition _SwigObject_objectDefinition; - -SWIGRUNTIME JSClassRef _SwigObject_classRef; - - -SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** ptr, swig_type_info *info, int flags) { - SwigPrivData *cdata; - - cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); - if (cdata == NULL) { - return SWIG_ERROR; - } - assert(ptr); - *ptr = NULL; - if (!info || cdata->info == info) { - *ptr = cdata->swigCObject; - } else { - swig_cast_info *tc = SWIG_TypeCheckStruct(cdata->info, info); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, cdata->swigCObject, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !cdata->swigCMemOwn) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (flags & SWIG_POINTER_DISOWN) { - cdata->swigCMemOwn = false; - } - if (flags & SWIG_POINTER_CLEAR) { - cdata->swigCObject = 0; - } - } - - return SWIG_OK; -} - -SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { - JSObjectRef objRef; - - /* special case: JavaScript null => C NULL pointer */ - if(JSValueIsNull(context, valRef)) { - *ptr=0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - if(!JSValueIsObject(context, valRef)) { - return SWIG_TypeError; - } - - objRef = JSValueToObject(context, valRef, NULL); - if(objRef == NULL) { - return SWIG_ERROR; - } - - return SWIG_JSC_ConvertInstancePtr(context, objRef, ptr, info, flags); -} - -SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, swig_type_info *info, int flags) { - JSClassRef classRef; - JSObjectRef result; - SwigPrivData *cdata; - - if (ptr == NULL) { - // HACK: it is not possible to use JSValueToObject (causing seg-fault) - // This static cast turned out to be a workaround - // In future, we should change the interface of this method - // to return JSValueRef instead of JSObjectRef. - return (JSObjectRef) JSValueMakeNull(context); - } - - if(info->clientdata == NULL) { - classRef = _SwigObject_classRef; - } else { - classRef = (JSClassRef) info->clientdata; - } - - result = JSObjectMake(context, classRef, NULL); - - cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); - cdata->swigCObject = ptr; - cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; - cdata->info = info; - - JSObjectSetPrivate(result, cdata); - - return result; -} - -#define SWIG_ConvertPtr(obj, ptr, info, flags) SWIG_JSC_ConvertPtr(context, obj, ptr, info, flags) -#define SWIG_NewPointerObj(ptr, info, flags) SWIG_JSC_NewPointerObj(context, ptr, info, flags) - -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_JSC_ConvertInstancePtr(context, obj, pptr, type, flags) -#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_JSC_NewPointerObj(context, thisvalue, type, flags) - -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_JSC_ConvertPtr(context, obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_JSC_NewPointerObj(context, ptr, type, 0) - -/* ---------------------------------------------------------------------------- - * A class for packed data - * - * ---------------------------------------------------------------------------*/ - -typedef struct { - void *data; - size_t size; - swig_type_info *type; -} SwigPackedData; - -SWIGRUNTIME JSStaticValue _SwigPackedData_values[] = { - { - 0, 0, 0, 0 - } -}; -SWIGRUNTIME JSStaticFunction _SwigPackedData_functions[] = { - { - 0, 0, 0 - } -}; -SWIGRUNTIME JSClassDefinition _SwigPackedData_objectDefinition; -SWIGRUNTIME JSClassRef _SwigPackedData_classRef; - -SWIGRUNTIMEINLINE -int SwigJSCPacked_Check(JSContextRef context, JSValueRef valRef) { - return JSValueIsObjectOfClass(context, valRef, _SwigPackedData_classRef); -} - -SWIGRUNTIME -swig_type_info* SwigJSCPacked_UnpackData(JSContextRef context, JSValueRef valRef, void *ptr, size_t size) { - if (SwigJSCPacked_Check(context, valRef)) { - JSObjectRef objRef = JSValueToObject(context, valRef, NULL); - SwigPackedData *sobj = (SwigPackedData *) JSObjectGetPrivate(objRef); - if (sobj->size != size) return 0; - memcpy(ptr, sobj->data, size); - return sobj->type; - } else { - return 0; - } -} - -SWIGRUNTIME -int SWIG_JSC_ConvertPacked(JSContextRef context, JSValueRef valRef, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigJSCPacked_UnpackData(context, valRef, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -SWIGRUNTIME -JSValueRef SWIG_JSC_NewPackedObj(JSContextRef context, void *data, size_t size, swig_type_info *type) { - - JSClassRef classRef = _SwigObject_classRef; - JSObjectRef result = JSObjectMake(context, classRef, NULL); - - SwigPackedData* cdata = (SwigPackedData*) malloc(sizeof(SwigPackedData)); - cdata->data = data; - cdata->size = size; - cdata->type = type; - - JSObjectSetPrivate(result, cdata); - - return result; -} - -/* SwigPackedData wrappers */ -SWIGRUNTIME -void _wrap_SwigPackedData_delete(JSObjectRef obj) -{ - SwigPackedData* cdata = (SwigPackedData*) JSObjectGetPrivate(obj); - if (cdata) { - free(cdata->data); - } -} - -/* for C++ member pointers, ie, member methods */ - -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_JSC_ConvertPacked(context, obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_JSC_NewPackedObj(context, ptr, sz, type) - - -/* --------------------------------------------------------------------------- - * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) - * - * ---------------------------------------------------------------------------*/ -SWIGRUNTIME -unsigned int SWIGJSC_ArrayLength(JSContextRef context, JSObjectRef arr) { - static JSStringRef LENGTH = 0; - JSValueRef exception = NULL; - JSValueRef js_length; - double length; - - if (LENGTH == 0) { - LENGTH = JSStringCreateWithUTF8CString("length"); - } - - js_length = JSObjectGetProperty(context, arr, LENGTH, &exception); - if (exception == 0 && JSValueIsNumber(context, js_length)) { - length = JSValueToNumber(context, js_length, 0); - return (unsigned int) length; - } else { - return 0; - } -} - -SWIGRUNTIME -bool SWIGJSC_ValueIsArray(JSContextRef context, JSValueRef value) { - if (JSValueIsObject(context, value)) { - static JSStringRef ArrayString = NULL; - static JSStringRef isArrayString = NULL; - JSObjectRef array = NULL; - JSObjectRef isArray = NULL; - JSValueRef retval = NULL; - - if (!ArrayString) - ArrayString = JSStringCreateWithUTF8CString("Array"); - if (!isArrayString) - isArrayString = JSStringCreateWithUTF8CString("isArray"); - - array = (JSObjectRef)JSObjectGetProperty(context, JSContextGetGlobalObject(context), ArrayString, NULL); - isArray = (JSObjectRef)JSObjectGetProperty(context, array, isArrayString, NULL); - retval = JSObjectCallAsFunction(context, isArray, NULL, 1, &value, NULL); - - if (JSValueIsBoolean(context, retval)) - return JSValueToBoolean(context, retval); - } - return false; -} - -SWIGRUNTIME -JSValueRef SWIGJSC_AppendOutput(JSContextRef context, JSValueRef value, JSValueRef obj) { - JSObjectRef arr; - unsigned int length; - - if (JSValueIsUndefined(context, value)) { - arr = JSObjectMakeArray(context, 0, 0, 0); - } else if (!SWIGJSC_ValueIsArray(context, value)) { - arr = JSObjectMakeArray(context, 1, &value, 0); - } else { - arr = JSValueToObject(context, value, 0); - } - - length = SWIGJSC_ArrayLength(context, arr); - JSObjectSetPropertyAtIndex(context, arr, length, obj, 0); - return arr; -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptruntime.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptruntime.swg deleted file mode 100755 index a626390c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptruntime.swg +++ /dev/null @@ -1,20 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascriptruntime.swg - * - * Javascript support code - * ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ -#include -#include -#include -#include -#include -#include -#include -%} - -%insert(runtime) "swigrun.swg"; /* SWIG API */ -%insert(runtime) "swigerrors.swg"; /* SWIG errors */ - -%insert(runtime) "javascriptrun.swg"; /* SWIG errors */ diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptstrings.swg b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptstrings.swg deleted file mode 100755 index 5c8081a8..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptstrings.swg +++ /dev/null @@ -1,187 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_JSC_AsCharPtrAndSize(JSContextRef context, JSValueRef valRef, char** cptr, size_t* psize, int *alloc) -{ - if(JSValueIsString(context, valRef)) { - JSStringRef js_str = JSValueToStringCopy(context, valRef, NULL); - size_t len = JSStringGetMaximumUTF8CStringSize(js_str); - char* cstr = (char*) %new_array(len, char); - /* JSStringGetUTF8CString returns the length including 0-terminator */ - len = JSStringGetUTF8CString(js_str, cstr, len); - - if(alloc) *alloc = SWIG_NEWOBJ; - if(psize) *psize = len; - if(cptr) *cptr = cstr; - - return SWIG_OK; - } else { - if(JSValueIsObject(context, valRef)) { - JSObjectRef obj = JSValueToObject(context, valRef, NULL); - // try if the object is a wrapped char[] - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - return SWIG_TypeError; - } else { - return SWIG_TypeError; - } - } -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE JSValueRef -SWIG_JSC_FromCharPtrAndSize(JSContextRef context, const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - // TODO: handle extra long strings - //swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - //return pchar_descriptor ? - // SWIG_InternalNewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : SWIG_Py_Void(); - return JSValueMakeUndefined(context); - } else { - JSStringRef jsstring; - JSValueRef result; - if(size < 2) { - char c[2]; - int i; - for(i=0;i - -/* Look for user fragments file. */ -%include - -/* Javascript fragments for fundamental types */ -%include - -/* Javascript fragments for char* strings */ -%include - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -#define SWIG_Object JSValueRef -#define VOID_Object JSValueMakeUndefined(context) - -/* append output */ -#define SWIG_AppendOutput(result, obj) SWIGJSC_AppendOutput(context, result, obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) - -/* raise */ -#define SWIG_Raise(obj, type, desc) SWIG_Javascript_Raise_ValueRef(context, exception, obj) - -%insert("runtime") %{ -#define SWIG_JSC_FROM_DECL_ARGS(arg1) (JSContextRef context, arg1) -#define SWIG_JSC_FROM_CALL_ARGS(arg1) (context, arg1) -#define SWIG_JSC_AS_DECL_ARGS(arg1, arg2) (JSContextRef context, arg1, arg2) -#define SWIG_JSC_AS_CALL_ARGS(arg1, arg2) (context, arg1, arg2) -%} - -/* Include the unified typemap library */ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_common.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_complex.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_complex.i deleted file mode 100755 index a252e0aa..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_complex.i +++ /dev/null @@ -1,26 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_deque.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_except.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_map.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_map.i deleted file mode 100755 index 9fa10880..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_map.i +++ /dev/null @@ -1,81 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_pair.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_string.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_vector.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_vector.i deleted file mode 100755 index 586ac5c6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/std_vector.i +++ /dev/null @@ -1,99 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/swigmove.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/typemaps.i b/linux/bin/swig/share/swig/4.1.0/javascript/jsc/typemaps.i deleted file mode 100755 index b5b441bc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/jsc/typemaps.i +++ /dev/null @@ -1,148 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Python tuple. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Python output of the function would be a tuple containing both -output values. - -*/ - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Python tuple. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Python). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Python variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/arrays_javascript.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/arrays_javascript.i deleted file mode 100755 index 6dc7e4b9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/arrays_javascript.i +++ /dev/null @@ -1,86 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_javascript.i - * - * These typemaps give more natural support for arrays. The typemaps are not efficient - * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from JavaScript and vice versa. The JavaScript array is expected to be the same size as the C array. - * An exception is thrown if they are not. - * - * Example usage: - * Wrapping: - * - * %include - * %inline %{ - * extern int FiddleSticks[3]; - * %} - * - * Use from JavaScript like this: - * - * var fs = [10, 11, 12]; - * example.FiddleSticks = fs; - * fs = example.FiddleSticks; - * ----------------------------------------------------------------------------- */ - - -%fragment("SWIG_JSCGetIntProperty", "header", fragment=SWIG_AsVal_frag(int)) {} -%fragment("SWIG_JSCGetNumberProperty", "header", fragment=SWIG_AsVal_frag(double)) {} -%fragment("SWIG_JSCOutInt", "header", fragment=SWIG_From_frag(int)) {} -%fragment("SWIG_JSCOutNumber", "header", fragment=SWIG_From_frag(double)) {} - -%define JAVASCRIPT_ARRAYS_IN_DECL(NAME, CTYPE, ANY, ANYLENGTH) - -%typemap(in, fragment=NAME) CTYPE[ANY] { - if ($input->IsArray()) { - // Convert into Array - v8::Local array = v8::Local::Cast($input); - - int length = ANYLENGTH; - - $1 = ($*1_ltype *)malloc(sizeof($*1_ltype) * length); - - // Get each element from array - for (int i = 0; i < length; i++) { - v8::Local jsvalue = SWIGV8_ARRAY_GET(array, i); - $*1_ltype temp; - - // Get primitive value from JSObject - int res = SWIG_AsVal(CTYPE)(jsvalue, &temp); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ERROR, "Failed to convert $input to double"); - } - arg$argnum[i] = temp; - } - } else { - SWIG_exception_fail(SWIG_ERROR, "$input is not an array"); - } -} - -%typemap(freearg) CTYPE[ANY] { - free($1); -} - -%enddef - -%define JAVASCRIPT_ARRAYS_OUT_DECL(NAME, CTYPE) - -%typemap(out, fragment=NAME) CTYPE[ANY] { - int length = $1_dim0; - v8::Local array = SWIGV8_ARRAY_NEW(length); - - for (int i = 0; i < length; i++) { - SWIGV8_ARRAY_SET(array, i, SWIG_From(CTYPE)($1[i])); - } - - $result = array; -} - -%enddef - -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, , array->Length()) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, ANY, $1_dim0) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, , array->Length()) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, ANY, $1_dim0) - -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutInt", int) -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutNumber", double) - diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/ccomplex.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/ccomplex.i deleted file mode 100755 index e58dbf71..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/ccomplex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ccomplex.i - * - * C complex typemaps - * ISO C99: 7.3 Complex arithmetic - * ----------------------------------------------------------------------------- */ - - -%include - -%{ -#include -%} - -#define complex _Complex - -/* C complex constructor */ -#define CCplxConst(r, i) ((r) + I*(i)) - -%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); - -/* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/cdata.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/complex.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/complex.i deleted file mode 100755 index 4c3b3c5e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/complex.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __cplusplus -%include -#else -%include -#endif - diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/exception.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/exception.i deleted file mode 100755 index 0246cfde..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/exception.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascript.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascript.swg deleted file mode 100755 index 3a83b649..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascript.swg +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascript.swg - * - * Javascript typemaps - * ----------------------------------------------------------------------------- */ - -%include - -%include - -%include - -%include - -%include - -%include - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcode.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcode.swg deleted file mode 100755 index dcda0ee6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcode.swg +++ /dev/null @@ -1,435 +0,0 @@ -/* ----------------------------------------------------------------------------- - * js_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ - -%fragment("js_ctor", "templates") %{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_OBJECT self = args.Holder(); - $jslocals - if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper."); - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - $jscode - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_veto_ctor: a vetoing ctor for abstract classes - * - $jswrapper: name of wrapper - * - $jsname: class name - * ----------------------------------------------------------------------------- */ -%fragment ("js_veto_ctor", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIG_exception(SWIG_ERROR, "Class $jsname can not be instantiated"); -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatcher: dispatcher for overloaded constructors - * - $jswrapper: name of wrapper - * - $jsname: class name - * - $jsdispatchcases: part containing code for dispatching - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatcher", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - OverloadErrorHandler errorHandler; - SWIGV8_VALUE self; - - // switch all cases by means of series of if-returns. - $jsdispatchcases - - // default: - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of $jsmangledname"); - -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ -%fragment("js_overloaded_ctor", "templates") %{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_OBJECT self = args.Holder(); - $jslocals - if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper."); - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - $jscode - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatch_case: template for a dispatch case for calling an overloaded ctor. - * - $jsargcount: number of arguments of called ctor - * - $jswrapper: wrapper of called ctor - * - * Note: a try-catch-like mechanism is used to switch cases - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatch_case", "templates") -%{ - if(args.Length() == $jsargcount) { - errorHandler.err.Clear(); - $jswrapper(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } - } -%} - -/* ----------------------------------------------------------------------------- - * js_dtor: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtor", "templates") -%{ - -static void $jswrapper(const v8::WeakCallbackInfo &data) { - SWIGV8_Proxy *proxy = data.GetParameter(); - - if(proxy->swigCMemOwn && proxy->swigCObject) { -#ifdef SWIGRUNTIME_DEBUG - printf("Deleting wrapped instance: %s\n", proxy->info->name); -#endif - $jsfree proxy->swigCObject; - } - delete proxy; -} -%} - -/* ----------------------------------------------------------------------------- - * js_dtoroverride: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * - ${destructor_action}: The custom destructor action to invoke. - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtoroverride", "templates") -%{ -static void $jswrapper(const v8::WeakCallbackInfo &data) { - SWIGV8_Proxy *proxy = data.GetParameter(); - - if(proxy->swigCMemOwn && proxy->swigCObject) { - $jstype arg1 = ($jstype)proxy->swigCObject; - ${destructor_action} - } - delete proxy; -} -%} - -/* ----------------------------------------------------------------------------- - * js_getter: template for getter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_getter", "templates") -%{ -static SwigV8ReturnValue $jswrapper(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - $jslocals - $jscode - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} -%} - -/* ----------------------------------------------------------------------------- - * js_setter: template for setter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_setter", "templates") -%{ -static void $jswrapper(v8::Local property, v8::Local value, const SwigV8PropertyCallbackInfoVoid &info) { - SWIGV8_HANDLESCOPE(); - - $jslocals - $jscode - goto fail; -fail: - return; -} -%} - -/* ----------------------------------------------------------------------------- - * js_function: template for function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_function", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - $jslocals - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatcher: template for a function dispatcher for overloaded functions - * - $jswrapper: wrapper function name - * - $jsname: name of the wrapped function - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_function_dispatcher", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - OverloadErrorHandler errorHandler; - $jscode - - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function $jsname."); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_function: template for a overloaded function - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_overloaded_function", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) -{ - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - $jslocals - $jscode - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatch_case: template for a case used in the function dispatcher - * - $jswrapper: wrapper function name - * - $jsargcount: number of arguments of overloaded function - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function_dispatch_case", "templates") -%{ - - if(args.Length() == $jsargcount) { - errorHandler.err.Clear(); - $jswrapper(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } - } -%} - -/* ----------------------------------------------------------------------------- - * jsv8_declare_class_template: template for a class template declaration. - * - $jsmangledname: mangled class name - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_declare_class_template", "templates") -%{ - SWIGV8_ClientData $jsmangledname_clientData; -%} - -/* ----------------------------------------------------------------------------- - * jsv8_define_class_template: template for a class template definition. - * - $jsmangledname: mangled class name - * - $jsmangledtype: mangled class type - * - $jsdtor: the dtor wrapper - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_define_class_template", "templates") -%{ - /* Name: $jsmangledname, Type: $jsmangledtype, Dtor: $jsdtor */ - SWIGV8_FUNCTION_TEMPLATE $jsmangledname_class = SWIGV8_CreateClassTemplate("$jsmangledname"); - SWIGV8_SET_CLASS_TEMPL($jsmangledname_clientData.class_templ, $jsmangledname_class); - $jsmangledname_clientData.dtor = $jsdtor; - if (SWIGTYPE_$jsmangledtype->clientdata == 0) { - SWIGTYPE_$jsmangledtype->clientdata = &$jsmangledname_clientData; - } -%} - - -/* ----------------------------------------------------------------------------- - * jsv8_inherit: template for an class inherit statement. - * - $jsmangledname: mangled class name - * - $jsbaseclass: mangled name of the base class - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_inherit", "templates") -%{ - if (SWIGTYPE_p$jsbaseclass->clientdata && !(static_cast(SWIGTYPE_p$jsbaseclass->clientdata)->class_templ.IsEmpty())) - { - $jsmangledname_class->Inherit( - v8::Local::New( - v8::Isolate::GetCurrent(), - static_cast(SWIGTYPE_p$jsbaseclass->clientdata)->class_templ) - ); - -#ifdef SWIGRUNTIME_DEBUG - printf("Inheritance successful $jsmangledname $jsbaseclass\n"); -#endif - } else { -#ifdef SWIGRUNTIME_DEBUG - printf("Unable to inherit baseclass, it didn't exist $jsmangledname $jsbaseclass\n"); -#endif - } -%} - -/* ----------------------------------------------------------------------------- - * jsv8_create_class_instance: template for creating an class object. - * - $jsname: class name - * - $jsmangledname: mangled class name - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_create_class_instance", "templates") -%{ - /* Class: $jsname ($jsmangledname) */ - SWIGV8_FUNCTION_TEMPLATE $jsmangledname_class_0 = SWIGV8_CreateClassTemplate("$jsname"); - $jsmangledname_class_0->SetCallHandler($jsctor); - $jsmangledname_class_0->Inherit($jsmangledname_class); -#if (SWIG_V8_VERSION < 0x0704) - $jsmangledname_class_0->SetHiddenPrototype(true); - v8::Local $jsmangledname_obj = $jsmangledname_class_0->GetFunction(); -#else - v8::Local $jsmangledname_obj = $jsmangledname_class_0->GetFunction(context).ToLocalChecked(); -#endif -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_class: template for a statement that registers a class in a parent namespace. - * - $jsname: class name - * - $jsmangledname: mangled class name - * - $jsparent: mangled name of parent namespace - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_class", "templates") -%{ - SWIGV8_MAYBE_CHECK($jsparent_obj->Set(context, SWIGV8_SYMBOL_NEW("$jsname"), $jsmangledname_obj)); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_create_namespace: template for a statement that creates a namespace object. - * - $jsmangledname: mangled namespace name - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_create_namespace", "templates") -%{ - SWIGV8_OBJECT $jsmangledname_obj = SWIGV8_OBJECT_NEW(); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_namespace: template for a statement that registers a namespace in a parent namespace. - * - $jsname: name of namespace - * - $jsmangledname: mangled name of namespace - * - $jsparent: mangled name of parent namespace - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_namespace", "templates") -%{ - SWIGV8_MAYBE_CHECK($jsparent_obj->Set(context, SWIGV8_SYMBOL_NEW("$jsname"), $jsmangledname_obj)); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_member_function: template for a statement that registers a member function. - * - $jsmangledname: mangled class name - * - $jsname: name of the function - * - $jswrapper: wrapper of the member function - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_member_function", "templates") -%{ - SWIGV8_AddMemberFunction($jsmangledname_class, "$jsname", $jswrapper); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_member_variable: template for a statement that registers a member variable. - * - $jsmangledname: mangled class name - * - $jsname: name of the function - * - $jsgetter: wrapper of the getter function - * - $jssetter: wrapper of the setter function - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_member_variable", "templates") -%{ - SWIGV8_AddMemberVariable($jsmangledname_class, "$jsname", $jsgetter, $jssetter); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_static_function: template for a statement that registers a static class function. - * - $jsname: function name - * - $jswrapper: wrapper of the function - * - $jsparent: mangled name of parent namespace - * - * Note: this template is also used for global functions. - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_static_function", "templates") -%{ - SWIGV8_AddStaticFunction($jsparent_obj, "$jsname", $jswrapper, context); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_static_variable: template for a statement that registers a static variable. - * - $jsname: variable name - * - $jsparent: mangled name of parent namespace - * - $jsgetter: wrapper of the getter function - * - $jssetter: wrapper of the setter function - * - * Note: this template is also used for global variables. - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_static_variable", "templates") -%{ - SWIGV8_AddStaticVariable($jsparent_obj, "$jsname", $jsgetter, $jssetter, context); -%} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcomplex.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcomplex.swg deleted file mode 100755 index 7b3c5547..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcomplex.swg +++ /dev/null @@ -1,124 +0,0 @@ -/* - Defines the As/From converters for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header", - fragment=SWIG_From_frag(double)) -{ -SWIGINTERNINLINE SWIGV8_VALUE -SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) -{ - SWIGV8_HANDLESCOPE_ESC(); - - v8::Local vals = SWIGV8_ARRAY_NEW(0); - - SWIGV8_ARRAY_SET(vals, 0, SWIG_From(double)(Real(c))); - SWIGV8_ARRAY_SET(vals, 1, SWIG_From(double)(Imag(c))); - SWIGV8_ESCAPE(vals); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ -SWIGINTERN int -SWIG_AsVal_dec(Type) (SWIGV8_VALUE o, Type* val) -{ - SWIGV8_HANDLESCOPE(); - - if (o->IsArray()) { - SWIGV8_ARRAY array = SWIGV8_ARRAY::Cast(o); - - if (array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); - double re, im; - int res; - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 0), &re); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 1), &im); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if (val) *val = Constructor(re, im); - return SWIG_OK; - } else if (o->IsNumber()) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { -SWIGINTERN int -SWIG_AsVal_dec(Type) (SWIGV8_VALUE o, Type* val) -{ - SWIGV8_HANDLESCOPE(); - - if (o->IsArray()) { - SWIGV8_ARRAY array = SWIGV8_ARRAY::Cast(o); - - if (array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); - double re, im; - int res; - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 0), &re); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 1), &im); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else if (o->IsNumber()) { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptfragments.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptfragments.swg deleted file mode 100755 index 4778bf03..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'javascriptfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the default ones defined by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascripthelpers.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascripthelpers.swg deleted file mode 100755 index ea303fa3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascripthelpers.swg +++ /dev/null @@ -1,87 +0,0 @@ -%insert(runtime) %{ - -typedef v8::FunctionCallback SwigV8FunctionCallback; -typedef v8::AccessorNameGetterCallback SwigV8AccessorGetterCallback; -typedef v8::AccessorNameSetterCallback SwigV8AccessorSetterCallback; -typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfoVoid; - -/** - * Creates a class template for a class with specified initialization function. - */ -SWIGRUNTIME SWIGV8_FUNCTION_TEMPLATE SWIGV8_CreateClassTemplate(const char* symbol) { - SWIGV8_HANDLESCOPE_ESC(); - - v8::Local class_templ = SWIGV8_FUNCTEMPLATE_NEW_VOID(); - class_templ->SetClassName(SWIGV8_SYMBOL_NEW(symbol)); - - SWIGV8_OBJECT_TEMPLATE inst_templ = class_templ->InstanceTemplate(); - inst_templ->SetInternalFieldCount(1); - - SWIGV8_OBJECT_TEMPLATE equals_templ = class_templ->PrototypeTemplate(); - equals_templ->Set(SWIGV8_SYMBOL_NEW("equals"), SWIGV8_FUNCTEMPLATE_NEW(_SWIGV8_wrap_equals)); - - SWIGV8_OBJECT_TEMPLATE cptr_templ = class_templ->PrototypeTemplate(); - cptr_templ->Set(SWIGV8_SYMBOL_NEW("getCPtr"), SWIGV8_FUNCTEMPLATE_NEW(_wrap_getCPtr)); - - SWIGV8_ESCAPE(class_templ); -} - -/** - * Registers a class method with given name for a given class template. - */ -SWIGRUNTIME void SWIGV8_AddMemberFunction(SWIGV8_FUNCTION_TEMPLATE class_templ, const char* symbol, - SwigV8FunctionCallback _func) { - SWIGV8_OBJECT_TEMPLATE proto_templ = class_templ->PrototypeTemplate(); - proto_templ->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)); -} - -/** - * Registers a class property with given name for a given class template. - */ -SWIGRUNTIME void SWIGV8_AddMemberVariable(SWIGV8_FUNCTION_TEMPLATE class_templ, const char* symbol, - SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) { - SWIGV8_OBJECT_TEMPLATE proto_templ = class_templ->InstanceTemplate(); - proto_templ->SetAccessor(SWIGV8_SYMBOL_NEW(symbol), getter, setter); -} - -/** - * Registers a class method with given name for a given object. - */ -SWIGRUNTIME void SWIGV8_AddStaticFunction(SWIGV8_OBJECT obj, const char* symbol, - const SwigV8FunctionCallback& _func, v8::Local context) { - SWIGV8_MAYBE_CHECK(obj->Set(context, SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)->GetFunction(context).ToLocalChecked())); -} - -/** - * Registers a class method with given name for a given object. - */ -SWIGRUNTIME void SWIGV8_AddStaticVariable(SWIGV8_OBJECT obj, const char* symbol, - SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter, - v8::Local context) { - SWIGV8_MAYBE_CHECK(obj->SetAccessor(context, SWIGV8_SYMBOL_NEW(symbol), getter, setter)); -} - -SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local value, const SwigV8PropertyCallbackInfoVoid& info) -{ - char buffer[256]; - char msg[512]; - int res; - - v8::Local sproperty; - if (property->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocal(&sproperty)) { - SWIGV8_WRITE_UTF8(sproperty, buffer, 256); - res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); - } - else { - res = -1; - } - - if(res<0) { - SWIG_exception(SWIG_ERROR, "Tried to write read-only variable."); - } else { - SWIG_exception(SWIG_ERROR, msg); - } -fail: ; -} - -%} // v8_helper_functions diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptinit.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptinit.swg deleted file mode 100755 index 3bf8c416..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptinit.swg +++ /dev/null @@ -1,126 +0,0 @@ -%insert(header) %{ -#include -%} - -%insert(init) %{ - -SWIGRUNTIME void -SWIG_V8_SetModule(v8::Local context, swig_module_info *swig_module) { - v8::Local global_obj = context->Global(); - v8::Local mod = SWIGV8_EXTERNAL_NEW(swig_module); - assert(!mod.IsEmpty()); - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("swig_module_info_data")); - global_obj->SetPrivate(context, privateKey, mod); -} - -SWIGRUNTIME swig_module_info * -SWIG_V8_GetModule(v8::Local context) { - v8::Local global_obj = context->Global(); - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("swig_module_info_data")); - v8::Local moduleinfo; - if (!global_obj->GetPrivate(context, privateKey).ToLocal(&moduleinfo)) - return 0; - - if (moduleinfo.IsEmpty() || moduleinfo->IsNull() || moduleinfo->IsUndefined()) - { - // It's not yet loaded - return 0; - } - - v8::Local moduleinfo_extern = v8::Local::Cast(moduleinfo); - - if (moduleinfo_extern.IsEmpty() || moduleinfo_extern->IsNull() || moduleinfo_extern->IsUndefined()) - { - // Something's not right - return 0; - } - - void *ptr = moduleinfo_extern->Value(); - assert(ptr); - swig_module_info *retptr = static_cast(ptr); - assert(retptr); - return retptr; -} - -#define SWIG_GetModule(clientdata) SWIG_V8_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_V8_SetModule(clientdata, pointer) -#define SWIG_INIT_CLIENT_DATA_TYPE v8::Local - -%} - -%insert(init) "swiginit.swg" - -// Open the initializer function definition here - -%fragment ("js_initializer_define", "templates") %{ -#define SWIGV8_INIT $jsname_initialize -%} - -%insert(init) %{ -#if !defined(NODE_MODULE_VERSION) || (NODE_MODULE_VERSION < 12) -// Note: 'extern "C"'' disables name mangling which makes it easier to load the symbol manually -extern "C" void SWIGV8_INIT (SWIGV8_OBJECT exports_obj) -#elif (NODE_MODULE_VERSION < 64) -void SWIGV8_INIT (SWIGV8_OBJECT exports_obj, SWIGV8_VALUE /*module*/, void*) -#else -void SWIGV8_INIT (SWIGV8_OBJECT exports_obj, SWIGV8_VALUE /*module*/, v8::Local context, void*) -#endif -{ -#if !defined(NODE_MODULE_VERSION) || NODE_MODULE_VERSION < 64 - v8::Local context = SWIGV8_CURRENT_CONTEXT(); -#endif - - SWIG_InitializeModule(context); -%} - - -/* ----------------------------------------------------------------------------- - * js_initializer: template for the module initializer function - * - $jsname: module name - * - $jsv8nspaces: part with code creating namespace objects - * - $jsv8classtemplates: part with code creating class templates - * - $jsv8wrappers: part with code that registers wrapper functions - * - $jsv8inheritance: part with inherit statements - * - $jsv8classinstances: part with code creating class objects - * - $jsv8staticwrappers: part with code adding static functions to class objects - * - $jsv8registerclasses: part with code that registers class objects in namespaces - * - $jsv8registernspaces: part with code that registers namespaces in parent namespaces - * ----------------------------------------------------------------------------- */ -%fragment("js_initializer", "templates") -%{ - // a class template for creating proxies of undefined types - SWIGV8_SET_CLASS_TEMPL(SWIGV8_SWIGTYPE_Proxy_class_templ, SWIGV8_CreateClassTemplate("SwigProxy")); - - /* create objects for namespaces */ - $jsv8nspaces - - /* create class templates */ - $jsv8classtemplates - - /* register wrapper functions */ - $jsv8wrappers - - /* setup inheritances */ - $jsv8inheritance - - /* class instances */ - $jsv8classinstances - - /* add static class functions and variables */ - $jsv8staticwrappers - - /* register classes */ - $jsv8registerclasses - - /* create and register namespace objects */ - $jsv8registernspaces -} - -#if defined(BUILDING_NODE_EXTENSION) -#if (NODE_MODULE_VERSION < 64) -NODE_MODULE($jsname, $jsname_initialize) -#else -NODE_MODULE_CONTEXT_AWARE($jsname, $jsname_initialize) -#endif -#endif -%} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptkw.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptkw.swg deleted file mode 100755 index c3c11839..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptkw.swg +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef JAVASCRIPT_JAVASCRIPTKW_SWG_ -#define JAVASCRIPT_JAVASCRIPTKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVASCRIPTKW(x) %keywordwarn("'" `x` "' is a javascript keyword, renaming to '_"`x`"'",rename="_%s") `x` - -/* Taken from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words */ - -JAVASCRIPTKW(break); -JAVASCRIPTKW(case); -JAVASCRIPTKW(catch); -JAVASCRIPTKW(continue); -JAVASCRIPTKW(default); -JAVASCRIPTKW(delete); -JAVASCRIPTKW(do); -JAVASCRIPTKW(else); -JAVASCRIPTKW(finally); -JAVASCRIPTKW(for); -JAVASCRIPTKW(function); -JAVASCRIPTKW(if); -JAVASCRIPTKW(in); -JAVASCRIPTKW(instanceof); -JAVASCRIPTKW(new); -JAVASCRIPTKW(return); -JAVASCRIPTKW(switch); -JAVASCRIPTKW(this); -JAVASCRIPTKW(throw); -JAVASCRIPTKW(try); -JAVASCRIPTKW(typeof); -JAVASCRIPTKW(var); -JAVASCRIPTKW(void); -JAVASCRIPTKW(while); -JAVASCRIPTKW(with); - -/* others bad names if any*/ -// for example %namewarn("321:clone() is a javascript bad method name") *::clone(); - -#undef JAVASCRIPTKW - -#endif //JAVASCRIPT_JAVASCRIPTKW_SWG_ diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptprimtypes.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptprimtypes.swg deleted file mode 100755 index 8ed571df..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptprimtypes.swg +++ /dev/null @@ -1,203 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE -SWIGV8_VALUE -SWIG_From_dec(bool)(bool value) -{ - return SWIGV8_BOOLEAN_NEW(value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN -int SWIG_AsVal_dec(bool)(SWIGV8_VALUE obj, bool *val) -{ - if(!obj->IsBoolean()) { - return SWIG_ERROR; - } - - if (val) *val = SWIGV8_BOOLEAN_VALUE(obj); - return SWIG_OK; -} -} - -/* int */ - -%fragment(SWIG_From_frag(int),"header") { -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(int)(int value) -{ - return SWIGV8_INT32_NEW(value); -} -} - -%fragment(SWIG_AsVal_frag(int),"header") { -SWIGINTERN -int SWIG_AsVal_dec(int)(SWIGV8_VALUE valRef, int* val) -{ - if (!valRef->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = SWIGV8_INTEGER_VALUE(valRef); - - return SWIG_OK; -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(long)(long value) -{ - return SWIGV8_NUMBER_NEW(value); -} -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN -int SWIG_AsVal_dec(long)(SWIGV8_VALUE obj, long* val) -{ - if (!obj->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = (long) SWIGV8_INTEGER_VALUE(obj); - - return SWIG_OK; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(unsigned long)(unsigned long value) -{ - return value <= UINT32_MAX ? (SWIGV8_VALUE)SWIGV8_INTEGER_NEW_UNS(value) : (SWIGV8_VALUE)SWIGV8_NUMBER_NEW(static_cast(value)); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN -int SWIG_AsVal_dec(unsigned long)(SWIGV8_VALUE obj, unsigned long *val) -{ - if(!obj->IsNumber()) { - return SWIG_TypeError; - } - - long longVal = (long) SWIGV8_NUMBER_VALUE(obj); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -} - -/* long long */ -// Note: these are copied from 'long' and probably need fixing - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(long long)(long long value) -{ - return SWIGV8_NUMBER_NEW(value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment=SWIG_AsVal_frag(long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN -int SWIG_AsVal_dec(long long)(SWIGV8_VALUE obj, long long* val) -{ - if (!obj->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = (long long) SWIGV8_INTEGER_VALUE(obj); - - return SWIG_OK; -} -%#endif -} - -/* unsigned long long */ -// Note: these are copied from 'unsigned long' and probably need fixing - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment=SWIG_From_frag(long long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return value <= UINT32_MAX ? (SWIGV8_VALUE)SWIGV8_INTEGER_NEW_UNS(value) : (SWIGV8_VALUE)SWIGV8_NUMBER_NEW(static_cast(value)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN -int SWIG_AsVal_dec(unsigned long long)(SWIGV8_VALUE obj, unsigned long long *val) -{ - if(!obj->IsNumber()) { - return SWIG_TypeError; - } - - long long longVal = (long long) SWIGV8_NUMBER_VALUE(obj); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERN -SWIGV8_VALUE SWIG_From_dec(double) (double val) -{ - return SWIGV8_NUMBER_NEW(val); -} -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN -int SWIG_AsVal_dec(double)(SWIGV8_VALUE obj, double *val) -{ - if(!obj->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = SWIGV8_NUMBER_VALUE(obj); - - return SWIG_OK; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptrun.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptrun.swg deleted file mode 100755 index f7627085..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptrun.swg +++ /dev/null @@ -1,487 +0,0 @@ -/* --------------------------------------------------------------------------- - * These typedefs and defines are used to deal with v8 API changes - * - * Useful table of versions: https://nodejs.org/en/download/releases/ - * ---------------------------------------------------------------------------*/ - -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_STRING_NEW2(cstr, len) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::String::kNormalString, len) -#else -#define SWIGV8_STRING_NEW2(cstr, len) (v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::NewStringType::kNormal, len)).ToLocalChecked() -#endif - -typedef void SwigV8ReturnValue; -typedef v8::FunctionCallbackInfo SwigV8Arguments; -typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; -#define SWIGV8_RETURN(val) args.GetReturnValue().Set(val); return -#define SWIGV8_RETURN_INFO(val, info) info.GetReturnValue().Set(val); return - -#define SWIGV8_HANDLESCOPE() v8::HandleScope scope(v8::Isolate::GetCurrent()); -#define SWIGV8_HANDLESCOPE_ESC() v8::EscapableHandleScope scope(v8::Isolate::GetCurrent()); -#define SWIGV8_ESCAPE(val) return scope.Escape(val) - -#define SWIGV8_ADJUST_MEMORY(size) v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size) -#define SWIGV8_CURRENT_CONTEXT() v8::Isolate::GetCurrent()->GetCurrentContext() -#define SWIGV8_THROW_EXCEPTION(err) v8::Isolate::GetCurrent()->ThrowException(err) - -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_STRING_NEW(str) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str, v8::String::kNormalString) -#define SWIGV8_SYMBOL_NEW(sym) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym, v8::String::kNormalString) -#else -#define SWIGV8_STRING_NEW(str) (v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str, v8::NewStringType::kNormal)).ToLocalChecked() -#define SWIGV8_SYMBOL_NEW(sym) (v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym, v8::NewStringType::kNormal)).ToLocalChecked() -#endif - -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_MAYBE_CHECK(maybe) maybe.FromJust() -#else -#define SWIGV8_MAYBE_CHECK(maybe) maybe.Check() -#endif - -#define SWIGV8_ARRAY_NEW(size) v8::Array::New(v8::Isolate::GetCurrent(), size) -#define SWIGV8_BOOLEAN_NEW(bool) v8::Boolean::New(v8::Isolate::GetCurrent(), bool) -#define SWIGV8_EXTERNAL_NEW(val) v8::External::New(v8::Isolate::GetCurrent(), val) -#define SWIGV8_FUNCTEMPLATE_NEW(func) v8::FunctionTemplate::New(v8::Isolate::GetCurrent(), func) -#define SWIGV8_FUNCTEMPLATE_NEW_VOID() v8::FunctionTemplate::New(v8::Isolate::GetCurrent()) -#define SWIGV8_INT32_NEW(num) v8::Int32::New(v8::Isolate::GetCurrent(), num) -#define SWIGV8_INTEGER_NEW(num) v8::Integer::New(v8::Isolate::GetCurrent(), num) -#define SWIGV8_INTEGER_NEW_UNS(num) v8::Integer::NewFromUnsigned(v8::Isolate::GetCurrent(), num) -#define SWIGV8_NUMBER_NEW(num) v8::Number::New(v8::Isolate::GetCurrent(), num) -#define SWIGV8_OBJECT_NEW() v8::Object::New(v8::Isolate::GetCurrent()) -#define SWIGV8_UNDEFINED() v8::Undefined(v8::Isolate::GetCurrent()) -#define SWIGV8_ARRAY v8::Local -#define SWIGV8_FUNCTION_TEMPLATE v8::Local -#define SWIGV8_OBJECT v8::Local -#define SWIGV8_OBJECT_TEMPLATE v8::Local -#define SWIGV8_VALUE v8::Local -#define SWIGV8_NULL() v8::Null(v8::Isolate::GetCurrent()) -#define SWIGV8_ARRAY_GET(array, index) (array)->Get(SWIGV8_CURRENT_CONTEXT(), index).ToLocalChecked() -#define SWIGV8_ARRAY_SET(array, index, value) SWIGV8_MAYBE_CHECK((array)->Set(SWIGV8_CURRENT_CONTEXT(), index, value)) - -#define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ.Reset(v8::Isolate::GetCurrent(), class); - -#if SWIG_V8_VERSION < 0x0608 -#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject() -#define SWIGV8_TO_STRING(handle) (handle)->ToString() -#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue() -#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue() -#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue() -#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(buffer, len) -#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length() -#else -#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() -#define SWIGV8_TO_STRING(handle) (handle)->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() -#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() -#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() -#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(v8::Isolate::GetCurrent(), buffer, len) -#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length(v8::Isolate::GetCurrent()) -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() -#else -#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(v8::Isolate::GetCurrent()) -#endif -#endif - -/* --------------------------------------------------------------------------- - * Error handling - * - * ---------------------------------------------------------------------------*/ - -#define SWIG_Error(code, msg) SWIGV8_ErrorHandler.error(code, msg) -#define SWIG_exception(code, msg) do { SWIGV8_ErrorHandler.error(code, msg); SWIG_fail; } while (0) -#define SWIG_fail goto fail -#define SWIGV8_OVERLOAD false - -SWIGINTERN void SWIG_V8_Raise(const char *msg) { - SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_STRING_NEW(msg))); -} - -SWIGINTERN void SWIG_V8_Raise(SWIGV8_VALUE obj, const char *msg) { - SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_TO_STRING(obj))); -} - - -/* - Note: There are two contexts for handling errors. - A static V8ErrorHandler is used in not overloaded methods. - For overloaded methods the throwing type checking mechanism is used - during dispatching. As V8 exceptions can not be reset properly - the trick is to use a dynamic ErrorHandler with same local name as the global - one. - - - See definition of SWIG_Error above. - - See code templates 'JS_function_dispatcher', 'JS_functionwrapper_overload', - and 'JS_function_dispatch_case' in javascriptcode.swg - -*/ -class V8ErrorHandler { -public: - virtual ~V8ErrorHandler() {} - virtual void error(int code, const char *msg) { - SWIG_V8_Raise(msg); - } -}; -// this is used in usually -SWIGRUNTIME V8ErrorHandler SWIGV8_ErrorHandler; - -// instances of this are used in overloaded functions -class OverloadErrorHandler: public V8ErrorHandler { -public: - virtual void error(int code, const char *msg) { - err = v8::Exception::Error(SWIGV8_STRING_NEW(msg)); - if(code != SWIG_TypeError) { - SWIGV8_THROW_EXCEPTION(err); - } - } - SWIGV8_VALUE err; -}; - -/* --------------------------------------------------------------------------- - * Basic Proxy object - * - * ---------------------------------------------------------------------------*/ - -// Note: to trigger the v8 gc more often one can tell v8 about the memory consumption -// TODO: we could add a v8 specific parameter to control this value -#define SWIGV8_AVG_OBJ_SIZE 1000 - -class SWIGV8_Proxy { -public: - SWIGV8_Proxy(): swigCMemOwn(false), swigCObject(0), info(0) { - SWIGV8_ADJUST_MEMORY(SWIGV8_AVG_OBJ_SIZE); - }; - - ~SWIGV8_Proxy() { - handle.ClearWeak(); - handle.Reset(); - - SWIGV8_ADJUST_MEMORY(-SWIGV8_AVG_OBJ_SIZE); - } - - bool swigCMemOwn; - void *swigCObject; - swig_type_info *info; - v8::Persistent handle; -}; - -class SWIGV8_ClientData { -public: - v8::Persistent class_templ; - - void (*dtor) (const v8::WeakCallbackInfo &data); -}; - -SWIGRUNTIME v8::Persistent SWIGV8_SWIGTYPE_Proxy_class_templ; - -SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(SWIGV8_OBJECT objRef, void **ptr, swig_type_info *info, int flags) { - SWIGV8_HANDLESCOPE(); - - if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; - - SWIGV8_Proxy *cdata = static_cast(objRef->GetAlignedPointerFromInternalField(0)); - - if(cdata == NULL) { - return SWIG_ERROR; - } - if(info && cdata->info != info) { - swig_cast_info *tc = SWIG_TypeCheckStruct(cdata->info, info); - if (!tc && cdata->info->name) { - tc = SWIG_TypeCheck(cdata->info->name, info); - } - bool type_valid = tc != 0; - if(!type_valid) { - return SWIG_TypeError; - } - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, cdata->swigCObject, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - *ptr = cdata->swigCObject; - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !cdata->swigCMemOwn) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (flags & SWIG_POINTER_DISOWN) { - cdata->swigCMemOwn = false; - } - if (flags & SWIG_POINTER_CLEAR) { - cdata->swigCObject = 0; - } - } - return SWIG_OK; -} - - -SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackInfo &data) { - SWIGV8_Proxy *proxy = data.GetParameter(); - delete proxy; -} - -SWIGRUNTIME int SWIG_V8_GetInstancePtr(SWIGV8_VALUE valRef, void **ptr) { - if(!valRef->IsObject()) { - return SWIG_TypeError; - } - SWIGV8_OBJECT objRef = SWIGV8_OBJECT::Cast(valRef); - - if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; - - SWIGV8_Proxy *cdata = static_cast(objRef->GetAlignedPointerFromInternalField(0)); - - if(cdata == NULL) { - return SWIG_ERROR; - } - - *ptr = cdata->swigCObject; - - return SWIG_OK; -} - -SWIGRUNTIME void SWIGV8_SetPrivateData(SWIGV8_OBJECT obj, void *ptr, swig_type_info *info, int flags) { - SWIGV8_Proxy *cdata = new SWIGV8_Proxy(); - cdata->swigCObject = ptr; - cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; - cdata->info = info; - - obj->SetAlignedPointerInInternalField(0, cdata); - - cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); - - if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { - cdata->handle.SetWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor, v8::WeakCallbackType::kParameter); - } else { - cdata->handle.SetWeak(cdata, SWIGV8_Proxy_DefaultDtor, v8::WeakCallbackType::kParameter); - } - -#if (SWIG_V8_VERSION < 0x0704) - cdata->handle.MarkIndependent(); -// Looks like future versions do not require that anymore: -// https://monorail-prod.appspot.com/p/chromium/issues/detail?id=923361#c11 -#endif -} - -SWIGRUNTIME int SWIG_V8_ConvertPtr(SWIGV8_VALUE valRef, void **ptr, swig_type_info *info, int flags) { - SWIGV8_HANDLESCOPE(); - - /* special case: JavaScript null => C NULL pointer */ - if(valRef->IsNull()) { - *ptr=0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - if(!valRef->IsObject()) { - return SWIG_TypeError; - } - SWIGV8_OBJECT objRef = SWIGV8_OBJECT::Cast(valRef); - return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); -} - -SWIGRUNTIME SWIGV8_VALUE SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { - SWIGV8_HANDLESCOPE_ESC(); - - SWIGV8_FUNCTION_TEMPLATE class_templ; - - if (ptr == NULL) { - v8::Local result = SWIGV8_NULL(); - SWIGV8_ESCAPE(result); - } - - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - - if(info->clientdata != 0) { - class_templ = v8::Local::New(isolate, ((SWIGV8_ClientData*) info->clientdata)->class_templ); - } else { - class_templ = v8::Local::New(isolate, SWIGV8_SWIGTYPE_Proxy_class_templ); - } - - v8::Local result = class_templ->InstanceTemplate()->NewInstance(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked(); - - SWIGV8_SetPrivateData(result, ptr, info, flags); - - SWIGV8_ESCAPE(result); -} - -#define SWIG_ConvertPtr(obj, ptr, info, flags) SWIG_V8_ConvertPtr(obj, ptr, info, flags) -#define SWIG_NewPointerObj(ptr, info, flags) SWIG_V8_NewPointerObj(ptr, info, flags) - -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_V8_ConvertInstancePtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_V8_NewPointerObj(thisvalue, type, flags) - -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_V8_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_V8_NewPointerObj(ptr, type, 0) - -#define SWIG_GetInstancePtr(obj, ptr) SWIG_V8_GetInstancePtr(obj, ptr) - -SWIGRUNTIME SwigV8ReturnValue _SWIGV8_wrap_equals(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - void *arg1 = (void *) 0 ; - void *arg2 = (void *) 0 ; - bool result; - int res1; - int res2; - - if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for equals."); - - res1 = SWIG_GetInstancePtr(args.Holder(), &arg1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ERROR, "Could not get pointer from 'this' object for equals."); - } - res2 = SWIG_GetInstancePtr(args[0], &arg2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "equals" "', argument " "1"" of type '" "void *""'"); - } - - result = (bool)(arg1 == arg2); - jsresult = SWIGV8_BOOLEAN_NEW(result); - - SWIGV8_RETURN(jsresult); - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - -SWIGRUNTIME SwigV8ReturnValue _wrap_getCPtr(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - void *arg1 = (void *) 0 ; - long result; - int res1; - - res1 = SWIG_GetInstancePtr(args.Holder(), &arg1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getCPtr" "', argument " "1"" of type '" "void *""'"); - } - - result = (long)arg1; - jsresult = SWIGV8_NUMBER_NEW(result); - - SWIGV8_RETURN(jsresult); - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - -/* --------------------------------------------------------------------------- - * PackedData object - * - * ---------------------------------------------------------------------------*/ - -class SwigV8PackedData { -public: - SwigV8PackedData(void *data, size_t size, swig_type_info *type): data(data), size(size), type(type) {}; - - ~SwigV8PackedData() { - }; - - void *data; - size_t size; - swig_type_info *type; - - v8::Persistent handle; -}; - -SWIGRUNTIMEINLINE -int SwigV8Packed_Check(SWIGV8_VALUE valRef) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_OBJECT objRef = SWIGV8_TO_OBJECT(valRef); - if(objRef->InternalFieldCount() < 1) return false; - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("__swig__packed_data__")); - v8::Local flag; - if (!objRef->GetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey).ToLocal(&flag)) - return false; - return (flag->IsBoolean() && SWIGV8_BOOLEAN_VALUE(flag)); -} - -SWIGRUNTIME -swig_type_info *SwigV8Packed_UnpackData(SWIGV8_VALUE valRef, void *ptr, size_t size) { - if (SwigV8Packed_Check(valRef)) { - SWIGV8_HANDLESCOPE(); - - SwigV8PackedData *sobj; - - SWIGV8_OBJECT objRef = SWIGV8_TO_OBJECT(valRef); - - sobj = static_cast(objRef->GetAlignedPointerFromInternalField(0)); - if (sobj == NULL || sobj->size != size) return 0; - memcpy(ptr, sobj->data, size); - return sobj->type; - } else { - return 0; - } -} - -SWIGRUNTIME -int SWIGV8_ConvertPacked(SWIGV8_VALUE valRef, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigV8Packed_UnpackData(valRef, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackInfo &data) { - SwigV8PackedData *cdata = data.GetParameter(); - delete cdata; -} - -SWIGRUNTIME -SWIGV8_VALUE SWIGV8_NewPackedObj(void *data, size_t size, swig_type_info *type) { - SWIGV8_HANDLESCOPE_ESC(); - - SwigV8PackedData *cdata = new SwigV8PackedData(data, size, type); -// v8::Handle obj = SWIGV8_OBJECT_NEW(); - v8::Local obj = SWIGV8_OBJECT_NEW(); - - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("__swig__packed_data__")); - obj->SetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey, SWIGV8_BOOLEAN_NEW(true)); - - obj->SetAlignedPointerInInternalField(0, cdata); - - cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); - - cdata->handle.SetWeak(cdata, _wrap_SwigV8PackedData_delete, v8::WeakCallbackType::kParameter); - -#if (SWIG_V8_VERSION < 0x0704) - cdata->handle.MarkIndependent(); -// Looks like future versions do not require that anymore: -// https://monorail-prod.appspot.com/p/chromium/issues/detail?id=923361#c11 -#endif - - SWIGV8_ESCAPE(obj); - -} - -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIGV8_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIGV8_NewPackedObj(ptr, sz, type) - - -/* --------------------------------------------------------------------------- - * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) - * - * ---------------------------------------------------------------------------*/ - -SWIGRUNTIME - -SWIGV8_VALUE SWIGV8_AppendOutput(SWIGV8_VALUE result, SWIGV8_VALUE obj) { - SWIGV8_HANDLESCOPE_ESC(); - - if (result->IsUndefined()) { - result = SWIGV8_ARRAY_NEW(0); - } else if (!result->IsArray()) { - SWIGV8_ARRAY tmparr = SWIGV8_ARRAY_NEW(0); - SWIGV8_ARRAY_SET(tmparr, 0, result); - result = tmparr; - } - - SWIGV8_ARRAY arr = SWIGV8_ARRAY::Cast(result); - SWIGV8_ARRAY_SET(arr, arr->Length(), obj); - SWIGV8_ESCAPE(arr); -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptruntime.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptruntime.swg deleted file mode 100755 index 4e93fc4c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptruntime.swg +++ /dev/null @@ -1,47 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascriptruntime.swg - * - * ----------------------------------------------------------------------------- */ - -// V8 Version Macro -// ---------------- -// -// v8 added version macros V8_MAJOR_VERSION, V8_MINOR_VERSION, V8_BUILD_NUMBER -// and V8_PATCH_LEVEL in version 4.3.0. SWIG doesn't support anything that -// old so SWIG generated code can rely on these. - -// Node support -// ------------ - -#ifdef BUILDING_NODE_EXTENSION -%insert("runtime") %{ -#include -//Older version of node.h does not include this -#include -%} -#endif - - -// V8 runtime -// ---------- - -%insert(runtime) %{ -#include - -#undef SWIG_V8_VERSION -#define SWIG_V8_VERSION ((V8_MAJOR_VERSION / 10) * 4096 + \ - (V8_MAJOR_VERSION % 10) * 256 + \ - (V8_MINOR_VERSION / 10) * 16 + \ - (V8_MINOR_VERSION % 10)) - -#include -#include -#include -#include -%} - -%insert(runtime) "swigrun.swg"; /* SWIG API */ -%insert(runtime) "swigerrors.swg"; /* SWIG errors */ - -%insert(runtime) "javascriptrun.swg" - diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptstrings.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptstrings.swg deleted file mode 100755 index 8dc2d945..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascriptstrings.swg +++ /dev/null @@ -1,59 +0,0 @@ - -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ -%fragment("SWIG_AsCharPtrAndSize", "header", fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(SWIGV8_VALUE valRef, char** cptr, size_t* psize, int *alloc) -{ - if(valRef->IsString()) { - v8::Local js_str = v8::Local::Cast(valRef); - - size_t len = SWIGV8_UTF8_LENGTH(js_str) + 1; - char* cstr = (char*) %new_array(len, char); - SWIGV8_WRITE_UTF8(js_str, cstr, len); - - if(alloc) *alloc = SWIG_NEWOBJ; - if(psize) *psize = len; - if(cptr) *cptr = cstr; - - return SWIG_OK; - } else { - if(valRef->IsObject()) { - SWIGV8_OBJECT obj = SWIGV8_OBJECT::Cast(valRef); - // try if the object is a wrapped char[] - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - return SWIG_TypeError; - } else { - return SWIG_TypeError; - } - } -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE SWIGV8_VALUE -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - // TODO: handle extra long strings - return SWIGV8_UNDEFINED(); - } else { - v8::Local js_str = SWIGV8_STRING_NEW2(carray, size); - return js_str; - } - } else { - return SWIGV8_UNDEFINED(); - } -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascripttypemaps.swg b/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascripttypemaps.swg deleted file mode 100755 index c4d341be..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/javascripttypemaps.swg +++ /dev/null @@ -1,43 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Javascript - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ - -/* Include fundamental fragemt definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Javascript fragments for fundamental types */ -%include - -/* Javascript fragments for char* strings */ -%include - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* Javascript types */ - -#define SWIG_Object SWIGV8_VALUE -#define VOID_Object SWIGV8_UNDEFINED() - -/* Overload of the output/constant/exception/dirout handling */ - -/* append output */ -#define SWIG_AppendOutput(result, obj) SWIGV8_AppendOutput(result, obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) - -/* raise */ -#define SWIG_Raise(obj, type, desc) SWIG_V8_Raise(obj, type) - -/* Include the unified typemap library */ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_common.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_complex.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_complex.i deleted file mode 100755 index a252e0aa..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_complex.i +++ /dev/null @@ -1,26 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_deque.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_except.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_map.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_map.i deleted file mode 100755 index 3b8b0936..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_map.i +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_pair.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_pair.i deleted file mode 100755 index b72c50b9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_pair.i +++ /dev/null @@ -1,35 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_string.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_vector.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_vector.i deleted file mode 100755 index 586ac5c6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/std_vector.i +++ /dev/null @@ -1,99 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/swigmove.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/javascript/v8/typemaps.i b/linux/bin/swig/share/swig/4.1.0/javascript/v8/typemaps.i deleted file mode 100755 index e88f0019..00000000 --- a/linux/bin/swig/share/swig/4.1.0/javascript/v8/typemaps.i +++ /dev/null @@ -1,148 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Python tuple. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Python output of the function would be a tuple containing both -output values. - -*/ - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Python tuple. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Python). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Python variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/linkruntime.c b/linux/bin/swig/share/swig/4.1.0/linkruntime.c old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/lua/_std_common.i b/linux/bin/swig/share/swig/4.1.0/lua/_std_common.i deleted file mode 100755 index 567e68b7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/_std_common.i +++ /dev/null @@ -1,93 +0,0 @@ -/* ----------------------------------------------------------------------------- - * _std_common.i - * - * std::helpers for LUA - * ----------------------------------------------------------------------------- */ - -%include // the general exceptions - -/* -The basic idea here, is instead of trying to feed SWIG all the -horribly templated STL code, to give it a neatened version. - -These %defines cover some of the more common methods -so the class declarations become just a set of %defines - -*/ - -/* #define for basic container features -note: I allow front(), back() & pop_back() to throw exceptions -upon empty containers, rather than coredump -(as we haven't defined the methods, we can use %extend to add with -new features) - -*/ -%define %STD_CONTAINER_METHODS(CLASS,T) -public: - CLASS(); - CLASS(const CLASS&); - unsigned int size() const; - unsigned int max_size() const; - bool empty() const; - void clear(); - %extend { // the extra stuff which must be checked - T front()const throw (std::out_of_range){ // only read front & back - if (self->empty()) - throw std::out_of_range("in "#CLASS"::front()"); - return self->front(); - } - T back()const throw (std::out_of_range){ // not write to them - if (self->empty()) - throw std::out_of_range("in "#CLASS"::back()"); - return self->back(); - } - } -%enddef - -/* push/pop for front/back -also note: front & back are read only methods, not used for writing -*/ -%define %STD_FRONT_ACCESS_METHODS(CLASS,T) -public: - void push_front(const T& val); - %extend { // must check this - void pop_front() throw (std::out_of_range){ - if (self->empty()) - throw std::out_of_range("in "#CLASS"::pop_front()"); - self->pop_back(); - } - } -%enddef - -%define %STD_BACK_ACCESS_METHODS(CLASS,T) -public: - void push_back(const T& val); - %extend { // must check this - void pop_back() throw (std::out_of_range){ - if (self->empty()) - throw std::out_of_range("in "#CLASS"::pop_back()"); - self->pop_back(); - } - } -%enddef - -/* -Random access methods -*/ -%define %STD_RANDOM_ACCESS_METHODS(CLASS,T) - %extend // this is a extra bit of SWIG code - { - // [] is replaced by __getitem__ & __setitem__ - // simply throws a string, which causes a lua error - T __getitem__(unsigned int idx) throw (std::out_of_range){ - if (idx>=self->size()) - throw std::out_of_range("in "#CLASS"::__getitem__()"); - return (*self)[idx]; - } - void __setitem__(unsigned int idx,const T& val) throw (std::out_of_range){ - if (idx>=self->size()) - throw std::out_of_range("in "#CLASS"::__setitem__()"); - (*self)[idx]=val; - } - }; -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/lua/argcargv.i b/linux/bin/swig/share/swig/4.1.0/lua/argcargv.i deleted file mode 100755 index 94cc8ed4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/argcargv.i +++ /dev/null @@ -1,57 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - - Use it as follows: - - %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) } - extern int mainApp(size_t argc, const char **argv); - - then from lua: - - args = { "arg0", "arg1" } - mainApp(args) - - * ------------------------------------------------------------ */ - -%{ -SWIGINTERN int SWIG_argv_size(lua_State* L, int index) { - int n=0; - while(1){ - lua_rawgeti(L,index,n+1); - if (lua_isnil(L,-1)) - break; - ++n; - lua_pop(L,1); - } - lua_pop(L,1); - return n; -} -%} - -%typemap(in) (int ARGC, char **ARGV) { - if (lua_istable(L,$input)) { - int i, size = SWIG_argv_size(L,$input); - $1 = ($1_ltype) size; - $2 = (char **) malloc((size+1)*sizeof(char *)); - for (i = 0; i < size; i++) { - lua_rawgeti(L,$input,i+1); - if (lua_isnil(L,-1)) - break; - $2[i] = (char *)lua_tostring(L, -1); - lua_pop(L,1); - } - $2[i]=NULL; - } else { - $1 = 0; $2 = 0; - lua_pushstring(L,"Expecting argv array"); - lua_error(L); - } -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = lua_istable(L,$input); -} - -%typemap(freearg) (int ARGC, char **ARGV) { - free((char *) $2); -} diff --git a/linux/bin/swig/share/swig/4.1.0/lua/carrays.i b/linux/bin/swig/share/swig/4.1.0/lua/carrays.i deleted file mode 100755 index 1bc45d81..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/carrays.i +++ /dev/null @@ -1,8 +0,0 @@ -/* Small change to the standard carrays.i -renaming the field to __getitem & __setitem -for operator[] access -*/ -%rename(__getitem) *::getitem; // the v=X[i] (get operator) -%rename(__setitem) *::setitem; // the X[i]=v (set operator) - -%include <../carrays.i> diff --git a/linux/bin/swig/share/swig/4.1.0/lua/factory.i b/linux/bin/swig/share/swig/4.1.0/lua/factory.i deleted file mode 100755 index 7e605c5d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/factory.i +++ /dev/null @@ -1,23 +0,0 @@ -/* - A modification of factory.swg from the generic UTL library. -*/ - -%include - -%define %_factory_dispatch(Type) -if (!dcast) { - Type *dobj = dynamic_cast($1); - if (dobj) { - dcast = 1; - SWIG_NewPointerObj(L, dobj, $descriptor(Type *), $owner); SWIG_arg++; - } -}%enddef - -%define %factory(Method,Types...) -%typemap(out) Method { - int dcast = 0; - %formacro(%_factory_dispatch, Types) - if (!dcast) { - SWIG_NewPointerObj(L, $1, $descriptor, $owner); SWIG_arg++; - } -}%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/lua/lua.swg b/linux/bin/swig/share/swig/4.1.0/lua/lua.swg deleted file mode 100755 index 12c635d7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/lua.swg +++ /dev/null @@ -1,236 +0,0 @@ -/* ----------------------------------------------------------------------------- - * lua.swg - * - * SWIG Configuration File for Lua. - * This file is parsed by SWIG before reading any other interface file. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * includes - * ----------------------------------------------------------------------------- */ - -%include /* The typemaps */ -%include /* The runtime stuff */ -%include /* Warnings for Lua keywords */ - -//%include -/* ----------------------------------------------------------------------------- - * constants typemaps - * ----------------------------------------------------------------------------- */ -// this basically adds to a table of constants -%typemap(consttab) int, unsigned int, short, unsigned short, long, unsigned long, unsigned char, signed char, bool, enum SWIGTYPE - {SWIG_LUA_CONSTTAB_INT("$symname", $value)} - -%typemap(consttab) float, double - {SWIG_LUA_CONSTTAB_FLOAT("$symname", $value)} - -%typemap(consttab) long long, unsigned long long, signed long long - {SWIG_LUA_CONSTTAB_FLOAT("$symname", $value)} - -%typemap(consttab) const long long&, const unsigned long long&, const signed long long& - {SWIG_LUA_CONSTTAB_FLOAT("$symname", *$value)} - -%typemap(consttab) char *, const char *, char [], const char [] - {SWIG_LUA_CONSTTAB_STRING("$symname", $value)} - -// note: char is treated as a separate special type -// signed char & unsigned char are numbers -%typemap(consttab) char - {SWIG_LUA_CONSTTAB_CHAR("$symname", $value)} - -%typemap(consttab) long long, unsigned long long - {SWIG_LUA_CONSTTAB_STRING("$symname", "$value")} - -%typemap(consttab) SWIGTYPE *, SWIGTYPE *const, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] - { SWIG_LUA_CONSTTAB_POINTER("$symname",$value, $1_descriptor) } - -%typemap(consttab) SWIGTYPE - { SWIG_LUA_CONSTTAB_POINTER("$symname",&$value, $&1_descriptor) } - -// member function pointers -%typemap(consttab) SWIGTYPE (CLASS::*) - { SWIG_LUA_CONSTTAB_BINARY("$symname", sizeof($type),&$value, $1_descriptor) } - - -/* ----------------------------------------------------------------------------- - * Overloaded operator support - * ----------------------------------------------------------------------------- */ -// lua calls the + operator '__add' -// python likes to call it '__add__' -// Assuming most SWIGers will probably use the __add__ if they extend their classes -// we have two sets of renames -// one to rename the operator+() to __add() -// (this lets SWIG rename the operator overloads) -// another is to rename __add__() to __add() -// (this means that people who wrote SWIG code to do that add will also work) - -#ifdef __cplusplus -// this is extra renaming for lua -// not all operators are supported, so only those that are, are listed -%rename(__add) *::operator+; -%rename(__sub) *::operator-; -%rename(__mul) *::operator*; -%rename(__div) *::operator/; -%rename(__unm) *::operator-(); -%rename(__unm) *::operator-() const; - -%rename(__eq) *::operator==; -%ignore *::operator!=; // note: Lua does not have a notequal operator - // it just uses 'not (a==b)' -%rename(__lt) *::operator<; -%ignore *::operator>; // ditto less than vs greater than -%rename(__le) *::operator<=; -%ignore *::operator>=; // ditto less than vs greater than -%ignore *::operator!; // does not support not - -%rename(__call) *::operator(); // the fn call operator - -// lua does not support overloading of: -// logical/bitwise operators -// assign operator -// +=,-=,*=, etc -// therefore ignoring them for now -// it also doesn't support non class operators -// eg friends or XX operator+(XX,XX) -// also ignoring -// note: some of these might be better to rename, but not doing that for now -%ignore *::operator&&; %ignore operator&&; -%ignore *::operator||; %ignore operator||; -%ignore *::operator+=; -%ignore *::operator-=; -%ignore *::operator*=; -%ignore *::operator/=; -%ignore *::operator%=; -%ignore *::operator++; %ignore *::operator--; - -%ignore *::operator=; // note: this might be better to rename to assign() or similar - -%ignore operator+; -%ignore operator-; -%ignore operator*; -%ignore operator/; -%ignore operator%; -%ignore operator[]; -%ignore operator>; %ignore operator>=; -%ignore operator<; %ignore operator<=; -%ignore operator==; %ignore operator!=; - - -// renaming the python operators to be compatible with lua -// this means that if a developer has written a fn __add__() -// it will be used for the lua + -%rename(__add) *::__add__; -%rename(__sub) *::__sub__; -%rename(__mul) *::__mul__; -%rename(__div) *::__div__; -%rename(__unm) *::__neg__; // lua calls unary minus,'unm' not 'neg' -%rename(__tostring) *::__str__; // both map to __tostring -%rename(__tostring) *::__repr__; // both map to __tostring - - -%rename(__pow) *::__pow__; // lua power '^' operator -%rename(__concat) *::__concat__; // lua concat '..' operator -%rename(__eq) *::__eq__; -%rename(__lt) *::__lt__; -%rename(__le) *::__le__; -%rename(__call) *::__call__; // the fn call operator() - -// the [] operator has two parts, the get & the set -%rename(__getitem) *::__getitem__; // the v=X[i] (get operator) -%rename(__setitem) *::__setitem__; // the X[i]=v (set operator) - - -#endif - - -/* ------------------------------------------------------------ - * Exceptions - * ------------------------------------------------------------ */ -/* Confession: I don't really like C++ exceptions -The python/lua ones are great, but C++ ones I don't like -(mainly because I cannot get the stack trace out of it) -Therefore I have not bothered to try doing much in this - -Therefore currently it's just enough to get a few test cases running ok - -note: if you wish to throw anything related to std::exception -use %include instead -*/ - -// number as number+error -%typemap(throws) int,unsigned int,signed int, - long,unsigned long,signed long, - short,unsigned short,signed short, - float,double, - long long,unsigned long long, - unsigned char, signed char, - int&,unsigned int&,signed int&, - long&,unsigned long&,signed long&, - short&,unsigned short&,signed short&, - float&,double&, - long long&,unsigned long long&, - unsigned char&, signed char& -%{lua_pushnumber(L,(lua_Number)$1);SWIG_fail; %} - -%typemap(throws) bool,bool& -%{lua_pushboolean(L,(int)($1==true));SWIG_fail; %} - -// enum as number+error -%typemap(throws) enum SWIGTYPE -%{lua_pushnumber(L,(lua_Number)(int)$1);SWIG_fail; %} - -// strings are just sent as errors -%typemap(throws) char *, const char * -%{lua_pushstring(L,$1);SWIG_fail;%} - -// char is changed to a string -%typemap(throws) char -%{lua_pushlstring(L,&$1,1);SWIG_fail;%} - -/* -Throwing object is a serious problem: -Assuming some code throws a 'FooBar' -There are a few options: -- return a pointer to it: but it's unclear how long this will last for. -- return a copy of it: but not all objects are copyable - (see exception_partial_info in the test suite for a case where you cannot do this) -- convert to a string & throw that - it's not so useful, but it works (this is more lua like). -The third option (though not nice) is used -For a more useful solution: see std_except for more details -*/ - -// basic typemap for structs, classes, pointers & references -// convert to string and error -%typemap(throws) SWIGTYPE -%{(void)$1; /* ignore it */ -lua_pushfstring(L,"object exception:%s",SWIG_TypePrettyName($1_descriptor)); -SWIG_fail;%} - -// code to make a copy of the object and return this -// if you have a function which throws a FooBar & you want SWIG to return a copy of the object as its error -// then use one of the below -// %apply SWIGTYPE EXCEPTION_BY_VAL {FooBar}; -// %apply SWIGTYPE& EXCEPTION_BY_VAL {FooBar&}; // note: need & twice -%typemap(throws) SWIGTYPE EXCEPTION_BY_VAL -%{SWIG_NewPointerObj(L,(void *)new $1_ltype($1),$&1_descriptor,1); -SWIG_fail;%} - -// similar for object reference -// note: swig typemaps seem a little confused around here, therefore we use $basetype -%typemap(throws) SWIGTYPE& EXCEPTION_BY_VAL -%{SWIG_NewPointerObj(L,(void *)new $basetype($1),$1_descriptor,1); -SWIG_fail;%} - - -// note: no support for object pointers -// it's not clear how long the pointer is valid for, therefore not supporting it - -/* ----------------------------------------------------------------------------- - * extras - * ----------------------------------------------------------------------------- */ -// this %define is to allow insertion of lua source code into the wrapper file -#define %luacode %insert("luacode") - - -/* ------------------------------ end lua.swg ------------------------------ */ diff --git a/linux/bin/swig/share/swig/4.1.0/lua/lua_fnptr.i b/linux/bin/swig/share/swig/4.1.0/lua/lua_fnptr.i deleted file mode 100755 index 81fa54bd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/lua_fnptr.i +++ /dev/null @@ -1,124 +0,0 @@ -/* ----------------------------------------------------------------------------- - * lua_fnptr.i - * - * SWIG Library file containing the main typemap code to support Lua modules. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Basic function pointer support - * ----------------------------------------------------------------------------- */ -/* -The structure: SWIGLUA_FN provides a simple (local only) wrapping for a function. - -For example if you wanted to have a C/C++ function take a lua function as a parameter. -You could declare it as: - int my_func(int a, int b, SWIGLUA_FN fn); -note: it should be passed by value, not byref or as a pointer. - -The SWIGLUA_FN holds a pointer to the lua_State, and the stack index where the function is held. -The macro SWIGLUA_FN_GET() will put a copy of the lua function at the top of the stack. -After that it's fairly simple to write the rest of the code (assuming know how to use lua), -just push the parameters, call the function and return the result. - - int my_func(int a, int b, SWIGLUA_FN fn) - { - SWIGLUA_FN_GET(fn); - lua_pushnumber(fn.L,a); - lua_pushnumber(fn.L,b); - lua_call(fn.L,2,1); // 2 in, 1 out - return luaL_checknumber(fn.L,-1); - } - -SWIG will automatically performs the wrapping of the arguments in and out. - -However: if you wish to store the function between calls, look to the SWIGLUA_REF below. - -*/ -// this is for the C code only, we don't want SWIG to wrapper it for us. -%{ -typedef struct{ - lua_State* L; /* the state */ - int idx; /* the index on the stack */ -}SWIGLUA_FN; - -#define SWIGLUA_FN_GET(fn) {lua_pushvalue(fn.L,fn.idx);} -%} - -// the actual typemap -%typemap(in,checkfn="lua_isfunction") SWIGLUA_FN -%{ $1.L=L; $1.idx=$input; %} - -/* ----------------------------------------------------------------------------- - * Storing lua object support - * ----------------------------------------------------------------------------- */ -/* -The structure: SWIGLUA_REF provides a mechanism to store object (usually functions) -between calls to the interpreter. - -For example if you wanted to have a C/C++ function take a lua function as a parameter. -Then call it later, You could declare it as: - SWIGLUA_REF myref; - void set_func(SWIGLUA_REF ref); - SWIGLUA_REF get_func(); - void call_func(int val); -note: it should be passed by value, not byref or as a pointer. - -The SWIGLUA_REF holds a pointer to the lua_State, and an integer reference to the object. -Because it holds a permanent ref to an object, the SWIGLUA_REF must be handled with a bit more care. -It should be initialised to {0,0}. The function swiglua_ref_set() should be used to set it. -swiglua_ref_clear() should be used to clear it when not in use, and swiglua_ref_get() to get the -data back. - -Note: the typemap does not check that the object is in fact a function, -if you need that you must add it yourself. - - - int my_func(int a, int b, SWIGLUA_FN fn) - { - SWIGLUA_FN_GET(fn); - lua_pushnumber(fn.L,a); - lua_pushnumber(fn.L,b); - lua_call(fn.L,2,1); // 2 in, 1 out - return luaL_checknumber(fn.L,-1); - } - -SWIG will automatically performs the wrapping of the arguments in and out. - -However: if you wish to store the function between calls, look to the SWIGLUA_REF below. - -*/ - -%{ -typedef struct{ - lua_State* L; /* the state */ - int ref; /* a ref in the lua global index */ -}SWIGLUA_REF; - - -void swiglua_ref_clear(SWIGLUA_REF* pref){ - if (pref->L!=0 && pref->ref!=LUA_NOREF && pref->ref!=LUA_REFNIL){ - luaL_unref(pref->L,LUA_REGISTRYINDEX,pref->ref); - } - pref->L=0; pref->ref=0; -} - -void swiglua_ref_set(SWIGLUA_REF* pref,lua_State* L,int idx){ - pref->L=L; - lua_pushvalue(L,idx); /* copy obj to top */ - pref->ref=luaL_ref(L,LUA_REGISTRYINDEX); /* remove obj from top & put into registry */ -} - -void swiglua_ref_get(SWIGLUA_REF* pref){ - if (pref->L!=0) - lua_rawgeti(pref->L,LUA_REGISTRYINDEX,pref->ref); -} - -%} - -%typemap(in) SWIGLUA_REF -%{ swiglua_ref_set(&$1,L,$input); %} - -%typemap(out) SWIGLUA_REF -%{ if ($1.L!=0) {swiglua_ref_get(&$1);} else {lua_pushnil(L);} - SWIG_arg++; %} - diff --git a/linux/bin/swig/share/swig/4.1.0/lua/luakw.swg b/linux/bin/swig/share/swig/4.1.0/lua/luakw.swg deleted file mode 100755 index 394e4005..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/luakw.swg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Warnings for Lua keywords, built-in names and bad names. -*/ - -#define LUAKW(x) %keywordwarn("'" `x` "' is a Lua keyword", rename="c_%s") `x` -#define LUABN(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "'" `x` "' conflicts with a basic function in Lua"), %$not %$ismember) `x` - -/* - Warnings for Lua keywords - http://www.lua.org/manual/5.2/manual.html#3.1 -*/ - -LUAKW(and); -LUAKW(break); -LUAKW(do); -LUAKW(else); -LUAKW(elseif); -LUAKW(end); -LUAKW(false); -LUAKW(for); -LUAKW(function); -LUAKW(goto); -LUAKW(if); -LUAKW(in); -LUAKW(local); -LUAKW(nil); -LUAKW(not); -LUAKW(or); -LUAKW(repeat); -LUAKW(return); -LUAKW(then); -LUAKW(true); -LUAKW(until); -LUAKW(while); - -/* - Basic functions - http://www.lua.org/manual/5.2/manual.html#6.1 -*/ - -LUABN(assert); -LUABN(collectgarbage); -LUABN(dofile); -LUABN(error); -LUABN(_G); // Not actually a function -LUABN(getmetatable); -LUABN(ipairs); -LUABN(load); -LUABN(loadfile); -LUABN(next); -LUABN(pairs); -LUABN(pcall); -LUABN(print); -LUABN(rawequal); -LUABN(rawget); -LUABN(rawlen); -LUABN(rawset); -LUABN(select); -LUABN(setmetatable); -LUABN(tonumber); -LUABN(tostring); -LUABN(type); -LUABN(_VERSION); // Not actually a function -LUABN(xpcall); - -#undef LUABN -#undef LUAKW diff --git a/linux/bin/swig/share/swig/4.1.0/lua/luarun.swg b/linux/bin/swig/share/swig/4.1.0/lua/luarun.swg deleted file mode 100755 index f47fd4fa..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/luarun.swg +++ /dev/null @@ -1,1950 +0,0 @@ -/* ----------------------------------------------------------------------------- - * luarun.swg - * - * This file contains the runtime support for Lua modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "lua.h" -#include "lauxlib.h" -#include /* for malloc */ -#include /* for a few sanity tests */ - -/* ----------------------------------------------------------------------------- - * Lua flavors - * ----------------------------------------------------------------------------- */ - -#define SWIG_LUA_FLAVOR_LUA 1 -#define SWIG_LUA_FLAVOR_ELUA 2 -#define SWIG_LUA_FLAVOR_ELUAC 3 - -#if !defined(SWIG_LUA_TARGET) -# error SWIG_LUA_TARGET not defined -#endif - -#if defined(SWIG_LUA_ELUA_EMULATE) - -struct swig_elua_entry; - -typedef struct swig_elua_key { - int type; - union { - const char* strkey; - lua_Number numkey; - } key; -} swig_elua_key; - -typedef struct swig_elua_val { - int type; - union { - lua_Number number; - const struct swig_elua_entry *table; - const char *string; - lua_CFunction function; - struct { - char member; - long lvalue; - void *pvalue; - swig_type_info **ptype; - } userdata; - } value; -} swig_elua_val; - -typedef struct swig_elua_entry { - swig_elua_key key; - swig_elua_val value; -} swig_elua_entry; - -#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} } -#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} } -#define LNILKEY {LUA_TNIL, {.strkey = 0} } - -#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} } -#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} } -#define LROVAL(x) {LUA_TTABLE, {.table = x} } -#define LNILVAL {LUA_TNIL, {.string = 0} } -#define LSTRVAL(x) {LUA_TSTRING, {.string = x} } - -#define LUA_REG_TYPE swig_elua_entry - -#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable" - -#define lua_pushrotable(L,p)\ - lua_newtable(L);\ - assert(p);\ - SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p)); - -#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ - LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } } - -#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\ - LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } } -#endif - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) -# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) -# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) -# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) - /* Those two types of constants are not supported in elua */ - -#ifndef SWIG_LUA_CONSTTAB_POINTER -#warning eLua does not support pointers as constants. By default, nil will be used as value -#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL -#endif - -#ifndef SWIG_LUA_CONSTTAB_BINARY -#warning eLua does not support pointers to member as constants. By default, nil will be used as value -#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL -#endif -#else /* SWIG_LUA_FLAVOR_LUA */ -# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 -# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 -# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 -# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 -# define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ - SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D -# define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\ - SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D -#endif - -#ifndef SWIG_LUA_ELUA_EMULATE -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} -# define LSTRVAL LRO_STRVAL -#endif -#endif /* SWIG_LUA_ELUA_EMULATE*/ - -#ifndef SWIG_LUA_ELUA_EMULATE -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) - -#ifndef MIN_OPT_LEVEL -#define MIN_OPT_LEVEL 2 -#endif - -#include "lrodefs.h" -#include "lrotable.h" -#endif -#endif /* SWIG_LUA_ELUA_EMULATE*/ -/* ----------------------------------------------------------------------------- - * compatibility defines - * ----------------------------------------------------------------------------- */ - -/* History of Lua C API length functions: In Lua 5.0 (and before?) - there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen", - but a compatibility define of "lua_strlen" was added. In Lua 5.2, - this function was again renamed, to "lua_rawlen" (to emphasize that - it doesn't call the "__len" metamethod), and the compatibility - define of lua_strlen was removed. All SWIG uses have been updated - to "lua_rawlen", and we add our own defines of that here for older - versions of Lua. */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 -# define lua_rawlen lua_strlen -#elif LUA_VERSION_NUM == 501 -# define lua_rawlen lua_objlen -#endif - - -/* lua_pushglobaltable is the recommended "future-proof" way to get - the global table for Lua 5.2 and later. Here we define - lua_pushglobaltable ourselves for Lua versions before 5.2. */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) -#endif - -/* lua_absindex was introduced in Lua 5.2 */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) -#endif - -/* lua_rawsetp was introduced in Lua 5.2 */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -#define lua_rawsetp(L,index,ptr)\ - lua_pushlightuserdata(L,(void*)(ptr));\ - lua_insert(L,-2);\ - lua_rawset(L,index); - -#define lua_rawgetp(L,index,ptr)\ - lua_pushlightuserdata(L,(void*)(ptr));\ - lua_rawget(L,index); - -#endif - -/* -------------------------------------------------------------------------- - * Helper functions for error handling - * -------------------------------------------------------------------------- */ - -/* Push the string STR on the Lua stack, like lua_pushstring, but - prefixed with the location of the innermost Lua call-point - (as formatted by luaL_where). */ -SWIGRUNTIME void -SWIG_Lua_pusherrstring (lua_State *L, const char *str) -{ - luaL_where (L, 1); - lua_pushstring (L, str); - lua_concat (L, 2); -} - -/* Push a formatted string generated from FMT and following args on - the Lua stack, like lua_pushfstring, but prefixed with the - location of the innermost Lua call-point (as formatted by luaL_where). */ -SWIGRUNTIME void -SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...) -{ - va_list argp; - va_start(argp, fmt); - luaL_where(L, 1); - lua_pushvfstring(L, fmt, argp); - va_end(argp); - lua_concat(L, 2); -} - - -/* ----------------------------------------------------------------------------- - * global swig types - * ----------------------------------------------------------------------------- */ -/* Constant table */ -#define SWIG_LUA_INT 1 -#define SWIG_LUA_FLOAT 2 -#define SWIG_LUA_STRING 3 -#define SWIG_LUA_POINTER 4 -#define SWIG_LUA_BINARY 5 -#define SWIG_LUA_CHAR 6 - -/* Structure for variable linking table */ -typedef struct { - const char *name; - lua_CFunction get; - lua_CFunction set; -} swig_lua_var_info; - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -typedef const LUA_REG_TYPE swig_lua_method; -typedef const LUA_REG_TYPE swig_lua_const_info; -#else /* Normal lua */ -typedef luaL_Reg swig_lua_method; - -/* Constant information structure */ -typedef struct { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_lua_const_info; - -#endif - -typedef struct { - const char *name; - lua_CFunction getmethod; - lua_CFunction setmethod; -} swig_lua_attribute; - - -struct swig_lua_class; -/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */ -typedef struct swig_lua_namespace { - const char *name; - swig_lua_method *ns_methods; - swig_lua_attribute *ns_attributes; - swig_lua_const_info *ns_constants; - struct swig_lua_class **ns_classes; - struct swig_lua_namespace **ns_namespaces; -} swig_lua_namespace; - -typedef struct swig_lua_class { - const char *name; /* Name that this class has in Lua */ - const char *fqname; /* Fully qualified name - Scope + class name */ - swig_type_info **type; - lua_CFunction constructor; - void (*destructor)(void *); - swig_lua_method *methods; - swig_lua_attribute *attributes; - swig_lua_namespace *cls_static; - swig_lua_method *metatable; /* 0 for -eluac */ - struct swig_lua_class **bases; - const char **base_names; -} swig_lua_class; - -/* this is the struct for wrapping all pointers in SwigLua -*/ -typedef struct { - swig_type_info *type; - int own; /* 1 if owned & must be destroyed */ - void *ptr; -} swig_lua_userdata; - -/* this is the struct for wrapping arbitrary packed binary data -(currently it is only used for member function pointers) -the data ordering is similar to swig_lua_userdata, but it is currently not possible -to tell the two structures apart within SWIG, other than by looking at the type -*/ -typedef struct { - swig_type_info *type; - int own; /* 1 if owned & must be destroyed */ - char data[1]; /* arbitrary amount of data */ -} swig_lua_rawdata; - -/* Common SWIG API */ -#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) -#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) -#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) -#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) - -/* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) -#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer) -#define SWIG_MODULE_CLIENTDATA_TYPE lua_State* - -/* Contract support */ -#define SWIG_contract_assert(expr, msg) \ - do { if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } } while (0) - - -/* helper #defines */ -#define SWIG_fail {goto fail;} -#define SWIG_fail_arg(func_name,argnum,type) \ - {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ - func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ - goto fail;} -#define SWIG_fail_ptr(func_name,argnum,type) \ - SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") -#define SWIG_check_num_args(func_name,a,b) \ - if (lua_gettop(L)b) \ - {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ - goto fail;} - - -#define SWIG_Lua_get_table(L,n) \ - (lua_pushstring(L, n), lua_rawget(L,-2)) - -#define SWIG_Lua_add_function(L,n,f) \ - (lua_pushstring(L, n), \ - lua_pushcfunction(L, f), \ - lua_rawset(L,-3)) - -#define SWIG_Lua_add_boolean(L,n,b) \ - (lua_pushstring(L, n), \ - lua_pushboolean(L, b), \ - lua_rawset(L,-3)) - -/* special helper for allowing 'nil' for usertypes */ -#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) - -#ifdef __cplusplus -/* Special helper for member function pointers -it gets the address, casts it, then dereferences it */ -/*#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) */ -#endif - -/* storing/access of swig_module_info */ -SWIGRUNTIME swig_module_info * -SWIG_Lua_GetModule(lua_State *L) { - swig_module_info *ret = 0; - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_rawget(L,LUA_REGISTRYINDEX); - if (lua_islightuserdata(L,-1)) - ret=(swig_module_info*)lua_touserdata(L,-1); - lua_pop(L,1); /* tidy */ - return ret; -} - -SWIGRUNTIME void -SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) { - /* add this all into the Lua registry: */ - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_pushlightuserdata(L,(void*)module); - lua_rawset(L,LUA_REGISTRYINDEX); -} - -/* ----------------------------------------------------------------------------- - * global variable support code: modules - * ----------------------------------------------------------------------------- */ - -/* this function is called when trying to set an immutable. -default action is to print an error. -This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ -SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L) -{ -/* there should be 1 param passed in: the new value */ -#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE - lua_pop(L,1); /* remove it */ - luaL_error(L,"This variable is immutable"); -#endif - return 0; /* should not return anything */ -} - -#ifdef SWIG_LUA_ELUA_EMULATE - -SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own); -SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type); -static int swig_lua_elua_emulate_unique_key; - -/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */ -SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table) -{ - int i, table_parsed, parsed_tables_array, target_table; - assert(lua_istable(L,-1)); - target_table = lua_gettop(L); - /* Get the registry where we put all parsed tables to avoid loops */ - lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); - if(lua_isnil(L,-1)) { - lua_pop(L,1); - lua_newtable(L); - lua_pushvalue(L,-1); - lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key)); - } - parsed_tables_array = lua_gettop(L); - lua_pushvalue(L,target_table); - lua_rawsetp(L, parsed_tables_array, table); - table_parsed = 0; - const int SWIGUNUSED pairs_start = lua_gettop(L); - for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++) - { - const swig_elua_entry *entry = table + i; - int is_metatable = 0; - switch(entry->key.type) { - case LUA_TSTRING: - lua_pushstring(L,entry->key.key.strkey); - if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0) - is_metatable = 1; - break; - case LUA_TNUMBER: - lua_pushnumber(L,entry->key.key.numkey); - break; - case LUA_TNIL: - lua_pushnil(L); - break; - default: - assert(0); - } - switch(entry->value.type) { - case LUA_TSTRING: - lua_pushstring(L,entry->value.value.string); - break; - case LUA_TNUMBER: - lua_pushnumber(L,entry->value.value.number); - break; - case LUA_TFUNCTION: - lua_pushcfunction(L,entry->value.value.function); - break; - case LUA_TTABLE: - lua_rawgetp(L,parsed_tables_array, entry->value.value.table); - table_parsed = !lua_isnil(L,-1); - if(!table_parsed) { - lua_pop(L,1); /*remove nil */ - lua_newtable(L); - SWIG_Lua_elua_emulate_register(L,entry->value.value.table); - } - if(is_metatable) { - assert(lua_istable(L,-1)); - lua_pushvalue(L,-1); - lua_setmetatable(L,target_table); - } - - break; - case LUA_TUSERDATA: - if(entry->value.value.userdata.member) - SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue, - entry->value.value.userdata.lvalue, - *(entry->value.value.userdata.ptype)); - else - SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue, - *(entry->value.value.userdata.ptype),0); - break; - case LUA_TNIL: - lua_pushnil(L); - break; - default: - assert(0); - } - assert(lua_gettop(L) == pairs_start + 2); - lua_rawset(L,target_table); - } - lua_pop(L,1); /* Removing parsed tables storage */ - assert(lua_gettop(L) == target_table); -} - -SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L) -{ - lua_pushnil(L); - lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); -} - -SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L); - -SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L) -{ - SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1); - SWIG_Lua_get_class_registry(L); - lua_getfield(L,-1,"lua_getmetatable"); - lua_remove(L,-2); /* remove the registry*/ - assert(!lua_isnil(L,-1)); - lua_pushvalue(L,1); - assert(lua_gettop(L) == 3); /* object | function | object again */ - lua_call(L,1,1); - if(!lua_isnil(L,-1)) /*There is an ordinary metatable */ - return 1; - /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/ - assert(lua_gettop(L) == 2); - if(lua_istable(L,-2)) { - lua_pop(L,1); /*remove the nil*/ - lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY); - } - assert(lua_gettop(L) == 2); - return 1; - -fail: - lua_error(L); - return 0; -} - -SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L) -{ - SWIG_Lua_get_class_registry(L); - lua_pushglobaltable(L); - lua_pushstring(L,"lua_getmetatable"); - lua_getfield(L,-2,"getmetatable"); - assert(!lua_isnil(L,-1)); - lua_rawset(L,-4); - lua_pushstring(L, "getmetatable"); - lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable); - lua_rawset(L,-3); - lua_pop(L,2); - -} -/* END OF REMOVE */ - -#endif -/* ----------------------------------------------------------------------------- - * global variable support code: namespaces and modules (which are the same thing) - * ----------------------------------------------------------------------------- */ - -SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) -{ -/* there should be 2 params passed in - (1) table (not the meta table) - (2) string name of the attribute -*/ - assert(lua_istable(L,-2)); /* just in case */ - lua_getmetatable(L,-2); - assert(lua_istable(L,-1)); - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); - /* look for the key in the .get table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,-2); /* stack tidy, remove .get table */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - /* ok, so try the .fn table */ - SWIG_Lua_get_table(L,".fn"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); /* look for the fn */ - lua_remove(L,-2); /* stack tidy, remove .fn table */ - if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */ - { /* found it so return the fn & let lua call it */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - return 0; -} - -SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L) -{ -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value -*/ - - assert(lua_istable(L,1)); - lua_getmetatable(L,1); /* get the meta table */ - assert(lua_istable(L,-1)); - - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,3); /* value */ - lua_call(L,1,0); - return 0; - } - lua_pop(L,1); /* remove the value */ - } - lua_pop(L,1); /* remove the value .set table */ - lua_pop(L,1); /* remote metatable */ - lua_rawset(L,-3); - return 0; -} - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ -SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */ -SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */ -SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss); - -/* helper function - register namespace methods and attributes into namespace */ -SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns) -{ - int i; - /* There must be namespace table (not metatable) at the top of the stack */ - assert(lua_istable(L,-1)); - SWIG_Lua_InstallConstants(L, ns->ns_constants); - - /* add methods to the namespace/module table */ - for(i=0;ns->ns_methods[i].name;i++){ - SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func); - } - lua_getmetatable(L,-1); - - /* add fns */ - for(i=0;ns->ns_attributes[i].name;i++){ - SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); - } - - /* clear stack - remove metatble */ - lua_pop(L,1); - return 0; -} - -/* Register all classes in the namespace */ -SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns) -{ - swig_lua_class **classes; - - /* There must be a module/namespace table at the top of the stack */ - assert(lua_istable(L,-1)); - - classes = ns->ns_classes; - - if( classes != 0 ) { - while(*classes != 0) { - SWIG_Lua_class_register(L, *classes); - classes++; - } - } -} - -/* Helper function. Creates namespace table and adds it to module table - if 'reg' is true, then will register namespace table to parent one (must be on top of the stack - when function is called). - Function always returns newly registered table on top of the stack. -*/ -SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg) -{ - swig_lua_namespace **sub_namespace; - /* 1 argument - table on the top of the stack */ - const int SWIGUNUSED begin = lua_gettop(L); - assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */ - lua_checkstack(L,5); - lua_newtable(L); /* namespace itself */ - lua_newtable(L); /* metatable for namespace */ - - /* add a table called ".get" */ - lua_pushstring(L,".get"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".set" */ - lua_pushstring(L,".set"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".fn" */ - lua_pushstring(L,".fn"); - lua_newtable(L); - lua_rawset(L,-3); - - /* add accessor fns for using the .get,.set&.fn */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); - - lua_setmetatable(L,-2); /* set metatable */ - - /* Register all functions, variables etc */ - SWIG_Lua_add_namespace_details(L,ns); - /* Register classes */ - SWIG_Lua_add_namespace_classes(L,ns); - - sub_namespace = ns->ns_namespaces; - if( sub_namespace != 0) { - while(*sub_namespace != 0) { - SWIG_Lua_namespace_register(L, *sub_namespace, 1); - lua_pop(L,1); /* removing sub-namespace table */ - sub_namespace++; - } - } - - if (reg) { - lua_pushstring(L,ns->name); - lua_pushvalue(L,-2); - lua_rawset(L,-4); /* add namespace to module table */ - } - assert(lua_gettop(L) == begin+1); -} -#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ - -/* ----------------------------------------------------------------------------- - * global variable support code: classes - * ----------------------------------------------------------------------------- */ - -SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname); - -typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret); - -SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type, - int first_arg, swig_lua_base_iterator_func func, int *const ret) -{ - /* first_arg - position of the object in stack. Everything that is above are arguments - * and is passed to every evocation of the func */ - int last_arg = lua_gettop(L);/* position of last argument */ - int original_metatable = last_arg + 1; - size_t bases_count; - int result = SWIG_ERROR; - int bases_table; - (void)swig_type; - lua_getmetatable(L,first_arg); - - /* initialise base search */ -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - SWIG_Lua_get_table(L,".bases"); - assert(lua_istable(L,-1)); - bases_count = lua_rawlen(L,-1); - bases_table = lua_gettop(L); -#else - /* In elua .bases table doesn't exist. Use table from swig_lua_class */ - (void)bases_table; - assert(swig_type!=0); - swig_module_info *module=SWIG_GetModule(L); - swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases; - const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names; - bases_count = 0; - for(;base_names[bases_count]; - bases_count++);/* get length of bases */ -#endif - - if(ret) - *ret = 0; - if(bases_count>0) - { - int to_remove; - size_t i; - int j; - int subcall_last_arg; - int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */ - int valid = 1; - swig_type_info *base_swig_type = 0; - for(j=first_arg;j<=last_arg;j++) - lua_pushvalue(L,j); - subcall_last_arg = lua_gettop(L); - - /* Trick: temporarily replacing original metatable with metatable for base class and call getter */ - for(i=0;ifqname); - base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]); - assert(base_swig_type != 0); - } -#endif - - if(!valid) - continue; - assert(lua_isuserdata(L, subcall_first_arg)); - assert(lua_istable(L,-1)); - lua_setmetatable(L,subcall_first_arg); /* Set new metatable */ - assert(lua_gettop(L) == subcall_last_arg); - result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */ - if(result != SWIG_ERROR) { - break; - } - } - /* Restore original metatable */ - lua_pushvalue(L,original_metatable); - lua_setmetatable(L,first_arg); - /* Clear - remove everything between last_arg and subcall_last_arg including */ - to_remove = subcall_last_arg - last_arg; - for(j=0;jtype; - result = SWIG_Lua_class_do_get(L,type,1,&ret); - if(result == SWIG_OK) - return ret; - - result = SWIG_Lua_class_do_get_item(L,type,1,&ret); - if(result == SWIG_OK) - return ret; - - return 0; -} - -/* helper for the class.set method, performs the lookup of class attributes - * It returns error code. Number of function return values is passed inside 'ret' - */ -SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret) -{ -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value - */ - - int bases_search_result; - int substack_start = lua_gettop(L) - 3; - lua_checkstack(L,5); - assert(lua_isuserdata(L,substack_start+1)); /* just in case */ - lua_getmetatable(L,substack_start+1); /* get the meta table */ - assert(lua_istable(L,-1)); /* just in case */ - if(ret) - *ret = 0; /* it is setter - number of return values is always 0 */ - - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,substack_start+2); /* key */ - lua_rawget(L,-2); - lua_remove(L,-2); /* tidy stack, remove .set table */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,substack_start+1); /* userdata */ - lua_pushvalue(L,substack_start+3); /* value */ - lua_call(L,2,0); - lua_remove(L,substack_start+4); /*remove metatable*/ - return SWIG_OK; - } - lua_pop(L,1); /* remove the value */ - } else { - lua_pop(L,1); /* remove the answer for .set table request*/ - } - /* NEW: looks for the __setitem() fn - this is a user provided set fn */ - SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ - if (lua_iscfunction(L,-1)) /* if it's there */ - { /* found it so call the fn & return its value */ - lua_pushvalue(L,substack_start+1); /* the userdata */ - lua_pushvalue(L,substack_start+2); /* the parameter */ - lua_pushvalue(L,substack_start+3); /* the value */ - lua_call(L,3,0); /* 3 values in ,0 out */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return SWIG_OK; - } - lua_pop(L,1); /* remove value */ - - lua_pop(L,1); /* remove metatable */ - /* Search among bases */ - bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret); - if(ret) - assert(*ret == 0); - assert(lua_gettop(L) == substack_start + 3); - return bases_search_result; -} - -/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly - * handles return values. - */ -SWIGINTERN int SWIG_Lua_class_set(lua_State *L) -{ -/* There should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value - */ - int ret = 0; - int result; - swig_lua_userdata *usr; - swig_type_info *type; - assert(lua_isuserdata(L,1)); - usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - type = usr->type; - result = SWIG_Lua_class_do_set(L,type,1,&ret); - if(result != SWIG_OK) { - SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method."); - lua_error(L); - } else { - assert(ret==0); - } - return 0; -} - -/* the class.destruct method called by the interpreter */ -SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) -{ -/* there should be 1 params passed in - (1) userdata (not the meta table) */ - swig_lua_userdata *usr; - swig_lua_class *clss; - assert(lua_isuserdata(L,-1)); /* just in case */ - usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ - /* if must be destroyed & has a destructor */ - if (usr->own) /* if must be destroyed */ - { - clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ - if (clss && clss->destructor) /* there is a destroy fn */ - { - clss->destructor(usr->ptr); /* bye bye */ - } - } - return 0; -} - -/* the class.__tostring method called by the interpreter and print */ -SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) -{ -/* there should be 1 param passed in - (1) userdata (not the metatable) */ - swig_lua_userdata* userData; - assert(lua_isuserdata(L,1)); /* just in case */ - userData = (swig_lua_userdata*)lua_touserdata(L,1); /* get the userdata address */ - - lua_pushfstring(L, "", userData->type->str, userData->ptr); - return 1; -} - -/* to manually disown some userdata */ -SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) -{ -/* there should be 1 params passed in - (1) userdata (not the meta table) */ - swig_lua_userdata *usr; - assert(lua_isuserdata(L,-1)); /* just in case */ - usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ - - usr->own = 0; /* clear our ownership */ - return 0; -} - -/* lua callable function to compare userdata's value -the issue is that two userdata may point to the same thing -but to lua, they are different objects */ -SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) -{ - int result; - swig_lua_userdata *usr1,*usr2; - if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ - return 0; /* nil reply */ - usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ - /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ - result=(usr1->ptr==usr2->ptr); - lua_pushboolean(L,result); - return 1; -} - -/* populate table at the top of the stack with metamethods that ought to be inherited */ -SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) -{ - SWIG_Lua_add_boolean(L, "__add", 1); - SWIG_Lua_add_boolean(L, "__sub", 1); - SWIG_Lua_add_boolean(L, "__mul", 1); - SWIG_Lua_add_boolean(L, "__div", 1); - SWIG_Lua_add_boolean(L, "__mod", 1); - SWIG_Lua_add_boolean(L, "__pow", 1); - SWIG_Lua_add_boolean(L, "__unm", 1); - SWIG_Lua_add_boolean(L, "__len", 1 ); - SWIG_Lua_add_boolean(L, "__concat", 1 ); - SWIG_Lua_add_boolean(L, "__eq", 1); - SWIG_Lua_add_boolean(L, "__lt", 1); - SWIG_Lua_add_boolean(L, "__le", 1); - SWIG_Lua_add_boolean(L, "__call", 1); - SWIG_Lua_add_boolean(L, "__tostring", 1); - SWIG_Lua_add_boolean(L, "__gc", 0); -} - -/* creates the swig registry */ -SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L) -{ - /* create main SWIG registry table */ - lua_pushstring(L,"SWIG"); - lua_newtable(L); - /* populate it with some predefined data */ - - /* .library table. Placeholder */ - lua_pushstring(L,".library"); - lua_newtable(L); - { - /* list of metamethods that class inherits from its bases */ - lua_pushstring(L,"inheritable_metamethods"); - lua_newtable(L); - /* populate with list of metamethods */ - SWIG_Lua_populate_inheritable_metamethods(L); - lua_rawset(L,-3); - } - lua_rawset(L,-3); - - lua_rawset(L,LUA_REGISTRYINDEX); -} - -/* gets the swig registry (or creates it) */ -SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L) -{ - /* add this all into the swig registry: */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ - if (!lua_istable(L,-1)) /* not there */ - { /* must be first time, so add it */ - lua_pop(L,1); /* remove the result */ - SWIG_Lua_create_class_registry(L); - /* then get it */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); - } -} - -SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L) -{ - SWIG_Lua_get_class_registry(L); - lua_pushstring(L, ".library"); - lua_rawget(L,-2); - assert( !lua_isnil(L,-1) ); - lua_pushstring(L, "inheritable_metamethods"); - lua_rawget(L,-2); - - /* Remove class registry and library table */ - lua_remove(L,-2); - lua_remove(L,-2); -} - -/* Helper function to get the classes metatable from the register */ -SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname) -{ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,cname); /* get the name */ - lua_rawget(L,-2); /* get it */ - lua_remove(L,-2); /* tidy up (remove registry) */ -} - -/* Set up the base classes pointers. -Each class structure has a list of pointers to the base class structures. -This function fills them. -It cannot be done at compile time, as this will not work with hireachies -spread over more than one swig file. -Therefore it must be done at runtime, querying the SWIG type system. -*/ -SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss) -{ - int i=0; - swig_module_info *module=SWIG_GetModule(L); - for(i=0;clss->base_names[i];i++) - { - if (clss->bases[i]==0) /* not found yet */ - { - /* lookup and cache the base class */ - swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); - if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; - } - } -} - -#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) -/* Merges two tables */ -SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source) -{ - /* iterating */ - lua_pushnil(L); - while (lua_next(L,source) != 0) { - /* -1 - value, -2 - index */ - /* have to copy to assign */ - lua_pushvalue(L,-2); /* copy of index */ - lua_pushvalue(L,-2); /* copy of value */ - lua_rawset(L, target); - lua_pop(L,1); - /* only key is left */ - } -} - -/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */ -SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base) -{ - /* push original[name], then base[name] */ - lua_pushstring(L,name); - lua_rawget(L,original); - int original_table = lua_gettop(L); - lua_pushstring(L,name); - lua_rawget(L,base); - int base_table = lua_gettop(L); - SWIG_Lua_merge_tables_by_index(L, original_table, base_table); - /* clearing stack */ - lua_pop(L,2); -} - -/* Function takes all symbols from base and adds it to derived class. It's just a helper. */ -SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls) -{ - /* There is one parameter - original, i.e. 'derived' class metatable */ - assert(lua_istable(L,-1)); - int original = lua_gettop(L); - SWIG_Lua_get_class_metatable(L,base_cls->fqname); - int base = lua_gettop(L); - SWIG_Lua_merge_tables(L, ".fn", original, base ); - SWIG_Lua_merge_tables(L, ".set", original, base ); - SWIG_Lua_merge_tables(L, ".get", original, base ); - lua_pop(L,1); -} - -/* Function squashes all symbols from 'clss' bases into itself */ -SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss) -{ - int i; - SWIG_Lua_get_class_metatable(L,clss->fqname); - for(i=0;clss->base_names[i];i++) - { - if (clss->bases[i]==0) /* Somehow it's not found. Skip it */ - continue; - /* Thing is: all bases are already registered. Thus they have already executed - * this function. So we just need to squash them into us, because their bases - * are already squashed into them. No need for recursion here! - */ - SWIG_Lua_class_squash_base(L, clss->bases[i]); - } - lua_pop(L,1); /*tidy stack*/ -} -#endif - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ -/* helper add a variable to a registered class */ -SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn) -{ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,getFn); - lua_pop(L,1); /* tidy stack (remove table) */ - if (setFn) - { - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,setFn); - lua_pop(L,1); /* tidy stack (remove table) */ - } -} - -/* helper to recursively add class static details (static attributes, operations and constants) */ -SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss) -{ - int i = 0; - /* The class namespace table must be on the top of the stack */ - assert(lua_istable(L,-1)); - /* call all the base classes first: we can then override these later: */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_add_class_static_details(L,clss->bases[i]); - } - - SWIG_Lua_add_namespace_details(L, clss->cls_static); -} - -SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */ - -/* helper to recursively add class details (attributes & operations) */ -SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss) -{ - int i; - size_t bases_count = 0; - /* Add bases to .bases table */ - SWIG_Lua_get_table(L,".bases"); - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); - /* Base class must be already registered */ - assert(lua_istable(L,-1)); - lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */ - bases_count++; - } - assert(lua_rawlen(L,-1) == bases_count); - lua_pop(L,1); /* remove .bases table */ - /* add attributes */ - for(i=0;clss->attributes[i].name;i++){ - SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); - } - /* add methods to the metatable */ - SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;clss->methods[i].name;i++){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func); - } - lua_pop(L,1); /* tidy stack (remove table) */ - /* add operator overloads - This adds methods from metatable array to metatable. Can mess up garbage - collectind if someone defines __gc method - */ - if(clss->metatable) { - for(i=0;clss->metatable[i].name;i++) { - SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func); - } - } - -#if !defined(SWIG_LUA_SQUASH_BASES) - /* Adding metamethods that are defined in base classes. If bases were squashed - * then it is obviously unnecessary - */ - SWIG_Lua_add_class_user_metamethods(L, clss); -#endif -} - -/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed - for the following issue: Lua runtime checks for metamethod existence with rawget function - ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method - search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly - in metatable and not in object). - Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants - are automatically given a special proxy __x that calls the real __x method. - Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime, - those changes must be reflected in all descendants. -*/ - -SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/ - -/* The real function that resolves a metamethod. - * Function searches given class and all its bases (recursively) for first instance of something that is - * not equal to SWIG_Lua_resolve_metamethod. (Almost always this 'something' is actual metamethod implementation - * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the - * answer. - * Returns 1 if found, 0 otherwise. - * clss is class which metatable we will search for method - * metamethod_name_idx is index in L where metamethod name (as string) lies - * skip_check allows skipping searching metamethod in the given class and immediately going to searching in bases. skip_check - * is not carried to subsequent recursive calls - false is always passed. It is set to true only at first call from - * SWIG_Lua_resolve_metamethod - * */ -SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx, - int skip_check) -{ - /* This function is called recursively */ - int result = 0; - int i = 0; - - if (!skip_check) { - SWIG_Lua_get_class_metatable(L, clss->fqname); - lua_pushvalue(L, metamethod_name_idx); - lua_rawget(L,-2); - /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then - * this isn't the function we are looking for :) - * lua_tocfunction will return NULL if not cfunction - */ - if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) { - lua_remove(L,-2); /* removing class metatable */ - return 1; - } - lua_pop(L,2); /* remove class metatable and query result */ - } - - /* Forwarding calls to bases */ - for(i=0;clss->bases[i];i++) - { - result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0); - if (result) - break; - } - - return result; -} - -/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method - * and calls it */ -SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) -{ - int numargs; - int metamethod_name_idx; - const swig_lua_class* clss; - int result; - - lua_checkstack(L,5); - numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */ - - /* Get upvalues from closure */ - lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/ - metamethod_name_idx = lua_gettop(L); - - lua_pushvalue(L, lua_upvalueindex(2)); - clss = (const swig_lua_class*)(lua_touserdata(L,-1)); - lua_pop(L,1); /* remove lightuserdata with clss from stack */ - - /* Actual work */ - result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1); - if (!result) { - SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation."); - lua_error(L); - return 0; - } - - lua_remove(L,-2); /* remove metamethod key */ - lua_insert(L,1); /* move function to correct position */ - lua_call(L, numargs, LUA_MULTRET); - return lua_gettop(L); /* return all results */ -} - - -/* If given metamethod must be present in given class, then creates appropriate proxy - * Returns 1 if successfully added, 0 if not added because no base class has it, -1 - * if method is defined in the class metatable itself - */ -SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index) -{ - int key_index; - int success = 0; - int i = 0; - - /* metamethod name - on the top of the stack */ - assert(lua_isstring(L,-1)); - - key_index = lua_gettop(L); - - /* Check whether method is already defined in metatable */ - lua_pushvalue(L,key_index); /* copy of the key */ - lua_gettable(L,metatable_index); - if( !lua_isnil(L,-1) ) { - lua_pop(L,1); - return -1; - } - lua_pop(L,1); - - /* Iterating over immediate bases */ - for(i=0;clss->bases[i];i++) - { - const swig_lua_class *base = clss->bases[i]; - SWIG_Lua_get_class_metatable(L, base->fqname); - lua_pushvalue(L, key_index); - lua_rawget(L, -2); - if( !lua_isnil(L,-1) ) { - lua_pushvalue(L, key_index); - - /* Add proxy function */ - lua_pushvalue(L, key_index); /* first closure value is function name */ - lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */ - lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2); - - lua_rawset(L, metatable_index); - success = 1; - } - lua_pop(L,1); /* remove function or nil */ - lua_pop(L,1); /* remove base class metatable */ - - if( success ) - break; - } - - return success; -} - -SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss) -{ - int metatable_index; - int metamethods_info_index; - int tostring_undefined; - int eq_undefined = 0; - - SWIG_Lua_get_class_metatable(L, clss->fqname); - metatable_index = lua_gettop(L); - SWIG_Lua_get_inheritable_metamethods(L); - assert(lua_istable(L,-1)); - metamethods_info_index = lua_gettop(L); - lua_pushnil(L); /* first key */ - while(lua_next(L, metamethods_info_index) != 0 ) { - /* key at index -2, value at index -1 */ - const int is_inheritable = lua_toboolean(L,-2); - lua_pop(L,1); /* remove value - we don't need it anymore */ - - if(is_inheritable) { /* if metamethod is inheritable */ - SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index); - } - } - - lua_pop(L,1); /* remove inheritable metamethods table */ - - /* Special handling for __tostring method */ - lua_pushstring(L, "__tostring"); - lua_pushvalue(L,-1); - lua_rawget(L,metatable_index); - tostring_undefined = lua_isnil(L,-1); - lua_pop(L,1); - if( tostring_undefined ) { - lua_pushcfunction(L, SWIG_Lua_class_tostring); - lua_rawset(L, metatable_index); - } else { - lua_pop(L,1); /* remove copy of the key */ - } - - /* Special handling for __eq method */ - lua_pushstring(L, "__eq"); - lua_pushvalue(L,-1); - lua_rawget(L,metatable_index); - eq_undefined = lua_isnil(L,-1); - lua_pop(L,1); - if( eq_undefined ) { - lua_pushcfunction(L, SWIG_Lua_class_equal); - lua_rawset(L, metatable_index); - } else { - lua_pop(L,1); /* remove copy of the key */ - } - /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[] - * a __getitem/__setitem method should be defined - */ - lua_pop(L,1); /* pop class metatable */ -} - -/* Register class static methods,attributes etc as well as constructor proxy */ -SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss) -{ - const int SWIGUNUSED begin = lua_gettop(L); - lua_checkstack(L,5); /* just in case */ - assert(lua_istable(L,-1)); /* just in case */ - assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */ - - SWIG_Lua_namespace_register(L,clss->cls_static, 1); - - assert(lua_istable(L,-1)); /* just in case */ - - /* add its constructor to module with the name of the class - so you can do MyClass(...) as well as new_MyClass(...) - BUT only if a constructor is defined - (this overcomes the problem of pure virtual classes without constructors)*/ - if (clss->constructor) - { - lua_getmetatable(L,-1); - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,"__call", clss->constructor); - lua_pop(L,1); - } - - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_class_static_details(L, clss); - - /* clear stack */ - lua_pop(L,1); - assert( lua_gettop(L) == begin ); -} - -/* Performs the instance (non-static) class registration process. Metatable for class is created - * and added to the class registry. - */ -SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss) -{ - const int SWIGUNUSED begin = lua_gettop(L); - int i; - /* if name already there (class is already registered) then do nothing */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - lua_rawget(L,-2); - if(!lua_isnil(L,-1)) { - lua_pop(L,2); - assert(lua_gettop(L)==begin); - return; - } - lua_pop(L,2); /* tidy stack */ - /* Recursively initialize all bases */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_class_register_instance(L,clss->bases[i]); - } - /* Again, get registry and push name */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - lua_newtable(L); /* create the metatable */ -#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - /* If squashing is requested, then merges all bases metatable into this one. - * It would get us all special methods: __getitem, __add etc. - * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away - */ - { - int new_metatable_index = lua_absindex(L,-1); - for(i=0;clss->bases[i];i++) - { - int base_metatable; - SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); - base_metatable = lua_absindex(L,-1); - SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); - lua_pop(L,1); - } - } - /* And now we will overwrite all incorrectly set data */ -#endif - /* add string of class name called ".type" */ - lua_pushstring(L,".type"); - lua_pushstring(L,clss->fqname); - lua_rawset(L,-3); - /* add a table called bases */ - lua_pushstring(L,".bases"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".get" */ - lua_pushstring(L,".get"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".set" */ - lua_pushstring(L,".set"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".fn" */ - lua_pushstring(L,".fn"); - lua_newtable(L); - /* add manual disown method */ - SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown); - lua_rawset(L,-3); - /* add accessor fns for using the .get,.set&.fn */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); - SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); - /* add it */ - lua_rawset(L,-3); /* metatable into registry */ - lua_pop(L,1); /* tidy stack (remove registry) */ - assert(lua_gettop(L) == begin); - -#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */ - SWIG_Lua_class_squash_bases(L,clss); -#endif - SWIG_Lua_get_class_metatable(L,clss->fqname); - SWIG_Lua_add_class_instance_details(L,clss); /* recursive adding of details (atts & ops) */ - lua_pop(L,1); /* tidy stack (remove class metatable) */ - assert( lua_gettop(L) == begin ); -} - -SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) -{ - int SWIGUNUSED begin; - assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */ - SWIG_Lua_class_register_instance(L,clss); - SWIG_Lua_class_register_static(L,clss); - - /* Add links from static part to instance part and vice versa */ - /* [SWIG registry] [Module] - * "MyClass" ----> [MyClass metatable] <===== "MyClass" -+> [static part] - * ".get" ----> ... | | getmetatable()----| - * ".set" ----> ... | | | - * ".static" --------------)----------------/ [static part metatable] - * | ".get" --> ... - * | ".set" --> .... - * |=============================== ".instance" - */ - begin = lua_gettop(L); - lua_pushstring(L,clss->cls_static->name); - lua_rawget(L,-2); /* get class static table */ - assert(lua_istable(L,-1)); - lua_getmetatable(L,-1); - assert(lua_istable(L,-1)); /* get class static metatable */ - lua_pushstring(L,".instance"); /* prepare key */ - - SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */ - assert(lua_istable(L,-1)); - lua_pushstring(L,".static"); /* prepare key */ - lua_pushvalue(L, -4); /* push static class TABLE */ - assert(lua_istable(L,-1)); - lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */ - lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */ - lua_pop(L,2); - assert(lua_gettop(L) == begin); -} -#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss) -{ - const int SWIGUNUSED begin = lua_gettop(L); - int i; - /* if name already there (class is already registered) then do nothing */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - lua_rawget(L,-2); - if(!lua_isnil(L,-1)) { - lua_pop(L,2); - assert(lua_gettop(L)==begin); - return; - } - lua_pop(L,2); /* tidy stack */ - /* Recursively initialize all bases */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_elua_class_register_instance(L,clss->bases[i]); - } - /* Again, get registry and push name */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - assert(clss->metatable); - lua_pushrotable(L, (void*)(clss->metatable)); /* create the metatable */ - lua_rawset(L,-3); - lua_pop(L,1); - assert(lua_gettop(L) == begin); -} -#endif /* elua && eluac */ - -/* ----------------------------------------------------------------------------- - * Class/structure conversion fns - * ----------------------------------------------------------------------------- */ - -/* helper to add metatable to new lua object */ -SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type) -{ - if (type->clientdata) /* there is clientdata: so add the metatable */ - { - SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname); - if (lua_istable(L,-1)) - { - lua_setmetatable(L,-2); - } - else - { - lua_pop(L,1); - } - } -} - -/* pushes a new object into the lua stack */ -SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own) -{ - swig_lua_userdata *usr; - if (!ptr){ - lua_pushnil(L); - return; - } - usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ - usr->ptr=ptr; /* set the ptr */ - usr->type=type; - usr->own=own; -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - SWIG_Lua_AddMetatable(L,type); /* add metatable */ -#endif -} - -/* takes a object from the lua stack & converts it into an object of the correct type - (if possible) */ -SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags) -{ - int ret = SWIG_ERROR; - swig_lua_userdata *usr; - swig_cast_info *cast; - /* special case: lua nil => NULL pointer */ - if (lua_isnil(L,index)) - { - *ptr=0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - if (lua_islightuserdata(L,index)) - { - *ptr=lua_touserdata(L,index); - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ - if (usr) - { - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !usr->own) - { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ - { - usr->own = 0; - } - if (!type) /* special cast void*, no casting fn */ - { - *ptr=usr->ptr; - ret = SWIG_OK; - } - else - { - cast=SWIG_TypeCheck(usr->type->name,type); /* performs normal type checking */ - if (cast) - { - int newmemory = 0; - *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - ret = SWIG_OK; - } - } - if ((ret == SWIG_OK) && (flags & SWIG_POINTER_CLEAR)) - { - usr->ptr = 0; - } - } - return ret; -} - -SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags, - int argnum,const char *func_name){ - void *result = 0; - if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ - luaL_error (L,"Error in %s, expected a %s at argument number %d\n", - func_name,(type && type->str)?type->str:"void*",argnum); - } - return result; -} - -/* pushes a packed userdata. user for member fn pointers only */ -SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type) -{ - swig_lua_rawdata *raw; - assert(ptr); /* not acceptable to pass in a NULL value */ - raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ - raw->type=type; - raw->own=0; - memcpy(raw->data,ptr,size); /* copy the data */ - SWIG_Lua_AddMetatable(L,type); /* add metatable */ -} - -/* converts a packed userdata. user for member fn pointers only */ -SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type) -{ - swig_lua_rawdata *raw; - raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ - if (!raw) return SWIG_ERROR; /* error */ - if (type==0 || type==raw->type) /* void* or identical type */ - { - memcpy(ptr,raw->data,size); /* copy it */ - return SWIG_OK; /* ok */ - } - return SWIG_ERROR; /* error */ -} - -/* a function to get the typestring of a piece of data */ -SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) -{ - swig_lua_userdata *usr; - if (lua_isuserdata(L,tp)) - { - usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ - if (usr && usr->type && usr->type->str) - return usr->type->str; - return "userdata (unknown type)"; - } - return lua_typename(L,lua_type(L,tp)); -} - -/* lua callable function to get the userdata's type */ -SWIGRUNTIME int SWIG_Lua_type(lua_State *L) -{ - lua_pushstring(L,SWIG_Lua_typename(L,1)); - return 1; -} - -/* ----------------------------------------------------------------------------- - * global variable support code: class/struct typemap functions - * ----------------------------------------------------------------------------- */ - -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) -/* Install Constants */ -SWIGINTERN void -SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) { - int i; - for (i = 0; constants[i].type; i++) { - switch(constants[i].type) { - case SWIG_LUA_INT: - lua_pushstring(L,constants[i].name); - lua_pushinteger(L,(lua_Integer)constants[i].lvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_FLOAT: - lua_pushstring(L,constants[i].name); - lua_pushnumber(L,(lua_Number)constants[i].dvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_CHAR: - lua_pushstring(L,constants[i].name); - { - char c = (char)constants[i].lvalue; - lua_pushlstring(L,&c,1); - } - lua_rawset(L,-3); - break; - case SWIG_LUA_STRING: - lua_pushstring(L,constants[i].name); - lua_pushstring(L,(char *) constants[i].pvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_POINTER: - lua_pushstring(L,constants[i].name); - SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0); - lua_rawset(L,-3); - break; - case SWIG_LUA_BINARY: - lua_pushstring(L,constants[i].name); - SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); - lua_rawset(L,-3); - break; - default: - break; - } - } -} -#endif - -/* ----------------------------------------------------------------------------- - * executing lua code from within the wrapper - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ -#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) -#endif -/* Executes a C string in Lua which is a really simple way of calling lua from C -Unfortunately lua keeps changing its APIs, so we need a conditional compile -In lua 5.0.X it's lua_dostring() -In lua 5.1.X it's luaL_dostring() -*/ -SWIGINTERN int -SWIG_Lua_dostring(lua_State *L, const char *str) { - int ok,top; - if (str==0 || str[0]==0) return 0; /* nothing to do */ - top=lua_gettop(L); /* save stack */ -#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) - ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ -#else - ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ -#endif - if (ok!=0) { - SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); - } - lua_settop(L,top); /* restore the stack */ - return ok; -} - -#ifdef __cplusplus -} -#endif - -/* ------------------------------ end luarun.swg ------------------------------ */ diff --git a/linux/bin/swig/share/swig/4.1.0/lua/luaruntime.swg b/linux/bin/swig/share/swig/4.1.0/lua/luaruntime.swg deleted file mode 100755 index 399bb640..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/luaruntime.swg +++ /dev/null @@ -1,104 +0,0 @@ -/* ----------------------------------------------------------------------------- - * luaruntime.swg - * - * all the runtime code for . - * ----------------------------------------------------------------------------- */ - -%runtime "swigrun.swg" /* Common C API type-checking code */ -%runtime "swigerrors.swg" /* SWIG errors */ -%runtime "luarun.swg" /* Lua runtime stuff */ - -%insert(initbeforefunc) "swiginit.swg" - -%insert(initbeforefunc) %{ - -/* Forward declaration of where the user's %init{} gets inserted */ -void SWIG_init_user(lua_State* L ); - -#ifdef __cplusplus -extern "C" { -#endif -/* this is the initialization function - added at the very end of the code - the function is always called SWIG_init, but an earlier #define will rename it -*/ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) -LUALIB_API int SWIG_init(lua_State* L) -#else -SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ -#endif -{ -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ - int i; - int globalRegister = 0; - /* start with global table */ - lua_pushglobaltable (L); - /* SWIG's internal initialisation */ - SWIG_InitializeModule((void*)L); - SWIG_PropagateClientData(); -#endif - -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE) - /* add a global fn */ - SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); - SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal); -#endif - -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - /* set up base class pointers (the hierarchy) */ - for (i = 0; swig_types[i]; i++){ - if (swig_types[i]->clientdata){ - SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); - } - } -#ifdef SWIG_LUA_MODULE_GLOBAL - globalRegister = 1; -#endif - - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister); -#endif - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) - for (i = 0; swig_types[i]; i++){ - if (swig_types[i]->clientdata){ - SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata)); - } - } -#endif - -#if defined(SWIG_LUA_ELUA_EMULATE) - lua_newtable(L); - SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods); - SWIG_Lua_elua_emulate_register_clear(L); - if(globalRegister) { - lua_pushstring(L,swig_SwigModule.name); - lua_pushvalue(L,-2); - lua_rawset(L,-4); - } -#endif - -#endif - -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - /* invoke user-specific initialization */ - SWIG_init_user(L); - /* end module */ - /* Note: We do not clean up the stack here (Lua will do this for us). At this - point, we have the globals table and out module table on the stack. Returning - one value makes the module table the result of the require command. */ - return 1; -#else - return 0; -#endif -} - -#ifdef __cplusplus -} -#endif - -%} - -/* Note: the initialization function is closed after all code is generated */ - diff --git a/linux/bin/swig/share/swig/4.1.0/lua/luatypemaps.swg b/linux/bin/swig/share/swig/4.1.0/lua/luatypemaps.swg deleted file mode 100755 index 7d23917e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/luatypemaps.swg +++ /dev/null @@ -1,418 +0,0 @@ -/* ----------------------------------------------------------------------------- - * luatypemaps.swg - * - * basic typemaps for Lua. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * standard typemaps - * ----------------------------------------------------------------------------- */ -/* NEW LANGUAGE NOTE: - the 'checkfn' param is something that I added for typemap(in) - it is an optional fn call to check the type of the lua object - the fn call must be of the form - int checkfn(lua_State *L, int index); - and return 1/0 depending upon if this is the correct type - For the typemap(out), an additional SWIG_arg parameter must be incremented - to reflect the number of values returned (normally SWIG_arg++; will do) -*/ -// numbers -%typemap(in,checkfn="lua_isnumber") int, short, long, - signed char, float, double -%{$1 = ($type)lua_tonumber(L, $input);%} - -// additional check for unsigned numbers, to not permit negative input -%typemap(in,checkfn="lua_isnumber") unsigned int, - unsigned short, unsigned long, unsigned char -%{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative"); -$1 = ($type)lua_tonumber(L, $input);%} - -%typemap(out) int,short,long, - unsigned int,unsigned short,unsigned long, - signed char,unsigned char, - float,double -%{ lua_pushnumber(L, (lua_Number) $1); SWIG_arg++;%} - -// we must also provide typemaps for primitives by const reference: -// given a function: -// int intbyref(const int& i); -// SWIG assumes that this code will need a pointer to int to be passed in -// (this might be ok for objects by const ref, but not for numeric primitives) -// therefore we add a set of typemaps to fix this (for both in & out) -%typemap(in,checkfn="lua_isnumber") const int&($*1_ltype temp) -%{ temp=($*1_ltype)lua_tonumber(L,$input); $1=&temp;%} - -%typemap(in,checkfn="lua_isnumber") const unsigned int&($*1_ltype temp) -%{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative"); -temp=($*1_ltype)lua_tonumber(L,$input); $1=&temp;%} - -%typemap(out) const int&, const unsigned int& -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} - -// for the other numbers we can just use an apply statement to cover them -%apply const int & {const short&,const long&,const signed char&, - const float&,const double&}; - -%apply const unsigned int & {const unsigned short&,const unsigned long&, - const unsigned char&}; - -/* enums have to be handled slightly differently - VC++ .net will not allow a cast from lua_Number(double) to enum directly. -*/ -%typemap(in,checkfn="lua_isnumber") enum SWIGTYPE -%{$1 = ($type)(int)lua_tonumber(L, $input);%} - -%typemap(out) enum SWIGTYPE -%{ lua_pushnumber(L, (lua_Number)(int)($1)); SWIG_arg++;%} - -// and const refs -%typemap(in,checkfn="lua_isnumber") const enum SWIGTYPE &($basetype temp) -%{ temp=($basetype)(int)lua_tonumber(L,$input); $1=&temp;%} -%typemap(in,checkfn="lua_isnumber") const enum SWIGTYPE &&($basetype temp) -%{ temp=($basetype)(int)lua_tonumber(L,$input); $1=&temp;%} -%typemap(out) const enum SWIGTYPE & -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} -%typemap(out) const enum SWIGTYPE && -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} - - -// boolean (which is a special type in lua) -// note: lua_toboolean() returns 1 or 0 -// note: 1 & 0 are not booleans in lua, only true & false -%typemap(in,checkfn="lua_isboolean") bool -%{$1 = (lua_toboolean(L, $input)!=0);%} - -%typemap(out) bool -%{ lua_pushboolean(L,(int)($1!=0)); SWIG_arg++;%} - -// for const bool&, SWIG treats this as a const bool* so we must dereference it -%typemap(in,checkfn="lua_isboolean") const bool& (bool temp) -%{temp=(lua_toboolean(L, $input)!=0); - $1=&temp;%} - -%typemap(out) const bool& -%{ lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%} - -// strings (char * and char[]) -%fragment("SWIG_lua_isnilstring", "header") { -SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) { - int ret = lua_isstring(L, idx); - if (!ret) - ret = lua_isnil(L, idx); - return ret; -} -} - -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char *, char * -%{$1 = ($ltype)lua_tostring(L, $input);%} - -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char[ANY], char[ANY] -%{$1 = ($ltype)lua_tostring(L, $input);%} - -%typemap(out) const char *, char * -%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} - -%typemap(out) const char[ANY], char[ANY] -%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} - -// char's -// currently treating chars as small strings, not as numbers -// (however signed & unsigned char's are numbers...) -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") char -%{$1 = (lua_tostring(L, $input))[0];%} - -%typemap(out) char -%{ lua_pushlstring(L, &$1, 1); SWIG_arg++;%} - -// by const ref -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char& (char temp) -%{temp = (lua_tostring(L, $input))[0]; $1=&temp;%} - -%typemap(out) const char& -%{ lua_pushlstring(L, $1, 1); SWIG_arg++;%} - -// pointers and references -// under SWIG rules, it is ok, to have a pass in a lua nil, -// it should be converted to a SWIG NULL. -// This will only be allowed for pointers & arrays, not refs or by value -// the checkfn lua_isuserdata will only work for userdata -// the checkfn SWIG_isptrtype will work for both userdata and nil -%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE*,SWIGTYPE[] -%{ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ - SWIG_fail_ptr("$symname",$argnum,$descriptor); - } -%} - -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE& -%{ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ - SWIG_fail_ptr("$symname",$argnum,$descriptor); - } -%} - -%typemap(in,checkfn="lua_isuserdata",fragment="") SWIGTYPE&& (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) %{ - res = SWIG_ConvertPtr(L, $input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type '$1_type' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $descriptor); - } - } - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -%} - -// out is simple -%typemap(out) SWIGTYPE*,SWIGTYPE& -%{SWIG_NewPointerObj(L,$1,$descriptor,$owner); SWIG_arg++; %} -%typemap(out) SWIGTYPE*,SWIGTYPE&& -%{SWIG_NewPointerObj(L,$1,$descriptor,$owner); SWIG_arg++; %} - -// dynamic casts -// this uses the SWIG_TypeDynamicCast() which relies on RTTI to find out what the pointer really is -// the we return it as the correct type -%typemap(out) SWIGTYPE *DYNAMIC, - SWIGTYPE &DYNAMIC -{ - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_NewPointerObj(L,(void*)$1,ty,$owner); SWIG_arg++; -} - - -// passing objects by value -// SWIG_ConvertPtr wants an object pointer (the $<ype argp) -// then dereferences it to get the object -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE ($<ype argp) -%{ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&argp,$&descriptor,0))){ - SWIG_fail_ptr("$symname",$argnum,$&descriptor); - } - $1 = *argp; -%} - -// Also needed for object ptrs by const ref -// eg A* const& ref_pointer(A* const& a); -// found in mixed_types.i -%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE *const&($*ltype temp) -%{temp=($*ltype)SWIG_MustGetPtr(L,$input,$*descriptor,0,$argnum,"$symname"); -$1=($1_ltype)&temp;%} - -%typemap(out) SWIGTYPE *const& -%{SWIG_NewPointerObj(L,*$1,$*descriptor,$owner); SWIG_arg++; %} - - -// DISOWN-ing typemaps -// if you have an object pointer which must be disowned, use this typemap -// eg. for void destroy_foo(Foo* toDie); -// use %apply SWIGTYPE* DISOWN {Foo* toDie}; -// you could just use %delobject, but this is more flexible -%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE* DISOWN,SWIGTYPE DISOWN[] -%{ if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("$symname",$argnum,$descriptor); - } -%} - - -// Primitive types--return by value -// must make a new object, copy the data & return the new object -// Note: the brackets are {...} and not %{..%}, because we want them to be included in the wrapper -// this is because typemap(out) does not support local variables, like in typemap(in) does -// and we need the $&1_ltype resultptr; to be declared -#ifdef __cplusplus -%typemap(out) SWIGTYPE -{ - $&1_ltype resultptr = new $1_ltype($1); - SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; -} -#else -%typemap(out) SWIGTYPE -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; -} -#endif - -// member function pointer -// a member fn ptr is not 4 bytes like a normal pointer, but 8 bytes (at least on mingw) -// so the standard wrapping cannot be done -// nor can you cast a member function pointer to a void* (obviously) -// therefore a special wrapping functions SWIG_ConvertMember() & SWIG_NewMemberObj() were written -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE (CLASS::*) -%{ - if (!SWIG_IsOK(SWIG_ConvertMember(L,$input,(void*)(&$1),sizeof($1),$descriptor))) - SWIG_fail_ptr("$symname",$argnum,$descriptor); -%} - -%typemap(out) SWIGTYPE (CLASS::*) -%{ - SWIG_NewMemberObj(L,(void*)(&$1),sizeof($1),$descriptor); SWIG_arg++; -%} - - -// void (must be empty without the SWIG_arg++) -%typemap(out) void "" - -/* void* is a special case -A function void fn(void*) should take any kind of pointer as a parameter (just like C/C++ does) -but if it's an output, then it should be wrapped like any other SWIG object (using default typemap) -*/ -%typemap(in,checkfn="SWIG_isptrtype") void* -%{$1=($1_ltype)SWIG_MustGetPtr(L,$input,0,0,$argnum,"$symname");%} - -/* long long is another special case: -as lua only supports one numeric type (lua_Number), we will just -cast it to that & accept the loss of precision. -An alternative solution would be a long long struct or class -with the relevant operators. -*/ -%apply long {long long, signed long long, unsigned long long}; -%apply const long& {const long long&, const signed long long&, const unsigned long long&}; - -/* It is possible to also pass a lua_State* into a function, so -void fn(int a, float b, lua_State* s) is wrappable as -> fn(1,4.3) -- note: the state is implicitly passed in -*/ -%typemap(in, numinputs=0) lua_State* -%{$1 = L;%} - - - -/* ----------------------------------------------------------------------------- - * typecheck rules - * ----------------------------------------------------------------------------- */ -/* These are needed for the overloaded functions -These define the detection routines which will spot what -parameters match which function -*/ - -// unfortunately lua only considers one type of number -// so all numbers (int,float,double) match -// you could add an advanced fn to get type & check if it's integral -%typecheck(SWIG_TYPECHECK_INTEGER) - int, short, long, - unsigned int, unsigned short, unsigned long, - signed char, unsigned char, - long long, unsigned long long, signed long long, - const int &, const short &, const long &, - const unsigned int &, const unsigned short &, const unsigned long &, - const signed char&, const unsigned char&, - const long long &, const unsigned long long &, - enum SWIGTYPE, const enum SWIGTYPE&, const enum SWIGTYPE &&, - float, double, const float &, const double& -{ - $1 = lua_isnumber(L,$input); -} - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, const bool & -{ - $1 = lua_isboolean(L,$input); -} - -// special check for a char (string of length 1) -%typecheck(SWIG_TYPECHECK_CHAR,fragment="SWIG_lua_isnilstring") char, const char& { - $1 = SWIG_lua_isnilstring(L,$input) && (lua_rawlen(L,$input)==1); -} - -%typecheck(SWIG_TYPECHECK_STRING,fragment="SWIG_lua_isnilstring") char *, char[] { - $1 = SWIG_lua_isnilstring(L,$input); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { - void *ptr; - if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE & { - void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE && { - void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $&1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, 0, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -// Also needed for object pointers by const ref -// eg const A* ref_pointer(A* const& a); -// found in mixed_types.i -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& -{ - void *ptr; - if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $*descriptor, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -/* ----------------------------------------------------------------------------- - * Others - * ----------------------------------------------------------------------------- */ - -// Array reference typemaps -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -// size_t (which is just a unsigned long) -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; - - -/* ----------------------------------------------------------------------------- - * Specials - * ----------------------------------------------------------------------------- */ -// swig::LANGUAGE_OBJ was added to allow containers of native objects -// however it's rather difficult to do this in lua, as you cannot hold pointers -// to native objects (they are held in the interpreter) -// therefore for now: just ignoring this feature -#ifdef __cplusplus -%ignore swig::LANGUAGE_OBJ; - -//%inline %{ -%{ -namespace swig { -typedef struct{} LANGUAGE_OBJ; -} -%} - -#endif // __cplusplus diff --git a/linux/bin/swig/share/swig/4.1.0/lua/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/lua/std_auto_ptr.i deleted file mode 100755 index b3b71d0f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, checkfn="SWIG_isptrtype", noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(L, $input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $descriptor(TYPE *)); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++; -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/lua/std_common.i b/linux/bin/swig/share/swig/4.1.0/lua/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/linux/bin/swig/share/swig/4.1.0/lua/std_deque.i b/linux/bin/swig/share/swig/4.1.0/lua/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/lua/std_except.i b/linux/bin/swig/share/swig/4.1.0/lua/std_except.i deleted file mode 100755 index 34ab6a1a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/std_except.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Typemaps used by the STL wrappers that throw exceptions. - * These typemaps are used when methods are declared with an STL exception - * specification, such as: - * size_t at() const throw (std::out_of_range); - * - * std_except.i - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} -%include - -namespace std -{ - %ignore exception; // not sure if I should ignore this... - class exception - { - public: - exception() throw() { } - virtual ~exception() throw(); - virtual const char* what() const throw(); - }; -} - -// normally objects which are thrown are returned to the interpreter as errors -// (which potentially may have problems if they are not copied) -// therefore all classes based upon std::exception are converted to their strings & returned as errors -%typemap(throws) std::bad_cast "SWIG_exception(SWIG_TypeError, $1.what());" -%typemap(throws) std::bad_exception "SWIG_exception(SWIG_RuntimeError, $1.what());" -%typemap(throws) std::domain_error "SWIG_exception(SWIG_ValueError, $1.what());" -%typemap(throws) std::exception "SWIG_exception(SWIG_SystemError, $1.what());" -%typemap(throws) std::invalid_argument "SWIG_exception(SWIG_ValueError, $1.what());" -%typemap(throws) std::length_error "SWIG_exception(SWIG_IndexError, $1.what());" -%typemap(throws) std::logic_error "SWIG_exception(SWIG_RuntimeError, $1.what());" -%typemap(throws) std::out_of_range "SWIG_exception(SWIG_IndexError, $1.what());" -%typemap(throws) std::overflow_error "SWIG_exception(SWIG_OverflowError, $1.what());" -%typemap(throws) std::range_error "SWIG_exception(SWIG_IndexError, $1.what());" -%typemap(throws) std::runtime_error "SWIG_exception(SWIG_RuntimeError, $1.what());" -%typemap(throws) std::underflow_error "SWIG_exception(SWIG_RuntimeError, $1.what());" diff --git a/linux/bin/swig/share/swig/4.1.0/lua/std_map.i b/linux/bin/swig/share/swig/4.1.0/lua/std_map.i deleted file mode 100755 index 773b6d0c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/std_map.i +++ /dev/null @@ -1,66 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; -} diff --git a/linux/bin/swig/share/swig/4.1.0/lua/std_pair.i b/linux/bin/swig/share/swig/4.1.0/lua/std_pair.i deleted file mode 100755 index 410da922..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/std_pair.i +++ /dev/null @@ -1,26 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * std::pair typemaps for LUA - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - T first; - U second; - }; - - template - pair make_pair(const T& first, const U& second); -} diff --git a/linux/bin/swig/share/swig/4.1.0/lua/std_string.i b/linux/bin/swig/share/swig/4.1.0/lua/std_string.i deleted file mode 100755 index b95a8a4a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/std_string.i +++ /dev/null @@ -1,125 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * std::string typemaps for LUA - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -/* -Only std::string and const std::string& are typemapped -they are converted to the Lua strings automatically - -std::string& and std::string* are not -they must be explicitly managed (see below) - -eg. - -std::string test_value(std::string x) { - return x; -} - -can be used as - -s="hello world" -s2=test_value(s) -assert(s==s2) -*/ - -namespace std { - -%naturalvar string; - -/* -Bug report #1526022: -Lua strings and std::string can contain embedded zero bytes -Therefore a standard out typemap should not be: - lua_pushstring(L,$1.c_str()); -but - lua_pushlstring(L,$1.data(),$1.size()); - -Similarly for getting the string - $1 = (char*)lua_tostring(L, $input); -becomes - $1.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); - -Not using: lua_tolstring() as this is only found in Lua 5.1 & not 5.0.2 -*/ - -%typemap(in,checkfn="lua_isstring") string -%{$1.assign(lua_tostring(L,$input),lua_rawlen(L,$input));%} - -%typemap(out) string -%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_arg++;%} - -%typemap(in,checkfn="lua_isstring") const string& ($*1_ltype temp) -%{temp.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); $1=&temp;%} - -%typemap(out) const string& -%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} - -// for throwing of any kind of string, string ref's and string pointers -// we convert all to lua strings -%typemap(throws) string, string&, const string& -%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_fail;%} - -%typemap(throws) string*, const string* -%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_fail;%} - -%typecheck(SWIG_TYPECHECK_STRING) string, const string& { - $1 = lua_isstring(L,$input); -} - -/* -std::string& can be wrapped, but you must inform SWIG if it is in or out - -eg: -void fn(std::string& str); -Is this an in/out/inout value? - -Therefore you need the usual -%apply (std::string& INOUT) {std::string& str}; -or -%apply std::string& INOUT {std::string& str}; -typemaps to tell SWIG what to do. -*/ - -%typemap(in) string &INPUT=const string &; -%typemap(in, numinputs=0) string &OUTPUT ($*1_ltype temp) -%{ $1 = &temp; %} -%typemap(argout) string &OUTPUT -%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} -%typemap(in) string &INOUT =const string &; -%typemap(argout) string &INOUT = string &OUTPUT; - -/* -A really cut down version of the string class - -This provides basic mapping of lua strings <-> std::string -and little else -(the std::string has a lot of unneeded functions anyway) - -note: no fn's taking the const string& -as this is overloaded by the const char* version -*/ - - class string { - public: - string(); - string(const char*); - unsigned int size() const; - unsigned int length() const; - bool empty() const; - // no support for operator[] - const char* c_str()const; - const char* data()const; - // assign does not return a copy of this object - // (no point in a scripting language) - void assign(const char*); - // no support for all the other features - // it's probably better to do it in lua - }; -} - diff --git a/linux/bin/swig/share/swig/4.1.0/lua/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/lua/std_unique_ptr.i deleted file mode 100755 index ad08f3b0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, checkfn="SWIG_isptrtype", noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(L, $input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $descriptor(TYPE *)); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++; -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/lua/std_vector.i b/linux/bin/swig/share/swig/4.1.0/lua/std_vector.i deleted file mode 100755 index 9eb85e9e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/std_vector.i +++ /dev/null @@ -1,140 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * std::vector typemaps for LUA - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} -%include // the general exceptions -/* -A really cut down version of the vector class. - -Note: this does not match the true std::vector class -but instead is an approximate, so that SWIG knows how to wrapper it. -(Eg, all access is by value, not ref, as SWIG turns refs to pointers) - -And no support for iterators & insert/erase - -It would be useful to have a vector<->Lua table conversion routine - -*/ -namespace std { - - template - class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(unsigned int); - vector(const vector& other); - vector(unsigned int,T); - - unsigned int size() const; - unsigned int max_size() const; - bool empty() const; - void clear(); - void push_back(T val); - void pop_back(); - T front()const; // only read front & back - T back()const; // not write to them - // operator [] given later: - - %extend // this is a extra bit of SWIG code - { - // [] is replaced by __getitem__ & __setitem__ - // simply throws a string, which causes a lua error - T __getitem__(unsigned int idx) throw (std::out_of_range) - { - if (idx>=self->size()) - throw std::out_of_range("in vector::__getitem__()"); - return (*self)[idx]; - } - void __setitem__(unsigned int idx,T val) throw (std::out_of_range) - { - if (idx>=self->size()) - throw std::out_of_range("in vector::__setitem__()"); - (*self)[idx]=val; - } - }; - }; - -} - -/* -Vector<->LuaTable fns -These look a bit like the array<->LuaTable fns -but are templated, not %defined -(you must have template support for STL) - -*/ -/* -%{ -// reads a table into a vector of numbers -// lua numbers will be cast into the type required (rounding may occur) -// return 0 if non numbers found in the table -// returns new'ed ptr if ok -template -std::vector* SWIG_read_number_vector(lua_State* L,int index) -{ - int i=0; - std::vector* vec=new std::vector(); - while(1) - { - lua_rawgeti(L,index,i+1); - if (!lua_isnil(L,-1)) - { - lua_pop(L,1); - break; // finished - } - if (!lua_isnumber(L,-1)) - { - lua_pop(L,1); - delete vec; - return 0; // error - } - vec->push_back((T)lua_tonumber(L,-1)); - lua_pop(L,1); - ++i; - } - return vec; // ok -} -// writes a vector of numbers out as a lua table -template -int SWIG_write_number_vector(lua_State* L,std::vector *vec) -{ - lua_newtable(L); - for(int i=0;isize();++i) - { - lua_pushnumber(L,(double)((*vec)[i])); - lua_rawseti(L,-2,i+1);// -1 is the number, -2 is the table - } -} -%} - -// then the typemaps - -%define SWIG_TYPEMAP_NUM_VECTOR(T) - -// in -%typemap(in) std::vector *INPUT -%{ $1 = SWIG_read_number_vector(L,$input); - if (!$1) SWIG_fail;%} - -%typemap(freearg) std::vector *INPUT -%{ delete $1;%} - -// out -%typemap(argout) std::vector *OUTPUT -%{ SWIG_write_number_vector(L,$1); SWIG_arg++; %} - -%enddef -*/ diff --git a/linux/bin/swig/share/swig/4.1.0/lua/stl.i b/linux/bin/swig/share/swig/4.1.0/lua/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/lua/swigmove.i b/linux/bin/swig/share/swig/4.1.0/lua/swigmove.i deleted file mode 100755 index d130e797..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/swigmove.i +++ /dev/null @@ -1,18 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, checkfn="lua_isuserdata", noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(L, $input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type '$1_type' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $&1_descriptor); - } - } - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/linux/bin/swig/share/swig/4.1.0/lua/typemaps.i b/linux/bin/swig/share/swig/4.1.0/lua/typemaps.i deleted file mode 100755 index 68f6f6cc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/typemaps.i +++ /dev/null @@ -1,554 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.swg - * - * SWIG Library file containing the main typemap code to support Lua modules. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Basic inout typemaps - * ----------------------------------------------------------------------------- */ -/* -These provide the basic ability for passing in & out of standard numeric data types -(int,long,float,double, etc) - -The basic code looks like this: - -%typemap(in,checkfn="lua_isnumber") int *INPUT(int temp), int &INPUT(int temp) -%{ temp = (int)lua_tonumber(L,$input); - $1 = &temp; %} - -%typemap(in, numinputs=0) int *OUTPUT (int temp) -%{ $1 = &temp; %} - -%typemap(argout) int *OUTPUT -%{ lua_pushnumber(L, (double) *$1); SWIG_arg++;%} - -%typemap(in) int *INOUT = int *INPUT; -%typemap(argout) int *INOUT = int *OUTPUT; - -However the code below is a mixture of #defines & such, so nowhere as easy to read - -To make you code work correctly it's not just a matter of %including this file -You also have to give SWIG the hints on which to use where - -eg -extern int add_pointer(int* a1,int* a2); // a1 & a2 are pointer values to be added -extern void swap(int* s1, int* s2); // does the swap - -You will need to either change the argument names -extern int add_pointer(int* INPUT,int* INPUT); - -or provide a %apply statement - -%apply int* INOUT{ int *s1, int *s2 }; - // if SWIG sees int* s1, int* s2, assume they are inout params -*/ - - -%define SWIG_NUMBER_TYPEMAP(TYPE) -%typemap(in,checkfn="lua_isnumber") TYPE *INPUT($*ltype temp), TYPE &INPUT($*ltype temp) -%{ temp = ($*ltype)lua_tonumber(L,$input); - $1 = &temp; %} -%typemap(in, numinputs=0) TYPE *OUTPUT ($*ltype temp) -%{ $1 = &temp; %} -%typemap(argout) TYPE *OUTPUT -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} -%typemap(in) TYPE *INOUT = TYPE *INPUT; -%typemap(argout) TYPE *INOUT = TYPE *OUTPUT; -%typemap(in) TYPE &OUTPUT = TYPE *OUTPUT; -%typemap(argout) TYPE &OUTPUT = TYPE *OUTPUT; -%typemap(in) TYPE &INOUT = TYPE *INPUT; -%typemap(argout) TYPE &INOUT = TYPE *OUTPUT; -// const version (the $*ltype is the basic number without ptr or const's) -%typemap(in,checkfn="lua_isnumber") const TYPE *INPUT($*ltype temp) -%{ temp = ($*ltype)lua_tonumber(L,$input); - $1 = &temp; %} -%enddef - -// now the code -SWIG_NUMBER_TYPEMAP(unsigned char); SWIG_NUMBER_TYPEMAP(signed char); - -SWIG_NUMBER_TYPEMAP(short); SWIG_NUMBER_TYPEMAP(unsigned short); SWIG_NUMBER_TYPEMAP(signed short); -SWIG_NUMBER_TYPEMAP(int); SWIG_NUMBER_TYPEMAP(unsigned int); SWIG_NUMBER_TYPEMAP(signed int); -SWIG_NUMBER_TYPEMAP(long); SWIG_NUMBER_TYPEMAP(unsigned long); SWIG_NUMBER_TYPEMAP(signed long); -SWIG_NUMBER_TYPEMAP(float); -SWIG_NUMBER_TYPEMAP(double); -SWIG_NUMBER_TYPEMAP(enum SWIGTYPE); -// also for long longs's -SWIG_NUMBER_TYPEMAP(long long); SWIG_NUMBER_TYPEMAP(unsigned long long); SWIG_NUMBER_TYPEMAP(signed long long); - -// note we don't do char, as a char* is probably a string not a ptr to a single char - -// similar for booleans -%typemap(in,checkfn="lua_isboolean") bool *INPUT(bool temp), bool &INPUT(bool temp) -%{ temp = (lua_toboolean(L,$input)!=0); - $1 = &temp; %} - -%typemap(in, numinputs=0) bool *OUTPUT (bool temp),bool &OUTPUT (bool temp) -%{ $1 = &temp; %} - -%typemap(argout) bool *OUTPUT,bool &OUTPUT -%{ lua_pushboolean(L, (int)((*$1)!=0)); SWIG_arg++;%} - -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; - -/* ----------------------------------------------------------------------------- - * Basic Array typemaps - * ----------------------------------------------------------------------------- */ -/* -I have no idea why this kind of code does not exist in SWIG as standard, -but here is it. -This code will convert to/from 1D numeric arrays. -In order to reduce code bloat, there are a few macros -and quite a few functions defined -(unfortunately this makes it a lot less clear) - -assuming we have functions -void process_array(int arr[3]); // nice fixed size array -void process_var_array(float arr[],int len); // variable sized array -void process_var_array_inout(double* arr,int len); // variable sized array - // data passed in & out -void process_enum_inout_array_var(enum Days *arrinout, int len); // using enums -void return_array_5(int arrout[5]); // out array only - -in order to wrap them correctly requires a typemap - -// inform SWIG of the correct typemap -// For fixed length, you must specify it as INPUT[ANY] -%apply (int INPUT[ANY]) {(int arr[3])}; -// variable length arrays are just the same -%apply (float INPUT[],int) {(float arr[],int len)}; -// it is also ok, to map the TYPE* instead of a TYPE[] -%apply (double *INOUT,int) {(double arr*,int len)}; -// for the enum's you must use enum SWIGTYPE -%apply (enum SWIGTYPE *INOUT,int) {(enum Days *arrinout, int len)}; -// fixed length out if also fine -%apply (int OUTPUT[ANY]) {(int arrout[5])}; - -Generally, you could use %typemap(...)=... -but the %apply is neater & easier - -a few things of note: -* all Lua tables are indexed from 1, all C/C++ arrays are indexed from 0 - therefore t={6,5,3} -- t[1]==6, t[2]==5, t[3]==3 - when passed to process_array(int arr[3]) becomes - arr[0]==6, arr[1]==5, arr[2]==3 -* for OUTPUT arrays, no array need be passed in, the fn will return a Lua table - so for the above mentioned return_array_5() would look like - arr=return_array_5() -- no parameters passed in -* for INOUT arrays, a table must be passed in, and a new table will be returned - (this is consistent with the way that numbers are processed) - if you want just use - arr={...} - arr=process_var_array_inout(arr) -- arr is replaced by the new version - -The following are not yet supported: -* variable length output only array (inout works ok) -* multidimensional arrays -* arrays of objects/structs -* arrays of pointers - -*/ - -/* -The internals of the array management stuff -helper fns/macros -SWIG_ALLOC_ARRAY(TYPE,LEN) // returns a typed array TYPE[LEN] -SWIG_FREE_ARRAY(PTR) // delete the ptr (if not zero) - -// counts the specified table & gets the size -// integer version -int SWIG_itable_size(lua_State* L, int index); -// other version -int SWIG_table_size(lua_State* L, int index); - -SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE) -// this fn declares up 4 functions for helping to read/write tables -// these can then be called by the macros ... -// all assume the table is an integer indexes from 1 -// but the C array is a indexed from 0 - // created a fixed size array, reads the specified table - // and then fills the array with numbers - // returns ptr to the array if ok, or 0 for error - // (also pushes a error message to the stack) -TYPE* SWIG_get_NAME_num_array_fixed(lua_State* L, int index, int size); - // as per SWIG_get_NAME_num_array_fixed() - // but reads the entire table & creates an array of the correct size - // (if the table is empty, it returns an error rather than a zero length array) -TYPE* SWIG_get_NAME_num_array_var(lua_State* L, int index, int* size); - // writes a table to Lua with all the specified numbers -void SWIG_write_NAME_num_array(lua_State* L,TYPE *array,int size); - // read the specified table, and fills the array with numbers - // returns 1 of ok (only fails if it doesn't find numbers) - // helper fn (called by SWIG_get_NAME_num_array_*() fns) -int SWIG_read_NAME_num_array(lua_State* L,int index,TYPE *array,int size); - -*/ - -%{ -#ifdef __cplusplus /* generic alloc/dealloc fns*/ -#define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN] -#define SWIG_FREE_ARRAY(PTR) delete[] PTR -#else -#define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE)) -#define SWIG_FREE_ARRAY(PTR) free(PTR) -#endif -/* counting the size of arrays:*/ -SWIGINTERN int SWIG_itable_size(lua_State* L, int index) -{ - int n=0; - while(1){ - lua_rawgeti(L,index,n+1); - if (lua_isnil(L,-1))break; - ++n; - lua_pop(L,1); - } - lua_pop(L,1); - return n; -} - -SWIGINTERN int SWIG_table_size(lua_State* L, int index) -{ - int n=0; - lua_pushnil(L); /* first key*/ - while (lua_next(L, index) != 0) { - ++n; - lua_pop(L, 1); /* removes `value'; keeps `key' for next iteration*/ - } - return n; -} - -/* super macro to declare array typemap helper fns */ -#define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\ - SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\ - int i;\ - for (i = 0; i < size; i++) {\ - lua_rawgeti(L,index,i+1);\ - if (lua_isnumber(L,-1)){\ - array[i] = (TYPE)lua_tonumber(L,-1);\ - } else {\ - lua_pop(L,1);\ - return 0;\ - }\ - lua_pop(L,1);\ - }\ - return 1;\ - }\ - SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\ - TYPE *array;\ - if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\ - SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);\ - return 0;\ - }\ - array=SWIG_ALLOC_ARRAY(TYPE,size);\ - if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\ - SWIG_Lua_pusherrstring(L,"table must contain numbers");\ - SWIG_FREE_ARRAY(array);\ - return 0;\ - }\ - return array;\ - }\ - SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\ - {\ - TYPE *array;\ - if (!lua_istable(L,index)) {\ - SWIG_Lua_pusherrstring(L,"expected a table");\ - return 0;\ - }\ - *size=SWIG_itable_size(L,index);\ - if (*size<1){\ - SWIG_Lua_pusherrstring(L,"table appears to be empty");\ - return 0;\ - }\ - array=SWIG_ALLOC_ARRAY(TYPE,*size);\ - if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\ - SWIG_Lua_pusherrstring(L,"table must contain numbers");\ - SWIG_FREE_ARRAY(array);\ - return 0;\ - }\ - return array;\ - }\ - SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\ - int i;\ - lua_newtable(L);\ - for (i = 0; i < size; i++){\ - lua_pushnumber(L,(lua_Number)array[i]);\ - lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \ - }\ - } -%} - -/* -This is one giant macro to define the typemaps & the helpers -for array handling -*/ -%define SWIG_TYPEMAP_NUM_ARR(NAME,TYPE) -%{SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)%} - -// fixed size array's -%typemap(in) TYPE INPUT[ANY] -%{ $1 = SWIG_get_##NAME##_num_array_fixed(L,$input,$1_dim0); - if (!$1) SWIG_fail;%} - -%typemap(freearg) TYPE INPUT[ANY] -%{ SWIG_FREE_ARRAY($1);%} - -// variable size array's -%typemap(in) (TYPE *INPUT,int) -%{ $1 = SWIG_get_##NAME##_num_array_var(L,$input,&$2); - if (!$1) SWIG_fail;%} - -%typemap(freearg) (TYPE *INPUT,int) -%{ SWIG_FREE_ARRAY($1);%} - -// out fixed arrays -%typemap(in,numinputs=0) TYPE OUTPUT[ANY] -%{ $1 = SWIG_ALLOC_ARRAY(TYPE,$1_dim0); %} - -%typemap(argout) TYPE OUTPUT[ANY] -%{ SWIG_write_##NAME##_num_array(L,$1,$1_dim0); SWIG_arg++; %} - -%typemap(freearg) TYPE OUTPUT[ANY] -%{ SWIG_FREE_ARRAY($1); %} - -// inout fixed arrays -%typemap(in) TYPE INOUT[ANY]=TYPE INPUT[ANY]; -%typemap(argout) TYPE INOUT[ANY]=TYPE OUTPUT[ANY]; -%typemap(freearg) TYPE INOUT[ANY]=TYPE INPUT[ANY]; -// inout variable arrays -%typemap(in) (TYPE *INOUT,int)=(TYPE *INPUT,int); -%typemap(argout) (TYPE *INOUT,int) -%{ SWIG_write_##NAME##_num_array(L,$1,$2); SWIG_arg++; %} -%typemap(freearg) (TYPE *INOUT,int)=(TYPE *INPUT,int); - -// TODO out variable arrays (is there a standard form for such things?) - -// referencing so that (int *INPUT,int) and (int INPUT[],int) are the same -%typemap(in) (TYPE INPUT[],int)=(TYPE *INPUT,int); -%typemap(freearg) (TYPE INPUT[],int)=(TYPE *INPUT,int); - -%enddef - -// the following line of code -// declares the C helper fns for the array typemaps -// as well as defining typemaps for -// fixed len arrays in & out, & variable length arrays in - -SWIG_TYPEMAP_NUM_ARR(schar,signed char); -SWIG_TYPEMAP_NUM_ARR(uchar,unsigned char); -SWIG_TYPEMAP_NUM_ARR(int,int); -SWIG_TYPEMAP_NUM_ARR(uint,unsigned int); -SWIG_TYPEMAP_NUM_ARR(short,short); -SWIG_TYPEMAP_NUM_ARR(ushort,unsigned short); -SWIG_TYPEMAP_NUM_ARR(long,long); -SWIG_TYPEMAP_NUM_ARR(ulong,unsigned long); -SWIG_TYPEMAP_NUM_ARR(float,float); -SWIG_TYPEMAP_NUM_ARR(double,double); - -// again enums are a problem so they need their own type -// we use the int conversion routine & recast it -%typemap(in) enum SWIGTYPE INPUT[ANY] -%{ $1 = ($ltype)SWIG_get_int_num_array_fixed(L,$input,$1_dim0); - if (!$1) SWIG_fail;%} - -%typemap(freearg) enum SWIGTYPE INPUT[ANY] -%{ SWIG_FREE_ARRAY($1);%} - -// variable size arrays -%typemap(in) (enum SWIGTYPE *INPUT,int) -%{ $1 = ($ltype)SWIG_get_int_num_array_var(L,$input,&$2); - if (!$1) SWIG_fail;%} - -%typemap(freearg) (enum SWIGTYPE *INPUT,int) -%{ SWIG_FREE_ARRAY($1);%} - -// out fixed arrays -%typemap(in,numinputs=0) enum SWIGTYPE OUTPUT[ANY] -%{ $1 = SWIG_ALLOC_ARRAY(enum SWIGTYPE,$1_dim0); %} - -%typemap(argout) enum SWIGTYPE OUTPUT[ANY] -%{ SWIG_write_int_num_array(L,(int*)$1,$1_dim0); SWIG_arg++; %} - -%typemap(freearg) enum SWIGTYPE OUTPUT[ANY] -%{ SWIG_FREE_ARRAY($1); %} - -// inout fixed arrays -%typemap(in) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; -%typemap(argout) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE OUTPUT[ANY]; -%typemap(freearg) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; -// inout variable arrays -%typemap(in) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); -%typemap(argout) (enum SWIGTYPE *INOUT,int) -%{ SWIG_write_int_num_array(L,(int*)$1,$2); SWIG_arg++; %} -%typemap(freearg) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); - - -/* Surprisingly pointer arrays are easier: -this is because all ptr arrays become void** -so only a few fns are needed & a few casts - -The function defined are - // created a fixed size array, reads the specified table - // and then fills the array with pointers (checking the type) - // returns ptr to the array if ok, or 0 for error - // (also pushes a error message to the stack) -void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type); - // as per SWIG_get_ptr_array_fixed() - // but reads the entire table & creates an array of the correct size - // (if the table is empty, it returns an error rather than a zero length array) -void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type); - // writes a table to Lua with all the specified pointers - // all pointers have the ownership value 'own' (normally 0) -void SWIG_write_ptr_array(lua_State* L,void **array,int size,int own); - // read the specified table, and fills the array with ptrs - // returns 1 of ok (only fails if it doesn't find correct type of ptrs) - // helper fn (called by SWIG_get_ptr_array_*() fns) -int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type); - -The key thing to remember is that it is assumed that there is no -modification of pointers ownership in the arrays - -eg A fn: -void pointers_in(TYPE* arr[],int len); -will make copies of the pointer into a temp array and then pass it into the fn -Lua does not remember that this fn held the pointers, so it is not safe to keep -these pointers until later - -eg A fn: -void pointers_out(TYPE* arr[3]); -will return a table containing three pointers -however these pointers are NOT owned by Lua, merely borrowed -so if the C/C++ frees then Lua is not aware - -*/ - -%{ -SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){ - int i; - for (i = 0; i < size; i++) { - lua_rawgeti(L,index,i+1); - if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){ - lua_pop(L,1); - return 0; - } - lua_pop(L,1); - } - return 1; -} -SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){ - void **array; - if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) { - SWIG_Lua_pushferrstring(L,"expected a table of size %d",size); - return 0; - } - array=SWIG_ALLOC_ARRAY(void*,size); - if (!SWIG_read_ptr_array(L,index,array,size,type)){ - SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name); - SWIG_FREE_ARRAY(array); - return 0; - } - return array; -} -SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){ - void **array; - if (!lua_istable(L,index)) { - SWIG_Lua_pusherrstring(L,"expected a table"); - return 0; - } - *size=SWIG_itable_size(L,index); - if (*size<1){ - SWIG_Lua_pusherrstring(L,"table appears to be empty"); - return 0; - } - array=SWIG_ALLOC_ARRAY(void*,*size); - if (!SWIG_read_ptr_array(L,index,array,*size,type)){ - SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name); - SWIG_FREE_ARRAY(array); - return 0; - } - return array; -} -SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){ - int i; - lua_newtable(L); - for (i = 0; i < size; i++){ - SWIG_NewPointerObj(L,array[i],type,own); - lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ - } -} -%} - -// fixed size array's -%typemap(in) SWIGTYPE* INPUT[ANY] -%{ $1 = ($ltype)SWIG_get_ptr_array_fixed(L,$input,$1_dim0,$*1_descriptor); - if (!$1) SWIG_fail;%} - -%typemap(freearg) SWIGTYPE* INPUT[ANY] -%{ SWIG_FREE_ARRAY($1);%} - -// variable size array's -%typemap(in) (SWIGTYPE **INPUT,int) -%{ $1 = ($ltype)SWIG_get_ptr_array_var(L,$input,&$2,$*1_descriptor); - if (!$1) SWIG_fail;%} - -%typemap(freearg) (SWIGTYPE **INPUT,int) -%{ SWIG_FREE_ARRAY($1);%} - -// out fixed arrays -%typemap(in,numinputs=0) SWIGTYPE* OUTPUT[ANY] -%{ $1 = SWIG_ALLOC_ARRAY($*1_type,$1_dim0); %} - -%typemap(argout) SWIGTYPE* OUTPUT[ANY] -%{ SWIG_write_ptr_array(L,(void**)$1,$1_dim0,$*1_descriptor,0); SWIG_arg++; %} - -%typemap(freearg) SWIGTYPE* OUTPUT[ANY] -%{ SWIG_FREE_ARRAY($1); %} - -// inout fixed arrays -%typemap(in) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; -%typemap(argout) SWIGTYPE* INOUT[ANY]=SWIGTYPE* OUTPUT[ANY]; -%typemap(freearg) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; -// inout variable arrays -%typemap(in) (SWIGTYPE** INOUT,int)=(SWIGTYPE** INPUT,int); -%typemap(argout) (SWIGTYPE** INOUT,int) -%{ SWIG_write_ptr_array(L,(void**)$1,$2,$*1_descriptor,0); SWIG_arg++; %} -%typemap(freearg) (SWIGTYPE**INOUT,int)=(SWIGTYPE**INPUT,int); - -/* ----------------------------------------------------------------------------- - * Pointer-Pointer typemaps - * ----------------------------------------------------------------------------- */ -/* -This code is to deal with the issue for pointer-pointer's -In particular for factory methods. - -for example take the following code segment: - -struct iMath; // some structure -int Create_Math(iMath** pptr); // its factory (assume it mallocs) - -to use it you might have the following C code: - -iMath* ptr; -int ok; -ok=Create_Math(&ptr); -// do things with ptr -//... -free(ptr); - -With the following SWIG code -%apply SWIGTYPE** OUTPUT{iMath **pptr }; - -You can get natural wrapping in Lua as follows: -ok,ptr=Create_Math() -- ptr is a iMath* which is returned with the int -ptr=nil -- the iMath* will be GC'ed as normal -*/ - -%typemap(in,numinputs=0) SWIGTYPE** OUTPUT ($*ltype temp) -%{ temp = ($*ltype)0; - $1 = &temp; %} -%typemap(argout) SWIGTYPE** OUTPUT -%{SWIG_NewPointerObj(L,*$1,$*descriptor,1); SWIG_arg++; %} - diff --git a/linux/bin/swig/share/swig/4.1.0/lua/wchar.i b/linux/bin/swig/share/swig/4.1.0/lua/wchar.i deleted file mode 100755 index 9f3be6fc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/lua/wchar.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wchar.i - * - * Typemaps for the wchar_t type - * These are mapped to a Lua string and are passed around by value. - * ----------------------------------------------------------------------------- */ - -// note: only support for pointer right now, not fixed length strings -// TODO: determine how long a const wchar_t* is so we can write wstr2str() -// & do the output typemap - -%{ -#include - -wchar_t* str2wstr(const char *str, int len) -{ - wchar_t* p; - if (str==0 || len<1) return 0; - p=(wchar_t *)malloc((len+1)*sizeof(wchar_t)); - if (p==0) return 0; - if (mbstowcs(p, str, len)==(size_t)-1) - { - free(p); - return 0; - } - p[len]=0; - return p; -} -%} - -%typemap(in, checkfn="SWIG_lua_isnilstring", fragment="SWIG_lua_isnilstring") wchar_t * -%{ -$1 = str2wstr(lua_tostring( L, $input ),lua_rawlen( L, $input )); -if ($1==0) {SWIG_Lua_pushferrstring(L,"Error in converting to wchar (arg %d)",$input);goto fail;} -%} - -%typemap(freearg) wchar_t * -%{ -free($1); -%} - -%typemap(typecheck) wchar_t * = char *; diff --git a/linux/bin/swig/share/swig/4.1.0/math.i b/linux/bin/swig/share/swig/4.1.0/math.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/Makefile b/linux/bin/swig/share/swig/4.1.0/mzscheme/Makefile deleted file mode 100755 index fba7fd5d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/Makefile +++ /dev/null @@ -1,3 +0,0 @@ - -co: - co RCS/*.i* RCS/*.swg* diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/mzrun.swg b/linux/bin/swig/share/swig/4.1.0/mzscheme/mzrun.swg deleted file mode 100755 index 57d04081..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/mzrun.swg +++ /dev/null @@ -1,521 +0,0 @@ -/* ----------------------------------------------------------------------------- - * mzrun.swg - * ----------------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Common SWIG API */ - -#define SWIG_ConvertPtr(s, result, type, flags) \ - SWIG_MzScheme_ConvertPtr(s, result, type, flags) -#define SWIG_NewPointerObj(ptr, type, owner) \ - SWIG_MzScheme_NewPointerObj((void *)ptr, type, owner) -#define SWIG_MustGetPtr(s, type, argnum, flags) \ - SWIG_MzScheme_MustGetPtr(s, type, argnum, flags, FUNC_NAME, argc, argv) - -#define SWIG_contract_assert(expr,msg) \ - do { \ - if (!(expr)) { \ - char *m=(char *) scheme_malloc(strlen(msg)+1000); \ - sprintf(m,"SWIG contract, assertion failed: function=%s, message=%s", \ - (char *) FUNC_NAME,(char *) msg); \ - scheme_signal_error(m); \ - } \ - } while (0) - -/* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_MzScheme_GetModule((Scheme_Env *)(clientdata)) -#define SWIG_SetModule(clientdata, pointer) SWIG_MzScheme_SetModule((Scheme_Env *) (clientdata), pointer) -#define SWIG_MODULE_CLIENTDATA_TYPE Scheme_Env * - -/* MzScheme-specific SWIG API */ - -#define SWIG_malloc(size) SWIG_MzScheme_Malloc(size, FUNC_NAME) -#define SWIG_free(mem) free(mem) -#define SWIG_NewStructFromPtr(ptr,type) \ - _swig_convert_struct_##type##(ptr) - -#define MAXVALUES 6 -#define swig_make_boolean(b) (b ? scheme_true : scheme_false) - -static long -SWIG_convert_integer(Scheme_Object *o, - long lower_bound, long upper_bound, - const char *func_name, int argnum, int argc, - Scheme_Object **argv) -{ - long value; - int status = scheme_get_int_val(o, &value); - if (!status) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - if (value < lower_bound || value > upper_bound) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - return value; -} - -static int -SWIG_is_integer(Scheme_Object *o) -{ - long value; - return scheme_get_int_val(o, &value); -} - -static unsigned long -SWIG_convert_unsigned_integer(Scheme_Object *o, - unsigned long lower_bound, unsigned long upper_bound, - const char *func_name, int argnum, int argc, - Scheme_Object **argv) -{ - unsigned long value; - int status = scheme_get_unsigned_int_val(o, &value); - if (!status) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - if (value < lower_bound || value > upper_bound) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - return value; -} - -static int -SWIG_is_unsigned_integer(Scheme_Object *o) -{ - unsigned long value; - return scheme_get_unsigned_int_val(o, &value); -} - -/* ----------------------------------------------------------------------- - * mzscheme 30X support code - * ----------------------------------------------------------------------- */ - -#ifndef SCHEME_STR_VAL -#define MZSCHEME30X 1 -#endif - -#ifdef MZSCHEME30X -/* - * This is MZSCHEME 299.100 or higher (30x). From version 299.100 of - * mzscheme upwards, strings are in unicode. These functions convert - * to and from utf8 encodings of these strings. NB! strlen(s) will be - * the size in bytes of the string, not the actual length. - */ -#define SCHEME_STR_VAL(obj) SCHEME_BYTE_STR_VAL(scheme_char_string_to_byte_string(obj)) -#define SCHEME_STRLEN_VAL(obj) SCHEME_BYTE_STRLEN_VAL(scheme_char_string_to_byte_string(obj)) -#define SCHEME_STRINGP(obj) SCHEME_CHAR_STRINGP(obj) -#define scheme_make_string(s) scheme_make_utf8_string(s) -#define scheme_make_sized_string(s,l) scheme_make_sized_utf8_string(s,l) -#define scheme_make_sized_offset_string(s,d,l) \ - scheme_make_sized_offset_utf8_string(s,d,l) -#define SCHEME_MAKE_STRING(s) scheme_make_utf8_string(s) -#else -#define SCHEME_MAKE_STRING(s) scheme_make_string_without_copying(s) -#endif -/* ----------------------------------------------------------------------- - * End of mzscheme 30X support code - * ----------------------------------------------------------------------- */ - -struct swig_mz_proxy { - Scheme_Type mztype; - swig_type_info *type; - void *object; - int own; -}; - -static Scheme_Type swig_type; - -static void -mz_free_swig(void *p, void *data) { - struct swig_mz_proxy *proxy = (struct swig_mz_proxy *) p; - if (SCHEME_NULLP((Scheme_Object*)p) || SCHEME_TYPE((Scheme_Object*)p) != swig_type) - return; - if (proxy->type) { - if (proxy->type->clientdata && proxy->own) { - ((Scheme_Prim *)proxy->type->clientdata)(1, (Scheme_Object **)&proxy); - } - } -} - -static Scheme_Object * -SWIG_MzScheme_NewPointerObj(void *ptr, swig_type_info *type, int owner) { - if (ptr) { - struct swig_mz_proxy *new_proxy; - new_proxy = (struct swig_mz_proxy *) scheme_malloc(sizeof(struct swig_mz_proxy)); - new_proxy->mztype = swig_type; - new_proxy->type = type; - new_proxy->object = ptr; - new_proxy->own = owner & SWIG_POINTER_OWN; - if (new_proxy->own) { - scheme_add_finalizer(new_proxy, mz_free_swig, NULL); - } - return (Scheme_Object *) new_proxy; - } else { - return scheme_make_null(); - } -} - -static int -SWIG_MzScheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, int flags) { - swig_cast_info *cast; - int ret = SWIG_ERROR; - - if (SCHEME_NULLP(s)) { - *result = NULL; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } else if (SCHEME_TYPE(s) == swig_type) { - struct swig_mz_proxy *proxy = (struct swig_mz_proxy *) s; - - if ((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE && !proxy->own) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - - if (type) { - cast = SWIG_TypeCheckStruct(proxy->type, type); - if (cast) { - int newmemory = 0; - *result = SWIG_TypeCast(cast, proxy->object, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - ret = SWIG_OK; - } else { - return SWIG_ERROR; - } - } else { - *result = proxy->object; - ret = SWIG_OK; - } - - if (flags & SWIG_POINTER_DISOWN) { - scheme_subtract_finalizer(proxy, mz_free_swig, NULL); - proxy->own = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - proxy->object = 0; - } - } - return ret; -} - -static SWIGINLINE void * -SWIG_MzScheme_MustGetPtr(Scheme_Object *s, swig_type_info *type, - int argnum, int flags, const char *func_name, - int argc, Scheme_Object **argv) { - void *result; - if (SWIG_MzScheme_ConvertPtr(s, &result, type, flags)) { - scheme_wrong_type(func_name, type->str ? type->str : "void *", argnum - 1, argc, argv); - } - return result; -} - -static SWIGINLINE void * -SWIG_MzScheme_Malloc(size_t size, const char *func_name) { - void *p = malloc(size); - if (p == NULL) { - scheme_signal_error("swig-memory-error"); - } else return p; -} - -static Scheme_Object * -SWIG_MzScheme_PackageValues(int num, Scheme_Object **values) { - /* ignore first value if void */ - if (num > 0 && SCHEME_VOIDP(values[0])) - num--, values++; - if (num == 0) return scheme_void; - else if (num == 1) return values[0]; - else return scheme_values(num, values); -} - -#ifndef scheme_make_inspector -#define scheme_make_inspector(x,y) \ - _scheme_apply(scheme_builtin_value("make-inspector"), x, y) -#endif - -/* Function to create a new struct. */ -static Scheme_Object * -SWIG_MzScheme_new_scheme_struct (Scheme_Env* env, const char* basename, - int num_fields, char** field_names) -{ - Scheme_Object *new_type; - int count_out, i; - Scheme_Object **struct_names; - Scheme_Object **vals; - Scheme_Object **a = (Scheme_Object**) \ - scheme_malloc(num_fields*sizeof(Scheme_Object*)); - - for (i=0; i -#else -#include -#endif - - static char **mz_dlopen_libraries=NULL; - static void **mz_libraries=NULL; - static char **mz_dynload_libpaths=NULL; - - static void mz_set_dlopen_libraries(const char *_libs) - { - int i,k,n; - int mz_dynload_debug=(1==0); - char *extra_paths[1000]; - char *EP; - - { - char *dbg=getenv("MZ_DYNLOAD_DEBUG"); - if (dbg!=NULL) { - mz_dynload_debug=atoi(dbg); - } - } - - { - char *ep=getenv("MZ_DYNLOAD_LIBPATH"); - int i,k,j; - k=0; - if (ep!=NULL) { - EP=strdup(ep); - for(i=0,j=0;EP[i]!='\0';i++) { - if (EP[i]==':') { - EP[i]='\0'; - extra_paths[k++]=&EP[j]; - j=i+1; - } - } - if (j!=i) { - extra_paths[k++]=&EP[j]; - } - } - else { - EP=strdup(""); - } - extra_paths[k]=NULL; - k+=1; - - if (mz_dynload_debug) { - fprintf(stderr,"SWIG:mzscheme:MZ_DYNLOAD_LIBPATH=%s\n",(ep==NULL) ? "(null)" : ep); - fprintf(stderr,"SWIG:mzscheme:extra_paths[%d]\n",k-1); - for(i=0;i %p\n",libp,mz_libraries[i]); - } - free(libp); - } - } - } - } - { - int i; - void *func=NULL; - - for(i=0;mz_dlopen_libraries[i]!=NULL && func==NULL;i++) { - if (mz_libraries[i]!=NULL) { -#ifdef __OS_WIN32 - func=GetProcAddress(mz_libraries[i],function); -#else - func=dlsym(mz_libraries[i],function); -#endif - } - if (mz_dynload_debug) { - fprintf(stderr, - "SWIG:mzscheme:library:%s;dlopen=%p,function=%s,func=%p\n", - mz_dlopen_libraries[i],mz_libraries[i],function,func - ); - } - } - - return func; - } - } - } - -/* The interpreter will store a pointer to this structure in a global - variable called swig-runtime-data-type-pointer. The instance of this - struct is only used if no other module has yet been loaded */ -struct swig_mzscheme_runtime_data { - swig_module_info *module_head; - Scheme_Type type; -}; -static struct swig_mzscheme_runtime_data swig_mzscheme_runtime_data; - - -static swig_module_info * -SWIG_MzScheme_GetModule(Scheme_Env *env) { - Scheme_Object *pointer, *symbol; - struct swig_mzscheme_runtime_data *data; - - /* first check if pointer already created */ - symbol = scheme_intern_symbol("swig-runtime-data-type-pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - pointer = scheme_lookup_global(symbol, env); - if (pointer && SCHEME_CPTRP(pointer)) { - data = (struct swig_mzscheme_runtime_data *) SCHEME_CPTR_VAL(pointer); - swig_type = data->type; - return data->module_head; - } else { - return NULL; - } -} - -static void -SWIG_MzScheme_SetModule(Scheme_Env *env, swig_module_info *module) { - Scheme_Object *pointer, *symbol; - struct swig_mzscheme_runtime_data *data; - - /* first check if pointer already created */ - symbol = scheme_intern_symbol("swig-runtime-data-type-pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - pointer = scheme_lookup_global(symbol, env); - if (pointer && SCHEME_CPTRP(pointer)) { - data = (struct swig_mzscheme_runtime_data *) SCHEME_CPTR_VAL(pointer); - swig_type = data->type; - data->module_head = module; - } else { - /* create a new type for wrapped pointer values */ - swig_type = scheme_make_type((char *)"swig"); - swig_mzscheme_runtime_data.module_head = module; - swig_mzscheme_runtime_data.type = swig_type; - - /* create a new pointer */ -#ifndef MZSCHEME30X - pointer = scheme_make_cptr((void *) &swig_mzscheme_runtime_data, "swig_mzscheme_runtime_data"); -#else - pointer = scheme_make_cptr((void *) &swig_mzscheme_runtime_data, - scheme_make_byte_string("swig_mzscheme_runtime_data")); -#endif - scheme_add_global_symbol(symbol, pointer, env); - } -} - -#ifdef __cplusplus -} -#endif - diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/mzscheme.swg b/linux/bin/swig/share/swig/4.1.0/mzscheme/mzscheme.swg deleted file mode 100755 index f45c8725..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/mzscheme.swg +++ /dev/null @@ -1,56 +0,0 @@ -/* ----------------------------------------------------------------------------- - * mzscheme.swg - * - * SWIG Configuration File for MzScheme. - * This file is parsed by SWIG before reading any other interface file. - * ----------------------------------------------------------------------------- */ - -/* Include headers */ -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors -%runtime "mzrun.swg" - -%define SWIG_APPEND_VALUE(value) - values[lenv++] = value -%enddef - -/* Definitions */ -#define SWIG_malloc(size) swig_malloc(size, FUNC_NAME) -#define SWIG_free(mem) free(mem) - -#define SWIG_convert_short(o) \ - SWIG_convert_integer(o, - (1 << (8 * sizeof(short) - 1)), \ - (1 << (8 * sizeof(short) - 1)) - 1, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_int(o) \ - SWIG_convert_integer(o, INT_MIN, INT_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_long(o) \ - SWIG_convert_integer(o, LONG_MIN, LONG_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_unsigned_short(o) \ - SWIG_convert_unsigned_integer(o, 0, \ - (1 << (8 * sizeof(short))) - 1, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_unsigned_int(o) \ - SWIG_convert_unsigned_integer(o, 0, UINT_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_unsigned_long(o) \ - SWIG_convert_unsigned_integer(o, 0, ULONG_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) - -/* Guile compatibility kludges */ -#define SCM_VALIDATE_VECTOR(argnum, value) (void)0 -#define SCM_VALIDATE_LIST(argnum, value) (void)0 - -/* Read in standard typemaps. */ -%include - -%insert(init) "swiginit.swg" - -%init %{ -Scheme_Object *scheme_reload(Scheme_Env *env) { - Scheme_Env *menv = SWIG_MZSCHEME_CREATE_MENV(env); - - SWIG_InitializeModule((void *) env); -%} diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/std_auto_ptr.i deleted file mode 100755 index c61bc8b2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'"); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_common.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/std_common.i deleted file mode 100755 index a83e2731..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_common.i +++ /dev/null @@ -1,23 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; - -%{ -#include - -SWIGINTERNINLINE -std::string swig_scm_to_string(Scheme_Object *x) { - return std::string(SCHEME_STR_VAL(x)); -} - -SWIGINTERNINLINE -Scheme_Object *swig_make_string(const std::string &s) { - return scheme_make_string(s.c_str()); -} -%} diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_deque.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_map.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/std_map.i deleted file mode 100755 index 1d3eec24..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_map.i +++ /dev/null @@ -1,1388 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// -// The aim of all that follows would be to integrate std::map with -// MzScheme as much as possible, namely, to allow the user to pass and -// be returned Scheme association lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::map), f(const std::map&), f(const std::map*): -// the parameter being read-only, either a Scheme alist or a -// previously wrapped std::map can be passed. -// -- f(std::map&), f(std::map*): -// the parameter must be modified; therefore, only a wrapped std::map -// can be passed. -// -- std::map f(): -// the map is returned by copy; therefore, a Scheme alist -// is returned which is most easily used in other Scheme functions -// -- std::map& f(), std::map* f(), const std::map& f(), -// const std::map* f(): -// the map is returned by reference; therefore, a wrapped std::map -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[*k] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[*k] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - K* key = new K(i->first); - T* val = new T(i->second); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - /* native sequence? */ - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - K* k; - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - /* native sequence? */ - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - K* k; - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, const T& x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - - - // specializations for built-ins - - %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) - - template class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[CONVERT_FROM(key)] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[CONVERT_FROM(key)] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - T* val = new T(i->second); - Scheme_Object* k = CONVERT_TO(i->first); - Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, const T& x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - Scheme_Object* k = CONVERT_TO(i->first); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) - template class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[*k] = CONVERT_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[*k] = CONVERT_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - Scheme_Object* x = CONVERT_TO(i->second); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - K* k; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - K* k; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, T x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, - T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) - template<> class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[CONVERT_K_FROM(key)] = - CONVERT_T_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - Scheme_Object* k = CONVERT_K_TO(i->first); - Scheme_Object* x = CONVERT_T_TO(i->second); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, T x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - Scheme_Object* k = CONVERT_K_TO(i->first); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - - specialize_std_map_on_key(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_key(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_key(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_key(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_map_on_value(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_value(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_value(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_value(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); -} diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_pair.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/std_pair.i deleted file mode 100755 index 75f6751c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_pair.i +++ /dev/null @@ -1,874 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - - -// ------------------------------------------------------------------------ -// std::pair -// -// See std_vector.i for the rationale of typemap application -// ------------------------------------------------------------------------ - -%{ -#include -%} - -// exported class - -namespace std { - - template struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(*x,*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = std::make_pair(*x,*y); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - T* x = new T($1.first); - U* y = new U($1.second); - Scheme_Object* first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - Scheme_Object* second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scheme_make_pair(first,second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // specializations for built-ins - - %define specialize_std_pair_on_first(T,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(CONVERT_FROM(first),*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = std::make_pair(CONVERT_FROM(first),*y); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - U* y = new U($1.second); - Scheme_Object* second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scheme_make_pair(CONVERT_TO($1.first),second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_second(U,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = std::make_pair(*x,CONVERT_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = std::make_pair(*x,CONVERT_FROM(second)); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - T* x = new T($1.first); - Scheme_Object* first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - $result = scheme_make_pair(first,CONVERT_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_both(T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO, - U,CHECK_U,CONVERT_U_FROM,CONVERT_U_TO) - template<> struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = make_pair(CONVERT_T_FROM(first), - CONVERT_U_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - Scheme_Object *first, *second; - T *x; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = make_pair(CONVERT_T_FROM(first), - CONVERT_U_FROM(second)); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - $result = scheme_make_pair(CONVERT_T_TO($1.first), - CONVERT_U_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - - specialize_std_pair_on_first(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_first(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_first(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_first(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_pair_on_second(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_second(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_second(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_second(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); -} diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_string.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/std_string.i deleted file mode 100755 index 70673ead..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_string.i +++ /dev/null @@ -1,64 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string types - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - /* Overloading check */ - - %typemap(typecheck) string = char *; - %typemap(typecheck) const string & = char *; - - %typemap(in) string { - if (SCHEME_STRINGP($input)) - $1.assign(SCHEME_STR_VAL($input)); - else - SWIG_exception(SWIG_TypeError, "string expected"); - } - - %typemap(in) const string & ($*1_ltype temp) { - if (SCHEME_STRINGP($input)) { - temp.assign(SCHEME_STR_VAL($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(out) string { - $result = scheme_make_string($1.c_str()); - } - - %typemap(out) const string & { - $result = scheme_make_string($1->c_str()); - } - - %typemap(throws) string { - scheme_signal_error("%s: %s", FUNC_NAME, $1.c_str()); - } - - %typemap(throws) const string & { - scheme_signal_error("%s: %s", FUNC_NAME, $1.c_str()); - } -} - - diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/std_unique_ptr.i deleted file mode 100755 index 53cf4669..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'"); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_vector.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/std_vector.i deleted file mode 100755 index 0ef5edb1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/std_vector.i +++ /dev/null @@ -1,451 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// MzScheme as much as possible, namely, to allow the user to pass and -// be returned MzScheme vectors or lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a MzScheme sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a MzScheme vector of T:s -// is returned which is most easily used in other MzScheme functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - $1 = std::vector(size); - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i(); - } else if (SCHEME_PAIRP($input)) { - Scheme_Object *head, *tail; - $1 = std::vector(); - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - $1.push_back(*((T*)SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const vector& (std::vector temp), - const vector* (std::vector temp) { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - temp = std::vector(size); - $1 = &temp; - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::vector(); - $1 = &temp; - Scheme_Object *head, *tail; - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - temp.push_back(*((T*) SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) vector { - $result = scheme_make_vector($1.size(),scheme_undefined); - Scheme_Object** els = SCHEME_VEC_ELS($result); - for (unsigned int i=0; i<$1.size(); i++) { - T* x = new T((($1_type &)$1)[i]); - els[i] = SWIG_NewPointerObj(x,$descriptor(T *), 1); - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - if (SWIG_ConvertPtr(items[0],(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - if (SWIG_ConvertPtr(items[0],(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T& ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - $1 = std::vector(size); - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i", - $argnum - 1, argc, argv); - } - } else if (SCHEME_NULLP($input)) { - $1 = std::vector(); - } else if (SCHEME_PAIRP($input)) { - Scheme_Object *head, *tail; - $1 = std::vector(); - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - if (CHECK(head)) - $1.push_back((T)(CONVERT_FROM(head))); - else - scheme_wrong_type(FUNC_NAME, "vector<" #T ">", - $argnum - 1, argc, argv); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const vector& (std::vector temp), - const vector* (std::vector temp) { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - temp = std::vector(size); - $1 = &temp; - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i", - $argnum - 1, argc, argv); - } - } else if (SCHEME_NULLP($input)) { - temp = std::vector(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::vector(); - $1 = &temp; - Scheme_Object *head, *tail; - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - if (CHECK(head)) - temp.push_back((T)(CONVERT_FROM(head))); - else - scheme_wrong_type(FUNC_NAME, "vector<" #T ">", - $argnum - 1, argc, argv); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum - 1, 0); - } - } - %typemap(out) vector { - $result = scheme_make_vector($1.size(),scheme_undefined); - Scheme_Object** els = SCHEME_VEC_ELS($result); - for (unsigned int i=0; i<$1.size(); i++) - els[i] = CONVERT_TO((($1_type &)$1)[i]); - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - $1 = CHECK(items[0]) ? 1 : 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) ? 1 : 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - $1 = CHECK(items[0]) ? 1 : 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) ? 1 : 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/swigmove.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/swigmove.i deleted file mode 100755 index bbfcdcb1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/swigmove.i +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type '$1_type'"); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (argp == NULL) scheme_signal_error(FUNC_NAME ": swig-type-error (null reference)"); - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/linux/bin/swig/share/swig/4.1.0/mzscheme/typemaps.i b/linux/bin/swig/share/swig/4.1.0/mzscheme/typemaps.i deleted file mode 100755 index 6c31aea5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/mzscheme/typemaps.i +++ /dev/null @@ -1,399 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * ----------------------------------------------------------------------------- */ - -#define %set_output(obj) $result = obj -#define %set_varoutput(obj) $result = obj -#define %argument_fail(code, type, name, argn) scheme_wrong_type(FUNC_NAME, type, argn, argc, argv) -#define %as_voidptr(ptr) (void*)(ptr) - - -/* The MzScheme module handles all types uniformly via typemaps. Here - are the definitions. */ - -/* Pointers */ - -%typemap(in) SWIGTYPE * { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} - -%typemap(in) void * { - $1 = SWIG_MustGetPtr($input, NULL, $argnum, 0); -} - -%typemap(varin) SWIGTYPE * { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, 1, 0); -} - -%typemap(varin) SWIGTYPE & { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE && { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE [ANY] { - void *temp; - int ii; - $1_basetype *b = 0; - temp = SWIG_MustGetPtr($input, $1_descriptor, 1, 0); - b = ($1_basetype *) $1; - for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii); -} - - -%typemap(varin) void * { - $1 = SWIG_MustGetPtr($input, NULL, 1, 0); -} - -%typemap(out) SWIGTYPE * { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE *DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj ($1, ty, $owner); -} - -%typemap(varout) SWIGTYPE *, SWIGTYPE [] { - $result = SWIG_NewPointerObj ($1, $descriptor, 0); -} - -%typemap(varout) SWIGTYPE & { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -%typemap(varout) SWIGTYPE && { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -/* C++ References */ - -#ifdef __cplusplus - -%typemap(in) SWIGTYPE & { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0); - if ($1 == NULL) scheme_signal_error(FUNC_NAME ": swig-type-error (null reference)"); -} - -%typemap(in, noblock=1, fragment="") SWIGTYPE && (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) { - res = SWIG_ConvertPtr($input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type '$1_type'"); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (argp == NULL) scheme_signal_error(FUNC_NAME ": swig-type-error (null reference)"); - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -} - -%typemap(out) SWIGTYPE &, SWIGTYPE && { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj ($1, ty, $owner); -} - -#endif - -/* Arrays */ - -%typemap(in) SWIGTYPE[] { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} - -%typemap(out) SWIGTYPE[] { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -/* Enums */ -%typemap(in) enum SWIGTYPE { - if (!SWIG_is_integer($input)) - scheme_wrong_type(FUNC_NAME, "integer", $argnum - 1, argc, argv); - $1 = ($1_type) SWIG_convert_int($input); -} - -%typemap(varin) enum SWIGTYPE { - if (!SWIG_is_integer($input)) - scheme_wrong_type(FUNC_NAME, "integer", 0, argc, argv); - $1 = ($1_type) SWIG_convert_int($input); -} - -%typemap(out) enum SWIGTYPE "$result = scheme_make_integer_value($1);" -%typemap(varout) enum SWIGTYPE "$result = scheme_make_integer_value($1);" - - -/* Pass-by-value */ - -%typemap(in) SWIGTYPE($&1_ltype argp) { - argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0); - $1 = *argp; -} - -%typemap(varin) SWIGTYPE { - $&1_ltype argp; - argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, 1, 0); - $1 = *argp; -} - - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype($1); - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 1); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1); -} -#endif - -%typemap(varout) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype($1); - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 0); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0); -} -#endif - -/* The SIMPLE_MAP macro below defines the whole set of typemaps needed - for simple types. */ - -%define SIMPLE_MAP(C_NAME, MZ_PREDICATE, MZ_TO_C, C_TO_MZ, MZ_NAME) -%typemap(in) C_NAME { - if (!MZ_PREDICATE($input)) - scheme_wrong_type(FUNC_NAME, #MZ_NAME, $argnum - 1, argc, argv); - $1 = MZ_TO_C($input); -} -%typemap(varin) C_NAME { - if (!MZ_PREDICATE($input)) - scheme_wrong_type(FUNC_NAME, #MZ_NAME, 0, argc, argv); - $1 = MZ_TO_C($input); -} -%typemap(out) C_NAME { - $result = C_TO_MZ($1); -} -%typemap(varout) C_NAME { - $result = C_TO_MZ($1); -} -%typemap(in) C_NAME *INPUT (C_NAME temp) { - temp = (C_NAME) MZ_TO_C($input); - $1 = &temp; -} -%typemap(in,numinputs=0) C_NAME *OUTPUT (C_NAME temp) { - $1 = &temp; -} -%typemap(argout) C_NAME *OUTPUT { - Scheme_Object *s; - s = C_TO_MZ(*$1); - SWIG_APPEND_VALUE(s); -} -%typemap(in) C_NAME *BOTH = C_NAME *INPUT; -%typemap(argout) C_NAME *BOTH = C_NAME *OUTPUT; -%typemap(in) C_NAME *INOUT = C_NAME *INPUT; -%typemap(argout) C_NAME *INOUT = C_NAME *OUTPUT; -%enddef - -SIMPLE_MAP(bool, SCHEME_BOOLP, SCHEME_TRUEP, - swig_make_boolean, boolean); -SIMPLE_MAP(char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -SIMPLE_MAP(unsigned char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -SIMPLE_MAP(int, SWIG_is_integer, SWIG_convert_int, - scheme_make_integer_value, integer); -SIMPLE_MAP(short, SWIG_is_integer, SWIG_convert_short, - scheme_make_integer_value, integer); -SIMPLE_MAP(long, SWIG_is_integer, SWIG_convert_long, - scheme_make_integer_value, integer); -SIMPLE_MAP(ptrdiff_t, SWIG_is_integer, SWIG_convert_long, - scheme_make_integer_value, integer); -SIMPLE_MAP(unsigned int, SWIG_is_unsigned_integer, SWIG_convert_unsigned_int, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(unsigned short, SWIG_is_unsigned_integer, SWIG_convert_unsigned_short, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(unsigned long, SWIG_is_unsigned_integer, SWIG_convert_unsigned_long, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(size_t, SWIG_is_unsigned_integer, SWIG_convert_unsigned_long, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(float, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); -SIMPLE_MAP(double, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); - -SIMPLE_MAP(char *, SCHEME_STRINGP, SCHEME_STR_VAL, - SCHEME_MAKE_STRING, string); -SIMPLE_MAP(const char *, SCHEME_STRINGP, SCHEME_STR_VAL, - SCHEME_MAKE_STRING, string); - -/* For MzScheme 30x: Use these typemaps if you are not going to use - UTF8 encodings in your C code. - SIMPLE_MAP(char *,SCHEME_BYTE_STRINGP, SCHEME_BYTE_STR_VAL, - scheme_make_byte_string_without_copying,bytestring); - SIMPLE_MAP(const char *,SCHEME_BYTE_STRINGP, SCHEME_BYTE_STR_VAL, - scheme_make_byte_string_without_copying,bytestring); -*/ - -/* Const primitive references. Passed by value */ - -%define REF_MAP(C_NAME, MZ_PREDICATE, MZ_TO_C, C_TO_MZ, MZ_NAME) - %typemap(in) const C_NAME & (C_NAME temp) { - if (!MZ_PREDICATE($input)) - scheme_wrong_type(FUNC_NAME, #MZ_NAME, $argnum - 1, argc, argv); - temp = MZ_TO_C($input); - $1 = &temp; - } - %typemap(out) const C_NAME & { - $result = C_TO_MZ(*$1); - } -%enddef - -REF_MAP(bool, SCHEME_BOOLP, SCHEME_TRUEP, - swig_make_boolean, boolean); -REF_MAP(char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -REF_MAP(unsigned char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -REF_MAP(int, SWIG_is_integer, SWIG_convert_int, - scheme_make_integer_value, integer); -REF_MAP(short, SWIG_is_integer, SWIG_convert_short, - scheme_make_integer_value, integer); -REF_MAP(long, SWIG_is_integer, SWIG_convert_long, - scheme_make_integer_value, integer); -REF_MAP(unsigned int, SWIG_is_unsigned_integer, SWIG_convert_unsigned_int, - scheme_make_integer_value_from_unsigned, integer); -REF_MAP(unsigned short, SWIG_is_unsigned_integer, SWIG_convert_unsigned_short, - scheme_make_integer_value_from_unsigned, integer); -REF_MAP(unsigned long, SWIG_is_unsigned_integer, SWIG_convert_unsigned_long, - scheme_make_integer_value_from_unsigned, integer); -REF_MAP(float, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); -REF_MAP(double, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); - -%typemap(throws) char * { - scheme_signal_error("%s: %s", FUNC_NAME, $1); -} - -/* Void */ - -%typemap(out) void "$result = scheme_void;" - -/* Pass through Scheme_Object * */ - -%typemap (in) Scheme_Object * "$1=$input;" -%typemap (out) Scheme_Object * "$result=$1;" -%typecheck(SWIG_TYPECHECK_POINTER) Scheme_Object * "$1=1;"; - - -/* ------------------------------------------------------------ - * String & length - * ------------------------------------------------------------ */ - -//%typemap(in) (char *STRING, int LENGTH) { -// int temp; -// $1 = ($1_ltype) SWIG_Guile_scm2newstr($input, &temp); -// $2 = ($2_ltype) temp; -//} - -/* ------------------------------------------------------------ - * Typechecking rules - * ------------------------------------------------------------ */ - -%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 -{ - $1 = (SWIG_is_integer($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_BOOL) bool, bool &, const bool & -{ - $1 = (SCHEME_BOOLP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) - float, double, - const float &, const double & -{ - $1 = (SCHEME_REALP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char { - $1 = (SCHEME_STRINGP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - $1 = (SCHEME_STRINGP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $1_descriptor, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE &, SWIGTYPE && { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $&1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, 0, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } - - diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/carray.i b/linux/bin/swig/share/swig/4.1.0/ocaml/carray.i deleted file mode 100755 index 4378f733..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/carray.i +++ /dev/null @@ -1,131 +0,0 @@ -%insert(mli) %{ -type _value = c_obj -%} - -%insert(ml) %{ -type _value = c_obj -%} - -%define %array_tmap_out(type,what,out_f) -%typemap(type) what [ANY] { - int i; - $result = caml_array_new($1_dim0); - for( i = 0; i < $1_dim0; i++ ) { - caml_array_set($result,i,out_f($1[i])); - } -} -%enddef - -%define %array_tmap_in(type,what,in_f) -%typemap(type) what [ANY] { - int i; - $1 = ($*1_type *)malloc( $1_size ); - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = in_f(caml_array_nth($input,i)); - } -} - -%typemap(free) what [ANY] { - free( (void *)$1 ); -} -%enddef - -%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(directorin,type,out_f); - -%array_tmap_in(in,type,in_f); -%array_tmap_in(varin,type,in_f); -%array_tmap_in(directorout,type,in_f); -%enddef - -%make_simple_array_typemap(bool,caml_val_bool,caml_long_val); -%make_simple_array_typemap(short,caml_val_short,caml_long_val); -%make_simple_array_typemap(unsigned short,caml_val_ushort,caml_long_val); -%make_simple_array_typemap(int,caml_val_int,caml_long_val); -%make_simple_array_typemap(unsigned int,caml_val_uint,caml_long_val); -%make_simple_array_typemap(long,caml_val_long,caml_long_val); -%make_simple_array_typemap(unsigned long,caml_val_ulong,caml_long_val); -%make_simple_array_typemap(size_t,caml_val_int,caml_long_val); -%make_simple_array_typemap(float,caml_val_float,caml_double_val); -%make_simple_array_typemap(double,caml_val_double,caml_double_val); - -#ifdef __cplusplus -%typemap(in) SWIGTYPE [] { - int i; - - $1 = new $*1_type [$1_dim0]; - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = *(($*1_ltype *) - caml_ptr_val(caml_array_nth($input,i), - $*1_descriptor)) ; - } -} -#else -%typemap(in) SWIGTYPE [] { - int i; - - $1 = ($*1_type *)malloc( $1_size ); - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = *(($*1_ltype) - caml_ptr_val(caml_array_nth($input), - $*1_descriptor)); - } -} -#endif - -%typemap(out) SWIGTYPE [] { - int i; - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - $result = caml_array_new($1_dim0); - - for( i = 0; i < $1_dim0; i++ ) { - if( fromval ) { - caml_array_set - ($result, - i, - caml_callback(*fromval,caml_val_ptr((void *)&$1[i],$*1_descriptor))); - } else { - caml_array_set - ($result, - i, - caml_val_ptr ((void *)&$1[i],$&1_descriptor)); - } - } -} - -%typemap(in) enum SWIGTYPE [] { - int i; - - $1 = ($*1_type *)malloc( $1_size ); - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = ($type) - caml_long_val_full(caml_array_nth($input), - "$type_marker"); - } -} - -%typemap(out) enum SWIGTYPE [] { - int i; - $result = caml_array_new($1_dim0); - - for( i = 0; i < $1_dim0; i++ ) { - caml_array_set - ($result, - i, - caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"), - *caml_named_value("$type_marker"), - Val_int($1[i]))); - } -} - -#ifdef __cplusplus -%typemap(freearg) SWIGTYPE [ANY] { - delete [] $1; -} -#else -%typemap(freearg) SWIGTYPE [ANY] { - free( (void *)$1 ); -} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/class.swg b/linux/bin/swig/share/swig/4.1.0/ocaml/class.swg deleted file mode 100755 index eb369cd7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/class.swg +++ /dev/null @@ -1,67 +0,0 @@ -(*Stream:class_ctors*) -let create_$classname_from_ptr raw_ptr = - C_obj -begin - let h = Hashtbl.create 20 in - List.iter (fun (nm,fn) -> Hashtbl.replace h nm fn) - [ "nop", (fun args -> C_void) ; - $classbody - "&", (fun args -> raw_ptr) ; - ":parents", - (fun args -> - C_list - (let out = ref [] in - Hashtbl.iter (fun x y -> out := (x,y) :: !out) h ; - (List.map - (fun (x,y) -> - C_string (String.sub x 2 ((String.length x) - 2))) - (List.filter - (fun (x,y) -> - ((String.length x) > 2) - && x.[0] == ':' && x.[1] == ':') !out)))) ; - ":classof", (fun args -> C_string "$realname") ; - ":methods", (fun args -> - C_list (let out = ref [] in - Hashtbl.iter (fun x y -> out := (C_string x) :: !out) h ; !out)) - ] ; - let rec invoke_inner raw_ptr mth arg = - begin - try - let application = Hashtbl.find h mth in - application - (match arg with - C_list l -> (C_list (raw_ptr :: l)) - | C_void -> (C_list [ raw_ptr ]) - | v -> (C_list [ raw_ptr ; v ])) - with Not_found -> - (* Try parent classes *) - begin - let parent_classes = [ - $baselist - ] in - let rec try_parent plist raw_ptr = - match plist with - p :: tl -> - begin - try - (invoke (p raw_ptr)) mth arg - with (BadMethodName (p,m,s)) -> - try_parent tl raw_ptr - end - | [] -> - raise (BadMethodName (raw_ptr,mth,"$realname")) - in try_parent parent_classes raw_ptr - end - end in - (fun mth arg -> invoke_inner raw_ptr mth arg) -end - -let _ = register_class_byname "$realname" create_$classname_from_ptr -let _ = Callback.register - "create_$normalized_from_ptr" - create_$classname_from_ptr - - -(*Stream:mli*) -val create_$classname_from_ptr : c_obj -> c_obj - diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/cstring.i b/linux/bin/swig/share/swig/4.1.0/ocaml/cstring.i deleted file mode 100755 index f1190ad5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/cstring.i +++ /dev/null @@ -1,268 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cstring.i - * - * This file provides typemaps and macros for dealing with various forms - * of C character string handling. The primary use of this module - * is in returning character data that has been allocated or changed in - * some way. - * ----------------------------------------------------------------------------- */ - -/* %cstring_input_binary(TYPEMAP, SIZE) - * - * Macro makes a function accept binary string data along with - * a size. - */ - -%define %cstring_input_binary(TYPEMAP, SIZE) -%apply (char *STRING, int LENGTH) { (TYPEMAP, SIZE) }; -%enddef - -/* - * %cstring_bounded_output(TYPEMAP, MAX) - * - * This macro is used to return a NULL-terminated output string of - * some maximum length. For example: - * - * %cstring_bounded_output(char *outx, 512); - * void foo(char *outx) { - * sprintf(outx,"blah blah\n"); - * } - * - */ - -%define %cstring_bounded_output(TYPEMAP,MAX) -%typemap(ignore) TYPEMAP(char temp[MAX+1]) { - $1 = ($1_ltype) temp; -} -%typemap(argout) TYPEMAP { - $1[MAX] = 0; - $result = caml_list_append($result,caml_val_string(str)); -} -%enddef - -/* - * %cstring_chunk_output(TYPEMAP, SIZE) - * - * This macro is used to return a chunk of binary string data. - * Embedded NULLs are okay. For example: - * - * %cstring_chunk_output(char *outx, 512); - * void foo(char *outx) { - * memmove(outx, somedata, 512); - * } - * - */ - -%define %cstring_chunk_output(TYPEMAP,SIZE) -%typemap(ignore) TYPEMAP(char temp[SIZE]) { - $1 = ($1_ltype) temp; -} -%typemap(argout) TYPEMAP { - $result = caml_list_append($result,caml_val_string_len($1,SIZE)); -} -%enddef - -/* - * %cstring_bounded_mutable(TYPEMAP, SIZE) - * - * This macro is used to wrap a string that's going to mutate. - * - * %cstring_bounded_mutable(char *in, 512); - * void foo(in *x) { - * while (*x) { - * *x = toupper(*x); - * x++; - * } - * } - * - */ - - -%define %cstring_bounded_mutable(TYPEMAP,MAX) -%typemap(in) TYPEMAP(char temp[MAX+1]) { - char *t = (char *)caml_ptr_val($input); - strncpy(temp,t,MAX); - $1 = ($1_ltype) temp; -} -%typemap(argout) TYPEMAP { - $result = caml_list_append($result,caml_val_string_len($1,MAX)); -} -%enddef - -/* - * %cstring_mutable(TYPEMAP [, expansion]) - * - * This macro is used to wrap a string that will mutate in place. - * It may change size up to a user-defined expansion. - * - * %cstring_mutable(char *in); - * void foo(in *x) { - * while (*x) { - * *x = toupper(*x); - * x++; - * } - * } - * - */ - -%define %cstring_mutable(TYPEMAP,...) -%typemap(in) TYPEMAP { - char *t = String_val($input); - int n = caml_string_length($input); - $1 = ($1_ltype) t; -#if #__VA_ARGS__ == "" -#ifdef __cplusplus - $1 = ($1_ltype) new char[n+1]; -#else - $1 = ($1_ltype) malloc(n+1); -#endif -#else -#ifdef __cplusplus - $1 = ($1_ltype) new char[n+1+__VA_ARGS__]; -#else - $1 = ($1_ltype) malloc(n+1+__VA_ARGS__); -#endif -#endif - memmove($1,t,n); - $1[n] = 0; -} - -%typemap(argout) TYPEMAP { - $result = caml_list_append($result,caml_val_string($1)); -#ifdef __cplusplus - delete[] $1; -#else - free($1); -#endif -} -%enddef - -/* - * %cstring_output_maxsize(TYPEMAP, SIZE) - * - * This macro returns data in a string of some user-defined size. - * - * %cstring_output_maxsize(char *outx, int max) { - * void foo(char *outx, int max) { - * sprintf(outx,"blah blah\n"); - * } - */ - -%define %cstring_output_maxsize(TYPEMAP, SIZE) -%typemap(in) (TYPEMAP, SIZE) { - $2 = caml_val_long($input); -#ifdef __cplusplus - $1 = ($1_ltype) new char[$2+1]; -#else - $1 = ($1_ltype) malloc($2+1); -#endif -} -%typemap(argout) (TYPEMAP,SIZE) { - $result = caml_list_append($result,caml_val_string($1)); -#ifdef __cplusplus - delete [] $1; -#else - free($1); -#endif -} -%enddef - -/* - * %cstring_output_withsize(TYPEMAP, SIZE) - * - * This macro is used to return character data along with a size - * parameter. - * - * %cstring_output_maxsize(char *outx, int *max) { - * void foo(char *outx, int *max) { - * sprintf(outx,"blah blah\n"); - * *max = strlen(outx); - * } - */ - -%define %cstring_output_withsize(TYPEMAP, SIZE) -%typemap(in) (TYPEMAP, SIZE) { - int n = caml_val_long($input); -#ifdef __cplusplus - $1 = ($1_ltype) new char[n+1]; - $2 = ($2_ltype) new $*1_ltype; -#else - $1 = ($1_ltype) malloc(n+1); - $2 = ($2_ltype) malloc(sizeof($*1_ltype)); -#endif - *$2 = n; -} -%typemap(argout) (TYPEMAP,SIZE) { - $result = caml_list_append($result,caml_val_string_len($1,$2)); -#ifdef __cplusplus - delete [] $1; - delete $2; -#else - free($1); - free($2); -#endif -} -%enddef - -/* - * %cstring_output_allocate(TYPEMAP, RELEASE) - * - * This macro is used to return character data that was - * allocated with new or malloc. - * - * %cstring_output_allocated(char **outx, free($1)); - * void foo(char **outx) { - * *outx = (char *) malloc(512); - * sprintf(outx,"blah blah\n"); - * } - */ - -%define %cstring_output_allocate(TYPEMAP, RELEASE) -%typemap(ignore) TYPEMAP($*1_ltype temp = 0) { - $1 = &temp; -} - -%typemap(argout) TYPEMAP { - if (*$1) { - $result = caml_list_append($result,caml_val_string($1)); - RELEASE; - } else { - $result = caml_list_append($result,caml_val_ptr($1)); - } -} -%enddef - -/* - * %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) - * - * This macro is used to return character data that was - * allocated with new or malloc. - * - * %cstring_output_allocated(char **outx, int *sz, free($1)); - * void foo(char **outx, int *sz) { - * *outx = (char *) malloc(512); - * sprintf(outx,"blah blah\n"); - * *sz = strlen(outx); - * } - */ - -%define %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) -%typemap(ignore) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) { - $1 = &temp; - $2 = &tempn; -} - -%typemap(argout)(TYPEMAP,SIZE) { - if (*$1) { - $result = caml_list_append($result,caml_val_string_len($1,$2)); - RELEASE; - } else - $result = caml_list_append($result,caml_val_ptr($1)); -} -%enddef - - - - - - diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/director.swg b/linux/bin/swig/share/swig/4.1.0/ocaml/director.swg deleted file mode 100755 index eb91aaf4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/director.swg +++ /dev/null @@ -1,101 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Ocaml proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#include -#include - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -namespace Swig { - /* base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - - public: - DirectorException(const char *msg="") : swig_msg(msg) { - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - /* type mismatch in the return value from a Ocaml method call */ - class DirectorTypeMismatchException : public DirectorException { - public: - DirectorTypeMismatchException(const char *msg="") : DirectorException(msg) { - } - }; - - /* any Ocaml exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException {}; - - /* attempt to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg="") : DirectorException(msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - /* simple thread abstraction for pthreads on win32 */ -#ifdef __THREAD__ -#define __PTHREAD__ -#if defined(_WIN32) || defined(__WIN32__) -#define pthread_mutex_lock EnterCriticalSection -#define pthread_mutex_unlock LeaveCriticalSection -#define pthread_mutex_t CRITICAL_SECTION -#define MUTEX_INIT(var) CRITICAL_SECTION var -#else -#include -#define MUTEX_INIT(var) pthread_mutex_t var = PTHREAD_MUTEX_INITIALIZER -#endif -#endif - - /* director base class */ - class Director { - private: - /* pointer to the wrapped ocaml object */ - CAML_VALUE swig_self; - /* flag indicating whether the object is owned by ocaml or c++ */ - mutable bool swig_disown_flag; - - public: - /* wrap a ocaml object. */ - Director(CAML_VALUE self) : swig_self(self), swig_disown_flag(false) { - caml_register_global_root(&swig_self); - } - - /* discard our reference at destruction */ - virtual ~Director() { - caml_remove_global_root(&swig_self); - swig_disown(); - // Disown is safe here because we're just divorcing a reference that points to us. - } - - /* return a pointer to the wrapped ocaml object */ - CAML_VALUE swig_get_self() const { - return swig_self; - } - - /* acquire ownership of the wrapped ocaml object (the sense of "disown" is from ocaml) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag=true; - caml_callback(*caml_named_value("caml_obj_disown"),swig_self); - } - } - }; -} - diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/extra-install.list b/linux/bin/swig/share/swig/4.1.0/ocaml/extra-install.list deleted file mode 100755 index 16486eb2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/extra-install.list +++ /dev/null @@ -1,4 +0,0 @@ -# see top-level Makefile.in -swigp4.ml -swig.mli -swig.ml diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/ocaml.i b/linux/bin/swig/share/swig/4.1.0/ocaml/ocaml.i deleted file mode 100755 index cc26d185..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/ocaml.i +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocaml.i - * - * SWIG Configuration File for Ocaml - * ----------------------------------------------------------------------------- */ - -/* Insert common stuff */ -%insert(runtime) "swigrun.swg" - -/* Include headers */ -%insert(runtime) "ocamlrundec.swg" - -/* Type registration */ -%insert(init) "swiginit.swg" -%insert(init) "typeregister.swg" - -%insert(mlitail) %{ - val swig_val : c_enum_type -> c_obj -> Swig.c_obj -%} - -%insert(mltail) %{ - let rec swig_val t v = - match v with - C_enum e -> enum_to_int t v - | C_list l -> Swig.C_list (List.map (swig_val t) l) - | C_array a -> Swig.C_array (Array.map (swig_val t) a) - | _ -> Obj.magic v -%} - -/*#ifndef SWIG_NOINCLUDE*/ -%insert(runtime) "ocamlrun.swg" -/*#endif*/ - -%insert(classtemplate) "class.swg" - -/* Read in standard typemaps. */ -%include -%include -%include -%include -%include - -/* ocaml keywords */ -/* There's no need to use this, because of my rewriting machinery. C++ - * words never collide with ocaml keywords */ - -/* still we include the file, but the warning says that the offending - name will be properly renamed. Just to let the user to know about - it. */ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/ocaml.swg b/linux/bin/swig/share/swig/4.1.0/ocaml/ocaml.swg deleted file mode 100755 index 703b7e44..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/ocaml.swg +++ /dev/null @@ -1,320 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocaml.swg - * - * The Ocaml module handles all types uniformly via typemaps. Here - * are the definitions. - * ----------------------------------------------------------------------------- */ - -/* Pointers */ - -%typemap(in) void "" - -%typemap(out) void "$result = Val_int(0);" - -%typemap(in) void * { - $1 = caml_ptr_val($input,$descriptor); -} - -%typemap(varin) void * { - $1 = ($ltype)caml_ptr_val($input,$descriptor); -} - -%typemap(out) void * { - $result = caml_val_ptr($1,$descriptor); -} - -%typemap(varout) void * { - $result = caml_val_ptr($1,$descriptor); -} - -%typemap(in) char *& (char *temp) { - temp = (char*)caml_val_ptr($1,$descriptor); - $1 = &temp; -} - -%typemap(argout) char *& { - swig_result = caml_list_append(swig_result,caml_val_string_len(*$1, strlen(*$1))); -} - -%typemap(in) SWIGTYPE & { - $1 = ($ltype) caml_ptr_val($input,$1_descriptor); -} - -%typemap(in, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ - $1 = ($ltype) caml_ptr_val($input,$1_descriptor); - rvrdeleter.reset($1); -%} - -%typemap(varin) SWIGTYPE & { - $1 = *(($ltype) caml_ptr_val($input,$1_descriptor)); -} - -%typemap(varin) SWIGTYPE && { - $1 = *(($ltype) caml_ptr_val($input,$1_descriptor)); -} - -%typemap(varout) SWIGTYPE &, SWIGTYPE && { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)&$1, $1_descriptor); -} - -%typemap(out) SWIGTYPE &, SWIGTYPE && { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); -} - -#if 0 -%typemap(argout) SWIGTYPE & { - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - swig_result = - caml_list_append(swig_result, - caml_callback(*fromval,caml_val_ptr((void *) $1, - $1_descriptor))); - } else { - swig_result = - caml_list_append(swig_result, - caml_val_ptr ((void *) $1,$1_descriptor)); - } -} -%typemap(argout) SWIGTYPE && { - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - swig_result = - caml_list_append(swig_result, - caml_callback(*fromval,caml_val_ptr((void *) $1, - $1_descriptor))); - } else { - swig_result = - caml_list_append(swig_result, - caml_val_ptr ((void *) $1,$1_descriptor)); - } -} -#endif - -%typemap(in) SWIGTYPE { - $1 = *(($&1_ltype) caml_ptr_val($input,$&1_descriptor)) ; -} - -%typemap(varout) SWIGTYPE { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)&$1, $&1_descriptor); -} - -#ifdef __cplusplus - -%typemap(out) SWIGTYPE { - $&1_ltype temp = new $1_ltype($1); - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)temp, $&1_descriptor); -} - -#else - -%typemap(out) SWIGTYPE { - void *temp = calloc(1,sizeof($ltype)); - memmove(temp, &$1, sizeof($1_type)); - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", temp, $&1_descriptor); -} - -#endif - -%typemap(varout) SWIGTYPE * { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); -} - -%typemap(directorin) SWIGTYPE { - $<ype temp = new $1_ltype(SWIG_STD_MOVE($1)); - swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)temp, $&1_descriptor); - args = caml_list_append(args, swig_result); -} - -%typemap(directorin) SWIGTYPE *, SWIGTYPE [], SWIGTYPE &, SWIGTYPE && { - swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)&$1, $&1_descriptor); - args = caml_list_append(args, swig_result); -} - -/* The SIMPLE_MAP macro below defines the whole set of typemaps needed - for simple types. */ - -%define SIMPLE_MAP(C_NAME, C_TO_OCAML, OCAML_TO_C) -/* In */ -%typemap(in) C_NAME { - $1 = OCAML_TO_C($input); -} -%typemap(varin) C_NAME { - $1 = OCAML_TO_C($input); -} -%typemap(in) const C_NAME & ($*1_ltype temp) { - temp = ($*1_ltype) OCAML_TO_C($input); - $1 = &temp; -} -%typemap(varin) const C_NAME & { - $1 = OCAML_TO_C($input); -} -%typemap(directorout) C_NAME { - $1 = OCAML_TO_C($input); -} -/* Out */ -%typemap(out) C_NAME { - $result = C_TO_OCAML($1); -} -%typemap(varout) C_NAME { - $result = C_TO_OCAML($1); -} -%typemap(varout) const C_NAME & { - $result = C_TO_OCAML($1); -} -%typemap(out) const C_NAME & { - $result = C_TO_OCAML(*$1); -} -%typemap(directorin) C_NAME { - args = caml_list_append(args, C_TO_OCAML($1)); -} -%enddef - -SIMPLE_MAP(bool, caml_val_bool, caml_long_val); -SIMPLE_MAP(char, caml_val_char, caml_long_val); -SIMPLE_MAP(signed char, caml_val_char, caml_long_val); -SIMPLE_MAP(unsigned char, caml_val_uchar, caml_long_val); -SIMPLE_MAP(int, caml_val_int, caml_long_val); -SIMPLE_MAP(short, caml_val_short, caml_long_val); -SIMPLE_MAP(wchar_t, caml_val_short, caml_long_val); -SIMPLE_MAP(long, caml_val_long, caml_long_val); -SIMPLE_MAP(ptrdiff_t, caml_val_int, caml_long_val); -SIMPLE_MAP(unsigned int, caml_val_uint, caml_long_val); -SIMPLE_MAP(unsigned short, caml_val_ushort, caml_long_val); -SIMPLE_MAP(unsigned long, caml_val_ulong, caml_long_val); -SIMPLE_MAP(size_t, caml_val_int, caml_long_val); -SIMPLE_MAP(float, caml_val_float, caml_double_val); -SIMPLE_MAP(double, caml_val_double, caml_double_val); -SIMPLE_MAP(long long,caml_val_ulong,caml_long_val); -SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); - -/* Void */ - -%typemap(out) void "$result = Val_unit;" - -/* Pass through value */ - -%typemap (in) CAML_VALUE "$1=$input;" -%typemap (out) CAML_VALUE "$result=$1;" - -#if 0 -%include -#endif - -/* Handle char arrays as strings */ - -%define %char_ptr_in(how) -%typemap(how) char *, signed char *, unsigned char * { - $1 = ($ltype)caml_string_val($input); -} -/* Again work around the empty array bound bug */ -%typemap(how) char [ANY], signed char [ANY], unsigned char [ANY] { - char *temp = caml_string_val($input); - strcpy((char *)$1,temp); -} -%enddef - -%char_ptr_in(in); -%char_ptr_in(varin); -%char_ptr_in(directorout); - -%define %char_ptr_out(how) -%typemap(how) - char *, signed char *, unsigned char *, - const char *, const signed char *, const unsigned char * { - $result = caml_val_string((char *)$1); -} -/* I'd like to use the length here but can't because it might be empty */ -%typemap(how) - char [ANY], signed char [ANY], unsigned char [ANY], - const char [ANY], const signed char [ANY], const unsigned char [ANY] { - $result = caml_val_string((char *)$1); -} -%enddef - -%char_ptr_out(out); -%char_ptr_out(varout); -%char_ptr_out(directorin); - -%define %swigtype_ptr_in(how) -%typemap(how) SWIGTYPE * { - $1 = ($ltype)caml_ptr_val($input,$1_descriptor); -} -%typemap(how) SWIGTYPE (CLASS::*) { - void *v = caml_ptr_val($input,$1_descriptor); - memcpy(& $1, &v, sizeof(v)); -} -%enddef - -%typemap(out) SWIGTYPE * { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); -} - -%define %swigtype_ptr_out(how) -%typemap(how) SWIGTYPE (CLASS::*) { - void *v; - memcpy(&v,& $1, sizeof(void *)); - $result = caml_val_ptr (v,$1_descriptor); -} -%enddef - -%swigtype_ptr_in(in); -%swigtype_ptr_in(varin); -%swigtype_ptr_in(directorout); -%swigtype_ptr_out(out); -%swigtype_ptr_out(varout); -%swigtype_ptr_out(directorin); - -%define %swigtype_array_fail(how,msg) -%typemap(how) SWIGTYPE [] { - caml_failwith(msg); -} -%enddef - -%swigtype_array_fail(in,"Array arguments for arbitrary types need a typemap"); -%swigtype_array_fail(varin,"Assignment to global arrays for arbitrary types need a typemap"); -%swigtype_array_fail(out,"Array arguments for arbitrary types need a typemap"); -%swigtype_array_fail(varout,"Array variables need a typemap"); -%swigtype_array_fail(directorin,"Array results with arbitrary types need a typemap"); -%swigtype_array_fail(directorout,"Array arguments with arbitrary types need a typemap"); - -/* C++ References */ - -/* Enums */ -%define %swig_enum_in(how) -%typemap(how) enum SWIGTYPE { - $1 = ($type)caml_long_val_full($input,"$type_marker"); -} -%enddef - -%define %swig_enum_out(how) -%typemap(how) enum SWIGTYPE { - $result = caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"),*caml_named_value("$type_marker"),Val_int((int)$1)); -} -%enddef - -%swig_enum_in(in) -%swig_enum_in(varin) -%swig_enum_in(directorout) -%swig_enum_out(out) -%swig_enum_out(varout) -%swig_enum_out(directorin) - -%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) { - $1 = ($1_ltype) caml_string_val($input); - $2 = ($2_ltype) caml_string_len($input); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **)&$1); - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, ty); -} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/ocamlkw.swg b/linux/bin/swig/share/swig/4.1.0/ocaml/ocamlkw.swg deleted file mode 100755 index 5e66085e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/ocamlkw.swg +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef OCAML_OCAMLKW_SWG_ -#define OCAML_OCAMLKW_SWG_ - -/* Warnings for Ocaml keywords */ -#define OCAMLKW(x) %namewarn("314: '" #x "' is an ocaml keyword and it will be appropriately renamed") #x - -/* - from - https://caml.inria.fr/pub/docs/manual-ocaml/lex.html -*/ - - -OCAMLKW(and); -OCAMLKW(as); -OCAMLKW(asr); -OCAMLKW(assert); -OCAMLKW(begin); -OCAMLKW(class); -OCAMLKW(constraint); -OCAMLKW(do); -OCAMLKW(done); -OCAMLKW(downto); -OCAMLKW(else); -OCAMLKW(end); -OCAMLKW(exception); -OCAMLKW(external); -OCAMLKW(false); -OCAMLKW(for); -OCAMLKW(fun); -OCAMLKW(function); -OCAMLKW(functor); -OCAMLKW(if); -OCAMLKW(in); -OCAMLKW(include); -OCAMLKW(inherit); -OCAMLKW(initializer); -OCAMLKW(land); -OCAMLKW(lazy); -OCAMLKW(let); -OCAMLKW(lor); -OCAMLKW(lsl); -OCAMLKW(lsr); -OCAMLKW(lxor); -OCAMLKW(match); -OCAMLKW(method); -OCAMLKW(mod); -OCAMLKW(module); -OCAMLKW(mutable); -OCAMLKW(new); -OCAMLKW(nonrec); -OCAMLKW(object); -OCAMLKW(of); -OCAMLKW(open); -OCAMLKW(or); -OCAMLKW(private); -OCAMLKW(rec); -OCAMLKW(sig); -OCAMLKW(struct); -OCAMLKW(then); -OCAMLKW(to); -OCAMLKW(true); -OCAMLKW(try); -OCAMLKW(type); -OCAMLKW(val); -OCAMLKW(virtual); -OCAMLKW(when); -OCAMLKW(while); -OCAMLKW(with); - -#undef OCAMLKW - -#endif //OCAML_OCAMLKW_SWG_ diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/ocamlrun.swg b/linux/bin/swig/share/swig/4.1.0/ocaml/ocamlrun.swg deleted file mode 100755 index 53ad952f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/ocamlrun.swg +++ /dev/null @@ -1,607 +0,0 @@ -/* -*-c-*- */ - -/* SWIG pointer structure */ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define C_bool 0 -#define C_char 1 -#define C_uchar 2 -#define C_short 3 -#define C_ushort 4 -#define C_int 5 -#define C_uint 6 -#define C_int32 7 -#define C_int64 8 -#define C_float 9 -#define C_double 10 -#define C_ptr 11 -#define C_array 12 -#define C_list 13 -#define C_obj 14 -#define C_string 15 -#define C_enum 16 -#define C_director_core 17 - - -/* Cast a pointer if possible; returns 1 if successful */ - - SWIGINTERN int - SWIG_Cast (void *source, swig_type_info *source_type, - void **ptr, swig_type_info *dest_type) - { - if( !source ) { /* Special case for NULL. This is a popular question - for other modules on the list, so I want an easy way out... */ - *ptr = 0; - return 0; - } - -#ifdef TYPE_CAST_VERBOSE - fprintf( stderr, "Trying to cast %s to %s\n", - source_type ? source_type->str : "", - dest_type ? dest_type->str : "" ); -#endif - if (dest_type != source_type) { - /* We have a type mismatch. Will have to look through our type - mapping table to figure out whether or not we can accept this - datatype. - -- - Ignore typechecks for void *. Allow any conversion. */ - if( !dest_type || !source_type || - !strcmp(dest_type->name,"_p_void") || - !strcmp(source_type->name,"_p_void") ) { - *ptr = source; - return 0; - } else { - swig_cast_info *tc = - SWIG_TypeCheckStruct(source_type, dest_type ); -#ifdef TYPE_CAST_VERBOSE - fprintf( stderr, "Typecheck -> %s\n", - tc ? tc->type->str : "" ); -#endif - if( tc ) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, source, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - return 0; - } else - return -1; - } - } else { - *ptr = source; - return 0; - } - } - -/* Return 0 if successful. */ - SWIGINTERN int - SWIG_GetPtr(void *inptr, void **outptr, - swig_type_info *intype, swig_type_info *outtype) { - if (intype) { - return SWIG_Cast(inptr, intype, - outptr, outtype) == -1; - } else { - *outptr = inptr; - return 0; - } - } - - SWIGINTERN void caml_print_list( CAML_VALUE v ); - - SWIGINTERN void caml_print_val( CAML_VALUE v ) { - switch( SWIG_Tag_val(v) ) { - case C_bool: - if( Bool_val(SWIG_Field(v,0)) ) fprintf( stderr, "true " ); - else fprintf( stderr, "false " ); - break; - case C_char: - case C_uchar: - fprintf( stderr, "'%c' (\\%03d) ", - (Int_val(SWIG_Field(v,0)) >= ' ' && - Int_val(SWIG_Field(v,0)) < 127) ? Int_val(SWIG_Field(v,0)) : '.', - Int_val(SWIG_Field(v,0)) ); - break; - case C_short: - case C_ushort: - case C_int: - fprintf( stderr, "%d ", (int)caml_long_val(v) ); - break; - - case C_uint: - case C_int32: - fprintf( stderr, "%ud ", (unsigned int)caml_long_val(v) ); - break; - case C_int64: - fprintf( stderr, "%ld ", caml_long_val(v) ); - break; - case C_float: - case C_double: - fprintf( stderr, "%f ", caml_double_val(v) ); - break; - - case C_ptr: - { - void *vout = 0; - swig_type_info *ty = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); - caml_ptr_val_internal(v,&vout,0); - fprintf( stderr, "PTR(%p,%s) ", - vout, - ty ? ty->name : "(null)" ); - } - break; - case C_array: - { - unsigned int i; - for( i = 0; i < Wosize_val( SWIG_Field(v,0) ); i++ ) - caml_print_val( SWIG_Field(SWIG_Field(v,0),i) ); - } - break; - case C_list: - caml_print_list( SWIG_Field(v,0) ); - break; - case C_obj: - fprintf( stderr, "OBJ(%p) ", (void *)SWIG_Field(v,0) ); - break; - case C_string: - { - void *cout; - caml_ptr_val_internal(v,&cout,0); - fprintf( stderr, "'%s' ", (char *)cout ); - } - break; - } - } - - SWIGINTERN void caml_print_list( CAML_VALUE v ) { - CAMLparam1(v); - while( v && Is_block(v) ) { - fprintf( stderr, "[ " ); - caml_print_val( SWIG_Field(v,0) ); - fprintf( stderr, "]\n" ); - v = SWIG_Field(v,1); - } - CAMLreturn0; - } - - SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) { - CAMLparam1(lst); - int i = 0; - while( i < n && lst && Is_block(lst) ) { - i++; lst = SWIG_Field(lst,1); - } - if( lst == Val_unit ) CAMLreturn(Val_unit); - else CAMLreturn(SWIG_Field(lst,0)); - } - - SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) { - CAMLparam2(lst,elt); - SWIG_CAMLlocal3(v,vt,lh); - lh = Val_unit; - v = Val_unit; - - /* Appending C_void should have no effect */ - if( !Is_block(elt) ) return lst; - - while( lst && Is_block(lst) ) { - if( v && v != Val_unit ) { - vt = caml_alloc_tuple(2); - SWIG_Store_field(v,1,vt); - v = vt; - } else { - v = lh = caml_alloc_tuple(2); - } - SWIG_Store_field(v,0,SWIG_Field(lst,0)); - lst = SWIG_Field(lst,1); - } - - if( v && Is_block(v) ) { - vt = caml_alloc_tuple(2); - SWIG_Store_field(v,1,vt); - v = vt; - } else { - v = lh = caml_alloc_tuple(2); - } - SWIG_Store_field(v,0,elt); - SWIG_Store_field(v,1,Val_unit); - - CAMLreturn(lh); - } - - SWIGINTERN int caml_list_length( CAML_VALUE lst ) { - CAMLparam1(lst); - int i = 0; - while( lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); } - CAMLreturn(i); - } - - SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) { - CAMLparam2(arr,item); - SWIG_Store_field(SWIG_Field(arr,0),n,item); - CAMLreturn0; - } - - SWIGINTERN value caml_array_nth( CAML_VALUE arr, int n ) { - CAMLparam1(arr); - if( SWIG_Tag_val(arr) == C_array ) - CAMLreturn(SWIG_Field(SWIG_Field(arr,0),n)); - else if( SWIG_Tag_val(arr) == C_list ) - CAMLreturn(caml_list_nth(arr,0)); - else - caml_failwith("Need array or list"); - } - - SWIGINTERN int caml_array_len( CAML_VALUE arr ) { - CAMLparam1(arr); - if( SWIG_Tag_val(arr) == C_array ) - CAMLreturn(Wosize_val(SWIG_Field(arr,0))); - else if( SWIG_Tag_val(arr) == C_list ) - CAMLreturn(caml_list_length(arr)); - else - caml_failwith("Need array or list"); - } - - SWIGINTERN CAML_VALUE caml_swig_alloc(int x,int y) { - return caml_alloc(x,y); - } - - SWIGINTERN value caml_array_new( int n ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - vv = caml_swig_alloc(1,C_array); - SWIG_Store_field(vv,0,caml_alloc_tuple(n)); - CAMLreturn(vv); - } - - SWIGINTERN CAML_VALUE caml_val_bool( int b ) { - CAMLparam0(); - SWIG_CAMLlocal1(bv); - bv = caml_swig_alloc(1,C_bool); - SWIG_Store_field(bv,0,Val_bool(b)); - CAMLreturn(bv); - } - - SWIGINTERN CAML_VALUE caml_val_char( char c ) { - CAMLparam0(); - SWIG_CAMLlocal1(cv); - cv = caml_swig_alloc(1,C_char); - SWIG_Store_field(cv,0,Val_int(c)); - CAMLreturn(cv); - } - - SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char uc ) { - CAMLparam0(); - SWIG_CAMLlocal1(ucv); - ucv = caml_swig_alloc(1,C_uchar); - SWIG_Store_field(ucv,0,Val_int(uc)); - CAMLreturn(ucv); - } - - SWIGINTERN CAML_VALUE caml_val_short( short s ) { - CAMLparam0(); - SWIG_CAMLlocal1(sv); - sv = caml_swig_alloc(1,C_short); - SWIG_Store_field(sv,0,Val_int(s)); - CAMLreturn(sv); - } - - SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short us ) { - CAMLparam0(); - SWIG_CAMLlocal1(usv); - usv = caml_swig_alloc(1,C_ushort); - SWIG_Store_field(usv,0,Val_int(us)); - CAMLreturn(usv); - } - - SWIGINTERN CAML_VALUE caml_val_int( int i ) { - CAMLparam0(); - SWIG_CAMLlocal1(iv); - iv = caml_swig_alloc(1,C_int); - SWIG_Store_field(iv,0,Val_int(i)); - CAMLreturn(iv); - } - - SWIGINTERN CAML_VALUE caml_val_uint( unsigned int ui ) { - CAMLparam0(); - SWIG_CAMLlocal1(uiv); - uiv = caml_swig_alloc(1,C_int); - SWIG_Store_field(uiv,0,Val_int(ui)); - CAMLreturn(uiv); - } - - SWIGINTERN CAML_VALUE caml_val_long( long l ) { - CAMLparam0(); - SWIG_CAMLlocal1(lv); - lv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(lv,0,caml_copy_int64(l)); - CAMLreturn(lv); - } - - SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long ul ) { - CAMLparam0(); - SWIG_CAMLlocal1(ulv); - ulv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(ulv,0,caml_copy_int64(ul)); - CAMLreturn(ulv); - } - - SWIGINTERN CAML_VALUE caml_val_float( float f ) { - CAMLparam0(); - SWIG_CAMLlocal1(fv); - fv = caml_swig_alloc(1,C_float); - SWIG_Store_field(fv,0,caml_copy_double((double)f)); - CAMLreturn(fv); - } - - SWIGINTERN CAML_VALUE caml_val_double( double d ) { - CAMLparam0(); - SWIG_CAMLlocal1(fv); - fv = caml_swig_alloc(1,C_double); - SWIG_Store_field(fv,0,caml_copy_double(d)); - CAMLreturn(fv); - } - - SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - vv = caml_swig_alloc(2,C_ptr); - SWIG_Store_field(vv,0,caml_copy_int64((long)p)); - SWIG_Store_field(vv,1,caml_copy_int64((long)info)); - CAMLreturn(vv); - } - - SWIGINTERN CAML_VALUE caml_val_string( const char *p ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - if( !p ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); - vv = caml_swig_alloc(1,C_string); - SWIG_Store_field(vv,0,caml_copy_string(p)); - CAMLreturn(vv); - } - - SWIGINTERN CAML_VALUE caml_val_string_len( const char *p, int len ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); - vv = caml_swig_alloc(1,C_string); - SWIG_Store_field(vv,0,caml_alloc_string(len)); - memcpy(Bp_val(SWIG_Field(vv,0)),p,len); - CAMLreturn(vv); - } - - #define caml_val_obj(v, name) caml_val_obj_helper(v, SWIG_TypeQuery((name)), name) - SWIGINTERN CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) { - CAMLparam0(); - CAMLreturn(caml_callback2(*caml_named_value("caml_create_object_fn"), - caml_val_ptr(v,type), - caml_copy_string(name))); - } - - SWIGINTERN long caml_long_val_full( CAML_VALUE v, const char *name ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_bool: - case C_char: - case C_uchar: - case C_short: - case C_ushort: - case C_int: - CAMLreturn(Int_val(SWIG_Field(v,0))); - case C_uint: - case C_int32: - CAMLreturn(Int32_val(SWIG_Field(v,0))); - case C_int64: - CAMLreturn((long)SWIG_Int64_val(SWIG_Field(v,0))); - case C_float: - case C_double: - CAMLreturn((long)Double_val(SWIG_Field(v,0))); - case C_string: - CAMLreturn((long)String_val(SWIG_Field(v,0))); - case C_ptr: - CAMLreturn((long)SWIG_Int64_val(SWIG_Field(SWIG_Field(v,0),0))); - case C_enum: { - SWIG_CAMLlocal1(ret); - const CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int"); - if( !name ) caml_failwith( "Not an enum conversion" ); - ret = caml_callback2(*enum_to_int,*caml_named_value(name),v); - CAMLreturn(caml_long_val(ret)); - } - default: - caml_failwith("No conversion to int"); - } - } - - SWIGINTERN long caml_long_val( CAML_VALUE v ) { - return caml_long_val_full(v,0); - } - - SWIGINTERN double caml_double_val( CAML_VALUE v ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0.0; - switch( SWIG_Tag_val(v) ) { - case C_bool: - case C_char: - case C_uchar: - case C_short: - case C_ushort: - case C_int: - CAMLreturn_type(Int_val(SWIG_Field(v,0))); - case C_uint: - case C_int32: - CAMLreturn_type(Int32_val(SWIG_Field(v,0))); - case C_int64: - CAMLreturn_type(SWIG_Int64_val(SWIG_Field(v,0))); - case C_float: - case C_double: - CAMLreturn_type(Double_val(SWIG_Field(v,0))); - default: - fprintf( stderr, "Unknown block tag %d\n", SWIG_Tag_val(v) ); - caml_failwith("No conversion to double"); - } - } - - SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, - swig_type_info *descriptor ) { - CAMLparam1(v); - void *outptr = NULL; - swig_type_info *outdescr = NULL; - static const CAML_VALUE *func_val = NULL; - - if( v == Val_unit ) { - *out = 0; - CAMLreturn_type(0); - } - if( !Is_block(v) ) return -1; - switch( SWIG_Tag_val(v) ) { - case C_obj: - if (!func_val) { - func_val = caml_named_value("caml_obj_ptr"); - } - CAMLreturn_type(caml_ptr_val_internal(caml_callback(*func_val, v), out, descriptor)); - case C_string: - outptr = (void *)String_val(SWIG_Field(v,0)); - break; - case C_ptr: - outptr = (void *)(long)SWIG_Int64_val(SWIG_Field(v,0)); - outdescr = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); - break; - default: - *out = 0; - CAMLreturn_type(1); - break; - } - - CAMLreturn_type(SWIG_GetPtr(outptr, out, outdescr, descriptor)); - } - - SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) { - CAMLparam0(); -#ifdef TYPE_CAST_VERBOSE - caml_print_val( v ); -#endif - void *out = NULL; - if( !caml_ptr_val_internal( v, &out, descriptor ) ) - CAMLreturn_type(out); - else - caml_failwith( "No appropriate conversion found." ); - } - - SWIGINTERN char *caml_string_val( CAML_VALUE v ) { - return (char *)caml_ptr_val( v, 0 ); - } - - SWIGINTERN int caml_string_len( CAML_VALUE v ) { - switch( SWIG_Tag_val(v) ) { - case C_string: - return caml_string_length(SWIG_Field(v,0)); - default: - return strlen((char *)caml_ptr_val(v,0)); - } - } - - SWIGINTERN int caml_bool_check( CAML_VALUE v ) { - CAMLparam1(v); - - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_bool: - case C_ptr: - case C_string: - CAMLreturn(1); - default: - CAMLreturn(0); - } - } - - SWIGINTERN int caml_int_check( CAML_VALUE v ) { - CAMLparam1(v); - - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_char: - case C_uchar: - case C_short: - case C_ushort: - case C_int: - case C_uint: - case C_int32: - case C_int64: - CAMLreturn(1); - - default: - CAMLreturn(0); - } - } - - SWIGINTERN int caml_float_check( CAML_VALUE v ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_float: - case C_double: - CAMLreturn(1); - - default: - CAMLreturn(0); - } - } - - SWIGINTERN int caml_ptr_check( CAML_VALUE v ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_string: - case C_ptr: - case C_int64: - CAMLreturn(1); - - default: - CAMLreturn(0); - } - } - - SWIGINTERN CAML_VALUE SWIG_Ocaml_ptr_to_val(const char *name, void *ptr, swig_type_info *descriptor) { - CAMLparam0(); - SWIG_CAMLlocal1(result); - - const CAML_VALUE *fromval = caml_named_value(name); - if (fromval) { - result = caml_callback(*fromval, caml_val_ptr(ptr, descriptor)); - } else { - result = caml_val_ptr(ptr, descriptor); - } - CAMLreturn(result); - } - - static swig_module_info *SWIG_Ocaml_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - CAML_VALUE pointer; - - pointer = caml_callback(*caml_named_value("swig_find_type_info"), caml_val_int(0)); - if (Is_block(pointer) && SWIG_Tag_val(pointer) == C_ptr) { - return (swig_module_info *)(void *)(long)SWIG_Int64_val(SWIG_Field(pointer,0)); - } - return 0; - } - - static void SWIG_Ocaml_SetModule(swig_module_info *pointer) { - CAML_VALUE mod_pointer; - - mod_pointer = caml_val_ptr(pointer, NULL); - caml_callback(*caml_named_value("swig_set_type_info"), mod_pointer); - } - -#ifdef __cplusplus -} -#endif -#undef value - diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/ocamlrundec.swg b/linux/bin/swig/share/swig/4.1.0/ocaml/ocamlrundec.swg deleted file mode 100755 index dde0b8e5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/ocamlrundec.swg +++ /dev/null @@ -1,212 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocamlrundec.swg - * - * Ocaml runtime code -- declarations - * ----------------------------------------------------------------------------- */ - -#include -#include -#include - -#ifdef __cplusplus -#define SWIGEXT extern "C" -SWIGEXT { -#else -#define SWIGEXT -#endif -#define value caml_value_t -#define CAML_VALUE caml_value_t -#define CAML_NAME_SPACE -#include -#include -#include -#include -#include -#include -#include - -#if defined(CAMLassert) -/* Both this macro and version.h were introduced in version 4.02.0 */ -#include -#else -#define OCAML_VERSION 0 /* Unknown, but < 40200 */ -#endif - -#define caml_array_set swig_caml_array_set - -/* Adapted from memory.h and mlvalues.h */ - -#define SWIG_CAMLlocal1(x) \ - caml_value_t x = 0; \ - CAMLxparam1 (x) - -#define SWIG_CAMLlocal2(x, y) \ - caml_value_t x = 0, y = 0; \ - CAMLxparam2 (x, y) - -#define SWIG_CAMLlocal3(x, y, z) \ - caml_value_t x = 0, y = 0, z = 0; \ - CAMLxparam3 (x, y, z) - -#define SWIG_CAMLlocal4(x, y, z, t) \ - caml_value_t x = 0, y = 0, z = 0, t = 0; \ - CAMLxparam4 (x, y, z, t) - -#define SWIG_CAMLlocal5(x, y, z, t, u) \ - caml_value_t x = 0, y = 0, z = 0, t = 0, u = 0; \ - CAMLxparam5 (x, y, z, t, u) - -#define SWIG_CAMLlocalN(x, size) \ - caml_value_t x [(size)] = { 0, /* 0, 0, ... */ }; \ - CAMLxparamN (x, (size)) - -#define SWIG_Field(x, i) (((caml_value_t *)(x)) [i]) /* Also an l-value. */ -#define SWIG_Store_field(block, offset, val) do{ \ - mlsize_t caml__temp_offset = (offset); \ - caml_value_t caml__temp_val = (val); \ - caml_modify (&SWIG_Field ((block), caml__temp_offset), caml__temp_val); \ -}while(0) - -#define SWIG_Data_custom_val(v) ((void *) &SWIG_Field((v), 1)) -#ifdef ARCH_BIG_ENDIAN -#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-1]) - /* Also an l-value. */ -#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [sizeof(caml_value_t)-1]) - /* Also an l-value. */ -#else -#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-sizeof(caml_value_t)]) - /* Also an l-value. */ -#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [0]) - /* Also an l-value. */ -#endif - -#ifdef CAMLreturn0 -#undef CAMLreturn0 -#endif -#define CAMLreturn0 do{ \ - caml_local_roots = caml__frame; \ - return; \ -}while (0) - -#ifdef CAMLreturn -#undef CAMLreturn -#endif -#define CAMLreturn(result) do{ \ - caml_value_t caml__temp_result = (result); \ - caml_local_roots = caml__frame; \ - return (caml__temp_result); \ -}while(0) - -#define CAMLreturn_type(result) do{ \ - caml_local_roots = caml__frame; \ - return result; \ -}while(0) - -#ifdef CAMLnoreturn -#undef CAMLnoreturn -#endif -#define CAMLnoreturn ((void) caml__frame) - - -#ifndef ARCH_ALIGN_INT64 -#if OCAML_VERSION >= 40300 -#define SWIG_Int64_val(v) (*((int64_t *) SWIG_Data_custom_val(v))) -#else -#define SWIG_Int64_val(v) (*((int64 *) SWIG_Data_custom_val(v))) -#endif -#else -#if OCAML_VERSION >= 40300 -CAMLextern int64_t Int64_val(caml_value_t v); -#else -CAMLextern int64 Int64_val(caml_value_t v); -#endif -#define SWIG_Int64_val(v) Int64_val(v) -#endif - -#define SWIG_NewPointerObj(p,type,flags) caml_val_ptr(p,type) -#define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer) - -typedef enum { - SWIG_OCamlArithmeticException, - SWIG_OCamlDirectorPureVirtual, - SWIG_OCamlOutOfMemoryError, - SWIG_OCamlOverflowException, - SWIG_OCamlIllegalArgumentException, - SWIG_OCamlIndexOutOfBoundsException, - SWIG_OCamlRuntimeException, - SWIG_OCamlSystemException, - SWIG_OCamlUnknownError -} SWIG_OCamlExceptionCodes; - -SWIGINTERN void SWIG_OCamlThrowException(SWIG_OCamlExceptionCodes code, const char *msg) { - CAMLparam0(); - SWIG_CAMLlocal1(str); - - switch (code) { - case SWIG_OCamlIllegalArgumentException: - caml_invalid_argument(msg); - break; - case SWIG_OCamlSystemException: - str = caml_copy_string(msg); - caml_raise_sys_error(str); - break; - case SWIG_OCamlArithmeticException: - case SWIG_OCamlIndexOutOfBoundsException: - case SWIG_OCamlOutOfMemoryError: - case SWIG_OCamlOverflowException: - case SWIG_OCamlRuntimeException: - case SWIG_OCamlUnknownError: - default: - caml_failwith(msg); - break; - } - CAMLreturn0; -} - -#define SWIG_contract_assert(expr, msg) do { if(!(expr)) {SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, msg);} } while (0) - - SWIGINTERN int - SWIG_GetPtr(void *source, void **result, swig_type_info *type, swig_type_info *result_type); - - SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ); - SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ); - SWIGINTERN int caml_list_length( CAML_VALUE lst ); - SWIGINTERN CAML_VALUE caml_array_new( int n ); - SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ); - SWIGINTERN CAML_VALUE caml_array_nth( CAML_VALUE arr, int n ); - SWIGINTERN int caml_array_len( CAML_VALUE arr ); - - SWIGINTERN CAML_VALUE caml_val_char( char c ); - SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char c ); - - SWIGINTERN CAML_VALUE caml_val_short( short s ); - SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short s ); - - SWIGINTERN CAML_VALUE caml_val_int( int x ); - SWIGINTERN CAML_VALUE caml_val_uint( unsigned int x ); - - SWIGINTERN CAML_VALUE caml_val_long( long x ); - SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long x ); - - SWIGINTERN CAML_VALUE caml_val_float( float f ); - SWIGINTERN CAML_VALUE caml_val_double( double d ); - - SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor ); - - SWIGINTERN CAML_VALUE caml_val_string( const char *str ); - SWIGINTERN CAML_VALUE caml_val_string_len( const char *str, int len ); - - SWIGINTERN long caml_long_val( CAML_VALUE v ); - SWIGINTERN double caml_double_val( CAML_VALUE v ); - - SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, - swig_type_info *descriptor ); - SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ); - - SWIGINTERN char *caml_string_val( CAML_VALUE v ); - SWIGINTERN int caml_string_len( CAML_VALUE v ); - -#ifdef __cplusplus -} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/preamble.swg b/linux/bin/swig/share/swig/4.1.0/ocaml/preamble.swg deleted file mode 100755 index 39374ce4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/preamble.swg +++ /dev/null @@ -1,17 +0,0 @@ -%insert(mli) %{ -exception BadArgs of string -exception BadMethodName of c_obj * string * string -exception NotObject of c_obj -exception NotEnumType of c_obj -exception LabelNotFromThisEnum of c_obj -exception InvalidDirectorCall of c_obj -%} - -%insert(ml) %{ -exception BadArgs of string -exception BadMethodName of c_obj * string * string -exception NotObject of c_obj -exception NotEnumType of c_obj -exception LabelNotFromThisEnum of c_obj -exception InvalidDirectorCall of c_obj -%} \ No newline at end of file diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/std_common.i b/linux/bin/swig/share/swig/4.1.0/ocaml/std_common.i deleted file mode 100755 index 7e64607d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/std_common.i +++ /dev/null @@ -1,23 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - -%{ -#include -SWIGINTERNINLINE -CAML_VALUE SwigString_FromString(const std::string &s) { - return caml_val_string((char *)s.c_str()); -} - -SWIGINTERNINLINE -std::string SwigString_AsString(CAML_VALUE o) { - return std::string((char *)caml_ptr_val(o,0)); -} -%} diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/std_complex.i b/linux/bin/swig/share/swig/4.1.0/ocaml/std_complex.i deleted file mode 100755 index 5192261a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/std_complex.i +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- -#ifndef SWIG_STD_COMPLEX_I_ -#define SWIG_STD_COMPLEX_I_ - -#ifdef SWIG - -%{ -#include -%} - -namespace std -{ - template class complex; - - %define specialize_std_complex(T) - - %typemap(in) complex { - if (PyComplex_Check($input)) { - $1 = std::complex(PyComplex_RealAsDouble($input), - PyComplex_ImagAsDouble($input)); - } else if (PyFloat_Check($input)) { - $1 = std::complex(PyFloat_AsDouble($input), 0); - } else if (PyInt_Check($input)) { - $1 = std::complex(PyInt_AsLong($input), 0); - } - else { - PyErr_SetString(PyExc_TypeError,"Expected a complex"); - SWIG_fail; - } - } - - %typemap(in) const complex& (std::complex temp) { - if (PyComplex_Check($input)) { - temp = std::complex(PyComplex_RealAsDouble($input), - PyComplex_ImagAsDouble($input)); - $1 = &temp; - } else if (PyFloat_Check($input)) { - temp = std::complex(PyFloat_AsDouble($input), 0); - $1 = &temp; - } else if (PyInt_Check($input)) { - temp = std::complex(PyInt_AsLong($input), 0); - $1 = &temp; - } else { - PyErr_SetString(PyExc_TypeError,"Expected a complex"); - SWIG_fail; - } - } - - %typemap(out) complex { - $result = PyComplex_FromDoubles($1.real(), $1.imag()); - } - - %typemap(out) const complex & { - $result = PyComplex_FromDoubles($1->real(), $1->imag()); - } - - %enddef - - specialize_std_complex(double); - specialize_std_complex(float); -} - -#endif // SWIG - -#endif //SWIG_STD_COMPLEX_I_ diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/std_deque.i b/linux/bin/swig/share/swig/4.1.0/ocaml/std_deque.i deleted file mode 100755 index 5b38962b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/std_deque.i +++ /dev/null @@ -1,28 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_deque.i - * - * Default std_deque wrapper - * ----------------------------------------------------------------------------- */ - -%module std_deque - -%rename(__getitem__) std::deque::getitem; -%rename(__setitem__) std::deque::setitem; -%rename(__delitem__) std::deque::delitem; -%rename(__getslice__) std::deque::getslice; -%rename(__setslice__) std::deque::setslice; -%rename(__delslice__) std::deque::delslice; - -%extend std::deque { - int __len__() { - return (int) self->size(); - } - int __nonzero__() { - return ! self->empty(); - } - void append(const T &x) { - self->push_back(x); - } -}; - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/std_except.i b/linux/bin/swig/share/swig/4.1.0/ocaml/std_except.i deleted file mode 100755 index 74ddcb51..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/std_except.i +++ /dev/null @@ -1,23 +0,0 @@ -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws) std::bad_cast "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::bad_exception "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::domain_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::exception "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::invalid_argument "SWIG_OCamlThrowException(SWIG_OCamlIllegalArgumentException, $1.what());" -%typemap(throws) std::length_error "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" -%typemap(throws) std::logic_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::out_of_range "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" -%typemap(throws) std::overflow_error "SWIG_OCamlThrowException(SWIG_OCamlArithmeticException, $1.what());" -%typemap(throws) std::range_error "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" -%typemap(throws) std::runtime_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::underflow_error "SWIG_OCamlThrowException(SWIG_OCamlArithmeticException, $1.what());" diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/std_list.i b/linux/bin/swig/share/swig/4.1.0/ocaml/std_list.i deleted file mode 100755 index e0524aa4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/std_list.i +++ /dev/null @@ -1,217 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list types - * ----------------------------------------------------------------------------- */ - -%include - -%module std_list -%{ -#include -#include -%} - - -namespace std { - template class list - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef T &iterator; - typedef const T& const_iterator; - - list(); - list(unsigned int size, const T& value = T()); - list(const list& other); - - void assign(unsigned int n, const T& value); - void swap(list &x); - - const_reference front(); - const_reference back(); - const_iterator begin(); - const_iterator end(); - - void resize(unsigned int n, T c = T()); - bool empty() const; - - void push_front(const T& x); - void push_back(const T& x); - - void pop_front(); - void pop_back(); - void clear(); - unsigned int size() const; - unsigned int max_size() const; - void resize(unsigned int n, const T& value); - - void remove(const T& value); - void unique(); - void reverse(); - void sort(); - - %extend - { - const_reference __getitem__(int i) throw (std::out_of_range) - { - std::list::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && i::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && i::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && ierase(first); - } - else throw std::out_of_range("list index out of range"); - } - std::list __getslice__(int i,int j) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - if (i>=j) i=j; - if (i>=0 && i=0) - { - for (int k=0;k tmp(j-i); - if (j>i) std::copy(first,end,tmp.begin()); - return tmp; - } - else throw std::out_of_range("list index out of range"); - } - void __delslice__(int i,int j) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - - for (int k=0;kerase(first,end); - } - void __setslice__(int i,int j, const std::list& v) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - - for (int k=0;kerase(first,end); - if (i+1 <= int(self->size())) - { - first = self->begin(); - for (int k=0;kinsert(first,v.begin(),v.end()); - } - else self->insert(self->end(),v.begin(),v.end()); - } - - } - unsigned int __len__() - { - return self->size(); - } - bool __nonzero__() - { - return !(self->empty()); - } - void append(const T& x) - { - self->push_back(x); - } - void pop() - { - self->pop_back(); - } - } - }; -} - - - - - - diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/std_map.i b/linux/bin/swig/share/swig/4.1.0/ocaml/std_map.i deleted file mode 100755 index 3f197baa..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/std_map.i +++ /dev/null @@ -1,79 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/std_pair.i b/linux/bin/swig/share/swig/4.1.0/ocaml/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/std_string.i b/linux/bin/swig/share/swig/4.1.0/ocaml/std_string.i deleted file mode 100755 index 2564cfb3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/std_string.i +++ /dev/null @@ -1,136 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%include -%include - -namespace std { - -%naturalvar string; -%naturalvar wstring; - -class string; -class wstring; - -/* Overloading check */ -%typemap(in) string { - if (caml_ptr_check($input)) - $1.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - else - SWIG_exception(SWIG_TypeError, "string expected"); -} - -%typemap(in) const string & ($*1_ltype temp) { - if (caml_ptr_check($input)) { - temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - -%typemap(in) string & ($*1_ltype temp) { - if (caml_ptr_check($input)) { - temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - -%typemap(in) string * ($*1_ltype *temp) { - if (caml_ptr_check($input)) { - temp = new $*1_ltype((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - -%typemap(free) string * ($*1_ltype *temp) { - delete temp; -} - -%typemap(argout) string & { - swig_result = caml_list_append(swig_result,caml_val_string_len((*$1).c_str(), (*$1).size())); -} - -%typemap(directorin) string { - swig_result = caml_val_string_len($1.c_str(), $1.size()); - args = caml_list_append(args, swig_result); -} - -%typemap(directorout) string { - $result.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); -} - -%typemap(out) string { - $result = caml_val_string_len($1.c_str(),$1.size()); -} - -%typemap(varout) string { - $result = caml_val_string_len($1.c_str(),$1.size()); -} - -%typemap(out) string * { - $result = caml_val_string_len((*$1).c_str(),(*$1).size()); -} - -%typemap(varout) string * { - $result = caml_val_string_len((*$1).c_str(),(*$1).size()); -} - -%typemap(typecheck) string, const string & = char *; - -%typemap(throws) string, const string & "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.c_str());" - -} - -#ifdef ENABLE_CHARPTR_ARRAY -char **c_charptr_array( const std::vector &str_v ); - -%{ - SWIGEXT char **c_charptr_array( const std::vector &str_v ) { - char **out = new char *[str_v.size() + 1]; - out[str_v.size()] = 0; - for( int i = 0; i < str_v.size(); i++ ) { - out[i] = (char *)str_v[i].c_str(); - } - return out; - } -%} -#endif - -#ifdef ENABLE_STRING_VECTOR -%template (StringVector) std::vector; - -%insert(ml) %{ - (* Some STL convenience items *) - - let string_array_to_vector sa = - let nv = _new_StringVector C_void in - ignore (array_to_vector nv (fun x -> C_string x) sa) ; nv - - let c_string_array ar = - _c_charptr_array (string_array_to_vector ar) -%} - -%insert(mli) %{ - val c_string_array: string array -> c_obj -%} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/std_vector.i b/linux/bin/swig/share/swig/4.1.0/ocaml/std_vector.i deleted file mode 100755 index 891d038c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/std_vector.i +++ /dev/null @@ -1,98 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector types - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Python as much as possible, namely, to allow the user to pass and -// be returned Python tuples or lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a Python sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a Python sequence of T:s -// is returned which is most easily used in other Python functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - void push_back(const T& x); - T operator [] ( int f ); - vector &operator = ( vector &other ); - %extend { - void set( int i, const T &x ) { - self->resize(i+1); - (*self)[i] = x; - } - }; - %extend { - T *to_array() { - T *array = new T[self->size() + 1]; - for( int i = 0; i < self->size(); i++ ) - array[i] = (*self)[i]; - return array; - } - }; - }; -}; - -%insert(ml) %{ - - let array_to_vector v argcons array = - for i = 0 to (Array.length array) - 1 do - ignore ((invoke v) "set" (C_list [ C_int i ; (argcons array.(i)) ])) - done ; - v - - let vector_to_array v argcons array = - for i = 0; to (get_int ((invoke v) "size" C_void)) - 1 do - array.(i) <- argcons ((invoke v) "[]" (C_int i)) - done ; - v - -%} - -%insert(mli) %{ - val array_to_vector : c_obj -> ('a -> c_obj) -> 'a array -> c_obj - val vector_to_array : c_obj -> (c_obj -> 'a) -> 'a array -> c_obj -%} diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/stl.i b/linux/bin/swig/share/swig/4.1.0/ocaml/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/swig.ml b/linux/bin/swig/share/swig/4.1.0/ocaml/swig.ml deleted file mode 100755 index 58a93347..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/swig.ml +++ /dev/null @@ -1,166 +0,0 @@ -(* -*- tuareg -*- *) -open Int32 -open Int64 - -type enum = [ `Int of int ] - -type 'a c_obj_t = - C_void - | C_bool of bool - | C_char of char - | C_uchar of char - | C_short of int - | C_ushort of int - | C_int of int - | C_uint of int32 - | C_int32 of int32 - | C_int64 of int64 - | C_float of float - | C_double of float - | C_ptr of int64 * int64 - | C_array of 'a c_obj_t array - | C_list of 'a c_obj_t list - | C_obj of (string -> 'a c_obj_t -> 'a c_obj_t) - | C_string of string - | C_enum of 'a - | C_director_core of 'a c_obj_t * 'a c_obj_t option ref - -type c_obj = enum c_obj_t - -exception BadArgs of string -exception BadMethodName of string * string -exception NotObject of c_obj -exception NotEnumType of c_obj -exception LabelNotFromThisEnum of c_obj -exception InvalidDirectorCall of c_obj -exception NoSuchClass of string -let rec invoke obj = - match obj with - C_obj o -> o - | C_director_core (o,r) -> invoke o - | _ -> raise (NotObject (Obj.magic obj)) -let _ = Callback.register "swig_runmethod" invoke - -let fnhelper arg = - match arg with C_list l -> l | C_void -> [] | _ -> [ arg ] - -let director_core_helper fnargs = - try - match List.hd fnargs with - | C_director_core (o,r) -> fnargs - | _ -> C_void :: fnargs - with Failure _ -> C_void :: fnargs - -let rec get_int x = - match x with - C_bool b -> if b then 1 else 0 - | C_char c - | C_uchar c -> (int_of_char c) - | C_short s - | C_ushort s - | C_int s -> s - | C_uint u - | C_int32 u -> (Int32.to_int u) - | C_int64 u -> (Int64.to_int u) - | C_float f -> (int_of_float f) - | C_double d -> (int_of_float d) - | C_ptr (p,q) -> (Int64.to_int p) - | C_obj o -> (try (get_int (o "int" C_void)) - with _ -> (get_int (o "&" C_void))) - | _ -> raise (Failure "Can't convert to int") - -let rec get_float x = - match x with - C_char c - | C_uchar c -> (float_of_int (int_of_char c)) - | C_short s -> (float_of_int s) - | C_ushort s -> (float_of_int s) - | C_int s -> (float_of_int s) - | C_uint u - | C_int32 u -> (float_of_int (Int32.to_int u)) - | C_int64 u -> (float_of_int (Int64.to_int u)) - | C_float f -> f - | C_double d -> d - | C_obj o -> (try (get_float (o "float" C_void)) - with _ -> (get_float (o "double" C_void))) - | _ -> raise (Failure "Can't convert to float") - -let rec get_char x = - (char_of_int (get_int x)) - -let rec get_string x = - match x with - C_string str -> str - | _ -> raise (Failure "Can't convert to string") - -let rec get_bool x = - match x with - C_bool b -> b - | _ -> - (try if get_int x != 0 then true else false - with _ -> raise (Failure "Can't convert to bool")) - -let disown_object obj = - match obj with - C_director_core (o,r) -> r := None - | _ -> raise (Failure "Not a director core object") -let _ = Callback.register "caml_obj_disown" disown_object -let addr_of obj = - match obj with - C_obj _ -> (invoke obj) "&" C_void - | C_director_core (self,r) -> (invoke self) "&" C_void - | C_ptr _ -> obj - | _ -> raise (Failure "Not a pointer.") -let _ = Callback.register "caml_obj_ptr" addr_of - -let make_float f = C_float f -let make_double f = C_double f -let make_string s = C_string s -let make_bool b = C_bool b -let make_char c = C_char c -let make_char_i c = C_char (char_of_int c) -let make_uchar c = C_uchar c -let make_uchar_i c = C_uchar (char_of_int c) -let make_short i = C_short i -let make_ushort i = C_ushort i -let make_int i = C_int i -let make_uint i = C_uint (Int32.of_int i) -let make_int32 i = C_int32 (Int32.of_int i) -let make_int64 i = C_int64 (Int64.of_int i) - -let new_derived_object cfun x_class args = - begin - let get_object ob = - match !ob with - None -> - raise (NotObject C_void) - | Some o -> o in - let ob_ref = ref None in - let class_fun class_f ob_r = - (fun meth args -> class_f (get_object ob_r) meth args) in - let new_class = class_fun x_class ob_ref in - let dircore = C_director_core (C_obj new_class,ob_ref) in - let obj = - cfun (match args with - C_list argl -> (C_list ((dircore :: argl))) - | C_void -> (C_list [ dircore ]) - | a -> (C_list [ dircore ; a ])) in - ob_ref := Some obj ; - obj - end - -let swig_current_type_info = ref C_void -let find_type_info obj = !swig_current_type_info -let _ = Callback.register "swig_find_type_info" find_type_info -let set_type_info obj = - match obj with - C_ptr _ -> swig_current_type_info := obj ; - obj - | _ -> raise (Failure "Internal error: passed non pointer to set_type_info") -let _ = Callback.register "swig_set_type_info" set_type_info - -let class_master_list = Hashtbl.create 20 -let register_class_byname nm co = - Hashtbl.replace class_master_list nm (Obj.magic co) -let create_class nm = - try (Obj.magic (Hashtbl.find class_master_list nm)) with _ -> raise (NoSuchClass nm) diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/swig.mli b/linux/bin/swig/share/swig/4.1.0/ocaml/swig.mli deleted file mode 100755 index c5ffadb1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/swig.mli +++ /dev/null @@ -1,62 +0,0 @@ -(* -*- tuareg -*- *) - -type enum = [ `Int of int ] - -type 'a c_obj_t = - C_void - | C_bool of bool - | C_char of char - | C_uchar of char - | C_short of int - | C_ushort of int - | C_int of int - | C_uint of int32 - | C_int32 of int32 - | C_int64 of int64 - | C_float of float - | C_double of float - | C_ptr of int64 * int64 - | C_array of 'a c_obj_t array - | C_list of 'a c_obj_t list - | C_obj of (string -> 'a c_obj_t -> 'a c_obj_t) - | C_string of string - | C_enum of 'a - | C_director_core of 'a c_obj_t * 'a c_obj_t option ref - -type c_obj = enum c_obj_t - -exception InvalidDirectorCall of c_obj -exception NoSuchClass of string - -val invoke : ('a c_obj_t) -> (string -> 'a c_obj_t -> 'a c_obj_t) -val fnhelper : 'a c_obj_t -> 'a c_obj_t list -val director_core_helper : 'a c_obj_t list -> 'a c_obj_t list - -val get_int : 'a c_obj_t -> int -val get_float : 'a c_obj_t -> float -val get_string : 'a c_obj_t -> string -val get_char : 'a c_obj_t -> char -val get_bool : 'a c_obj_t -> bool - -val make_float : float -> 'a c_obj_t -val make_double : float -> 'a c_obj_t -val make_string : string -> 'a c_obj_t -val make_bool : bool -> 'a c_obj_t -val make_char : char -> 'a c_obj_t -val make_char_i : int -> 'a c_obj_t -val make_uchar : char -> 'a c_obj_t -val make_uchar_i : int -> 'a c_obj_t -val make_short : int -> 'a c_obj_t -val make_ushort : int -> 'a c_obj_t -val make_int : int -> 'a c_obj_t -val make_uint : int -> 'a c_obj_t -val make_int32 : int -> 'a c_obj_t -val make_int64 : int -> 'a c_obj_t - -val new_derived_object: - ('a c_obj_t -> 'a c_obj_t) -> - ('a c_obj_t -> string -> 'a c_obj_t -> 'a c_obj_t) -> - 'a c_obj_t -> 'a c_obj_t - -val register_class_byname : string -> ('a c_obj_t -> 'a c_obj_t) -> unit -val create_class : string -> 'a c_obj_t -> 'a c_obj_t diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/swigmove.i b/linux/bin/swig/share/swig/4.1.0/ocaml/swigmove.i deleted file mode 100755 index 32f9903b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/swigmove.i +++ /dev/null @@ -1,11 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0) { - argp1 = ($&1_ltype) caml_ptr_val($input,$&1_descriptor); - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/swigp4.ml b/linux/bin/swig/share/swig/4.1.0/ocaml/swigp4.ml deleted file mode 100755 index 2f6074a9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/swigp4.ml +++ /dev/null @@ -1,135 +0,0 @@ -open Camlp4 - -module Id : Sig.Id = -struct - let name = "swigp4" - let version = "0.1" -end - -module Make (Syntax : Sig.Camlp4Syntax) = -struct - open Sig - include Syntax - - let _loc = Loc.ghost - let lap x y = x :: y - let c_ify e loc = - match e with - <:expr< $int:_$ >> -> <:expr< (C_int $e$) >> - | <:expr< $str:_$ >> -> <:expr< (C_string $e$) >> - | <:expr< $chr:_$ >> -> <:expr< (C_char $e$) >> - | <:expr< $flo:_$ >> -> <:expr< (C_double $e$) >> - | <:expr< True >> -> <:expr< (C_bool $e$) >> - | <:expr< False >> -> <:expr< (C_bool $e$) >> - | _ -> <:expr< $e$ >> - let mk_list args loc f = - let rec mk_list_inner args loc f = - match args with - [] -> <:expr< [] >> - | x :: xs -> - (let loc = Ast.loc_of_expr x in - <:expr< [ ($f x _loc$) ] @ ($mk_list_inner xs loc f$) >>) in - match args with - [] -> <:expr< (Obj.magic C_void) >> - | [ a ] -> <:expr< (Obj.magic $f a _loc$) >> - | _ -> <:expr< (Obj.magic (C_list ($mk_list_inner args loc f$))) >> ;; - - EXTEND Gram - GLOBAL: expr; - - expr: LEVEL "top" - [ [ e1 = expr ; "'" ; "[" ; e2 = expr ; "]" -> - <:expr< (invoke $e1$) "[]" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) $str:l$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) $str:u$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) $s$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "." ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) "()" ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke ((invoke $e1$) "->" C_void)) $str:l$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke ((invoke $e1$) "->" C_void)) $str:u$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke ((invoke $e1$) "->" C_void)) $s$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "++" -> - <:expr< (invoke $e1$) "++" C_void >> - | e1 = expr ; "'" ; "--" -> - <:expr< (invoke $e1$) "--" C_void >> - | e1 = expr ; "'" ; "-" ; e2 = expr -> - <:expr< (invoke $e1$) "-" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "+" ; e2 = expr -> <:expr< (invoke $e1$) "+" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "*" ; e2 = expr -> <:expr< (invoke $e1$) "*" (C_list [ $c_ify e2 _loc$ ]) >> - | "'" ; "&" ; e1 = expr -> - <:expr< (invoke $e1$) "&" C_void >> - | "'" ; "!" ; e1 = expr -> - <:expr< (invoke $e1$) "!" C_void >> - | "'" ; "~" ; e1 = expr -> - <:expr< (invoke $e1$) "~" C_void >> - | e1 = expr ; "'" ; "/" ; e2 = expr -> - <:expr< (invoke $e1$) "/" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "%" ; e2 = expr -> - <:expr< (invoke $e1$) "%" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsl" ; e2 = expr -> - <:expr< (invoke $e1$) ("<" ^ "<") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsr" ; e2 = expr -> - <:expr< (invoke $e1$) (">" ^ ">") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "<" ; e2 = expr -> - <:expr< (invoke $e1$) "<" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "<=" ; e2 = expr -> - <:expr< (invoke $e1$) "<=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; ">" ; e2 = expr -> - <:expr< (invoke $e1$) ">" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; ">=" ; e2 = expr -> - <:expr< (invoke $e1$) ">=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "==" ; e2 = expr -> - <:expr< (invoke $e1$) "==" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "!=" ; e2 = expr -> - <:expr< (invoke $e1$) "!=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "&" ; e2 = expr -> - <:expr< (invoke $e1$) "&" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "^" ; e2 = expr -> - <:expr< (invoke $e1$) "^" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "|" ; e2 = expr -> - <:expr< (invoke $e1$) "|" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "&&" ; e2 = expr -> - <:expr< (invoke $e1$) "&&" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "||" ; e2 = expr -> - <:expr< (invoke $e1$) "||" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "=" ; e2 = expr -> - <:expr< (invoke $e1$) "=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "+=" ; e2 = expr -> - <:expr< (invoke $e1$) "+=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "-=" ; e2 = expr -> - <:expr< (invoke $e1$) "-=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "*=" ; e2 = expr -> - <:expr< (invoke $e1$) "*=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "/=" ; e2 = expr -> - <:expr< (invoke $e1$) "/=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "%=" ; e2 = expr -> - <:expr< (invoke $e1$) "%=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsl" ; "=" ; e2 = expr -> - <:expr< (invoke $e1$) ("<" ^ "<=") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsr" ; "=" ; e2 = expr -> - <:expr< (invoke $e1$) (">" ^ ">=") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "&=" ; e2 = expr -> - <:expr< (invoke $e1$) "&=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "^=" ; e2 = expr -> - <:expr< (invoke $e1$) "^=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "|=" ; e2 = expr -> - <:expr< (invoke $e1$) "|=" (C_list [ $c_ify e2 _loc$ ]) >> - | "'" ; e = expr -> c_ify e _loc - | c = expr ; "as" ; id = LIDENT -> <:expr< $lid:"get_" ^ id$ $c$ >> - | c = expr ; "to" ; id = LIDENT -> <:expr< $uid:"C_" ^ id$ $c$ >> - | "`" ; "`" ; l = LIDENT -> <:expr< C_enum `$lid:l$ >> - | "`" ; "`" ; u = UIDENT -> <:expr< C_enum `$uid:u$ >> - | f = expr ; "'" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< $f$ ($mk_list args _loc c_ify$) >> - ] ] ; - END ;; - -end - -module M = Register.OCamlSyntaxExtension(Id)(Make) diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/typecheck.i b/linux/bin/swig/share/swig/4.1.0/ocaml/typecheck.i deleted file mode 100755 index 0c0a600a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/typecheck.i +++ /dev/null @@ -1,197 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typecheck.i - * - * Typechecking rules - * ----------------------------------------------------------------------------- */ - -%typecheck(SWIG_TYPECHECK_INT8) char, signed char, const char &, const signed char & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_char: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_UINT8) unsigned char, const unsigned char & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_uchar: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_INT16) short, signed short, const short &, const signed short &, wchar_t { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_short: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_UINT16) unsigned short, const unsigned short & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_ushort: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -// XXX arty -// Will move enum SWIGTYPE later when I figure out what to do with it... - -%typecheck(SWIG_TYPECHECK_INT32) int, signed int, const int &, const signed int &, enum SWIGTYPE { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_int: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_UINT32) unsigned int, const unsigned int & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_uint: $1 = 1; break; - case C_int32: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_INT64) - long, signed long, unsigned long, - long long, signed long long, unsigned long long, - const long &, const signed long &, const unsigned long &, - const long long &, const signed long long &, const unsigned long long &, - size_t, const size_t & -{ - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_int64: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_BOOL) bool, const bool & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_bool: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_FLOAT) float, const float & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_float: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) double, const double & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_double: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_string: $1 = 1; break; - case C_ptr: { - swig_type_info *typeinfo = - (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field($input,1)); - $1 = SWIG_TypeCheck("char *",typeinfo) || - SWIG_TypeCheck("signed char *",typeinfo) || - SWIG_TypeCheck("unsigned char *",typeinfo) || - SWIG_TypeCheck("const char *",typeinfo) || - SWIG_TypeCheck("const signed char *",typeinfo) || - SWIG_TypeCheck("const unsigned char *",typeinfo) || - SWIG_TypeCheck("std::string",typeinfo); - } break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - if (!Is_block($input) || !(SWIG_Tag_val($input) == C_obj || SWIG_Tag_val($input) == C_ptr)) { - $1 = 0; - } else { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, $descriptor); - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - swig_type_info *typeinfo; - if (!Is_block($input)) { - $1 = 0; - } else { - switch (SWIG_Tag_val($input)) { - case C_obj: { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, $&1_descriptor); - break; - } - case C_ptr: { - typeinfo = (swig_type_info *)SWIG_Int64_val(SWIG_Field($input, 1)); - $1 = SWIG_TypeCheck("$1_type", typeinfo) != NULL; - break; - } - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, 0); -} - -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) CAML_VALUE "$1 = 1;" - -/* ------------------------------------------------------------ - * Exception handling - * ------------------------------------------------------------ */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short { - char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, error_msg); -} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] { - (void)$1; - SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, "C++ $1_type exception thrown"); -} - -%typemap(throws) char * { - SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1); -} diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/typemaps.i b/linux/bin/swig/share/swig/4.1.0/ocaml/typemaps.i deleted file mode 100755 index 39231e22..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/typemaps.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ---------------------------------------------------------------------------- - * typemaps.i - * - * These typemaps provide support for input/output arguments for C/C++ pointers - * and C++ references. -* ---------------------------------------------------------------------------- */ - -%define INPUT_OUTPUT_INOUT_TYPEMAPS(type, c_to_ocaml, ocaml_to_c) -%typemap(in) type *INPUT(type temp), type &INPUT(type temp) { - temp = (type)ocaml_to_c($input); - $1 = &temp; -} -%typemap(typecheck) type *INPUT = type; -%typemap(typecheck) type &INPUT = type; - -%typemap(in, numinputs=0) type *OUTPUT($*1_ltype temp), type &OUTPUT($*1_ltype temp) "$1 = &temp;" -%typemap(argout) type *OUTPUT, type &OUTPUT { - swig_result = caml_list_append(swig_result, c_to_ocaml(*$1)); -} -%typemap(in) type *INOUT = type *INPUT; -%typemap(in) type &INOUT = type &INPUT; - -%typemap(argout) type *INOUT = type *OUTPUT; -%typemap(argout) type &INOUT = type &OUTPUT; - -%typemap(typecheck) type *INOUT = type; -%typemap(typecheck) type &INOUT = type; -%enddef - -INPUT_OUTPUT_INOUT_TYPEMAPS(bool, caml_val_bool, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(int, caml_val_int, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(long, caml_val_long, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(short, caml_val_int, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(char, caml_val_char, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(signed char, caml_val_char, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(float, caml_val_float, caml_double_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(double, caml_val_double, caml_double_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned int, caml_val_uint, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned long, caml_val_ulong, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned short, caml_val_ushort, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned char, caml_val_uchar, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(long long, caml_val_long, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned long long, caml_val_ulong, caml_long_val); -#undef INPUT_OUTPUT_INOUT_TYPEMAPS diff --git a/linux/bin/swig/share/swig/4.1.0/ocaml/typeregister.swg b/linux/bin/swig/share/swig/4.1.0/ocaml/typeregister.swg deleted file mode 100755 index c3ba904a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ocaml/typeregister.swg +++ /dev/null @@ -1,2 +0,0 @@ -SWIGEXT void SWIG_init() { - SWIG_InitializeModule(0); diff --git a/linux/bin/swig/share/swig/4.1.0/octave/argcargv.i b/linux/bin/swig/share/swig/4.1.0/octave/argcargv.i deleted file mode 100755 index 8d455e58..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/argcargv.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - if ($input.is_scalar_type()) { - $1 = 0; $2 = NULL; - %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' is not a list", $symname, $argnum); - } - octave_value_list list = $input.list_value(); - int i, len = list.length(); - $1 = ($1_ltype) len; - $2 = (char **) malloc((len+1)*sizeof(char *)); - for (i = 0; i < len; i++) { - if (!list(i).is_string()) { - $1 = 0; - %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' use a non-string", $symname, $argnum); - } - $2[i] = (char *)list(i).string_value().c_str(); - } - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = 0; - const octave_value& ov = $input; - if (!ov.is_scalar_type()) { - octave_value_list list = ov.list_value(); - int i, len = list.length(); - $1 = 1; - for (i = 0; i < len; i++) { - if (!list(i).is_string()) { - $1 = 0; - break; - } - } - } -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/linux/bin/swig/share/swig/4.1.0/octave/attribute.i b/linux/bin/swig/share/swig/4.1.0/octave/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/boost_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/octave/boost_shared_ptr.i deleted file mode 100755 index 87c89b5f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/boost_shared_ptr.i +++ /dev/null @@ -1,401 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/octave/carrays.i b/linux/bin/swig/share/swig/4.1.0/octave/carrays.i deleted file mode 100755 index 014de37f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/carrays.i +++ /dev/null @@ -1,5 +0,0 @@ -%define %array_class(TYPE,NAME) - %array_class_wrap(TYPE,NAME,__paren__,__paren_asgn__) -%enddef - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/cdata.i b/linux/bin/swig/share/swig/4.1.0/octave/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/cmalloc.i b/linux/bin/swig/share/swig/4.1.0/octave/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/director.swg b/linux/bin/swig/share/swig/4.1.0/octave/director.swg deleted file mode 100755 index 5b9cd86e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/director.swg +++ /dev/null @@ -1,146 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Octave proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -namespace Swig { - - class Director { - octave_swig_type *self; - bool swig_disowned; - - Director(const Director &x); - Director &operator=(const Director &rhs); - public: - - Director(void *vptr):self(0), swig_disowned(false) { - set_rtdir(vptr, this); - } - - ~Director() { - swig_director_destroyed(self, this); - if (swig_disowned) - self->decref(); - } - - void swig_set_self(octave_swig_type *new_self) { - assert(!swig_disowned); - self = new_self; - } - - octave_swig_type *swig_get_self() const { - return self; - } - - void swig_disown() { - if (swig_disowned) - return; - swig_disowned = true; - self->incref(); - } - }; - - // Base class for director exceptions. - class DirectorException : public std::exception { - public: - static void raise(const char *msg) { - // ... todo - throw DirectorException(); - } - - static void raise(const octave_value &ov, const char *msg) { - // ... todo - raise(msg); - } - }; - - class DirectorTypeMismatchException : public DirectorException { - public: - static void raise(const char *msg) { - // ... todo - throw DirectorTypeMismatchException(); - } - - static void raise(const octave_value &ov, const char *msg) { - // ... todo - raise(msg); - } - }; - - class DirectorPureVirtualException : public DirectorException { - public: - static void raise(const char *msg) { - // ... todo - throw DirectorPureVirtualException(); - } - - static void raise(const octave_value &ov, const char *msg) { - // ... todo - raise(msg); - } - }; - - SWIGINTERN rtdir_map *get_rtdir_map() { - static swig_module_info *module = 0; - if (!module) - module = SWIG_GetModule(0); - if (!module) - return 0; - if (!module->clientdata) - module->clientdata = new rtdir_map; - return (rtdir_map *) module->clientdata; - } - - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *d) { - rtdir_map *rm = get_rtdir_map(); - if (rm) - (*rm)[vptr] = d; - } - - SWIGINTERNINLINE void erase_rtdir(void *vptr) { - rtdir_map *rm = get_rtdir_map(); - if (rm) - (*rm).erase(vptr); - } - - SWIGINTERNINLINE Director *get_rtdir(void *vptr) { - rtdir_map *rm = get_rtdir_map(); - if (!rm) - return 0; - rtdir_map::const_iterator pos = rm->find(vptr); - Director *rtdir = (pos != rm->end())? pos->second : 0; - return rtdir; - } - - SWIGRUNTIME void swig_director_destroyed(octave_swig_type *self, Director *d) { - self->director_destroyed(d); - } - - SWIGRUNTIME octave_swig_type *swig_director_get_self(Director *d) { - return d->swig_get_self(); - } - - SWIGRUNTIME void swig_director_set_self(Director *d, octave_swig_type *self) { - d->swig_set_self(self); - } - -} - -SWIGRUNTIME void swig_acquire_ownership(void *vptr) { - // assert(0); - // ... todo -} - -SWIGRUNTIME void swig_acquire_ownership_array(void *vptr) { - // assert(0); - // ... todo -} - -SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own) { - // assert(0); - // ... todo -} diff --git a/linux/bin/swig/share/swig/4.1.0/octave/exception.i b/linux/bin/swig/share/swig/4.1.0/octave/exception.i deleted file mode 100755 index 2f0f489a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/exception.i +++ /dev/null @@ -1,14 +0,0 @@ -%include - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) -} - -%define SWIG_RETHROW_OCTAVE_EXCEPTIONS - /* rethrow any exceptions thrown by Octave */ -%#if SWIG_OCTAVE_PREREQ(4,2,0) - catch (octave::execution_exception& _e) { throw; } - catch (octave::exit_exception& _e) { throw; } - catch (octave::interrupt_exception& _e) { throw; } -%#endif -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/octave/extra-install.list b/linux/bin/swig/share/swig/4.1.0/octave/extra-install.list deleted file mode 100755 index 41ef9477..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/extra-install.list +++ /dev/null @@ -1,2 +0,0 @@ -# see top-level Makefile.in -octheaders.hpp diff --git a/linux/bin/swig/share/swig/4.1.0/octave/factory.i b/linux/bin/swig/share/swig/4.1.0/octave/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/implicit.i b/linux/bin/swig/share/swig/4.1.0/octave/implicit.i deleted file mode 100755 index 152c2b05..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/implicit.i +++ /dev/null @@ -1,7 +0,0 @@ -%include -%include - -#warning "This file provides the %implicit directive, which is an old and fragile" -#warning "way to implement the C++ implicit conversion mechanism." -#warning "Try using the more robust '%implicitconv Type;' directive instead." - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octave.swg b/linux/bin/swig/share/swig/4.1.0/octave/octave.swg deleted file mode 100755 index 872054d8..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octave.swg +++ /dev/null @@ -1,8 +0,0 @@ -%include -%include -%include -%include -%include -%include - -%define %docstring %feature("docstring") %enddef diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octcomplex.swg b/linux/bin/swig/share/swig/4.1.0/octave/octcomplex.swg deleted file mode 100755 index 553c25a3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octcomplex.swg +++ /dev/null @@ -1,92 +0,0 @@ -/* - Defines the As/From conversors for double/float complex, you need to - provide complex Type, the Name you want to use in the conversors, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from conversor */ -%define %swig_fromcplx_conv(Type, OctConstructor, Real, Imag) - %fragment(SWIG_From_frag(Type),"header") -{ - SWIGINTERNINLINE octave_value - SWIG_From(Type)(const Type& c) - { - return octave_value(OctConstructor(Real(c), Imag(c))); - } -} -%enddef - -// the double case -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) - %fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ - SWIGINTERN int - SWIG_AsVal(Type) (const octave_value& ov, Type* val) - { - if (ov.is_complex_scalar()) { - if (val) { - Complex c(ov.complex_value()); - *val=Constructor(c.real(),c.imag()); - } - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(ov, &d)); - if (SWIG_IsOK(res)) { - if (val) - *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; - } -} -%swig_fromcplx_conv(Type, Complex, Real, Imag); -%enddef - -// the float case -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) - %fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { - SWIGINTERN int - SWIG_AsVal(Type) (const octave_value& ov, Type* val) - { - if (ov.is_complex_scalar()) { - if (val) { - Complex c(ov.complex_value()); - double re = c.real(); - double im = c.imag(); - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) - *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else - return SWIG_OverflowError; - } - } else { - float d; - int res = SWIG_AddCast(SWIG_AsVal(float)(ov, &d)); - if (SWIG_IsOK(res)) { - if (val) - *val = Constructor(d, 0.0f); - return res; - } - } - return SWIG_TypeError; - } -} - -%swig_fromcplx_conv(Type, FloatComplex, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octcontainer.swg b/linux/bin/swig/share/swig/4.1.0/octave/octcontainer.swg deleted file mode 100755 index 394c90ba..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octcontainer.swg +++ /dev/null @@ -1,623 +0,0 @@ -/* ----------------------------------------------------------------------------- - * octcontainer.swg - * - * Octave cell <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Octave, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - -%include - -// The Octave C++ Wrap - -%fragment(""); - -%include - -%fragment(SWIG_Traits_frag(octave_value),"header",fragment="StdTraits") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "octave_value"; } - }; - - template <> struct traits_from { - typedef octave_value value_type; - static octave_value from(const value_type& val) { - return val; - } - }; - - template <> - struct traits_check { - static bool check(const octave_value&) { - return true; - } - }; - - template <> struct traits_asval { - typedef octave_value value_type; - static int asval(const octave_value& obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} -} - -%fragment("OctSequence_Base","header",fragment="") -{ - -namespace std { - template <> - struct less - { - bool - operator()(const octave_value& v, const octave_value& w) const - { - octave_value res = do_binary_op(octave_value::op_le,v,w); - return res.is_true(); - } - }; -} - -namespace swig { - inline size_t - check_index(ptrdiff_t i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - - throw std::out_of_range("index out of range"); - } - - inline size_t - slice_index(ptrdiff_t i, size_t size) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) { - return (size_t) (i + size); - } else { - throw std::out_of_range("index out of range"); - } - } else { - return ( (size_t) i < size ) ? ((size_t) i) : size; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (jj > ii) { - typename Sequence::const_iterator vb = self->begin(); - typename Sequence::const_iterator ve = self->begin(); - std::advance(vb,ii); - std::advance(ve,jj); - return new Sequence(vb, ve); - } else { - return new Sequence(); - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj < ii) jj = ii; - size_t ssize = jj - ii; - if (ssize <= v.size()) { - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); - std::advance(sb,ii); - std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); - } else { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj > ii) { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - } - } -} -} - -%fragment("OctSequence_Cont","header", - fragment="StdTraits", - fragment="OctSequence_Base", - fragment="OctSwigIterator_T") -{ -namespace swig -{ - template - struct OctSequence_Ref // * octave can't support these, because of how assignment works - { - OctSequence_Ref(const octave_value& seq, int index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - // swig::SwigVar_PyObject item = OctSequence_GetItem(_seq, _index); - octave_value item; // * todo - try { - return swig::as(item); - } catch (const std::exception& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", _index); - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - SWIG_Octave_AddErrorMsg(msg); - SWIG_Octave_AddErrorMsg(e.what()); - throw; - } - } - - OctSequence_Ref& operator=(const T& v) - { - // OctSequence_SetItem(_seq, _index, swig::from(v)); - // * todo - return *this; - } - - private: - octave_value _seq; - int _index; - }; - - template - struct OctSequence_ArrowProxy - { - OctSequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct OctSequence_InputIterator - { - typedef OctSequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - - OctSequence_InputIterator() - { - } - - OctSequence_InputIterator(const octave_value& seq, int index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - OctSequence_ArrowProxy - operator->() const { - return OctSequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - octave_value _seq; - difference_type _index; - }; - - template - struct OctSequence_Cont - { - typedef OctSequence_Ref reference; - typedef const OctSequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - typedef int size_type; - typedef const pointer const_pointer; - typedef OctSequence_InputIterator iterator; - typedef OctSequence_InputIterator const_iterator; - - OctSequence_Cont(const octave_value& seq) : _seq(seq) - { - // * assert that we have map type etc. - /* - if (!OctSequence_Check(seq)) { - throw std::invalid_argument("a sequence is expected"); - } - _seq = seq; - Py_INCREF(_seq); - */ - } - - ~OctSequence_Cont() - { - } - - size_type size() const - { - // return static_cast(OctSequence_Size(_seq)); - return 0; // * todo - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - int s = size(); - for (int i = 0; i < s; ++i) { - // swig::SwigVar_PyObject item = OctSequence_GetItem(_seq, i); - octave_value item; // * todo - if (!swig::check(item)) - return false; - } - return true; - } - - private: - octave_value _seq; - }; - -} -} - -%define %swig_sequence_iterator(Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - class iterator; - class reverse_iterator; - class const_iterator; - class const_reverse_iterator; - - %typemap(out,noblock=1,fragment="OctSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - $result = SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &)), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN); - } - %typemap(out,fragment="OctSequence_Cont") - std::pair, std::pair { - octave_value_list tmpc; - tmpc.append(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &).first), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN)); - tmpc.append(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &).second), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN)); - $result = Cell(tmpc); - } - - %fragment("SwigPyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="OctSequence_Cont") {} - - %typemap(out,fragment="OctPairBoolOutputIterator") - std::pair, std::pair { - octave_value_list tmpc; - tmpc.append(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &).first), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN)); - tmpc.append(SWIG_From(bool)(%static_cast($1,const $type &).second)); - $result = Cell(tmpc); - } - - %typemap(in,noblock=1,fragment="OctSequence_Cont") - iterator(swig::OctSwigIterator *iter = 0, int res), - reverse_iterator(swig::OctSwigIterator *iter = 0, int res), - const_iterator(swig::OctSwigIterator *iter = 0, int res), - const_reverse_iterator(swig::OctSwigIterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::OctSwigIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::OctSwigIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="OctSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - swig::OctSwigIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::OctSwigIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("OctSequence_Cont"); -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - -// The octave container methods - -%define %swig_container_methods(Container...) -%enddef - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - - %fragment("OctSequence_Base"); - - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - value_type __paren__(difference_type i) throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __paren_asgn__(difference_type i, value_type x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - - void append(value_type x) { - self->push_back(x); - } - } - -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="OctSequence_Cont") -{ -namespace swig { - template - inline void - assign(const OctSeq& octseq, Seq* seq) { -%#ifdef SWIG_STD_NOASSIGN_STL - typedef typename OctSeq::value_type value_type; - typename OctSeq::const_iterator it = octseq.begin(); - for (;it != octseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } -%#else - seq->assign(octseq.begin(), octseq.end()); -%#endif - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(const octave_value& obj, sequence **seq) { - if (!obj.is_defined() || Swig::swig_value_deref(obj)) { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } -%#if SWIG_OCTAVE_PREREQ(4,4,0) - } else if (obj.iscell()) { -%#else - } else if (obj.is_cell()) { -%#endif - try { - OctSequence_Cont octseq(obj); - if (seq) { - sequence *pseq = new sequence(); - assign(octseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return octseq.check() ? SWIG_OK : SWIG_ERROR; - } - } -%#if SWIG_OCTAVE_PREREQ(6,0,0) - catch (octave::execution_exception& exec) { - } -%#endif - catch (std::exception& e) { -%#if SWIG_OCTAVE_PREREQ(6,0,0) - if (seq) // Know that octave is not in an error state -%#else - if (seq&&!error_state) -%#endif - error("swig type error: %s",e.what()); - return SWIG_ERROR; - } - } - return SWIG_ERROR; - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static octave_value from(const sequence& seq) { -#ifdef SWIG_OCTAVE_EXTRA_NATIVE_CONTAINERS - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); - } -#endif - size_type size = seq.size(); - if (size <= (size_type)INT_MAX) { - Cell c(size,1); - int i = 0; - for (const_iterator it = seq.begin(); - it != seq.end(); ++it, ++i) { - c(i) = swig::from(*it); - } - return c; - } else { - error("swig overflow error: sequence size not valid in octave"); - return octave_value(); - } - return octave_value(); - } - }; -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octfragments.swg b/linux/bin/swig/share/swig/4.1.0/octave/octfragments.swg deleted file mode 100755 index 8b137891..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octfragments.swg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octheaders.hpp b/linux/bin/swig/share/swig/4.1.0/octave/octheaders.hpp deleted file mode 100755 index 26e5564d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octheaders.hpp +++ /dev/null @@ -1,130 +0,0 @@ -// -// This header includes all C++ headers required for generated Octave wrapper code. -// Using a single header file allows pre-compilation of Octave headers, as follows: -// * Check out this header file: -// swig -octave -co octheaders.hpp -// * Pre-compile header file into octheaders.hpp.gch: -// g++ -c ... octheaders.hpp -// * Use pre-compiled header file: -// g++ -c -include octheaders.hpp ... -// - -#if !defined(SWIG_OCTAVE_OCTHEADERS_HPP) -#define SWIG_OCTAVE_OCTHEADERS_HPP - -// Required C++ headers -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Minimal headers to define Octave version -#include -#include - -// Macro for enabling features which require Octave version >= major.minor.patch -// - Use (OCTAVE_PATCH_VERSION + 0) to handle both '' (released) and '+' (in development) patch numbers -#define SWIG_OCTAVE_PREREQ(major, minor, patch) \ - ( (OCTAVE_MAJOR_VERSION<<16) + (OCTAVE_MINOR_VERSION<<8) + (OCTAVE_PATCH_VERSION + 0) >= ((major)<<16) + ((minor)<<8) + (patch) ) - -// Reconstruct Octave major, minor, and patch versions for releases prior to 3.8.1 -#if !defined(OCTAVE_MAJOR_VERSION) - -# if !defined(OCTAVE_API_VERSION_NUMBER) - -// Hack to distinguish between Octave 3.8.0, which removed OCTAVE_API_VERSION_NUMBER but did not yet -// introduce OCTAVE_MAJOR_VERSION, and Octave <= 3.2, which did not define OCTAVE_API_VERSION_NUMBER -# include -# if defined(octave_ov_h) -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 8 -# define OCTAVE_PATCH_VERSION 0 -# else - -// Hack to distinguish between Octave 3.2 and earlier versions, before OCTAVE_API_VERSION_NUMBER existed -# define ComplexLU __ignore -# include -# undef ComplexLU -# if defined(octave_Complex_LU_h) - -// We know only that this version is prior to Octave 3.2, i.e. OCTAVE_API_VERSION_NUMBER < 37 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 1 -# define OCTAVE_PATCH_VERSION 99 - -# else - -// OCTAVE_API_VERSION_NUMBER == 37 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 2 -# define OCTAVE_PATCH_VERSION 0 - -# endif // defined(octave_Complex_LU_h) - -# endif // defined(octave_ov_h) - -// Correlation between Octave API and version numbers extracted from Octave's -// ChangeLogs; version is the *earliest* released Octave with that API number -# elif OCTAVE_API_VERSION_NUMBER >= 48 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 6 -# define OCTAVE_PATCH_VERSION 0 - -# elif OCTAVE_API_VERSION_NUMBER >= 45 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 4 -# define OCTAVE_PATCH_VERSION 1 - -# elif OCTAVE_API_VERSION_NUMBER >= 42 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 54 - -# elif OCTAVE_API_VERSION_NUMBER >= 41 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 53 - -# elif OCTAVE_API_VERSION_NUMBER >= 40 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 52 - -# elif OCTAVE_API_VERSION_NUMBER >= 39 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 51 - -# else // OCTAVE_API_VERSION_NUMBER == 38 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 50 - -# endif // !defined(OCTAVE_API_VERSION_NUMBER) - -#endif // !defined(OCTAVE_MAJOR_VERSION) - -// Required Octave headers -#include -#include -#include -#include -#include -#include -#include -#if SWIG_OCTAVE_PREREQ(4,2,0) -#include -#else -#include -#endif -#include -#if SWIG_OCTAVE_PREREQ(4,2,0) -#include -#endif - -#endif // !defined(SWIG_OCTAVE_OCTHEADERS_HPP) diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octiterators.swg b/linux/bin/swig/share/swig/4.1.0/octave/octiterators.swg deleted file mode 100755 index e186c94a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octiterators.swg +++ /dev/null @@ -1,357 +0,0 @@ -/* ----------------------------------------------------------------------------- - * octiterators.swg - * - * Users can derive form the OctSwigIterator to implement their - * own iterators. As an example (real one since we use it for STL/STD - * containers), the template OctSwigIterator_T does the - * implementation for generic C++ iterators. - * ----------------------------------------------------------------------------- */ - -%include - -%fragment("OctSwigIterator","header",fragment="") { -namespace swig { - struct stop_iteration { - }; - - struct OctSwigIterator { - private: - octave_value _seq; - - protected: - OctSwigIterator(octave_value seq) : _seq(seq) - { - } - - public: - virtual ~OctSwigIterator() {} - - virtual octave_value value() const = 0; - - virtual OctSwigIterator *incr(size_t n = 1) = 0; - - virtual OctSwigIterator *decr(size_t n = 1) - { - throw stop_iteration(); - } - - virtual ptrdiff_t distance(const OctSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual bool equal (const OctSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual OctSwigIterator *copy() const = 0; - - octave_value next() - { - octave_value obj = value(); - incr(); - return obj; - } - - octave_value previous() - { - decr(); - return value(); - } - - OctSwigIterator *advance(ptrdiff_t n) - { - return (n > 0) ? incr(n) : decr(-n); - } - - bool operator == (const OctSwigIterator& x) const - { - return equal(x); - } - - bool operator != (const OctSwigIterator& x) const - { - return ! operator==(x); - } - - OctSwigIterator* operator ++ () { - incr(); - return this; - } - - OctSwigIterator* operator -- () { - decr(); - return this; - } - - OctSwigIterator* operator + (ptrdiff_t n) const - { - return copy()->advance(n); - } - - OctSwigIterator* operator - (ptrdiff_t n) const - { - return copy()->advance(-n); - } - - ptrdiff_t operator - (const OctSwigIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::OctSwigIterator *"); - init = 1; - } - return desc; - } - }; -} -} - -%fragment("OctSwigIterator_T","header",fragment="",fragment="OctSwigIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - template - class OctSwigIterator_T : public OctSwigIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef OctSwigIterator_T self_type; - - OctSwigIterator_T(out_iterator curr, octave_value seq) - : OctSwigIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const OctSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const OctSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef octave_value result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - template::value_type, - typename FromOper = from_oper > - class OctSwigIteratorOpen_T : public OctSwigIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef OctSwigIterator_T base; - typedef OctSwigIteratorOpen_T self_type; - - OctSwigIteratorOpen_T(out_iterator curr, octave_value seq) - : OctSwigIterator_T(curr, seq) - { - } - - octave_value value() const { - return from(static_cast(*(base::current))); - } - - OctSwigIterator *copy() const - { - return new self_type(*this); - } - - OctSwigIterator *incr(size_t n = 1) - { - while (n--) { - ++base::current; - } - return this; - } - - OctSwigIterator *decr(size_t n = 1) - { - while (n--) { - --base::current; - } - return this; - } - }; - - template::value_type, - typename FromOper = from_oper > - class OctSwigIteratorClosed_T : public OctSwigIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef OctSwigIterator_T base; - typedef OctSwigIteratorClosed_T self_type; - - OctSwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, octave_value seq) - : OctSwigIterator_T(curr, seq), begin(first), end(last) - { - } - - octave_value value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - OctSwigIterator *copy() const - { - return new self_type(*this); - } - - OctSwigIterator *incr(size_t n = 1) - { - while (n--) { - if (base::current == end) { - throw stop_iteration(); - } else { - ++base::current; - } - } - return this; - } - - OctSwigIterator *decr(size_t n = 1) - { - while (n--) { - if (base::current == begin) { - throw stop_iteration(); - } else { - --base::current; - } - } - return this; - } - - private: - out_iterator begin; - out_iterator end; - }; - - template - inline OctSwigIterator* - make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, octave_value seq = octave_value()) - { - return new OctSwigIteratorClosed_T(current, begin, end, seq); - } - - template - inline OctSwigIterator* - make_output_iterator(const OutIter& current, octave_value seq = octave_value()) - { - return new OctSwigIteratorOpen_T(current, seq); - } -} -} - - -%fragment("OctSwigIterator"); -namespace swig -{ -// Throw a StopIteration exception - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws) stop_iteration { - error("stop_iteration exception"); - SWIG_fail; - } - -// Mark methods that return new objects - %newobject OctSwigIterator::copy; - %newobject OctSwigIterator::operator + (ptrdiff_t n) const; - %newobject OctSwigIterator::operator - (ptrdiff_t n) const; - - %nodirector OctSwigIterator; - - %catches(swig::stop_iteration) OctSwigIterator::value() const; - %catches(swig::stop_iteration) OctSwigIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) OctSwigIterator::decr(size_t n = 1); - %catches(std::invalid_argument) OctSwigIterator::distance(const OctSwigIterator &x) const; - %catches(std::invalid_argument) OctSwigIterator::equal (const OctSwigIterator &x) const; - %catches(swig::stop_iteration) OctSwigIterator::next(); - %catches(swig::stop_iteration) OctSwigIterator::previous(); - %catches(swig::stop_iteration) OctSwigIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) OctSwigIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) OctSwigIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) OctSwigIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) OctSwigIterator::operator - (ptrdiff_t n) const; - - - struct OctSwigIterator - { - protected: - OctSwigIterator(octave_value seq); - - public: - virtual ~OctSwigIterator(); - - virtual octave_value value() const = 0; - - virtual OctSwigIterator *incr(size_t n = 1) = 0; - - virtual OctSwigIterator *decr(size_t n = 1); - - virtual ptrdiff_t distance(const OctSwigIterator &x) const; - - virtual bool equal (const OctSwigIterator &x) const; - - virtual OctSwigIterator *copy() const = 0; - - octave_value next(); - octave_value previous(); - OctSwigIterator *advance(ptrdiff_t n); - - bool operator == (const OctSwigIterator& x) const; - bool operator != (const OctSwigIterator& x) const; - OctSwigIterator* operator ++ (); - OctSwigIterator* operator -- (); - OctSwigIterator* operator + (ptrdiff_t n) const; - OctSwigIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const OctSwigIterator& x) const; - }; -} - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octopers.swg b/linux/bin/swig/share/swig/4.1.0/octave/octopers.swg deleted file mode 100755 index 665b7033..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octopers.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus - -// operators supported in Octave, and the methods they are routed to - -// __brace__ a{args} -// __brace_asgn__ a{args} = rhs -// __paren__ a(args) -// __paren_asgn__ a(args) = rhs -// __str__ generates string rep - -// __not__ !a -// __uplus__ +a -// __uminus__ -a -// __transpose__ a.' -// __hermitian__ a' -// __incr__ a++ -// __decr__ a-- -// __add__ a + b -// __sub__ a - b -// __mul__ a * b -// __div__ a / b -// __pow__ a ^ b -// __ldiv__ a \ b -// __lt__ a < b -// __le__ a <= b -// __eq__ a == b -// __ge__ a >= b -// __gt__ a > b -// __ne__ a != b -// __el_mul__ a .* b -// __el_div__ a ./ b -// __el_pow__ a .^ b -// __el_ldiv__ a .\ b -// __el_and__ a & b -// __el_or__ a | b - -// operators supported in C++, and the methods that route to them - -%rename(__add__) *::operator+; -%rename(__add__) *::operator+(); -%rename(__add__) *::operator+() const; -%rename(__sub__) *::operator-; -%rename(__uminus__) *::operator-(); -%rename(__uminus__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__mod__) *::operator%; -%rename(__el_and__) *::operator&&; -%rename(__el_or__) *::operator||; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__lt__) *::operator<; -%rename(__le__) *::operator<=; -%rename(__gt__) *::operator>; -%rename(__ge__) *::operator>=; -%rename(__eq__) *::operator==; -%rename(__ne__) *::operator!=; -%rename(__not__) *::operator!; -%rename(__incr__) *::operator++; -%rename(__decr__) *::operator--; -%rename(__paren__) *::operator(); -%rename(__brace__) *::operator[]; - -// Ignored inplace operators -%ignoreoperator(PLUSEQ) operator+=; -%ignoreoperator(MINUSEQ) operator-=; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; - -// Ignored operators -%ignoreoperator(EQ) operator=; -%ignoreoperator(ARROWSTAR) operator->*; -%ignoreoperator(LSHIFT) operator<<; -%ignoreoperator(RSHIFT) operator>>; - -#endif /* __cplusplus */ diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octprimtypes.swg b/linux/bin/swig/share/swig/4.1.0/octave/octprimtypes.swg deleted file mode 100755 index 1c9aa908..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octprimtypes.swg +++ /dev/null @@ -1,254 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - - -// boolean - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE octave_value - SWIG_From_dec(bool)(bool value) -{ - return octave_value(value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(const octave_value& ov, bool *val) -{ -%#if SWIG_OCTAVE_PREREQ(4,4,0) - if (!ov.islogical()) -%#else - if (!ov.is_bool_type()) -%#endif - return SWIG_ERROR; - if (val) - *val = ov.bool_value(); - return SWIG_OK; -} -} - -// long - -%fragment(SWIG_From_frag(long),"header") { - SWIGINTERNINLINE octave_value SWIG_From_dec(long) (long value) - { - return octave_value(value); - } -} - - -%fragment(SWIG_AsVal_frag(long),"header") { - SWIGINTERN int SWIG_AsVal_dec(long)(const octave_value& ov, long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v!=floor(v)) - return SWIG_TypeError; - } - if (val) - *val = ov.long_value(); - return SWIG_OK; - } -} - -// unsigned long - -%fragment(SWIG_From_frag(unsigned long),"header") { - SWIGINTERNINLINE octave_value SWIG_From_dec(unsigned long) (unsigned long value) - { - return octave_value(value); - } -} - - -%fragment(SWIG_AsVal_frag(unsigned long),"header") { - SWIGINTERN int SWIG_AsVal_dec(unsigned long)(const octave_value& ov, unsigned long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v<0) - return SWIG_OverflowError; - if (v!=floor(v)) - return SWIG_TypeError; - } - if (ov.is_int8_type()||ov.is_int16_type()|| - ov.is_int32_type()) { - long v=ov.long_value(); - if (v<0) - return SWIG_OverflowError; - } - if (ov.is_int64_type()) { - long long v=ov.int64_scalar_value().value(); - if (v<0) - return SWIG_OverflowError; - } - if (val) - *val = ov.ulong_value(); - return SWIG_OK; - } -} - -// long long - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERNINLINE octave_value SWIG_From_dec(long long) (long long value) - { - return octave_int64(value); - } -%#endif -} - - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERN int SWIG_AsVal_dec(long long)(const octave_value& ov, long long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v!=floor(v)) - return SWIG_TypeError; - } - if (val) { - if (ov.is_int64_type()) - *val = ov.int64_scalar_value().value(); - else if (ov.is_uint64_type()) - *val = ov.uint64_scalar_value().value(); - else - *val = ov.long_value(); - } - return SWIG_OK; - } -%#endif -} - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERNINLINE octave_value SWIG_From_dec(unsigned long long) (unsigned long long value) - { - return octave_uint64(value); - } -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERN int SWIG_AsVal_dec(unsigned long long)(const octave_value& ov, unsigned long long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v<0) - return SWIG_OverflowError; - if (v!=floor(v)) - return SWIG_TypeError; - } - if (ov.is_int8_type()||ov.is_int16_type()|| - ov.is_int32_type()) { - long v=ov.long_value(); - if (v<0) - return SWIG_OverflowError; - } - if (ov.is_int64_type()) { - long long v=ov.int64_scalar_value().value(); - if (v<0) - return SWIG_OverflowError; - } - if (val) { - if (ov.is_int64_type()) - *val = ov.int64_scalar_value().value(); - else if (ov.is_uint64_type()) - *val = ov.uint64_scalar_value().value(); - else - *val = ov.long_value(); - } - return SWIG_OK; - } -%#endif -} - -// double - -%fragment(SWIG_From_frag(double),"header") { - SWIGINTERNINLINE octave_value SWIG_From_dec(double) (double value) - { - return octave_value(value); - } -} - - -%fragment(SWIG_AsVal_frag(double),"header") { - SWIGINTERN int SWIG_AsVal_dec(double)(const octave_value& ov, double* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (val) - *val = ov.double_value(); - return SWIG_OK; - } -} - -// const char* (strings) - -%fragment("SWIG_AsCharPtrAndSize","header") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(octave_value ov, char** cptr, size_t* psize, int *alloc) -{ - if ( -%#if SWIG_OCTAVE_PREREQ(4,4,0) - ov.iscell() -%#else - ov.is_cell() -%#endif - && ov.rows() == 1 && ov.columns() == 1) - ov = ov.cell_value()(0); - if (!ov.is_string()) - return SWIG_TypeError; - - std::string str=ov.string_value(); - size_t len=str.size(); - char* cstr=(char*)str.c_str(); - if (alloc) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else if (cptr) - *cptr = cstr; - if (psize) - *psize = len + 1; - return SWIG_OK; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE octave_value -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - return std::string(carray,carray+size); -} -} - - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octrun.swg b/linux/bin/swig/share/swig/4.1.0/octave/octrun.swg deleted file mode 100755 index 2973318c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octrun.swg +++ /dev/null @@ -1,1669 +0,0 @@ -#if !SWIG_OCTAVE_PREREQ(3,2,0) -#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, FS ## cname, args, nargout, doc) -#else -#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, G ## cname, args, nargout, doc) -#endif - -SWIGRUNTIME bool SWIG_check_num_args(const char *func_name, int num_args, int max_args, int min_args, int varargs) { - if (num_args > max_args && !varargs) - error("function %s takes at most %i arguments", func_name, max_args); - else if (num_args < min_args) - error("function %s requires at least %i arguments", func_name, min_args); - else - return true; - return false; -} - -SWIGRUNTIME octave_value_list *SWIG_Octave_AppendOutput(octave_value_list *ovl, const octave_value &ov) { - ovl->append(ov); - return ovl; -} - -SWIGRUNTIME octave_value SWIG_ErrorType(int code) { - switch (code) { - case SWIG_MemoryError: - return "SWIG_MemoryError"; - case SWIG_IOError: - return "SWIG_IOError"; - case SWIG_RuntimeError: - return "SWIG_RuntimeError"; - case SWIG_IndexError: - return "SWIG_IndexError"; - case SWIG_TypeError: - return "SWIG_TypeError"; - case SWIG_DivisionByZero: - return "SWIG_DivisionByZero"; - case SWIG_OverflowError: - return "SWIG_OverflowError"; - case SWIG_SyntaxError: - return "SWIG_SyntaxError"; - case SWIG_ValueError: - return "SWIG_ValueError"; - case SWIG_SystemError: - return "SWIG_SystemError"; - case SWIG_AttributeError: - return "SWIG_AttributeError"; - } - return "SWIG unknown error"; -} - -SWIGRUNTIME octave_value SWIG_Error(int code, const char *msg) { - octave_value type(SWIG_ErrorType(code)); - std::string r = msg; - r += " (" + type.string_value() + ")"; - error("%s", r.c_str()); - return octave_value(r); -} - -#define SWIG_fail goto fail - -#define SWIG_Octave_ConvertPtr(obj, pptr, type, flags) SWIG_Octave_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Octave_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Octave_ConvertPtrAndOwn(obj, pptr, type, flags, own) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Octave_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Octave_NewPointerObj(ptr, type, flags) -#define swig_owntype int - -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Octave_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Octave_NewPackedObj(ptr, sz, type) - -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Octave_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Octave_NewPackedObj(ptr, sz, type) - -#define SWIG_GetModule(clientdata) SWIG_Octave_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Octave_SetModule(clientdata,pointer); -#define SWIG_MODULE_CLIENTDATA_TYPE void* - -#define Octave_Error_Occurred() 0 -#define SWIG_Octave_AddErrorMsg(msg) {;} - -SWIGRUNTIME swig_module_info *SWIG_Octave_GetModule(void *clientdata); -SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info *pointer); - -// For backward compatibility only -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) 0 - -// Runtime API implementation - -typedef octave_value_list(*octave_func) (const octave_value_list &, int); -class octave_swig_type; - -namespace Swig { - -#ifdef SWIG_DIRECTORS - - class Director; - - typedef std::map < void *, Director * > rtdir_map; - SWIGINTERN rtdir_map* get_rtdir_map(); - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *d); - SWIGINTERNINLINE void erase_rtdir(void *vptr); - SWIGINTERNINLINE Director *get_rtdir(void *vptr); - - SWIGRUNTIME void swig_director_destroyed(octave_swig_type *self, Director *d); - SWIGRUNTIME octave_swig_type *swig_director_get_self(Director *d); - SWIGRUNTIME void swig_director_set_self(Director *d, octave_swig_type *self); - -#endif - - SWIGRUNTIME octave_base_value *swig_value_ref(octave_swig_type *ost); - SWIGRUNTIME octave_swig_type *swig_value_deref(octave_value ov); - SWIGRUNTIME octave_swig_type *swig_value_deref(const octave_base_value &ov); -} - -#ifdef SWIG_DIRECTORS -SWIGRUNTIME void swig_acquire_ownership(void *vptr); -SWIGRUNTIME void swig_acquire_ownership_array(void *vptr); -SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); -#endif - - struct swig_octave_member { - const char *name; - octave_func method; - octave_func get_method; - octave_func set_method; - int flags; // 1 static, 2 global - const char *doc; - bool is_static() const { - return flags &1; - } bool is_global() const { - return flags &2; - } - }; - - struct swig_octave_class { - const char *name; - swig_type_info **type; - int director; - octave_func constructor; - const char *constructor_doc; - octave_func destructor; - const swig_octave_member *members; - const char **base_names; - const swig_type_info **base; - }; - -#if SWIG_OCTAVE_PREREQ(4,4,0) - // in Octave 4.4 behaviour of octave_builtin() appears to have changed and 'self' argument is no longer passed - // to function (maybe because this is now a 'method'??) so need to create our own octave_function subclass -#define SWIG_OCTAVE_BOUND_FUNC(func, args) octave_value(new octave_swig_bound_func(func, args)) - class octave_swig_bound_func : public octave_function { - public: - - octave_swig_bound_func(void) : octave_function(), method(0), first_args() - { } - - octave_swig_bound_func(octave_function* _method, octave_value_list _first_args) - : octave_function("", ""), method(_method), first_args(_first_args) - { } - - octave_swig_bound_func(const octave_swig_bound_func& f) = delete; - - octave_swig_bound_func& operator= (const octave_swig_bound_func& f) = delete; - - ~octave_swig_bound_func(void) = default; - - bool is_function(void) const { return true; } - - octave_function* function_value(bool = false) { return this; } - -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave_value_list call(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { - return execute(tw,nargout,args); - } -#endif -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave_value_list execute(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { -#else - octave_value_list call(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { -#endif - octave_value_list all_args; - all_args.append(first_args); - all_args.append(args); - return method->call(tw, nargout, all_args); - } - - octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) { - octave_value_list ovl = subsref(ops, idx, 1); - return ovl.length() ? ovl(0) : octave_value(); - } - - octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) { - assert(ops.size() > 0); - assert(ops.size() == idx.size()); - if (ops != "(") - error("invalid function call"); - octave::tree_evaluator& tw = octave::interpreter::the_interpreter()->get_evaluator(); - return call(tw, nargout, *idx.begin()); - } - - protected: - - octave_function* method; - octave_value_list first_args; - - std::set dispatch_classes; - - }; -#else -#define SWIG_OCTAVE_BOUND_FUNC(func, args) octave_value(func) -#endif - - // octave_swig_type plays the role of both the shadow class and the class - // representation within Octave, since there is no support for classes. - // - // These should really be decoupled, with the class support added to Octave - // and the shadow class given by an m-file script. That would dramatically - // reduce the runtime complexity, and be more in line w/ other modules. - - class octave_swig_type:public octave_base_value { - struct cpp_ptr { - void *ptr; - bool destroyed; - cpp_ptr(void *_ptr):ptr(_ptr), destroyed(false) { - }}; - typedef std::pair < const swig_type_info *, cpp_ptr > type_ptr_pair; - - mutable swig_module_info *module; - - const swig_type_info *construct_type; // type of special type object - std::vector < type_ptr_pair > types; // our c++ base classes - int thisown; // whether we call c++ destructors when we die - - typedef std::pair < const swig_octave_member *, octave_value > member_value_pair; - typedef std::map < std::string, member_value_pair > member_map; - member_map members; - bool always_static; - - const swig_octave_member *find_member(const swig_type_info *type, const std::string &name) { - if (!type->clientdata) - return 0; - swig_octave_class *c = (swig_octave_class *) type->clientdata; - const swig_octave_member *m; - for (m = c->members; m->name; ++m) - if (m->name == name) - return m; - for (int j = 0; c->base_names[j]; ++j) { - if (!c->base[j]) { - if (!module) - module = SWIG_GetModule(0); - assert(module); - c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]); - } - if (!c->base[j]) - return 0; - if ((m = find_member(c->base[j], name))) - return m; - } - return 0; - } - - member_value_pair *find_member(const std::string &name, bool insert_if_not_found) { - member_map::iterator it = members.find(name); - if (it != members.end()) - return &it->second; - const swig_octave_member *m; - for (unsigned int j = 0; j < types.size(); ++j) - if ((m = find_member(types[j].first, name))) - return &members.insert(std::make_pair(name, std::make_pair(m, octave_value()))).first->second; - if (!insert_if_not_found) - return 0; - return &members[name]; - } - - const swig_type_info *find_base(const std::string &name, const swig_type_info *base) { - if (!base) { - for (unsigned int j = 0; j < types.size(); ++j) { - assert(types[j].first->clientdata); - swig_octave_class *cj = (swig_octave_class *) types[j].first->clientdata; - if (cj->name == name) - return types[j].first; - } - return 0; - } - assert(base->clientdata); - swig_octave_class *c = (swig_octave_class *) base->clientdata; - for (int j = 0; c->base_names[j]; ++j) { - if (!c->base[j]) { - if (!module) - module = SWIG_GetModule(0); - assert(module); - c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]); - } - if (!c->base[j]) - return 0; - assert(c->base[j]->clientdata); - swig_octave_class *cj = (swig_octave_class *) c->base[j]->clientdata; - if (cj->name == name) - return c->base[j]; - } - return 0; - } - - void load_members(const swig_octave_class* c,member_map& out) const { - for (const swig_octave_member *m = c->members; m->name; ++m) { - if (out.find(m->name) == out.end()) - out.insert(std::make_pair(m->name, std::make_pair(m, octave_value()))); - } - for (int j = 0; c->base_names[j]; ++j) { - if (!c->base[j]) { - if (!module) - module = SWIG_GetModule(0); - assert(module); - c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]); - } - if (!c->base[j]) - continue; - assert(c->base[j]->clientdata); - const swig_octave_class *cj = - (const swig_octave_class *) c->base[j]->clientdata; - load_members(cj,out); - } - } - - void load_members(member_map& out) const { - out=members; - for (unsigned int j = 0; j < types.size(); ++j) - if (types[j].first->clientdata) - load_members((const swig_octave_class *) types[j].first->clientdata, out); - } - - octave_value_list member_invoke(member_value_pair *m, const octave_value_list &args, int nargout) { - if (m->second.is_defined()) - return m->second.subsref("(", std::list < octave_value_list > (1, args), nargout); - else if (m->first && m->first->method) - return m->first->method(args, nargout); - error("member not defined or not invocable"); - return octave_value_list(); - } - - bool dispatch_unary_op(const std::string &symbol, octave_value &ret) const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - member_value_pair *m = nc_this->find_member(symbol, false); - if (!m || m->first->is_static() || m->first->is_global()) - return false; - octave_value_list args; - args.append(nc_this->as_value()); - octave_value_list argout(nc_this->member_invoke(m, args, 1)); - if (argout.length() < 1) - return false; - ret = argout(0); - return true; - } - - bool dispatch_binary_op(const std::string &symbol, const octave_base_value &rhs, octave_value &ret) const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - member_value_pair *m = nc_this->find_member(symbol, false); - if (!m || m->first->is_static() || m->first->is_global()) - return false; - octave_value_list args; - args.append(nc_this->as_value()); - args.append(make_value_hack(rhs)); - octave_value_list argout(nc_this->member_invoke(m, args, 1)); - if (argout.length() < 1) - return false; - ret = argout(0); - return true; - } - - bool dispatch_index_op(const std::string &symbol, const octave_value_list &rhs, octave_value_list &ret) const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - member_value_pair *m = nc_this->find_member(symbol, false); - if (!m || m->first->is_static() || m->first->is_global()) - return false; - octave_value_list args; - args.append(nc_this->as_value()); - args.append(rhs); - octave_value_list argout(nc_this->member_invoke(m, args, 1)); - if (argout.length() >= 1) - ret = argout(0); - return true; - } - - octave_value_list member_deref(member_value_pair *m, const octave_value_list &args) { - if (m->second.is_defined()) { - if (m->second.is_function() || m->second.is_function_handle()) { - return SWIG_OCTAVE_BOUND_FUNC(m->second.function_value(), args); - } else { - return m->second; - } - } else if (m->first) { - if (m->first->get_method) - return m->first->get_method(args, 1); - else if (m->first->method) - return SWIG_OCTAVE_BOUND_FUNC(new octave_builtin(m->first->method), args); - } - error("undefined member"); - return octave_value_list(); - } - - static octave_value make_value_hack(const octave_base_value &x) { - ((octave_swig_type &) x).count++; - return octave_value((octave_base_value *) &x); - } - - octave_swig_type(const octave_swig_type &x); - octave_swig_type &operator=(const octave_swig_type &rhs); - public: - - octave_swig_type(void *_ptr = 0, const swig_type_info *_type = 0, int _own = 0, - bool _always_static = false) - : module(0), construct_type(_ptr ? 0 : _type), thisown(_own), - always_static(_always_static) { - if (_type || _ptr) - types.push_back(std::make_pair(_type, _ptr)); -#ifdef SWIG_DIRECTORS - if (_ptr) { - Swig::Director *d = Swig::get_rtdir(_ptr); - if (d) - Swig::swig_director_set_self(d, this); - } -#endif - } - - ~octave_swig_type() { - if (thisown) { - ++count; - for (unsigned int j = 0; j < types.size(); ++j) { - if (!types[j].first || !types[j].first->clientdata) - continue; - swig_octave_class *c = (swig_octave_class *) types[j].first->clientdata; - if (c->destructor && !types[j].second.destroyed && types[j].second.ptr) { - c->destructor(as_value(), 0); - } - } - } -#ifdef SWIG_DIRECTORS - for (unsigned int j = 0; j < types.size(); ++j) - Swig::erase_rtdir(types[j].second.ptr); -#endif - } - - dim_vector dims(void) const { - octave_value out; - if (!dispatch_unary_op("__dims__", out)) - return dim_vector(1,1); - - // Return value should be cell or matrix of integers -#if SWIG_OCTAVE_PREREQ(4,4,0) - if (out.iscell()) { -#else - if (out.is_cell()) { -#endif - const Cell & c=out.cell_value(); - int ndim = c.rows(); - if (ndim==1 && c.columns()!=1) ndim = c.columns(); - - dim_vector d; - d.resize(ndim < 2 ? 2 : ndim); - d(0) = d(1) = 1; - - // Fill in dim_vector - for (int k=0;k a; - try { - a = out.int_vector_value(); - } - catch (octave::execution_exception& oee) { - return dim_vector(1,1); - } -#else - Array a = out.int_vector_value(); - if (error_state) return dim_vector(1,1); -#endif - dim_vector d; - d.resize(a.numel() < 2 ? 2 : a.numel()); - d(0) = d(1) = 1; - for (int k=0;kclientdata) - return 0; - swig_octave_class *c = (swig_octave_class *) types[0].first->clientdata; - return c->constructor_doc; - } - - std::string swig_type_name() const { - // * need some way to manually name subclasses. - // * eg optional first arg to subclass(), or named_subclass() - std::string ret; - for (unsigned int j = 0; j < types.size(); ++j) { - if (j) - ret += "_"; - if (types[j].first->clientdata) { - swig_octave_class *c = (swig_octave_class *) types[j].first->clientdata; - ret += c->name; - } else - ret += types[j].first->name; - } - return ret; - } - - void merge(octave_swig_type &rhs) { - rhs.thisown = 0; - for (unsigned int j = 0; j < rhs.types.size(); ++j) { - assert(!rhs.types[j].second.destroyed); -#ifdef SWIG_DIRECTORS - Swig::Director *d = Swig::get_rtdir(rhs.types[j].second.ptr); - if (d) - Swig::swig_director_set_self(d, this); -#endif - } - types.insert(types.end(), rhs.types.begin(), rhs.types.end()); - members.insert(rhs.members.begin(), rhs.members.end()); -#if SWIG_OCTAVE_PREREQ(4,4,0) - assign(rhs.swig_type_name(), rhs.as_value()); -#else - rhs.types.clear(); - rhs.members.clear(); -#endif - } - - typedef member_map::const_iterator swig_member_const_iterator; - swig_member_const_iterator swig_members_begin() { return members.begin(); } - swig_member_const_iterator swig_members_end() { return members.end(); } - - int cast(void **vptr, swig_type_info *type, int *own, int flags) { - int res = SWIG_ERROR; - int clear_pointer = 0; - - if (own) - *own = 0; - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !thisown) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (own) - *own = *own | thisown; - if (flags & SWIG_POINTER_DISOWN) { - thisown = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - clear_pointer = 1; - } - } - - if (!type && types.size()) { - if (vptr) { - *vptr = types[0].second.ptr; - if (clear_pointer) - types[0].second.ptr = 0; - } - return SWIG_OK; - } - for (unsigned int j = 0; j < types.size(); ++j) - if (type == types[j].first) { - if (vptr) { - *vptr = types[j].second.ptr; - if (clear_pointer) - types[j].second.ptr = 0; - } - return SWIG_OK; - } - for (unsigned int j = 0; j < types.size(); ++j) { - swig_cast_info *tc = SWIG_TypeCheck(types[j].first->name, type); - if (!tc) - continue; - if (vptr) { - int newmemory = 0; - *vptr = SWIG_TypeCast(tc, types[j].second.ptr, &newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - if (clear_pointer) - types[j].second.ptr = 0; - } - res = SWIG_OK; - break; - } - return res; - } - - bool is_owned() const { - return thisown; - } - -#ifdef SWIG_DIRECTORS - void director_destroyed(Swig::Director *d) { - bool found = false; - for (unsigned int j = 0; j < types.size(); ++j) { - Swig::Director *dj = Swig::get_rtdir(types[j].second.ptr); - if (dj == d) { - types[j].second.destroyed = true; - found = true; - } - } - assert(found); - } -#endif - - void assign(const std::string &name, const octave_value &ov) { - members[name] = std::make_pair((const swig_octave_member *) 0, ov); - } - - void assign(const std::string &name, const swig_octave_member *m) { - members[name] = std::make_pair(m, octave_value()); - } - - octave_base_value *clone() const { - // pass-by-value is probably not desired, and is harder; - // requires calling copy constructors of contained types etc. - assert(0); - *(int *) 0 = 0; - return 0; - } - - octave_base_value *empty_clone() const { - return new octave_swig_type(); - } - - bool is_defined() const { - return true; - } - -#if SWIG_OCTAVE_PREREQ(6,0,0) - virtual bool isstruct() const { -#else - virtual bool is_map() const { -#endif - return true; - } - - virtual octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) { - octave_value_list ovl = subsref(ops, idx, 1); - return ovl.length()? ovl(0) : octave_value(); - } - - virtual octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) { - assert(ops.size() > 0); - assert(ops.size() == idx.size()); - - std::list < octave_value_list >::const_iterator idx_it = idx.begin(); - int skip = 0; - octave_value_list sub_ovl; - - // constructor invocation - if (ops[skip] == '(' && construct_type) { - assert(construct_type->clientdata); - swig_octave_class *c = (swig_octave_class *) construct_type->clientdata; - if (!c->constructor) { - error("cannot create instance"); - return octave_value_list(); - } - octave_value_list args; - if (c->director) - args.append(Swig::swig_value_ref(new octave_swig_type(this, 0, 0))); - args.append(*idx_it++); - ++skip; - sub_ovl = c->constructor(args, nargout); - } - // member dereference or invocation - else if (ops[skip] == '.') { - std::string subname; - const swig_type_info *base = 0; // eg, a.base.base_cpp_mem - for (;;) { - octave_value_list subname_ovl(*idx_it++); - ++skip; - assert(subname_ovl.length() == 1 && subname_ovl(0).is_string()); - subname = subname_ovl(0).string_value(); - - const swig_type_info *next_base = find_base(subname, base); - if (!next_base || skip >= (int) ops.size() || ops[skip] != '.') - break; - base = next_base; - } - - member_value_pair tmp, *m = &tmp; - if (!base || !(m->first = find_member(base, subname))) - m = find_member(subname, false); - if (!m) { - error("member not found"); - return octave_value_list(); - } - - octave_value_list args; - if (!always_static && - (!m->first || (!m->first->is_static() && !m->first->is_global()))) - args.append(as_value()); - if (skip < (int) ops.size() && ops[skip] == '(' && - ((m->first && m->first->method) || m->second.is_function() || - m->second.is_function_handle())) { - args.append(*idx_it++); - ++skip; - sub_ovl = member_invoke(m, args, nargout); - } else { - sub_ovl = member_deref(m, args); - } - } - // index operator - else { - if (ops[skip] == '(' || ops[skip] == '{') { - const char *op_name = ops[skip] == '(' ? "__paren__" : "__brace__"; - octave_value_list args; - args.append(*idx_it++); - ++skip; - if (!dispatch_index_op(op_name, args, sub_ovl)) { - error("error evaluating index operator"); - return octave_value_list(); - } - } else { - error("unsupported subsref"); - return octave_value_list(); - } - } - - if (skip >= (int) ops.size()) - return sub_ovl; - if (sub_ovl.length() < 1) { - error("bad subs ref"); - return octave_value_list(); - } - return sub_ovl(0).next_subsref(nargout, ops, idx, skip); - } - - octave_value subsasgn(const std::string &ops, const std::list < octave_value_list > &idx, const octave_value &rhs) { - assert(ops.size() > 0); - assert(ops.size() == idx.size()); - - std::list < octave_value_list >::const_iterator idx_it = idx.begin(); - int skip = 0; - - if (ops.size() > 1) { - std::list < octave_value_list >::const_iterator last = idx.end(); - --last; - std::list < octave_value_list > next_idx(idx.begin(), last); - octave_value next_ov = subsref(ops.substr(0, ops.size() - 1), next_idx); - next_ov.subsasgn(ops.substr(ops.size() - 1), std::list < octave_value_list > (1, *last), rhs); - } - - else if (ops[skip] == '(' || ops[skip] == '{') { - const char *op_name = ops[skip] == '(' ? "__paren_asgn__" : "__brace_asgn__"; - member_value_pair *m = find_member(op_name, false); - if (m) { - octave_value_list args; - args.append(as_value()); - args.append(*idx_it); - args.append(rhs); - member_invoke(m, args, 1); - } else - error("%s member not found", op_name); - } - - else if (ops[skip] == '.') { - octave_value_list subname_ovl(*idx_it++); - ++skip; - assert(subname_ovl.length() == 1 &&subname_ovl(0).is_string()); - std::string subname = subname_ovl(0).string_value(); - - member_value_pair *m = find_member(subname, true); - if (!m->first || !m->first->set_method) { - m->first = 0; - m->second = rhs; - } else if (m->first->set_method) { - octave_value_list args; - if (!m->first->is_static() && !m->first->is_global()) - args.append(as_value()); - args.append(rhs); - m->first->set_method(args, 1); - } else - error("member not assignable"); - } else - error("unsupported subsasgn"); - - return as_value(); - } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - virtual bool isobject() const { -#else - virtual bool is_object() const { -#endif - return true; - } - - virtual bool is_string() const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - return !!nc_this->find_member("__str__", false); - } - - virtual std::string string_value(bool force = false) const { - octave_value ret; - if (!dispatch_unary_op("__str__", ret)) { - error("__str__ method not defined"); - return std::string(); - } - if (!ret.is_string()) { - error("__str__ method did not return a string"); - return std::string(); - } - return ret.string_value(); - } - - virtual double scalar_value(bool frc_str_conv = false) const { - octave_value ret; - if (!dispatch_unary_op("__float__", ret)) { - error("__float__ method not defined"); - } - return ret.scalar_value(); - } - -#if SWIG_OCTAVE_PREREQ(4,2,0) - virtual octave_value as_double(void) const { - octave_value ret; - if (!dispatch_unary_op("__float__", ret)) { - error("__float__ method not defined"); - } - return ret.as_double(); - } - - virtual octave_value as_single(void) const { - octave_value ret; - if (!dispatch_unary_op("__float__", ret)) { - error("__float__ method not defined"); - } - return ret.as_single(); - } -#endif - -#if SWIG_OCTAVE_PREREQ(3,8,0) - virtual octave_value map(octave_base_value::unary_mapper_t umap) const { - const std::string opname = std::string("__") + octave_base_value::get_umap_name(umap) + std::string("__"); - octave_value ret; - if (!dispatch_unary_op(opname, ret)) { - error("%s", (opname + std::string(" method not found")).c_str()); - return octave_value(); - } - return ret; - } -#endif - -#if SWIG_OCTAVE_PREREQ(3,3,52) - virtual octave_map map_value() const { - return octave_map(); - } -#else - virtual Octave_map map_value() const { - return Octave_map(); - } -#endif - - virtual string_vector map_keys() const { - member_map tmp; - load_members(tmp); - - string_vector keys(tmp.size()); - int k = 0; - for (member_map::iterator it = tmp.begin(); it != tmp.end(); ++it) - keys(k++) = it->first; - - return keys; - } - - virtual bool save_ascii (std::ostream& os) { - return true; - } - - virtual bool load_ascii (std::istream& is) { - return true; - } - - virtual bool save_binary (std::ostream& os, bool& save_as_floats) { - return true; - } - - virtual bool load_binary (std::istream& is, bool swap, -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::mach_info::float_format fmt) { -#else - oct_mach_info::float_format fmt) { -#endif - return true; - } - -#if defined (HAVE_HDF5) -# if SWIG_OCTAVE_PREREQ(4,0,0) - virtual bool - save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# else - virtual bool - save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# endif -#endif - - virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const { - return string_value(); - } - - virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const { - return string_value(); - } - - static bool dispatch_global_op(const std::string &symbol, const octave_value_list &args, octave_value &ret) { - // we assume that SWIG_op_prefix-prefixed functions are installed in global namespace - // (rather than any module namespace). - - octave_function *fcn = is_valid_function(symbol, std::string(), false); - if (!fcn) - return false; -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::tree_evaluator& tw = octave::interpreter::the_interpreter()->get_evaluator(); - octave_value_list retval = fcn->call(tw, 1, args); - if (retval.length() == 1) - ret = retval(0); -#else - ret = fcn->do_multi_index_op(1, args)(0); -#endif - return true; - } - - static octave_value dispatch_unary_op(const octave_base_value &x, const char *op_name) { - octave_swig_type *ost = Swig::swig_value_deref(x); - assert(ost); - - octave_value ret; - if (ost->dispatch_unary_op(std::string("__") + op_name + std::string("__"), ret)) - return ret; - std::string symbol = SWIG_op_prefix + ost->swig_type_name() + "_" + op_name; - octave_value_list args; - args.append(make_value_hack(x)); - if (dispatch_global_op(symbol, args, ret)) - return ret; - - error("could not dispatch unary operator"); - return octave_value(); - } - - static octave_value dispatch_binary_op(const octave_base_value &lhs, const octave_base_value &rhs, const char *op_name) { - octave_swig_type *lhs_ost = Swig::swig_value_deref(lhs); - octave_swig_type *rhs_ost = Swig::swig_value_deref(rhs); - - octave_value ret; - if (lhs_ost && lhs_ost->dispatch_binary_op(std::string("__") + op_name + std::string("__"), rhs, ret)) - return ret; - if (rhs_ost) { - if (strlen(op_name) == 2 && (op_name[1] == 't' || op_name[1] == 'e')) { - if (op_name[0] == 'l' && rhs_ost->dispatch_binary_op(std::string("__g") + op_name[1] + std::string("__"), lhs, ret)) - return ret; - if (op_name[0] == 'g' && rhs_ost->dispatch_binary_op(std::string("__l") + op_name[1] + std::string("__"), lhs, ret)) - return ret; - } - if (rhs_ost->dispatch_binary_op(std::string("__r") + op_name + std::string("__"), lhs, ret)) - return ret; - } - - std::string symbol; - octave_value_list args; - args.append(make_value_hack(lhs)); - args.append(make_value_hack(rhs)); - - symbol = SWIG_op_prefix; - symbol += lhs_ost ? lhs_ost->swig_type_name() : lhs.type_name(); - symbol += "_"; - symbol += op_name; - symbol += "_"; - symbol += rhs_ost ? rhs_ost->swig_type_name() : rhs.type_name(); - if (dispatch_global_op(symbol, args, ret)) - return ret; - - symbol = SWIG_op_prefix; - symbol += lhs_ost ? lhs_ost->swig_type_name() : lhs.type_name(); - symbol += "_"; - symbol += op_name; - symbol += "_"; - symbol += "any"; - if (dispatch_global_op(symbol, args, ret)) - return ret; - - symbol = SWIG_op_prefix; - symbol += "any"; - symbol += "_"; - symbol += op_name; - symbol += "_"; - symbol += rhs_ost ? rhs_ost->swig_type_name() : rhs.type_name(); - if (dispatch_global_op(symbol, args, ret)) - return ret; - - error("could not dispatch binary operator"); - return octave_value(); - } - -#if SWIG_OCTAVE_PREREQ(4,0,0) - void print(std::ostream &os, bool pr_as_read_syntax = false) -#else - void print(std::ostream &os, bool pr_as_read_syntax = false) const -#endif - { - if (is_string()) { - os << string_value(); - return; - } - - member_map tmp; - load_members(tmp); - - indent(os); - os << "{"; newline(os); - increment_indent_level(); - for (unsigned int j = 0; j < types.size(); ++j) { - indent(os); - if (types[j].first->clientdata) { - const swig_octave_class *c = (const swig_octave_class *) types[j].first->clientdata; - os << c->name << ", ptr = " << types[j].second.ptr; newline(os); - } else { - os << types[j].first->name << ", ptr = " << types[j].second.ptr; newline(os); - } - } - for (member_map::const_iterator it = tmp.begin(); it != tmp.end(); ++it) { - indent(os); - if (it->second.first) { - const char *objtype = it->second.first->method ? "method" : "variable"; - const char *modifier = (it->second.first->flags &1) ? "static " : (it->second.first->flags &2) ? "global " : ""; - os << it->second.first->name << " (" << modifier << objtype << ")"; newline(os); - assert(it->second.first->name == it->first); - } else { - os << it->first; newline(os); - } - } - decrement_indent_level(); - indent(os); - os << "}"; newline(os); - } - }; - - // Octave tries hard to preserve pass-by-value semantics. Eg, assignments - // will call clone() via make_unique() if there is more than one outstanding - // reference to the lhs, and forces the clone's reference count to 1 - // (so you can't just increment your own count and return this). - // - // One way to fix this (without modifying Octave) is to add a level of - // indirection such that clone copies ref-counted pointer and we keep - // pass-by-ref semantics (which are more natural/expected for C++ bindings). - // - // Supporting both pass-by-{ref,value} and toggling via %feature/option - // might be nice. - - class octave_swig_ref:public octave_base_value { - octave_swig_type *ptr; - public: - octave_swig_ref(octave_swig_type *_ptr = 0) - :ptr(_ptr) - { - // Ensure type_id() is set correctly - if (t_id == -1) { - t_id = octave_swig_ref::static_type_id(); - } - } - - ~octave_swig_ref() - { if (ptr) ptr->decref(); } - - octave_swig_type *get_ptr() const - { return ptr; } - - octave_base_value *clone() const - { if (ptr) ptr->incref(); return new octave_swig_ref(ptr); } - - octave_base_value *empty_clone() const - { return new octave_swig_ref(0); } - - dim_vector dims(void) const - { return ptr->dims(); } - - bool is_defined() const - { return ptr->is_defined(); } - -#if SWIG_OCTAVE_PREREQ(6,0,0) - virtual bool isstruct() const - { return ptr->isstruct(); } -#else - virtual bool is_map() const - { return ptr->is_map(); } -#endif - - virtual octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) - { return ptr->subsref(ops, idx); } - - virtual octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) - { return ptr->subsref(ops, idx, nargout); } - - octave_value subsasgn(const std::string &ops, const std::list < octave_value_list > &idx, const octave_value &rhs) - { return ptr->subsasgn(ops, idx, rhs); } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - virtual bool isobject() const - { return ptr->isobject(); } -#else - virtual bool is_object() const - { return ptr->is_object(); } -#endif - - virtual bool is_string() const - { return ptr->is_string(); } - - virtual std::string string_value(bool force = false) const - { return ptr->string_value(force); } - - virtual double scalar_value(bool frc_str_conv = false) const - { return ptr->scalar_value(frc_str_conv); } - -#if SWIG_OCTAVE_PREREQ(4,2,0) - virtual octave_value as_double(void) const - { return ptr->as_double(); } - - virtual octave_value as_single(void) const - { return ptr->as_single(); } -#endif - -#if SWIG_OCTAVE_PREREQ(3,8,0) - virtual octave_value map(octave_base_value::unary_mapper_t umap) const - { return ptr->map(umap); } -#endif - -#if SWIG_OCTAVE_PREREQ(3,3,52) - virtual octave_map map_value() const - { return ptr->map_value(); } -#else - virtual Octave_map map_value() const - { return ptr->map_value(); } -#endif - - virtual string_vector map_keys() const - { return ptr->map_keys(); } - - virtual bool save_ascii (std::ostream& os) - { return ptr->save_ascii(os); } - - virtual bool load_ascii (std::istream& is) - { return ptr->load_ascii(is); } - - virtual bool save_binary (std::ostream& os, bool& save_as_floats) - { return ptr->save_binary(os, save_as_floats); } - - virtual bool load_binary (std::istream& is, bool swap, -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::mach_info::float_format fmt) -#else - oct_mach_info::float_format fmt) -#endif - { return ptr->load_binary(is, swap, fmt); } - -#if defined (HAVE_HDF5) -# if SWIG_OCTAVE_PREREQ(4,0,0) - virtual bool - save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) - { return ptr->save_hdf5(loc_id, name, save_as_floats); } - - virtual bool - load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) - { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); } -# else - virtual bool - save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) - { return ptr->save_hdf5(loc_id, name, save_as_floats); } - - virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) - { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); } -# endif -#endif - - virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const - { return ptr->convert_to_str(pad, force, type); } - - virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const - { return ptr->convert_to_str_internal(pad, force, type); } - -#if SWIG_OCTAVE_PREREQ(4,0,0) - void print(std::ostream &os, bool pr_as_read_syntax = false) -#else - void print(std::ostream &os, bool pr_as_read_syntax = false) const -#endif - { return ptr->print(os, pr_as_read_syntax); } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - static void set_type_id(int type_id) { t_id=type_id; } -#endif - - virtual type_conv_info numeric_conversion_function(void) const { - return octave_base_value::type_conv_info (default_numeric_conversion_function, - octave_scalar::static_type_id ()); - } - - private: - static octave_base_value *default_numeric_conversion_function (const octave_base_value& a) { - const octave_swig_ref& v = dynamic_cast(a); - return new octave_scalar(v.scalar_value()); - } - -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DECLARE_OCTAVE_ALLOCATOR; -#endif - DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; - }; -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DEFINE_OCTAVE_ALLOCATOR(octave_swig_ref); -#endif - DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_ref, "swig_ref", "swig_ref"); - - class octave_swig_packed:public octave_base_value { - swig_type_info *type; - std::vector < char > buf; - public: - - octave_swig_packed(swig_type_info *_type = 0, const void *_buf = 0, size_t _buf_len = 0) - : type(_type), buf((const char*)_buf, (const char*)_buf + _buf_len) - { - // Ensure type_id() is set correctly - if (t_id == -1) { - t_id = octave_swig_packed::static_type_id(); - } - } - - bool copy(swig_type_info *outtype, void *ptr, size_t sz) const { - if (outtype && outtype != type) - return false; - assert(sz <= buf.size()); - std::copy(buf.begin(), buf.begin()+sz, (char*)ptr); - return true; - } - - octave_base_value *clone() const { - return new octave_swig_packed(*this); - } - - octave_base_value *empty_clone() const { - return new octave_swig_packed(); - } - - bool is_defined() const { - return true; - } - -#if SWIG_OCTAVE_PREREQ(4,0,0) - void print(std::ostream &os, bool pr_as_read_syntax = false) -#else - void print(std::ostream &os, bool pr_as_read_syntax = false) const -#endif - { - indent(os); - os << "swig packed type: name = " << (type ? type->name : std::string()) << ", len = " << buf.size(); newline(os); - } - - - virtual bool save_ascii (std::ostream& os) { - return true; - } - - virtual bool load_ascii (std::istream& is) { - return true; - } - - virtual bool save_binary (std::ostream& os, bool& save_as_floats) { - return true; - } - - virtual bool load_binary (std::istream& is, bool swap, -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::mach_info::float_format fmt) { -#else - oct_mach_info::float_format fmt) { -#endif - return true; - } - -#if defined (HAVE_HDF5) -# if SWIG_OCTAVE_PREREQ(4,0,0) - virtual bool - save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# else - virtual bool - save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# endif -#endif - -#if SWIG_OCTAVE_PREREQ(4,4,0) - static void set_type_id(int type_id) { t_id=type_id; } -#endif - - private: -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DECLARE_OCTAVE_ALLOCATOR; -#endif - DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; - }; -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DEFINE_OCTAVE_ALLOCATOR(octave_swig_packed); -#endif - DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_packed, "swig_packed", "swig_packed"); - - SWIGRUNTIME octave_value_list octave_set_immutable(const octave_value_list &args, int nargout) { - error("attempt to set immutable member variable"); - return octave_value_list(); - } - - struct octave_value_ref { - const octave_value_list &ovl; - int j; - - octave_value_ref(const octave_value_list &_ovl, int _j) - :ovl(_ovl), j(_j) { } - - operator octave_value() const { - return ovl(j); - } - - octave_value operator*() const { - return ovl(j); - } - }; - - -namespace Swig { - - SWIGRUNTIME octave_base_value *swig_value_ref(octave_swig_type *ost) { - return new octave_swig_ref(ost); - } - - SWIGRUNTIME octave_swig_type *swig_value_deref(octave_value ov) { - if ( -#if SWIG_OCTAVE_PREREQ(4,4,0) - ov.iscell() -#else - ov.is_cell() -#endif - && ov.rows() == 1 && ov.columns() == 1) - ov = ov.cell_value()(0); - return swig_value_deref(*ov.internal_rep()); - } - - SWIGRUNTIME octave_swig_type *swig_value_deref(const octave_base_value &ov) { - if (ov.type_id() != octave_swig_ref::static_type_id()) - return 0; - const octave_swig_ref *osr = static_cast < const octave_swig_ref *>(&ov); - return osr->get_ptr(); - } - -} - - -#define swig_unary_op(name) \ -SWIGRUNTIME octave_value swig_unary_op_##name(const octave_base_value &x) { \ - return octave_swig_type::dispatch_unary_op(x,#name); \ -} -#define swig_binary_op(name) \ -SWIGRUNTIME octave_value swig_binary_op_##name(const octave_base_value&lhs,const octave_base_value &rhs) { \ - return octave_swig_type::dispatch_binary_op(lhs,rhs,#name); \ -} -#if SWIG_OCTAVE_PREREQ(4,4,0) -#define swigreg_unary_op(name) \ -if (!octave_value_typeinfo::lookup_unary_op(octave_value::op_##name,tid)) \ -typeinfo.register_unary_op(octave_value::op_##name,tid,swig_unary_op_##name); -#else -#define swigreg_unary_op(name) \ -if (!octave_value_typeinfo::lookup_unary_op(octave_value::op_##name,tid)) \ -octave_value_typeinfo::register_unary_op(octave_value::op_##name,tid,swig_unary_op_##name); -#endif -#if SWIG_OCTAVE_PREREQ(4,4,0) -#define swigreg_binary_op(name) \ -if (!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2)) \ -typeinfo.register_binary_op(octave_value::op_##name,tid1,tid2,swig_binary_op_##name); -#else -#define swigreg_binary_op(name) \ -if (!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2)) \ -octave_value_typeinfo::register_binary_op(octave_value::op_##name,tid1,tid2,swig_binary_op_##name); -#endif - - swig_unary_op(not); - swig_unary_op(uplus); - swig_unary_op(uminus); - swig_unary_op(transpose); - swig_unary_op(hermitian); - swig_unary_op(incr); - swig_unary_op(decr); - - swig_binary_op(add); - swig_binary_op(sub); - swig_binary_op(mul); - swig_binary_op(div); - swig_binary_op(pow); - swig_binary_op(ldiv); -#if !SWIG_OCTAVE_PREREQ(4,2,0) - swig_binary_op(lshift); - swig_binary_op(rshift); -#endif - swig_binary_op(lt); - swig_binary_op(le); - swig_binary_op(eq); - swig_binary_op(ge); - swig_binary_op(gt); - swig_binary_op(ne); - swig_binary_op(el_mul); - swig_binary_op(el_div); - swig_binary_op(el_pow); - swig_binary_op(el_ldiv); - swig_binary_op(el_and); - swig_binary_op(el_or); - - SWIGRUNTIME void SWIG_InstallUnaryOps(int tid) { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::type_info& typeinfo = octave::interpreter::the_interpreter()->get_type_info(); -#endif - swigreg_unary_op(not); - swigreg_unary_op(uplus); - swigreg_unary_op(uminus); - swigreg_unary_op(transpose); - swigreg_unary_op(hermitian); - swigreg_unary_op(incr); - swigreg_unary_op(decr); - } - SWIGRUNTIME void SWIG_InstallBinaryOps(int tid1, int tid2) { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::type_info& typeinfo = octave::interpreter::the_interpreter()->get_type_info(); -#endif - swigreg_binary_op(add); - swigreg_binary_op(sub); - swigreg_binary_op(mul); - swigreg_binary_op(div); - swigreg_binary_op(pow); - swigreg_binary_op(ldiv); -#if !SWIG_OCTAVE_PREREQ(4,2,0) - swigreg_binary_op(lshift); - swigreg_binary_op(rshift); -#endif - swigreg_binary_op(lt); - swigreg_binary_op(le); - swigreg_binary_op(eq); - swigreg_binary_op(ge); - swigreg_binary_op(gt); - swigreg_binary_op(ne); - swigreg_binary_op(el_mul); - swigreg_binary_op(el_div); - swigreg_binary_op(el_pow); - swigreg_binary_op(el_ldiv); - swigreg_binary_op(el_and); - swigreg_binary_op(el_or); - } - SWIGRUNTIME void SWIG_InstallOps(int tid) { - // here we assume that tid are conseq integers increasing from zero, and - // that our tid is the last one. might be better to have explicit string - // list of types we should bind to, and use lookup_type to resolve their tid. - - SWIG_InstallUnaryOps(tid); - SWIG_InstallBinaryOps(tid, tid); - for (int j = 0; j < tid; ++j) { - SWIG_InstallBinaryOps(j, tid); - SWIG_InstallBinaryOps(tid, j); - } - } - -SWIGRUNTIME octave_value SWIG_Octave_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - int own = (flags &SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - - if (ptr) { -#ifdef SWIG_DIRECTORS - Swig::Director *d = Swig::get_rtdir(ptr); - if (d && Swig::swig_director_get_self(d)) - return Swig::swig_director_get_self(d)->as_value(); -#endif - return Swig::swig_value_ref(new octave_swig_type(ptr, type, own)); - } - return octave_value(Matrix()); // null matrix -} - -SWIGRUNTIME int SWIG_Octave_ConvertPtrAndOwn(octave_value ov, void **ptr, swig_type_info *type, int flags, int *own) { - if ( -#if SWIG_OCTAVE_PREREQ(4,4,0) - ov.iscell() -#else - ov.is_cell() -#endif - && ov.rows() == 1 && ov.columns() == 1) - ov = ov.cell_value()(0); - if (!ov.is_defined() || - (ov.is_matrix_type() && ov.rows() == 0 && ov.columns() == 0) ) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - if (ov.type_id() != octave_swig_ref::static_type_id()) - return SWIG_ERROR; - octave_swig_ref *osr = static_cast < octave_swig_ref *>(ov.internal_rep()); - octave_swig_type *ost = osr->get_ptr(); - return ost->cast(ptr, type, own, flags); -} - -SWIGRUNTIME octave_value SWIG_Octave_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return new octave_swig_packed(type, (char *) ptr, sz); -} - -SWIGRUNTIME int SWIG_Octave_ConvertPacked(const octave_value &ov, void *ptr, size_t sz, swig_type_info *type) { - if (!ov.is_defined()) - return SWIG_ERROR; - if (ov.type_id() != octave_swig_packed::static_type_id()) - return SWIG_ERROR; - octave_swig_packed *ost = static_cast < octave_swig_packed *>(ov.internal_rep()); - return ost->copy(type, (char *) ptr, sz) ? SWIG_OK : SWIG_ERROR; -} - -SWIGRUNTIMEINLINE void SWIG_Octave_SetConstant(octave_swig_type *module_ns, const std::string &name, const octave_value &ov) { - module_ns->assign(name, ov); -} - -SWIGRUNTIMEINLINE octave_value SWIG_Octave_GetGlobalValue(std::string name) { -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::interpreter *interp = octave::interpreter::the_interpreter (); - return interp->global_varval(name); -#else -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - return symtab.global_varval(name); -#else - return get_global_value(name, true); -#endif -#endif -} - -SWIGRUNTIME void SWIG_Octave_SetGlobalValue(std::string name, const octave_value& value) { -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::interpreter *interp = octave::interpreter::the_interpreter (); - interp->global_assign(name, value); -#elif SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - symtab.global_assign(name, value); -#else - set_global_value(name, value); -#endif -} - -SWIGRUNTIME void SWIG_Octave_LinkGlobalValue(std::string name) { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_scope symscope = octave::interpreter::the_interpreter()->get_current_scope(); -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::interpreter *interp = octave::interpreter::the_interpreter (); - interp->assign(name, interp->global_varval(name)); - octave::tree_evaluator& tree_eval = interp->get_evaluator(); - octave::call_stack& callStack = tree_eval.get_call_stack(); - std::shared_ptr stackFrame = callStack.get_current_stack_frame(); - octave::symbol_record sym=symscope.lookup_symbol(name); - stackFrame->mark_global(sym); -#else - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - symscope.assign(name, symtab.global_varval(name)); - symscope.mark_global(name); -#endif -#else -#if !SWIG_OCTAVE_PREREQ(3,2,0) - link_to_global_variable(curr_sym_tab->lookup(name, true)); -#else -#if !SWIG_OCTAVE_PREREQ(3,8,0) - symbol_table::varref(name); -#endif - symbol_table::mark_global(name); -#endif -#endif -} - -SWIGRUNTIME swig_module_info *SWIG_Octave_GetModule(void *clientdata) { - octave_value ov = SWIG_Octave_GetGlobalValue("__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME SWIG_RUNTIME_VERSION); - if (!ov.is_defined() || - ov.type_id() != octave_swig_packed::static_type_id()) - return 0; - const octave_swig_packed* osp = - static_cast < const octave_swig_packed *> (ov.internal_rep()); - swig_module_info *pointer = 0; - osp->copy(0, &pointer, sizeof(swig_module_info *)); - return pointer; -} - -SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info *pointer) { - octave_value ov = new octave_swig_packed(0, &pointer, sizeof(swig_module_info *)); - SWIG_Octave_SetGlobalValue("__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME SWIG_RUNTIME_VERSION, ov); -} diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octruntime.swg b/linux/bin/swig/share/swig/4.1.0/octave/octruntime.swg deleted file mode 100755 index e76151f1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octruntime.swg +++ /dev/null @@ -1,425 +0,0 @@ -#ifdef SWIG_OCTAVE_EXTERNAL_OCTHEADERS -%insert(runtime) %{ -#include "octheaders.hpp" -%} -#else -%insert(runtime) "octheaders.hpp"; -#endif - -%insert(runtime) "swigrun.swg"; -%insert(runtime) "swigerrors.swg"; -%insert(runtime) "octrun.swg"; - -%insert(initbeforefunc) "swiginit.swg" - -%insert(initbeforefunc) %{ - -static bool SWIG_init_user(octave_swig_type* module_ns); - -SWIGINTERN bool SWIG_Octave_LoadModule(std::string name) { - bool retn = false; - { -#if SWIG_OCTAVE_PREREQ(6,0,0) -#elif SWIG_OCTAVE_PREREQ(4,2,0) - octave::unwind_protect frame; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#elif SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect frame; - frame.protect_var(error_state); error_state = 0; - frame.protect_var(warning_state); warning_state = 0; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#else - unwind_protect::begin_frame("SWIG_Octave_LoadModule"); - unwind_protect_int(error_state); error_state = 0; - unwind_protect_int(warning_state); warning_state = 0; - unwind_protect_bool(discard_error_messages); discard_error_messages = true; - unwind_protect_bool(discard_warning_messages); discard_warning_messages = true; -#endif -#if SWIG_OCTAVE_PREREQ(4,2,0) - try { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::feval(name, octave_value_list(), 0); -#else - feval(name, octave_value_list(), 0); -#endif - retn = true; - } catch (octave::execution_exception&) { } -#else - feval(name, octave_value_list(), 0); - retn = (error_state == 0); -#endif -#if !SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect::run_frame("SWIG_Octave_LoadModule"); -#endif - } - if (!retn) { - error(SWIG_name_d ": could not load module `%s'", name.c_str()); - } - return retn; -} - -SWIGINTERN bool SWIG_Octave_InstallFunction(octave_function *octloadfcn, std::string name) { - bool retn = false; - { -#if SWIG_OCTAVE_PREREQ(6,0,0) -#elif SWIG_OCTAVE_PREREQ(4,2,0) - octave::unwind_protect frame; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#elif SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect frame; - frame.protect_var(error_state); error_state = 0; - frame.protect_var(warning_state); warning_state = 0; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#else - unwind_protect::begin_frame("SWIG_Octave_InstallFunction"); - unwind_protect_int(error_state); error_state = 0; - unwind_protect_int(warning_state); warning_state = 0; - unwind_protect_bool(discard_error_messages); discard_error_messages = true; - unwind_protect_bool(discard_warning_messages); discard_warning_messages = true; -#endif - octave_value_list args; - args.append(name); - args.append(octloadfcn->fcn_file_name()); -#if SWIG_OCTAVE_PREREQ(4,2,0) - try { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::feval("autoload", args, 0); -#else - feval("autoload", args, 0); -#endif - retn = true; - } catch (octave::execution_exception&) { } -#else - feval("autoload", args, 0); - retn = (error_state == 0); -#endif -#if !SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect::run_frame("SWIG_Octave_InstallFunction"); -#endif - } - if (!retn) { - error(SWIG_name_d ": could not load function `%s'", name.c_str()); - } - return retn; -} - -static const char *const subclass_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} subclass()\n\ -@deftypefnx{Loadable Function} {} subclass(@var{swigclass}, @var{name}, @var{fcn}, @dots{})\n\ -Subclass a C++ class from within Octave, and provide implementations of its virtual methods.\n\ -\n\ -See the SWIG manual for usage examples.\n\ -@end deftypefn"; - -DEFUN_DLD( subclass, args, nargout, subclass_usage ) { - octave_swig_type *top = new octave_swig_type; - for (int j = 0; j < args.length(); ++j) { - if (args(j).type_id() == octave_swig_ref::static_type_id()) { - octave_swig_ref *osr = static_cast < octave_swig_ref *>(args(j).internal_rep()); - octave_swig_type *ost = osr->get_ptr(); - if (!ost->is_owned()) { - error("subclass: cannot subclass object not constructed on octave side"); - return octave_value_list(); - } - top->merge(*ost); - } else if (args(j).is_function_handle()) { - top->assign(args(j).fcn_handle_value()->fcn_name(), args(j)); - } else if (args(j).is_string()) { - if (j + 1 >= args.length()) { - error("subclass: member assignments must be of string,value form"); - return octave_value_list(); - } - top->assign(args(j).string_value(), args(j + 1)); - ++j; - } else { - error("subclass: invalid arguments to subclass()"); - return octave_value_list(); - } - } - return octave_value(Swig::swig_value_ref(top)); -} - -static const char *const swig_type_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_type(@var{swigref})\n\ -Return the underlying C/C++ type name of a SWIG-wrapped object.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_type, args, nargout, swig_type_usage ) { - if (args.length() != 1) { - error("swig_type: must be called with only a single object"); - return octave_value_list(); - } - octave_swig_type *ost = Swig::swig_value_deref(args(0)); - if (!ost) { - error("swig_type: object is not a swig_ref"); - return octave_value_list(); - } - return octave_value(ost->swig_type_name()); -} - -static const char *const swig_typequery_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_typequery(@var{string})\n\ -Return @var{string} if it is a recognised SWIG-wrapped C/C++ type name;\n\ -otherwise return `'.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_typequery, args, nargout, swig_typequery_usage ) { - if (args.length() != 1 || !args(0).is_string()) { - error("swig_typequery: must be called with single string argument"); - return octave_value_list(); - } - swig_module_info *module = SWIG_GetModule(0); - swig_type_info *type = SWIG_TypeQueryModule(module, module, args(0).string_value().c_str()); - if (!type) - return octave_value(""); - return octave_value(type->name); -} - -static const char *const swig_this_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_this(@var{swigref})\n\ -Return the underlying C/C++ pointer of a SWIG-wrapped object.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_this, args, nargout, swig_this_usage ) { - if (args.length() != 1) { - error("swig_this: must be called with only a single object"); - return octave_value_list(); - } - if (args(0).is_matrix_type() && args(0).rows() == 0 && args(0).columns() == 0) - return octave_value(octave_uint64(0)); - octave_swig_type *ost = Swig::swig_value_deref(args(0)); - if (!ost) { - error("swig_this: object is not a swig_ref"); - return octave_value_list(); - } - return octave_value(octave_uint64((unsigned long long) ost->swig_this())); -} - -static const char *const swig_octave_prereq_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_octave_prereq(@var{major}, @var{minor}, @var{patch})\n\ -Return true if the version of Octave is at least @var{major}.@var{minor}.@var{patch}.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_octave_prereq, args, nargout, swig_octave_prereq_usage ) { - if (args.length() != 3) { - error("swig_octave_prereq: must be called with 3 arguments"); - return octave_value_list(); - } - const int major = args(0).int_value(); - const int minor = args(1).int_value(); - const int patch = args(2).int_value(); - const bool prereq = SWIG_OCTAVE_PREREQ(major, minor, patch); - return octave_value(prereq); -} - -static const char *const swig_exit_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_exit([@var{exit_status}])\n\ -Exit Octave without performing any memory cleanup.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_exit, args, nargout, swig_exit_usage ) { - if (args.length() > 1) { - error("swig_exit: must be called with at most one arguments"); - return octave_value_list(); - } - int exit_status = 0; - if (args.length() == 1) { - exit_status = args(0).int_value(); - } - ::_Exit(exit_status); - return octave_value(); -} - -static const char *const SWIG_name_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Module} {} " SWIG_name_d "\n\ -Loads the SWIG-generated module `" SWIG_name_d "'.\n\ -@end deftypefn"; - -DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) { - - static octave_swig_type* module_ns = 0; - - // workaround to prevent octave seg-faulting on exit: set Octave exit function - // octave_exit to _Exit, which exits immediately without trying to cleanup memory. - // definitely affected version 3.2.*, not sure about 3.3.*, seems to be fixed in - // version 3.4.*, reappeared in 4.2.*, hack not possible in 4.4.* or later due to - // removal of octave_exit, so turn on for all versions between 3.2.*. and 4.4.*. - // can be turned off with macro definition. -#ifndef SWIG_OCTAVE_NO_SEGFAULT_HACK -#if !SWIG_OCTAVE_PREREQ(4,4,0) -#if SWIG_OCTAVE_PREREQ(3,2,0) - octave_exit = ::_Exit; -#endif -#endif -#endif - - // check for no input and output args - if (args.length() != 0 || nargout != 0) { - print_usage(); - return octave_value_list(); - } - - // create module on first function call - if (!module_ns) { - - // workaround bug in octave where installing global variable of custom type and then - // exiting without explicitly clearing the variable causes octave to segfault. -#if SWIG_OCTAVE_PREREQ(3,2,0) - octave_value_list eval_args; - eval_args.append("base"); - eval_args.append("function __swig_atexit__; " - " if mislocked() " - " clear -all; " - " else " - " mlock(); " - " endif; " - "endfunction; " - "__swig_atexit__; " - "atexit(\"__swig_atexit__\", false); " - "atexit(\"__swig_atexit__\")"); -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::feval("evalin", eval_args, 0); -#else - feval("evalin", eval_args, 0); -#endif -#endif - -#if SWIG_OCTAVE_PREREQ(4,4,0) - { - octave::type_info& typeinfo = octave::interpreter::the_interpreter()->get_type_info(); - string_vector types = typeinfo.installed_type_names(); - bool register_octave_swig_ref = true; - bool register_octave_swig_packed = true; - for (int i = 0; i < types.numel(); ++i) { - if (types(i) == octave_swig_ref::static_type_name()) { - register_octave_swig_ref = false; - octave_swig_ref::set_type_id(i); - } - if (types(i) == octave_swig_packed::static_type_name()) { - register_octave_swig_packed = false; - octave_swig_packed::set_type_id(i); - } - } - if (register_octave_swig_ref) { - octave_swig_ref::register_type(); - } - if (register_octave_swig_packed) { - octave_swig_packed::register_type(); - } - } -#else - octave_swig_ref::register_type(); - octave_swig_packed::register_type(); -#endif - SWIG_InitializeModule(0); - SWIG_PropagateClientData(); - -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::tree_evaluator& tree_eval = octave::interpreter::the_interpreter()->get_evaluator(); - octave::call_stack& stack = tree_eval.get_call_stack(); - octave_function *me = stack.current_function(); -#elif SWIG_OCTAVE_PREREQ(4,4,0) - octave::call_stack& stack = octave::interpreter::the_interpreter()->get_call_stack(); - octave_function *me = stack.current(); -#else - octave_function *me = octave_call_stack::current(); -#endif - - if (!SWIG_Octave_InstallFunction(me, "subclass")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_type")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_typequery")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_this")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_octave_prereq")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_exit")) { - return octave_value_list(); - } - - octave_swig_type* cvar_ns=0; - if (std::string(SWIG_global_name) != ".") { - cvar_ns=new octave_swig_type; - for (int j=0;swig_globals[j].name;++j) - if (swig_globals[j].get_method) - cvar_ns->assign(swig_globals[j].name,&swig_globals[j]); - } - - module_ns=new octave_swig_type(0, 0, 0, true); - if (std::string(SWIG_global_name) != ".") { - module_ns->assign(SWIG_global_name,Swig::swig_value_ref(cvar_ns)); - } - else { - for (int j=0;swig_globals[j].name;++j) - if (swig_globals[j].get_method) - module_ns->assign(swig_globals[j].name,&swig_globals[j]); - } - for (int j=0;swig_globals[j].name;++j) - if (swig_globals[j].method) - module_ns->assign(swig_globals[j].name,&swig_globals[j]); - - // * need better solution here; swig_type -> octave_class mapping is - // * really n-to-1, in some cases such as template partial spec, etc. - // * see failing tests. - for (int j=0;swig_types[j];++j) - if (swig_types[j]->clientdata) { - swig_octave_class* c=(swig_octave_class*)swig_types[j]->clientdata; - module_ns->assign(c->name, - Swig::swig_value_ref - (new octave_swig_type(0,swig_types[j]))); - } - - if (!SWIG_init_user(module_ns)) { - delete module_ns; - module_ns=0; - return octave_value_list(); - } - - SWIG_InstallOps(octave_swig_ref::static_type_id()); - - octave_swig_type::swig_member_const_iterator mb; - for (mb = module_ns->swig_members_begin(); mb != module_ns->swig_members_end(); ++mb) { - if (mb->second.first && mb->second.first->method) { - if (!SWIG_Octave_InstallFunction(me, mb->first)) { - return octave_value_list(); - } - } - } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::interpreter::the_interpreter()->mlock(); -#elif SWIG_OCTAVE_PREREQ(3,2,0) - mlock(); -#else - mlock(me->name()); -#endif - - } - - octave_swig_type::swig_member_const_iterator mb; - for (mb = module_ns->swig_members_begin(); mb != module_ns->swig_members_end(); ++mb) { - if (mb->second.second.is_defined()) { - SWIG_Octave_SetGlobalValue(mb->first, mb->second.second); - SWIG_Octave_LinkGlobalValue(mb->first); - } - } - - SWIG_Octave_SetGlobalValue(SWIG_name_d, module_ns->as_value()); - SWIG_Octave_LinkGlobalValue(SWIG_name_d); - - return octave_value_list(); - -} - -%} diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octstdcommon.swg b/linux/bin/swig/share/swig/4.1.0/octave/octstdcommon.swg deleted file mode 100755 index 80b2154d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octstdcommon.swg +++ /dev/null @@ -1,222 +0,0 @@ -%fragment("StdTraits","header",fragment="StdTraitsCommon") -{ -namespace swig { -// Traits that provides the from method - template struct traits_from_ptr { - static octave_value from(Type *val, int owner = 0) { - return SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static octave_value from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static octave_value from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static octave_value from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline octave_value from(const Type& val) { - return traits_from::from(val); - } - - template - inline octave_value from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - // Traits that provides the asval/as/check method - template - struct traits_asptr { - static int asptr(const octave_value& obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(const octave_value& obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(const octave_value& obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(const octave_value& obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(const octave_value& obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(const octave_value& obj) { - Type v; - int res = asval(obj, &v); - if (!obj.is_defined() || !SWIG_IsOK(res)) { - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(const octave_value& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(const octave_value& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(const octave_value& obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(const octave_value& obj) { - int res = asval(obj, (Type *)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(const octave_value& obj) { - int res = asptr(obj, (Type **)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(const octave_value& obj) { - return traits_check::category>::check(obj); - } -} -} - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(const octave_value& obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static octave_value from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(const octave_value& obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef - - -#define specialize_std_vector(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_list(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_deque(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octtypemaps.swg b/linux/bin/swig/share/swig/4.1.0/octave/octtypemaps.swg deleted file mode 100755 index 4984fddf..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octtypemaps.swg +++ /dev/null @@ -1,99 +0,0 @@ - -// Include fundamental fragment definitions -%include - -// Look for user fragments file. -%include - -// Octave fragments for primitive types -%include - -// Octave fragments for char* strings -//%include - - -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - -// Octave types -#define SWIG_Object octave_value -#define VOID_Object octave_value() - -/* -// Octave allows implicit conversion -#define %implicitconv_flag $implicitconv -*/ - -// append output -#define SWIG_AppendOutput(result, obj) SWIG_Octave_AppendOutput(result, obj) - -// set constant -#define SWIG_SetConstant(name, obj) SWIG_Octave_SetConstant(module_ns,name,obj) - -// raise -%runtime %{ -SWIGINTERN void SWIG_Octave_Raise(const octave_value &obj, const char *type) { - if (obj.is_string()) - error("%s", obj.string_value().c_str()); - else - error("C++ side threw an exception of type %s", type); -} -%} -#define SWIG_Raise(obj, type, desc) SWIG_Octave_Raise(obj, type) - -// Include the unified typemap library -%include - -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) SWIG_Object "$1 = (*$input).is_defined();"; -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) octave_value_list "$1 = true;"; - -%typemap(in) (octave_value_list varargs,...) { - for (int j=$argnum-1;jappend($1); -} -%typemap(out,noblock=1) octave_map, Octave_map { - $result=$1; -} -%typemap(out,noblock=1) NDArray { - $result=$1; -} -%typemap(out,noblock=1) Cell { - $result=$1; -} - -/* -// Smart Pointers -%typemap(out,noblock=1) const SWIGTYPE & SMARTPOINTER { - $result = SWIG_NewPointerObj(%new_copy(*$1, $*ltype), $descriptor, SWIG_POINTER_OWN | %newpointer_flags); -} - -%typemap(ret) const SWIGTYPE & SMARTPOINTER, SWIGTYPE SMARTPOINTER { - octave_swig_type* lobj=Swig::swig_value_deref($result); - if (lobj) { - std::list idx; - idx.push_back(octave_value("__deref__")); - idx.push_back(octave_value_list()); - octave_value_list ovl(lobj->subsref(".(",idx)); - octave_swig_type* robj=ovl.length()>=1?Swig::swig_value_deref(ovl(0)):0; - if (robj && !error_state) - lobj->append(robj); - } -} -*/ diff --git a/linux/bin/swig/share/swig/4.1.0/octave/octuserdir.swg b/linux/bin/swig/share/swig/4.1.0/octave/octuserdir.swg deleted file mode 100755 index ebb11b3a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/octuserdir.swg +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------------------------------------- - * Special user directives - * ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ -/* - Implicit Conversion using the C++ constructor mechanism -*/ - -#define %implicitconv %feature("implicitconv") -#define %noimplicitconv %feature("implicitconv", "0") -#define %clearimplicitconv %feature("implicitconv", "") - - -/* ------------------------------------------------------------------------- */ -/* - %extend_smart_pointer extend the smart pointer support. - - For example, if you have a smart pointer as: - - template class RCPtr { - public: - ... - RCPtr(Type *p); - Type * operator->() const; - ... - }; - - you use the %extend_smart_pointer directive as: - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - - then, if you have something like: - - RCPtr make_ptr(); - int foo(A *); - - you can do the following: - - a = make_ptr(); - b = foo(a); - - ie, swig will accept a RCPtr object where a 'A *' is - expected. - - Also, when using vectors - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - %template(vector_A) std::vector >; - - you can type - - a = A(); - v = vector_A(2) - v[0] = a - - ie, an 'A *' object is accepted, via implicit conversion, - where a RCPtr object is expected. Additionally - - x = v[0] - - returns (and sets 'x' as) a copy of v[0], making reference - counting possible and consistent. -*/ - -%define %extend_smart_pointer(Type...) -%implicitconv Type; -%apply const SWIGTYPE& SMARTPOINTER { const Type& }; -%apply SWIGTYPE SMARTPOINTER { Type }; -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_alloc.i b/linux/bin/swig/share/swig/4.1.0/octave/std_alloc.i deleted file mode 100755 index 35dc051b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/octave/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_basic_string.i b/linux/bin/swig/share/swig/4.1.0/octave/std_basic_string.i deleted file mode 100755 index 01a2c34a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_basic_string.i +++ /dev/null @@ -1,64 +0,0 @@ -#if !defined(SWIG_STD_STRING) -#define SWIG_STD_BASIC_STRING -#define SWIG_STD_MODERN_STL - -%include - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(octave_value obj, std::string **val) { - if (obj.is_string()) { - if (val) - *val = new std::string(obj.string_value()); - return SWIG_NEWOBJ; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromCharPtrAndSize") { -SWIGINTERNINLINE octave_value - SWIG_From(std::basic_string)(const std::string& s) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } -} - -%ignore std::basic_string::operator +=; - -%include -%typemaps_asptrfromn(%checkcode(STRING), std::basic_string); - -#endif - - -#if !defined(SWIG_STD_WSTRING) - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsWCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(octave_value obj, std::wstring **val) { - if (obj.is_string()) { - if (val) - *val = new std::wstring(obj.string_value()); - return SWIG_NEWOBJ; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromWCharPtrAndSize") { -SWIGINTERNINLINE PyObject* - SWIG_From(std::basic_string)(const std::wstring& s) { - return SWIG_FromWCharPtrAndSize(s.data(), s.size()); - } -} - -%typemaps_asptrfromn(%checkcode(UNISTRING), std::basic_string); - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_carray.i b/linux/bin/swig/share/swig/4.1.0/octave/std_carray.i deleted file mode 100755 index e69de29b..00000000 diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_char_traits.i b/linux/bin/swig/share/swig/4.1.0/octave/std_char_traits.i deleted file mode 100755 index bf4e6c47..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_common.i b/linux/bin/swig/share/swig/4.1.0/octave/std_common.i deleted file mode 100755 index c8f17ba7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_common.i +++ /dev/null @@ -1,72 +0,0 @@ -%include -%include - - -// Generate the traits for a 'primitive' type, such as 'double', -// for which the SWIG_AsVal and SWIG_From methods are already defined. - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(octave_value obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static octave_value from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(octave_value obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static octave_value from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_complex.i b/linux/bin/swig/share/swig/4.1.0/octave/std_complex.i deleted file mode 100755 index 461e2fdf..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_complex.i +++ /dev/null @@ -1,25 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); - - - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_container.i b/linux/bin/swig/share/swig/4.1.0/octave/std_container.i deleted file mode 100755 index cab76452..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_deque.i b/linux/bin/swig/share/swig/4.1.0/octave/std_deque.i deleted file mode 100755 index c40cfee1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_deque.i +++ /dev/null @@ -1,25 +0,0 @@ -// Deques - -%fragment("StdDequeTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(octave_value obj, std::deque **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static octave_value from(const std::deque& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_except.i b/linux/bin/swig/share/swig/4.1.0/octave/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_list.i b/linux/bin/swig/share/swig/4.1.0/octave/std_list.i deleted file mode 100755 index 35f6c132..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_list.i +++ /dev/null @@ -1,26 +0,0 @@ -// Lists - -%fragment("StdListTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const octave_value& obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static octave_value *from(const std::list& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_map.i b/linux/bin/swig/share/swig/4.1.0/octave/std_map.i deleted file mode 100755 index fd15661c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_map.i +++ /dev/null @@ -1,157 +0,0 @@ -// Maps - -%include - -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") -{ - namespace swig { - template - struct from_key_oper - { - typedef const ValueType& argument_type; - typedef octave_value result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.first); - } - }; - - template - struct from_value_oper - { - typedef const ValueType& argument_type; - typedef octave_value result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.second); - } - }; - - template - struct OctMapIterator_T : OctSwigIteratorClosed_T - { - OctMapIterator_T(OutIterator curr, OutIterator first, OutIterator last, octave_value seq) - : OctSwigIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct OctMapKeyIterator_T : OctMapIterator_T - { - OctMapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, octave_value seq) - : OctMapIterator_T(curr, first, last, seq) - { - } - }; - - template - inline OctSwigIterator* - make_output_key_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, octave_value seq = octave_value()) - { - return new OctMapKeyIterator_T(current, begin, end, seq); - } - - template > - struct OctMapValueIterator_T : OctMapIterator_T - { - OctMapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, octave_value seq) - : OctMapIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline OctSwigIterator* - make_output_value_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, octave_value seq = 0) - { - return new OctMapValueIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const OctSeq& octseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename OctSeq::const_iterator it = octseq.begin(); - for (;it != octseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::map map_type; - static int asptr(octave_value obj, map_type **val) { - /* - int res = SWIG_ERROR; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - map_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - */ - return SWIG_ERROR; - } - }; - - template - struct traits_from > { - typedef std::map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static octave_value from(const map_type& map) { - /* - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - size_type size = map.size(); - int pysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (pysize < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_OverflowError, - "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - return obj; - } - */ - return octave_value(); - } - }; - } -} - -%define %swig_map_common(Map...) - %swig_sequence_iterator(Map); - %swig_container_methods(Map); -%enddef - -%define %swig_map_methods(Map...) - %swig_map_common(Map) -%enddef - - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_pair.i b/linux/bin/swig/share/swig/4.1.0/octave/std_pair.i deleted file mode 100755 index 2f307380..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_pair.i +++ /dev/null @@ -1,147 +0,0 @@ -// Pairs - -%include - -//#define SWIG_STD_PAIR_ASVAL - -%fragment("StdPairTraits","header",fragment="StdTraits") { - namespace swig { -#ifdef SWIG_STD_PAIR_ASVAL - template - struct traits_asval > { - typedef std::pair value_type; - - static int get_pair(const octave_value& first, octave_value second, - std::pair *val) - { - if (val) { - T *pfirst = &(val->first); - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) - return res1; - U *psecond = &(val->second); - int res2 = swig::asval(second, psecond); - if (!SWIG_IsOK(res2)) - return res2; - return res1 > res2 ? res1 : res2; - } else { - T *pfirst = 0; - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) - return res1; - U *psecond = 0; - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) - return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asval(const octave_value& obj, std::pair *val) { - if ( -%#if SWIG_OCTAVE_PREREQ(4,4,0) - obj.iscell() -%#else - obj.is_cell() -%#endif - ) { - Cell c=obj.cell_value(); - if (c.numel()<2) { - error("pair from Cell array requires at least two elements"); - return SWIG_ERROR; - } - return get_pair(c(0),c(1),val); - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) - *val = *p; - return res; - } - return SWIG_ERROR; - } - }; - -#else - template - struct traits_asptr > { - typedef std::pair value_type; - - static int get_pair(const octave_value& first, octave_value second, - std::pair **val) - { - if (val) { - value_type *vp = %new_instance(std::pair); - T *pfirst = &(vp->first); - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) { - %delete(vp); - return res1; - } - U *psecond = &(vp->second); - int res2 = swig::asval(second, psecond); - if (!SWIG_IsOK(res2)) { - %delete(vp); - return res2; - } - *val = vp; - return SWIG_AddNewMask(res1 > res2 ? res1 : res2); - } else { - T *pfirst = 0; - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) - return res1; - U *psecond = 0; - int res2 = swig::asval(second, psecond); - if (!SWIG_IsOK(res2)) - return res2; - return res1 > res2 ? res1 : res2; - } - return SWIG_ERROR; - } - - static int asptr(const octave_value& obj, std::pair **val) { - if ( -%#if SWIG_OCTAVE_PREREQ(4,4,0) - obj.iscell() -%#else - obj.is_cell() -%#endif - ) { - Cell c=obj.cell_value(); - if (c.numel()<2) { - error("pair from Cell array requires at least two elements"); - return SWIG_ERROR; - } - return get_pair(c(0),c(1),val); - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) - *val = p; - return res; - } - return SWIG_ERROR; - } - }; - -#endif - template - struct traits_from > { - static octave_value from(const std::pair& val) { - Cell c(1,2); - c(0)=swig::from(val.first); - c(1)=swig::from(val.second); - return c; - } - }; - } -} - -%define %swig_pair_methods(pair...) -%enddef - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/octave/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_string.i b/linux/bin/swig/share/swig/4.1.0/octave/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/octave/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_vector.i b/linux/bin/swig/share/swig/4.1.0/octave/std_vector.i deleted file mode 100755 index 2862b5e7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_vector.i +++ /dev/null @@ -1,26 +0,0 @@ -// Vectors - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const octave_value& obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static octave_value from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/std_wstring.i b/linux/bin/swig/share/swig/4.1.0/octave/std_wstring.i deleted file mode 100755 index dc1378ae..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/std_wstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/stl.i b/linux/bin/swig/share/swig/4.1.0/octave/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/octave/swigmove.i b/linux/bin/swig/share/swig/4.1.0/octave/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/octave/typemaps.i b/linux/bin/swig/share/swig/4.1.0/octave/typemaps.i deleted file mode 100755 index 1f9b9c43..00000000 --- a/linux/bin/swig/share/swig/4.1.0/octave/typemaps.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/Makefile.in b/linux/bin/swig/share/swig/4.1.0/perl5/Makefile.in deleted file mode 100755 index e0b3b74b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/Makefile.in +++ /dev/null @@ -1,120 +0,0 @@ -# --------------------------------------------------------------- -# SWIG Perl5 Makefile -# -# This file can be used to build various Perl5 extensions with SWIG. -# By default this file is set up for dynamic loading, but it can -# be easily customized for static extensions by modifying various -# portions of the file. -# -# SRCS = C source files -# CXXSRCS = C++ source files -# OBJCSRCS = Objective-C source files -# OBJS = Additional .o files (compiled previously) -# INTERFACE = SWIG interface file -# TARGET = Name of target module or executable -# -# Many portions of this file were created by the SWIG configure -# script and should already reflect your machine. -#---------------------------------------------------------------- - -SRCS = -CXXSRCS = -OBJCSRCS = -OBJS = -INTERFACE = -WRAPFILE = $(INTERFACE:.i=_wrap.c) -WRAPOBJ = $(INTERFACE:.i=_wrap.o) -TARGET = module@SO@ # Use this kind of target for dynamic loading -#TARGET = myperl # Use this target for static linking - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -CC = @CC@ -CXX = @CXX@ -OBJC = @CC@ -Wno-import # -Wno-import needed for gcc -CFLAGS = -INCLUDES = -LIBS = - -# SWIG Options -# SWIG = location of the SWIG executable -# SWIGOPT = SWIG compiler options -# SWIGCC = Compiler used to compile the wrapper file - -SWIG = $(exec_prefix)/bin/swig -SWIGOPT = -perl5 -SWIGCC = $(CC) - -# SWIG Library files. Uncomment this to statically rebuild Perl -#SWIGLIBS = -static -lperlmain.i - -# Rules for creating .o files from source. - -COBJS = $(SRCS:.c=.o) -CXXOBJS = $(CXXSRCS:.cxx=.o) -OBJCOBJS = $(OBJCSRCS:.m=.o) -ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) - -# Command that will be used to build the final extension. -BUILD = $(SWIGCC) - -# Uncomment the following if you are using dynamic loading -CCSHARED = @CCSHARED@ -BUILD = @LDSHARED@ - -# Uncomment the following if you are using dynamic loading with C++ and -# need to provide additional link libraries (this is not always required). - -#DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ - -L/usr/local/lib -lg++ -lstdc++ -lgcc - -# Perl installation - -PERL_INCLUDE = -I@PERL5EXT@ -PERL_LIB = -L@PERL5EXT@ -lperl -PERL_FLAGS = -Dbool=char -Dexplicit= - -# Build libraries (needed for static builds) - -LIBM = @LIBM@ -LIBC = @LIBC@ -SYSLIBS = $(LIBM) $(LIBC) @LIBS@ - -# Build options - -BUILD_LIBS = $(LIBS) # Dynamic loading - -# Compilation rules for non-SWIG components - -.SUFFIXES: .c .cxx .m - -.c.o: - $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - -.cxx.o: - $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< - -.m.o: - $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - - -# ---------------------------------------------------------------------- -# Rules for building the extension -# ---------------------------------------------------------------------- - -all: $(TARGET) - -# Convert the wrapper file into an object file - -$(WRAPOBJ) : $(WRAPFILE) - $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(PERL_INCLUDE) $(PERL_FLAGS) $(WRAPFILE) - -$(WRAPFILE) : $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIBS) $(INTERFACE) - -$(TARGET): $(WRAPOBJ) $(ALLOBJS) - $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) - -clean: - rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/Makefile.pl b/linux/bin/swig/share/swig/4.1.0/perl5/Makefile.pl deleted file mode 100755 index cffdc8e7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/Makefile.pl +++ /dev/null @@ -1,19 +0,0 @@ -# File : Makefile.pl -# MakeMaker file for a SWIG module. Use this file if you are -# producing a module for general use or distribution. -# -# 1. Modify the file as appropriate. Replace $module with the -# real name of your module and wrapper file. -# 2. Run perl as 'perl Makefile.pl' -# 3. Type 'make' to build your module -# 4. Type 'make install' to install your module. -# -# See "Programming Perl", 2nd. Ed, for more gory details than -# you ever wanted to know. - -use ExtUtils::MakeMaker; -WriteMakefile( - 'NAME' => '$module', # Name of your module - 'LIBS' => [''], # Custom libraries (if any) - 'OBJECT' => '$module_wrap.o' # Object files -); diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/argcargv.i b/linux/bin/swig/share/swig/4.1.0/perl5/argcargv.i deleted file mode 100755 index 48a6047b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/argcargv.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - int i; - I32 len; - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) { - SWIG_croak("in method '$symname', Expecting reference to argv array"); - goto fail; - } - len = av_len(av) + 1; - $1 = ($1_ltype) len; - $2 = (char **) malloc((len+1)*sizeof(char *)); - for (i = 0; i < len; i++) { - SV **tv = av_fetch(av, i, 0); - $2[i] = SvPV_nolen(*tv); - } - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - AV *av = (AV *)SvRV($input); - $1 = SvTYPE(av) == SVt_PVAV; -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/attribute.i b/linux/bin/swig/share/swig/4.1.0/perl5/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/carrays.i b/linux/bin/swig/share/swig/4.1.0/perl5/carrays.i deleted file mode 100755 index 8be67abc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/carrays.i +++ /dev/null @@ -1,2 +0,0 @@ -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/cdata.i b/linux/bin/swig/share/swig/4.1.0/perl5/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/cmalloc.i b/linux/bin/swig/share/swig/4.1.0/perl5/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/cpointer.i b/linux/bin/swig/share/swig/4.1.0/perl5/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/cstring.i b/linux/bin/swig/share/swig/4.1.0/perl5/cstring.i deleted file mode 100755 index ede9c596..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/director.swg b/linux/bin/swig/share/swig/4.1.0/perl5/director.swg deleted file mode 100755 index f0a6614f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/director.swg +++ /dev/null @@ -1,317 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Perl proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DIRECTOR_PERL_HEADER_ -#define SWIG_DIRECTOR_PERL_HEADER_ - -#include -#include -#include -#include -#include - - -/* - Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the - native C++ RTTI and dynamic_cast<>. But be aware that directors - could stop working when using this option. -*/ -#ifdef SWIG_DIRECTOR_NORTTI -/* - When we don't use the native C++ RTTI, we implement a minimal one - only for Directors. -*/ -# ifndef SWIG_DIRECTOR_RTDIR -# define SWIG_DIRECTOR_RTDIR - -namespace Swig { - class Director; - SWIGINTERN std::map& get_rtdir_map() { - static std::map rtdir_map; - return rtdir_map; - } - - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *rtdir) { - get_rtdir_map()[vptr] = rtdir; - } - - SWIGINTERNINLINE Director *get_rtdir(void *vptr) { - std::map::const_iterator pos = get_rtdir_map().find(vptr); - Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0; - return rtdir; - } -} -# endif /* SWIG_DIRECTOR_RTDIR */ - -# define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast(ARG)) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast(ARG1), ARG2) - -#else - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) - -#endif /* SWIG_DIRECTOR_NORTTI */ - -extern "C" { - struct swig_type_info; -} - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() {} - - virtual int get_own() const { - return 0; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem *operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(int own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - int get_own() const { - return _own; - } - - private: - int _own; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - template - struct GCArray_T : GCItem { - GCArray_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCArray_T() { - delete[] _ptr; - } - - private: - Type *_ptr; - }; - - /* base class for director exceptions */ - class DirectorException : public std::exception { - public: - virtual SV *getNative() const = 0; - }; - - /* exceptions emitted by Perl */ - class DirectorMethodException : public DirectorException { - protected: - SV *err; - public: - DirectorMethodException(SV *sv = sv_mortalcopy(ERRSV)) : err(sv) { - SvREFCNT_inc(err); - } - - const char *what() const throw() { - return SvPV_nolen(err); - } - - SV *getNative() const { - return sv_2mortal(newSVsv(err)); - } - - static void raise(SV *sv) { - throw DirectorMethodException(sv); - } - }; - - /* exceptions emitted by wrap code */ - class DirectorWrapException : public DirectorException { - protected: - std::string msg; - DirectorWrapException(const char *str) : msg(str) { - } - - public: - virtual ~DirectorWrapException() throw() { - } - - const char *what() const throw() { - return msg.c_str(); - } - - virtual SV *getNative() const { - return sv_2mortal(newSVpvn(msg.data(), msg.size())); - } - }; - - class DirectorTypeMismatchException : public DirectorWrapException { - public: - DirectorTypeMismatchException(const char *str) : DirectorWrapException(str) { - } - - static void raise(const char *type, const char *msg) { - std::string err = std::string(type); - err += ": "; - err += msg; - throw DirectorTypeMismatchException(err.c_str()); - } - }; - - class DirectorPureVirtualException : public DirectorWrapException { - public: - DirectorPureVirtualException(const char *name) - : DirectorWrapException("SWIG director pure virtual method called: ") { - msg += name; - } - - static void raise(const char *name) { - throw DirectorPureVirtualException(name); - } - }; - - /* director base class */ - class Director { - private: - /* pointer to the wrapped perl object */ - SV *swig_self; - /* class of wrapped perl object */ - std::string swig_class; - /* flag indicating whether the object is owned by perl or c++ */ - mutable bool swig_disown_flag; - - /* decrement the reference count of the wrapped perl object */ - void swig_decref() const { - if (swig_disown_flag) { - SvREFCNT_dec(swig_self); - } - } - - public: - /* wrap a Perl object. */ - Director(SV *pkg) : swig_disown_flag(false) { - STRLEN len; - char *str = SvPV(pkg, len); - swig_class = std::string(str, len); - swig_self = newRV_inc((SV *)newHV()); - } - - /* discard our reference at destruction */ - virtual ~Director() { - swig_decref(); - } - - /* return a pointer to the wrapped Perl object */ - SV *swig_get_self() const { - return swig_self; - } - - const char *swig_get_class() const { - return swig_class.c_str(); - } - - /* acquire ownership of the wrapped Perl object (the sense of "disown" is from perl) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag=true; - swig_incref(); - } - } - - /* increase the reference count of the wrapped Perl object */ - void swig_incref() const { - if (swig_disown_flag) { - SvREFCNT_inc(swig_self); - } - } - - /* methods to implement pseudo protected director members */ - virtual bool swig_get_inner(const char * /* swig_protected_method_name */) const { - return true; - } - - virtual void swig_set_inner(const char * /* swig_protected_method_name */, bool /* swig_val */) const { - } - - /* ownership management */ - private: - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; - - public: - template - void swig_acquire_ownership_array(Type *vptr) const { - if (vptr) { - swig_owner[vptr] = new GCArray_T(vptr); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, int own) const { - if (vptr && own) { - swig_owner[vptr] = new GCItem_Object(own); - } - } - - int swig_release_ownership(void *vptr) const { - int own = 0; - if (vptr) { - swig_ownership_map::iterator iter = swig_owner.find(vptr); - if (iter != swig_owner.end()) { - own = iter->second->get_own(); - swig_owner.erase(iter); - } - } - return own; - } - }; - -} - -#endif - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/exception.i b/linux/bin/swig/share/swig/4.1.0/perl5/exception.i deleted file mode 100755 index b786f25e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/exception.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) -} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/extra-install.list b/linux/bin/swig/share/swig/4.1.0/perl5/extra-install.list deleted file mode 100755 index db93830a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/extra-install.list +++ /dev/null @@ -1,2 +0,0 @@ -# see top-level Makefile.in -Makefile.pl noembed.h diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/factory.i b/linux/bin/swig/share/swig/4.1.0/perl5/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/noembed.h b/linux/bin/swig/share/swig/4.1.0/perl5/noembed.h deleted file mode 100755 index 4e30f111..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/noembed.h +++ /dev/null @@ -1,116 +0,0 @@ -/* Workaround perl5 global namespace pollution. Note that undefining library - * functions like fopen will not solve the problem on all platforms as fopen - * might be a macro on Windows but not necessarily on other operating systems. */ -#ifdef do_open - #undef do_open -#endif -#ifdef do_close - #undef do_close -#endif -#ifdef do_exec - #undef do_exec -#endif -#ifdef scalar - #undef scalar -#endif -#ifdef list - #undef list -#endif -#ifdef apply - #undef apply -#endif -#ifdef convert - #undef convert -#endif -#ifdef Error - #undef Error -#endif -#ifdef form - #undef form -#endif -#ifdef vform - #undef vform -#endif -#ifdef LABEL - #undef LABEL -#endif -#ifdef METHOD - #undef METHOD -#endif -#ifdef Move - #undef Move -#endif -#ifdef yylex - #undef yylex -#endif -#ifdef yyparse - #undef yyparse -#endif -#ifdef yyerror - #undef yyerror -#endif -#ifdef invert - #undef invert -#endif -#ifdef ref - #undef ref -#endif -#ifdef read - #undef read -#endif -#ifdef write - #undef write -#endif -#ifdef eof - #undef eof -#endif -#ifdef close - #undef close -#endif -#ifdef rewind - #undef rewind -#endif -#ifdef free - #undef free -#endif -#ifdef malloc - #undef malloc -#endif -#ifdef calloc - #undef calloc -#endif -#ifdef Stat - #undef Stat -#endif -#ifdef check - #undef check -#endif -#ifdef seekdir - #undef seekdir -#endif -#ifdef open - #undef open -#endif -#ifdef readdir - #undef readdir -#endif -#ifdef bind - #undef bind -#endif -#ifdef access - #undef access -#endif -#ifdef stat - #undef stat -#endif -#ifdef seed - #undef seed -#endif - -#ifdef bool - /* Leave if macro is from C99 stdbool.h */ - #ifndef __bool_true_false_are_defined - #undef bool - #endif -#endif - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perl5.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perl5.swg deleted file mode 100755 index 693c2b94..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perl5.swg +++ /dev/null @@ -1,42 +0,0 @@ -/* ------------------------------------------------------------ - * perl.swg - * - * Perl configuration module. - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Perl keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Perl initialization function - * ------------------------------------------------------------ */ -%include - - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlerrors.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlerrors.swg deleted file mode 100755 index 57296c67..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlerrors.swg +++ /dev/null @@ -1,34 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGINTERN const char* -SWIG_Perl_ErrorType(int code) { - switch(code) { - case SWIG_MemoryError: - return "MemoryError"; - case SWIG_IOError: - return "IOError"; - case SWIG_RuntimeError: - return "RuntimeError"; - case SWIG_IndexError: - return "IndexError"; - case SWIG_TypeError: - return "TypeError"; - case SWIG_DivisionByZero: - return "ZeroDivisionError"; - case SWIG_OverflowError: - return "OverflowError"; - case SWIG_SyntaxError: - return "SyntaxError"; - case SWIG_ValueError: - return "ValueError"; - case SWIG_SystemError: - return "SystemError"; - case SWIG_AttributeError: - return "AttributeError"; - default: - return "RuntimeError"; - } -} - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlfragments.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlfragments.swg deleted file mode 100755 index 45d25d1f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'perlfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the ones defined by default by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlhead.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlhead.swg deleted file mode 100755 index 773adee9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlhead.swg +++ /dev/null @@ -1,91 +0,0 @@ -#ifdef __cplusplus -/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ -#include -#include -extern "C" { -#endif - -#if __GNUC__ >= 10 -#if defined(__cplusplus) -#pragma GCC diagnostic ignored "-Wvolatile" -#endif -#endif - -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#if __GNUC__ >= 10 -#pragma GCC diagnostic pop -#endif - -/* PERL_REVISION was added in Perl 5.6. */ -#if !defined PERL_REVISION || (PERL_REVISION-0 == 5 && PERL_VERSION-0 < 8) -# error SWIG requires Perl >= 5.8.0 -#endif - -#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) -#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) -#endif - -#ifndef SvIOK_UV -# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv))) -#endif - -#ifndef SvUOK -# define SvUOK(sv) SvIOK_UV(sv) -#endif - -#ifndef IVSIZE -# ifdef LONGSIZE -# define IVSIZE LONGSIZE -# else -# define IVSIZE 4 /* A bold guess, but the best we can make. */ -# endif -#endif - -#ifndef INT2PTR -# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) -# define PTRV UV -# define INT2PTR(any,d) (any)(d) -# else -# if PTRSIZE == LONGSIZE -# define PTRV unsigned long -# else -# define PTRV unsigned -# endif -# define INT2PTR(any,d) (any)(PTRV)(d) -# endif - -# define NUM2PTR(any,d) (any)(PTRV)(d) -# define PTR2IV(p) INT2PTR(IV,p) -# define PTR2UV(p) INT2PTR(UV,p) -# define PTR2NV(p) NUM2PTR(NV,p) - -# if PTRSIZE == LONGSIZE -# define PTR2ul(p) (unsigned long)(p) -# else -# define PTR2ul(p) INT2PTR(unsigned long,p) -# endif -#endif /* !INT2PTR */ - -#ifndef SvPV_nolen -# define SvPV_nolen(x) SvPV(x,PL_na) -#endif - -#ifndef get_sv -# define get_sv perl_get_sv -#endif - -#ifndef ERRSV -# define ERRSV get_sv("@",FALSE) -#endif - -#ifndef pTHX_ -#define pTHX_ -#endif - -#include -#ifdef __cplusplus -} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlinit.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlinit.swg deleted file mode 100755 index c26b93fa..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlinit.swg +++ /dev/null @@ -1,78 +0,0 @@ - -/* Export the SWIG initialization function */ -%header %{ -#ifdef __cplusplus -extern "C" -#endif -#ifndef MULTIPLICITY -SWIGEXPORT void SWIG_init (CV* cv); -#else -SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); -#endif -%} - -/* Module initialization function */ - -%insert(init) "swiginit.swg" - -%init %{ - -#if defined(__cplusplus) && ! defined(XSPROTO) -extern "C" -#endif - -XS(SWIG_init) { - dXSARGS; - int i; - (void)items; - - SWIG_InitializeModule(0); - - /* Install commands */ - for (i = 0; swig_commands[i].name; i++) { - /* Casts only needed for Perl < 5.10. */ -#ifdef __cplusplus - newXS(const_cast(swig_commands[i].name), swig_commands[i].wrapper, const_cast(__FILE__)); -#else - newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__); -#endif - } - - /* Install variables */ - for (i = 0; swig_variables[i].name; i++) { - SV *sv; - sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); - if (swig_variables[i].type) { - SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); - } else { - sv_setiv(sv,(IV) 0); - } - swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); - } - - /* Install constant */ - for (i = 0; swig_constants[i].type; i++) { - SV *sv; - sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); - switch(swig_constants[i].type) { - case SWIG_INT: - sv_setiv(sv, (IV) swig_constants[i].lvalue); - break; - case SWIG_FLOAT: - sv_setnv(sv, (double) swig_constants[i].dvalue); - break; - case SWIG_STRING: - sv_setpv(sv, (const char *) swig_constants[i].pvalue); - break; - case SWIG_POINTER: - SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); - break; - case SWIG_BINARY: - SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); - break; - default: - break; - } - SvREADONLY_on(sv); - } -%} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlkw.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlkw.swg deleted file mode 100755 index 00648e0b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlkw.swg +++ /dev/null @@ -1,251 +0,0 @@ -/* Warnings for Perl keywords */ -#define PERLKW(x) %keywordwarn("'" `x` "' is a perl keyword") `x` -#define PERLBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in perl") "::" `x` - - -/* - - From http://www.rocketaware.com/perl/perlfunc/ - -*/ - -/* Functions for SCALARs or strings*/ -PERLBN(chomp); -PERLBN(chop); -PERLBN(chr); -PERLBN(crypt); -PERLBN(hex); -PERLBN(index); -PERLBN(lc); -PERLBN(lcfirst); -PERLBN(length); -PERLBN(oct); -PERLBN(ord); -PERLBN(pack); -PERLBN(reverse); -PERLBN(rindex); -PERLBN(sprintf); -PERLBN(substr); -PERLBN(uc); -PERLBN(ucfirst); - -/* Regular expressions and pattern matching */ -PERLBN(m); -PERLBN(pos); -PERLBN(quotemeta); -PERLBN(split); -PERLBN(study); - -/* Numeric functions */ -PERLBN(abs); -PERLBN(atan2); -PERLBN(cos); -PERLBN(exp); -PERLBN(hex); -PERLBN(int); -PERLBN(log); -PERLBN(oct); -PERLBN(rand); -PERLBN(sin); -PERLBN(sqrt); -PERLBN(srand); - - -/* Functions for real @ARRAYs*/ -PERLBN(pop); -PERLBN(push); -PERLBN(shift); -PERLBN(splice); -PERLBN(unshift); - -/* Functions for list data*/ -PERLBN(grep); -PERLBN(join); -PERLBN(map); -PERLBN(qw); -PERLBN(reverse); -PERLBN(sort); -PERLBN(unpack); - - -/* Functions for real %HASHes*/ -PERLBN(delete); -PERLBN(each); -PERLBN(exists); -PERLBN(keys); -PERLBN(values); - - -/* Input and output functions*/ - -PERLBN(binmode); -PERLBN(close); -PERLBN(closedir); -PERLBN(dbmclose); -PERLBN(dbmopen); -PERLBN(die); -PERLBN(eof); -PERLBN(fileno); -PERLBN(flock); -PERLBN(format); -PERLBN(getc); -PERLBN(print); -PERLBN(printf); -PERLBN(read); -PERLBN(readdir); -PERLBN(rewinddir); -PERLBN(seek); -PERLBN(seekdir); -PERLBN(select); -PERLBN(syscall); -PERLBN(sysread); -PERLBN(sysseek); -PERLBN(syswrite); -PERLBN(tell); -PERLBN(telldir); -PERLBN(truncate); -PERLBN(warn); -PERLBN(write); - - -/* Functions for fixed length data or records*/ -PERLBN(pack); -PERLBN(read); -PERLBN(syscall); -PERLBN(sysread); -PERLBN(syswrite); -PERLBN(unpack); -PERLBN(vec); - - -/* Functions for filehandles, files, or directories */ -PERLBN(chdir); -PERLBN(chmod); -PERLBN(chown); -PERLBN(chroot); -PERLBN(fcntl); -PERLBN(glob); -PERLBN(ioctl); -PERLBN(link); -PERLBN(lstat); -PERLBN(mkdir); -PERLBN(open); -PERLBN(opendir); -PERLBN(readlink); -PERLBN(rename); -PERLBN(rmdir); -PERLBN(stat); -PERLBN(symlink); -PERLBN(umask); -PERLBN(unlink); -PERLBN(utime); - - -/* Keywords related to the control flow of your perl program */ -PERLKW(caller); -PERLKW(continue); -PERLKW(die); -PERLKW(do); -PERLKW(dump); -PERLKW(eval); -PERLKW(exit); -PERLKW(goto); -PERLKW(last); -PERLKW(next); -PERLKW(redo); -PERLKW(return); -PERLKW(sub); -PERLKW(wantarray); - - -/* Keywords related to scoping */ -PERLKW(caller); -PERLKW(import); -PERLKW(local); -PERLKW(my); -PERLKW(package); -PERLKW(use); - - -/* Miscellaneous functions */ -PERLBN("defined"); -PERLBN(dump); -PERLBN(eval); -PERLBN(formline); -PERLBN(local); -PERLBN(my); -PERLBN(reset); -PERLBN(scalar); -PERLBN(undef); -PERLBN(wantarray); - - -/* Functions for processes and process groups */ -PERLBN(alarm); -PERLBN(exec); -PERLBN(fork); -PERLBN(getpgrp); -PERLBN(getppid); -PERLBN(getpriority); -PERLBN(kill); -PERLBN(pipe); -PERLBN(setpgrp); -PERLBN(setpriority); -PERLBN(sleep); -PERLBN(system); -PERLBN(times); -PERLBN(wait); -PERLBN(waitpid); - - -/* Keywords related to perl modules */ -PERLKW(do); -PERLKW(import); -PERLKW(no); -PERLKW(package); -PERLKW(require); -PERLKW(use); - - -/* Keywords related to classes and object-orientedness */ -PERLKW(bless); -PERLKW(dbmclose); -PERLKW(dbmopen); -PERLKW(package); -PERLKW(ref); -PERLKW(tie); -PERLKW(tied); -PERLKW(untie); -PERLKW(use); - -/* Functions new in perl5 */ -PERLBN(abs); -PERLBN(bless); -PERLBN(chomp); -PERLBN(chr); -PERLBN(exists); -PERLBN(formline); -PERLBN(glob); -PERLBN(import); -PERLBN(lc); -PERLBN(lcfirst); -PERLBN(map); -PERLBN(my); -PERLBN(no); -PERLBN(prototype); -PERLBN(qx); -PERLBN(qw); -PERLBN(readline); -PERLBN(readpipe); -PERLBN(ref); -PERLBN(sub); -PERLBN(sysopen); -PERLBN(tie); -PERLBN(tied); -PERLBN(uc); -PERLBN(ucfirst); -PERLBN(untie); -PERLBN(use); - -#undef PERLKW -#undef PERLBN diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlmacros.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlmacros.swg deleted file mode 100755 index 4917f6ef..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlmacros.swg +++ /dev/null @@ -1,2 +0,0 @@ -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlmain.i b/linux/bin/swig/share/swig/4.1.0/perl5/perlmain.i deleted file mode 100755 index 18ecb7eb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlmain.i +++ /dev/null @@ -1,82 +0,0 @@ -/* ----------------------------------------------------------------------------- - * perlmain.i - * - * Code to statically rebuild perl5. - * ----------------------------------------------------------------------------- */ - -#ifdef AUTODOC -%subsection "perlmain.i" -%text %{ -This module provides support for building a new version of the -Perl executable. This will be necessary on systems that do -not support shared libraries and may be necessary with C++ -extensions. - -This module may only build a stripped down version of the -Perl executable. Thus, it may be necessary (or desirable) -to hand-edit this file for your particular application. To -do this, simply copy this file from swig_lib/perl5/perlmain.i -to your working directory and make the appropriate modifications. - -This library file works with Perl 5.003. It may work with earlier -versions, but it hasn't been tested. As far as I know, this -library is C++ safe. -%} -#endif - -%{ - -static void xs_init _((pTHX)); -static PerlInterpreter *my_perl; - -int perl_eval(char *string) { - char *argv[2]; - argv[0] = string; - argv[1] = (char *) 0; - return perl_call_argv("eval",0,argv); -} - -int -main(int argc, char **argv, char **env) -{ - int exitstatus; - - my_perl = perl_alloc(); - if (!my_perl) - exit(1); - perl_construct( my_perl ); - - exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL ); - if (exitstatus) - exit( exitstatus ); - - /* Initialize all of the module variables */ - - exitstatus = perl_run( my_perl ); - - perl_destruct( my_perl ); - perl_free( my_perl ); - - exit( exitstatus ); -} - -/* Register any extra external extensions */ - -/* Do not delete this line--writemain depends on it */ -/* EXTERN_C void boot_DynaLoader _((CV* cv)); */ - -static void -xs_init(pTHX) -{ -/* dXSUB_SYS; */ - char *file = __FILE__; - { - /* newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); */ - newXS(SWIG_name, SWIG_init, file); -#ifdef SWIGMODINIT - SWIGMODINIT -#endif - } -} - -%} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlopers.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlopers.swg deleted file mode 100755 index e7d13b67..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlopers.swg +++ /dev/null @@ -1,54 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus - -// These are auto-supported by the Perl-module -%rename(__plusplus__) *::operator++; -%rename(__minmin__) *::operator--; -%rename(__add__) *::operator+; -%rename(__sub__) *::operator-; -%rename(__neg__) *::operator-(); -%rename(__neg__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__eq__) *::operator==; -%rename(__ne__) *::operator!=; -%rename(__mod__) *::operator%; -%rename(__gt__) *::operator>; -%rename(__lt__) *::operator<; -%rename(__not__) *::operator!; -%rename(__le__) *::operator<=; -%rename(__ge__) *::operator>=; -%rename(__and__) *::operator&; -%rename(__or__) *::operator|; -%rename(__iadd__) *::operator+=; -%rename(__isub__) *::operator-=; - -// These are renamed, but no test exists in operator_overload_runme.pl -%ignoreoperator(EQ) operator=; - -// These are renamed, but no 'use overload...' is added -%rename(__lshift__) *::operator<<; -%rename(__rshift__) *::operator>>; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__call__) *::operator(); - -/* Ignored operators */ -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; -%ignoreoperator(ARROWSTAR) operator->*; -%ignoreoperator(INDEX) operator[]; - - -#endif /* __cplusplus */ diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlprimtypes.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlprimtypes.swg deleted file mode 100755 index 4cb67567..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlprimtypes.swg +++ /dev/null @@ -1,364 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* bool */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(bool)(bool value) -{ - return boolSV(value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header") { -SWIGINTERN int -SWIG_AsVal_dec(bool)(SV *obj, bool* val) -{ - if (obj == &PL_sv_yes) { - if (val) *val = true; - return SWIG_OK; - } else if (obj == &PL_sv_no) { - if (val) *val = false; - return SWIG_OK; - } else { - if (val) *val = SvTRUE(obj) ? true : false; - return SWIG_AddCast(SWIG_OK); - } -} -} - - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(long)(long value) -{ - SV *sv; - if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX)) - sv = newSViv(value); - else - sv = newSVpvf("%ld", value); - return sv_2mortal(sv); -} -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="", - fragment="", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(long)(SV *obj, long* val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - if (UVSIZE < sizeof(*val) || v <= LONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) { - if(val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - long v; - errno = 0; - v = strtol(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(unsigned long)(unsigned long value) -{ - SV *sv; - if (UVSIZE >= sizeof(value) || value <= UV_MAX) - sv = newSVuv(value); - else - sv = newSVpvf("%lu", value); - return sv_2mortal(sv); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="", - fragment="", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(SV *obj, unsigned long *val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - if (UVSIZE <= sizeof(*val) || v <= ULONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - unsigned long v; - errno = 0; - v = strtoul(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SV * -SWIG_From_dec(long long)(long long value) -{ - SV *sv; - if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX)) - sv = newSViv((IV)(value)); - else { - //sv = newSVpvf("%lld", value); doesn't work in non 64bit Perl - char temp[256]; - sprintf(temp, "%lld", value); - sv = newSVpv(temp, 0); - } - return sv_2mortal(sv); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="", - fragment="SWIG_CanCastAsInteger") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(SV *obj, long long *val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - /* pretty sure this could allow v == LLONG MAX */ - if (UVSIZE < sizeof(*val) || v < LLONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (IVSIZE <= sizeof(*val) || (v >= LLONG_MIN && v <= LLONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - long long v; - errno = 0; - v = strtoll(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - const double mant_max = 1LL << DBL_MANT_DIG; - const double mant_min = -mant_max; - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { - if (val) *val = (long long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SV * -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - SV *sv; - if (UVSIZE >= sizeof(value) || value <= UV_MAX) - sv = newSVuv((UV)(value)); - else { - //sv = newSVpvf("%llu", value); doesn't work in non 64bit Perl - char temp[256]; - sprintf(temp, "%llu", value); - sv = newSVpv(temp, 0); - } - return sv_2mortal(sv); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="", - fragment="SWIG_CanCastAsInteger") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(SV *obj, unsigned long long *val) -{ - if (SvUOK(obj)) { - /* pretty sure this should be conditional on - * (UVSIZE <= sizeof(*val) || v <= ULLONG_MAX) */ - if (val) *val = SvUV(obj); - return SWIG_OK; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULLONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - unsigned long long v; - errno = 0; - v = strtoull(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(double)(double value) -{ - return sv_2mortal(newSVnv(value)); -} -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(SV *obj, double *val) -{ - if (SvNIOK(obj)) { - if (val) *val = SvNV(obj); - return SWIG_OK; - } else if (SvIOK(obj)) { - if (val) *val = (double) SvIV(obj); - return SWIG_AddCast(SWIG_OK); - } else { - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - double v; - errno = 0; - v = strtod(nptr, &endptr); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - } - return SWIG_TypeError; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlrun.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlrun.swg deleted file mode 100755 index 71f19cbf..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlrun.swg +++ /dev/null @@ -1,493 +0,0 @@ -/* ----------------------------------------------------------------------------- - * perlrun.swg - * - * This file contains the runtime support for Perl modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -#define SWIG_PERL_OBJECT_DECL -#define SWIG_PERL_OBJECT_CALL - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) -#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own) -#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) -#define SWIG_AcquirePtr(ptr, src) SWIG_Perl_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) -#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) -#define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - -/* Perl-specific SWIG API */ - -#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags) -#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type) -#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str) - - -#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1) -#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1) -#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2) -#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2) - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 - -#ifdef __cplusplus -extern "C" { -#endif - -#define SWIG_OWNER SWIG_POINTER_OWN -#define SWIG_SHADOW SWIG_OWNER << 1 - -#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL - -/* SWIG Perl macros */ - -/* Macro to declare an XS function */ -#ifndef XSPROTO -# define XSPROTO(name) void name(pTHX_ CV* cv) -#endif - -/* Macro to call an XS function */ -#ifndef MULTIPLICITY -# define SWIG_CALLXS(_name) _name(cv) -#else -# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) -#endif - -#define MAGIC_PPERL -#define SWIGCLASS_STATIC static SWIGUNUSED - -#ifndef MULTIPLICITY -#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFunc)(SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#else /* MULTIPLICITY */ - -#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#endif /* MULTIPLICITY */ - -static void SWIGUNUSED SWIG_croak_null() -{ - SV *err = get_sv("@", GV_ADD); - if (sv_isobject(err)) - croak(0); - else - croak("%s", SvPV_nolen(err)); -} - - -/* - Define how strict is the cast between strings and integers/doubles - when overloading between these types occurs. - - The default is making it as strict as possible by using SWIG_AddCast - when needed. - - You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to - disable the SWIG_AddCast, making the casting between string and - numbers less strict. - - In the end, we try to solve the overloading between strings and - numerical types in the more natural way, but if you can avoid it, - well, avoid it using %rename, for example. -*/ -#ifndef SWIG_PERL_NO_STRICT_STR2NUM -# ifndef SWIG_PERL_STRICT_STR2NUM -# define SWIG_PERL_STRICT_STR2NUM -# endif -#endif -#ifdef SWIG_PERL_STRICT_STR2NUM -/* string takes precedence */ -#define SWIG_Str2NumCast(x) SWIG_AddCast(x) -#else -/* number takes precedence */ -#define SWIG_Str2NumCast(x) x -#endif - - - -#include - -SWIGRUNTIME const char * -SWIG_Perl_TypeProxyName(const swig_type_info *type) { - if (!type) return NULL; - if (type->clientdata != NULL) { - return (const char*) type->clientdata; - } - else { - return type->name; - } -} - -/* Identical to SWIG_TypeCheck, except for strcmp comparison */ -SWIGRUNTIME swig_cast_info * -SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, int own) { - /* TODO */ - return 0; -} - -/* Function for getting a pointer value */ - -SWIGRUNTIME int -SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) { - swig_cast_info *tc; - void *voidptr = (void *)0; - SV *tsv = 0; - int check_owned_pointer_release = (flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE; - - if (own) - *own = 0; - - /* If magical, apply more magic */ - if (SvGMAGICAL(sv)) - mg_get(sv); - - /* Check to see if this is an object */ - if (sv_isobject(sv)) { - IV tmp = 0; - tsv = (SV*) SvRV(sv); - if ((SvTYPE(tsv) == SVt_PVHV)) { - MAGIC *mg; - if (SvMAGICAL(tsv)) { - mg = mg_find(tsv,'P'); - if (mg) { - sv = mg->mg_obj; - if (sv_isobject(sv)) { - tsv = (SV*)SvRV(sv); - tmp = SvIV(tsv); - } - } - } else { - return SWIG_ERROR; - } - } else { - tmp = SvIV(tsv); - } - voidptr = INT2PTR(void *,tmp); - } else if (! SvOK(sv)) { /* Check for undef */ - *(ptr) = (void *) 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ - if (!SvROK(sv)) { - /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */ - if (SvIOK(sv)) { - return SWIG_ERROR; - } else { - /* NULL pointer (reference to undef). */ - *(ptr) = (void *) 0; - return SWIG_OK; - } - } else { - return SWIG_ERROR; - } - } else { /* Don't know what it is */ - return SWIG_ERROR; - } - if (_t) { - /* Now see if the types match */ - char *_c = HvNAME(SvSTASH(SvRV(sv))); - tc = SWIG_TypeProxyCheck(_c,_t); -#ifdef SWIG_DIRECTORS - if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) { -#else - if (!tc) { -#endif - return SWIG_ERROR; - } - { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - } else { - *ptr = voidptr; - } - - /* - * DISOWN implementation: we need a perl guru to check this one. - */ - if (tsv && ((flags & SWIG_POINTER_DISOWN) || check_owned_pointer_release)) { - /* - * almost copy paste code from below SWIG_POINTER_OWN setting - */ - SV *obj = sv; - HV *stash = SvSTASH(SvRV(obj)); - GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); - int owned = 0; - if (isGV(gv)) { - HV *hv = GvHVn(gv); - /* - * To set ownership (see below), a newSViv(1) entry is added. - * Hence, to remove ownership, we delete the entry. - */ - if (hv_exists_ent(hv, obj, 0)) { - owned = 1; - if (flags & SWIG_POINTER_DISOWN) { - hv_delete_ent(hv, obj, 0, 0); - } - } - } - if (check_owned_pointer_release && !owned) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - } - - if (tsv && (flags & SWIG_POINTER_CLEAR)) { - SvIV_set(tsv, 0); - } - - return SWIG_OK; -} - -SWIGRUNTIME int -SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { - return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0); -} - -SWIGRUNTIME void -SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { - if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) { - SV *self; - SV *obj=newSV(0); - HV *hash=newHV(); - HV *stash; - sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr); - stash=SvSTASH(SvRV(obj)); - if (flags & SWIG_POINTER_OWN) { - HV *hv; - GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); - if (!isGV(gv)) - gv_init(gv, stash, "OWNER", 5, FALSE); - hv=GvHVn(gv); - hv_store_ent(hv, obj, newSViv(1), 0); - } - sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); - SvREFCNT_dec(obj); - self=newRV_noinc((SV *)hash); - sv_setsv(sv, self); - SvREFCNT_dec((SV *)self); - sv_bless(sv, stash); - } - else { - sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr); - } -} - -SWIGRUNTIMEINLINE SV * -SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { - SV *result = sv_newmortal(); - SWIG_MakePtr(result, ptr, t, flags); - return result; -} - -SWIGRUNTIME void -SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - strcpy(r,SWIG_Perl_TypeProxyName(type)); - sv_setpv(sv, result); -} - -SWIGRUNTIME SV * -SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) { - SV *result = sv_newmortal(); - SWIG_Perl_MakePackedObj(result, ptr, sz, type); - return result; -} - -/* Convert a packed pointer value */ -SWIGRUNTIME int -SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c = 0; - - if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; - c = SvPV_nolen(obj); - /* Pointer values must start with leading underscore */ - if (*c != '_') return SWIG_ERROR; - c++; - c = SWIG_UnpackData(c,ptr,sz); - if (ty) { - tc = SWIG_TypeCheck(c,ty); - if (!tc) return SWIG_ERROR; - } - return SWIG_OK; -} - - -/* Macros for low-level exception handling */ -#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; } - - -typedef XSPROTO(SwigPerlWrapper); -typedef SwigPerlWrapper *SwigPerlWrapperPtr; - -/* Structure for command table */ -typedef struct { - const char *name; - SwigPerlWrapperPtr wrapper; -} swig_command_info; - -/* Information for constant table */ - -#define SWIG_INT 1 -#define SWIG_FLOAT 2 -#define SWIG_STRING 3 -#define SWIG_POINTER 4 -#define SWIG_BINARY 5 - -/* Constant information structure */ -typedef struct swig_constant_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_constant_info; - - -/* Structure for variable table */ -typedef struct { - const char *name; - SwigMagicFunc set; - SwigMagicFunc get; - swig_type_info **type; -} swig_variable_info; - -/* Magic variable code */ -#ifdef __cplusplus -# define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast(a),b,c) -#else -# define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c) -#endif -#ifndef MULTIPLICITY -SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) -#else -SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) -#endif -{ - MAGIC *mg; - sv_magic(sv,sv,'U',name,strlen(name)); - mg = mg_find(sv,'U'); - mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); - mg->mg_virtual->svt_get = (SwigMagicFunc) get; - mg->mg_virtual->svt_set = (SwigMagicFunc) set; - mg->mg_virtual->svt_len = 0; - mg->mg_virtual->svt_clear = 0; - mg->mg_virtual->svt_free = 0; -} - - -SWIGRUNTIME swig_module_info * -SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - static void *type_pointer = (void *)0; - SV *pointer; - - /* first check if pointer already created */ - if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); - if (pointer && SvOK(pointer)) { - type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); - } - } - - return (swig_module_info *) type_pointer; -} - -SWIGRUNTIME void -SWIG_Perl_SetModule(swig_module_info *module) { - SV *pointer; - - /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); - sv_setiv(pointer, PTR2IV(module)); -} - -#ifdef __cplusplus -} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlruntime.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlruntime.swg deleted file mode 100755 index f948023d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlruntime.swg +++ /dev/null @@ -1,8 +0,0 @@ - -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors -%runtime "perlhead.swg" // Perl includes and fixes -%runtime "perlerrors.swg" // Perl errors -%runtime "perlrun.swg" // Perl runtime functions -%runtime "noembed.h" // undefine Perl5 macros - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perlstrings.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perlstrings.swg deleted file mode 100755 index 242a9c96..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perlstrings.swg +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) -{ - if (SvMAGICAL(obj)) { - SV *tmp = sv_newmortal(); - SvSetSV(tmp, obj); - obj = tmp; - } - if (SvPOK(obj)) { - STRLEN len = 0; - char *cstr = SvPV(obj, len); - size_t size = len + 1; - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, size, char); - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } - } - if (psize) *psize = size; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - char* vptr = 0; - if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = vptr; - if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header") { -SWIGINTERNINLINE SV * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - SV *obj = sv_newmortal(); - if (carray) { - sv_setpvn(obj, carray, size); - } else { - sv_setsv(obj, &PL_sv_undef); - } - return obj; -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perltypemaps.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perltypemaps.swg deleted file mode 100755 index 42f8887b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perltypemaps.swg +++ /dev/null @@ -1,104 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Perl - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ - -/* - in Perl we need to pass the CPerlObj value, sometimes, so, we define - the decl/call macros as needed. -*/ - -#define SWIG_AS_DECL_ARGS SWIG_PERL_DECL_ARGS_2 -#define SWIG_AS_CALL_ARGS SWIG_PERL_CALL_ARGS_2 - -#define SWIG_FROM_DECL_ARGS SWIG_PERL_DECL_ARGS_1 -#define SWIG_FROM_CALL_ARGS SWIG_PERL_CALL_ARGS_1 - - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Perl fragments for primitive types */ -%include - -/* Perl fragments for char* strings */ -%include - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* director support in Perl is experimental */ -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Perl types */ -#define SWIG_Object SV * -#define VOID_Object &PL_sv_undef - -/* Perl $shadow flag */ -#define %newpointer_flags $shadow -#define %newinstance_flags $shadow - - -/* Complete overload of the output/constant/exception macros */ - -/* output */ -%define %set_output(obj) $result = obj; argvi++ %enddef - -/* append output */ -%define %append_output(obj) -if (argvi >= items) EXTEND(sp, argvi+1); -%set_output(obj) %enddef - -/* variable output */ -%define %set_varoutput(obj) sv_setsv($result,obj) %enddef - -/* constant */ -%define %set_constant(name, obj) %begin_block - SV *sv = get_sv((char*) SWIG_prefix name, TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, obj); - SvREADONLY_on(sv); -%end_block %enddef - -/* raise exception */ -%define %raise(obj, type, desc) sv_setsv(get_sv("@", GV_ADD), obj); SWIG_fail %enddef - -/* For directors to raise/throw the original exception */ -%typemap(throws) Swig::DirectorException -%{ sv_setsv(ERRSV, $1.getNative()); SWIG_fail; %} - -/* Include the unified typemap library */ -%include - -/* ------------------------------------------------------------ - * Perl extra typemaps / typemap overrides - * ------------------------------------------------------------ */ - -%typemap(varout,type="$1_descriptor") SWIGTYPE *, SWIGTYPE [] - "sv_setiv(SvRV($result),PTR2IV($1));"; - -%typemap(varout,type="$1_descriptor") SWIGTYPE & - "sv_setiv(SvRV($result),PTR2IV(&$1));"; - -%typemap(varout,type="$1_descriptor") SWIGTYPE && - "sv_setiv(SvRV($result),PTR2IV(&$1));"; - -%typemap(varout,type="$&1_descriptor") SWIGTYPE - "sv_setiv(SvRV($result), PTR2IV(&$1));"; - -%typemap(varout,type="$1_descriptor") SWIGTYPE (CLASS::*) { - SWIG_MakePackedObj($result, (void *) &$1, sizeof($1), $1_descriptor); -} - -%typemap(varout) SWIGTYPE *const = SWIGTYPE *; - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/perluserdir.swg b/linux/bin/swig/share/swig/4.1.0/perl5/perluserdir.swg deleted file mode 100755 index 718440e8..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/perluserdir.swg +++ /dev/null @@ -1,2 +0,0 @@ -#define %perlcode %insert("perl") - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/reference.i b/linux/bin/swig/share/swig/4.1.0/perl5/reference.i deleted file mode 100755 index b424c533..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/reference.i +++ /dev/null @@ -1,261 +0,0 @@ -/* ----------------------------------------------------------------------------- - * reference.i - * - * Accept Perl references as pointers - * ----------------------------------------------------------------------------- */ - -/* -The following methods make Perl references work like simple C -pointers. References can only be used for simple input/output -values, not C arrays however. It should also be noted that -REFERENCES are specific to Perl and not supported in other -scripting languages at this time. - - int *REFERENCE - short *REFERENCE - long *REFERENCE - unsigned int *REFERENCE - unsigned short *REFERENCE - unsigned long *REFERENCE - unsigned char *REFERENCE - float *REFERENCE - double *REFERENCE - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include reference.i - void neg(double *REFERENCE); - -or you can use the %apply directive : - - %include reference.i - %apply double *REFERENCE { double *x }; - void neg(double *x); - -Unlike the INOUT mapping described in typemaps.i, this approach directly -modifies the value of a Perl reference. Thus, you could use it -as follows : - - $x = 3; - neg(\$x); - print "$x\n"; # Should print out -3. - -*/ - -%typemap(in) double *REFERENCE (double dvalue), double &REFERENCE(double dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { - printf("Received %d\n", SvTYPE(tempsv)); - SWIG_croak("Expected a double reference."); - } - dvalue = SvNV(tempsv); - $1 = &dvalue; -} - -%typemap(in) float *REFERENCE (float dvalue), float &REFERENCE(float dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { - SWIG_croak("expected a double reference"); - } - dvalue = (float) SvNV(tempsv); - $1 = &dvalue; -} - -%typemap(in) int *REFERENCE (int dvalue), int &REFERENCE (int dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = SvIV(tempsv); - $1 = &dvalue; -} - -%typemap(in) short *REFERENCE (short dvalue), short &REFERENCE(short dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (short) SvIV(tempsv); - $1 = &dvalue; -} -%typemap(in) long *REFERENCE (long dvalue), long &REFERENCE(long dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (long) SvIV(tempsv); - $1 = &dvalue; -} -%typemap(in) unsigned int *REFERENCE (unsigned int dvalue), unsigned int &REFERENCE(unsigned int dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned int) SvUV(tempsv); - $1 = &dvalue; -} -%typemap(in) unsigned short *REFERENCE (unsigned short dvalue), unsigned short &REFERENCE(unsigned short dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned short) SvUV(tempsv); - $1 = &dvalue; -} -%typemap(in) unsigned long *REFERENCE (unsigned long dvalue), unsigned long &REFERENCE(unsigned long dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned long) SvUV(tempsv); - $1 = &dvalue; -} - -%typemap(in) unsigned char *REFERENCE (unsigned char dvalue), unsigned char &REFERENCE(unsigned char dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned char) SvUV(tempsv); - $1 = &dvalue; -} - -%typemap(in) signed char *REFERENCE (signed char dvalue), signed char &REFERENCE(signed char dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (signed char) SvIV(tempsv); - $1 = &dvalue; -} - -%typemap(in) bool *REFERENCE (bool dvalue), bool &REFERENCE(bool dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = SvIV(tempsv) ? true : false; - $1 = &dvalue; -} - -%typemap(typecheck) int *REFERENCE, int &REFERENCE, - short *REFERENCE, short &REFERENCE, - long *REFERENCE, long &REFERENCE, - signed char *REFERENCE, signed char &REFERENCE, - bool *REFERENCE, bool &REFERENCE -{ - $1 = SvROK($input) && SvIOK(SvRV($input)); -} -%typemap(typecheck) double *REFERENCE, double &REFERENCE, - float *REFERENCE, float &REFERENCE -{ - $1 = SvROK($input); - if($1) { - SV *tmpsv = SvRV($input); - $1 = SvNOK(tmpsv) || SvIOK(tmpsv); - } -} -%typemap(typecheck) unsigned int *REFERENCE, unsigned int &REFERENCE, - unsigned short *REFERENCE, unsigned short &REFERENCE, - unsigned long *REFERENCE, unsigned long &REFERENCE, - unsigned char *REFERENCE, unsigned char &REFERENCE -{ - $1 = SvROK($input); - if($1) { - SV *tmpsv = SvRV($input); - $1 = SvUOK(tmpsv) || SvIOK(tmpsv); - } -} - -%typemap(argout) double *REFERENCE, double &REFERENCE, - float *REFERENCE, float &REFERENCE -{ - SV *tempsv; - tempsv = SvRV($arg); - if (!$1) SWIG_croak("expected a reference"); - sv_setnv(tempsv, (double) *$1); -} - -%typemap(argout) int *REFERENCE, int &REFERENCE, - short *REFERENCE, short &REFERENCE, - long *REFERENCE, long &REFERENCE, - signed char *REFERENCE, signed char &REFERENCE, - bool *REFERENCE, bool &REFERENCE -{ - SV *tempsv; - tempsv = SvRV($input); - if (!$1) SWIG_croak("expected a reference"); - sv_setiv(tempsv, (IV) *$1); -} - -%typemap(argout) unsigned int *REFERENCE, unsigned int &REFERENCE, - unsigned short *REFERENCE, unsigned short &REFERENCE, - unsigned long *REFERENCE, unsigned long &REFERENCE, - unsigned char *REFERENCE, unsigned char &REFERENCE -{ - SV *tempsv; - tempsv = SvRV($input); - if (!$1) SWIG_croak("expected a reference"); - sv_setuv(tempsv, (UV) *$1); -} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_common.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_common.i deleted file mode 100755 index 7c1ff232..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_common.i +++ /dev/null @@ -1,28 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; - -%fragment(""); -%{ -SWIGINTERN -double SwigSvToNumber(SV* sv) { - return SvIOK(sv) ? double(SvIVX(sv)) : SvNVX(sv); -} -SWIGINTERN -std::string SwigSvToString(SV* sv) { - STRLEN len; - char *ptr = SvPV(sv, len); - return std::string(ptr, len); -} -SWIGINTERN -void SwigSvFromString(SV* sv, const std::string& s) { - sv_setpvn(sv,s.data(),s.size()); -} -%} - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_deque.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_except.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_list.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_list.i deleted file mode 100755 index 36678add..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_list.i +++ /dev/null @@ -1,377 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list types - * ----------------------------------------------------------------------------- */ - -%include -%include - -// containers - - -// ------------------------------------------------------------------------ -// std::list -// -// The aim of all that follows would be to integrate std::list with -// Perl as much as possible, namely, to allow the user to pass and -// be returned Perl arrays. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::list), f(const std::list&), f(const std::list*): -// the parameter being read-only, either a Perl sequence or a -// previously wrapped std::list can be passed. -// -- f(std::list&), f(std::list*): -// the parameter must be modified; therefore, only a wrapped std::list -// can be passed. -// -- std::list f(): -// the list is returned by copy; therefore, a Perl sequence of T:s -// is returned which is most easily used in other Perl functions -// -- std::list& f(), std::list* f(), const std::list& f(), -// const std::list* f(): -// the list is returned by reference; therefore, a wrapped std::list -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template class list { - %typemap(in) list (std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1) { - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i& (std::list temp, - std::list* v), - const list* (std::list temp, - std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i { - std::list< T >::const_iterator i; - unsigned int j; - int len = $1.size(); - SV **svs = new SV*[len]; - for (i=$1.begin(), j=0; i!=$1.end(); i++, j++) { - T* ptr = new T(*i); - svs[j] = sv_newmortal(); - SWIG_MakePtr(svs[j], (void*) ptr, - $descriptor(T *), $shadow|$owner); - } - AV *myav = av_make(len, svs); - delete[] svs; - $result = newRV_noinc((SV*) myav); - sv_2mortal($result); - argvi++; - } - %typecheck(SWIG_TYPECHECK_LIST) list { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_&descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_LIST) const list&, - const list* { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - list(); - list(const list& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(const T& x); - }; - - - // specializations for built-ins - - %define specialize_std_list(T,CHECK_T,TO_T,FROM_T) - template<> class list { - %typemap(in) list (std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1){ - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - for (int i=0; i& (std::list temp, - std::list* v), - const list* (std::list temp, - std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i { - std::list< T >::const_iterator i; - unsigned int j; - int len = $1.size(); - SV **svs = new SV*[len]; - for (i=$1.begin(), j=0; i!=$1.end(); i++, j++) { - svs[j] = sv_newmortal(); - FROM_T(svs[j], *i); - } - AV *myav = av_make(len, svs); - delete[] svs; - $result = newRV_noinc((SV*) myav); - sv_2mortal($result); - argvi++; - } - %typecheck(SWIG_TYPECHECK_LIST) list { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_&descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_LIST) const list&, - const list* { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef T value_type; - typedef const value_type& const_reference; - - list(); - list(const list& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T x); - }; - %enddef - - specialize_std_list(bool,SvIOK,SvIVX,sv_setiv); - specialize_std_list(char,SvIOK,SvIVX,sv_setiv); - specialize_std_list(int,SvIOK,SvIVX,sv_setiv); - specialize_std_list(short,SvIOK,SvIVX,sv_setiv); - specialize_std_list(long,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned char,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned int,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned short,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned long,SvIOK,SvIVX,sv_setiv); - specialize_std_list(float,SvNIOK,SwigSvToNumber,sv_setnv); - specialize_std_list(double,SvNIOK,SwigSvToNumber,sv_setnv); - specialize_std_list(std::string,SvPOK,SvPVX,SwigSvFromString); - -} - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_map.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_map.i deleted file mode 100755 index 1b373183..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_map.i +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_pair.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_string.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_string.i deleted file mode 100755 index 6f34f184..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_string.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/std_vector.i b/linux/bin/swig/share/swig/4.1.0/perl5/std_vector.i deleted file mode 100755 index 5bfd2c5a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/std_vector.i +++ /dev/null @@ -1,592 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector types - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Perl as much as possible, namely, to allow the user to pass and -// be returned Perl arrays. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a Perl sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a Perl sequence of T:s -// is returned which is most easily used in other Perl functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector (std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1) { - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i& (std::vector temp, - std::vector* v), - const vector* (std::vector temp, - std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i { - size_t len = $1.size(); - SV **svs = new SV*[len]; - for (size_t i=0; i { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - SV **tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - SV **tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T& get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector (std::vector* v) { - int res = SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0); - if (SWIG_IsOK(res)){ - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - I32 len = av_len(av) + 1; - for (int i=0; i& (std::vector temp,std::vector* v), - const vector* (std::vector temp,std::vector* v) { - int res = SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,0); - if (SWIG_IsOK(res)) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - I32 len = av_len(av) + 1; - for (int i=0; i { - size_t len = $1.size(); - SV **svs = new SV*[len]; - for (size_t i=0; i { - { - /* wrapped vector? */ - std::vector< T *>* v; - int res = SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0); - if (SWIG_IsOK(res)) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - void *v; - SV **tv = av_fetch(av, 0, 0); - int res = SWIG_ConvertPtr(*tv, &v, $descriptor(T *),0); - if (SWIG_IsOK(res)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&,const vector* { - { - /* wrapped vector? */ - std::vector< T *> *v; - int res = SWIG_ConvertPtr($input,%as_voidptrptr(&v), $1_descriptor,0); - if (SWIG_IsOK(res)) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - void *v; - SV **tv = av_fetch(av, 0, 0); - int res = SWIG_ConvertPtr(*tv, &v, $descriptor(T *),0); - if (SWIG_IsOK(res)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T* value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, T *value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T *x); - %extend { - T *pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T *x = self->back(); - self->pop_back(); - return x; - } - T *get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector (std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1){ - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - for (int i=0; i& (std::vector temp, - std::vector* v), - const vector* (std::vector temp, - std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - for (int i=0; i { - size_t len = $1.size(); - SV **svs = new SV*[len]; - for (size_t i=0; i { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SV **tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SV **tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, T value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/swigmove.i b/linux/bin/swig/share/swig/4.1.0/perl5/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/perl5/typemaps.i b/linux/bin/swig/share/swig/4.1.0/perl5/typemaps.i deleted file mode 100755 index 3e1f60d9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/perl5/typemaps.i +++ /dev/null @@ -1,371 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * The SWIG typemap library provides a language independent mechanism for - * supporting output arguments, input values, and other C function - * calling mechanisms. The primary use of the library is to provide a - * better interface to certain C function--especially those involving - * pointers. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_USE_OLD_TYPEMAPS) -%include -#else - - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -%define INPUT_TYPEMAP(type, converter) -%typemap(in) type *INPUT(type temp), type &INPUT(type temp) { - temp = (type) converter($input); - $1 = &temp; -} -%typemap(typecheck) type *INPUT = type; -%typemap(typecheck) type &INPUT = type; -%enddef - -INPUT_TYPEMAP(float, SvNV); -INPUT_TYPEMAP(double, SvNV); -INPUT_TYPEMAP(int, SvIV); -INPUT_TYPEMAP(long, SvIV); -INPUT_TYPEMAP(short, SvIV); -INPUT_TYPEMAP(signed char, SvIV); -INPUT_TYPEMAP(unsigned int, SvUV); -INPUT_TYPEMAP(unsigned long, SvUV); -INPUT_TYPEMAP(unsigned short, SvUV); -INPUT_TYPEMAP(unsigned char, SvUV); - -%typemap(in) bool *INPUT(bool temp), bool &INPUT(bool temp) { - temp = SvIV($input) ? true : false; - $1 = &temp; -} -%typemap(typecheck) bool *INPUT = bool; -%typemap(typecheck) bool &INPUT = bool; - -%typemap(in) long long *INPUT($*1_ltype temp), long long &INPUT($*1_ltype temp) { - temp = strtoll(SvPV_nolen($input), 0, 0); - $1 = &temp; -} -%typemap(typecheck) long long *INPUT = long long; -%typemap(typecheck) long long &INPUT = long long; - -%typemap(in) unsigned long long *INPUT($*1_ltype temp), unsigned long long &INPUT($*1_ltype temp) { - temp = strtoull(SvPV_nolen($input), 0, 0); - $1 = &temp; -} -%typemap(typecheck) unsigned long long *INPUT = unsigned long long; -%typemap(typecheck) unsigned long long &INPUT = unsigned long long; - - -#undef INPUT_TYPEMAP - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, functions will return a Perl array. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters).: - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include typemaps.i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Perl output of the function would be an array containing both -output values. - -*/ - -// Force the argument to be ignored. - -%typemap(in,numinputs=0) int *OUTPUT(int temp), int &OUTPUT(int temp), - short *OUTPUT(short temp), short &OUTPUT(short temp), - long *OUTPUT(long temp), long &OUTPUT(long temp), - unsigned int *OUTPUT(unsigned int temp), unsigned int &OUTPUT(unsigned int temp), - unsigned short *OUTPUT(unsigned short temp), unsigned short &OUTPUT(unsigned short temp), - unsigned long *OUTPUT(unsigned long temp), unsigned long &OUTPUT(unsigned long temp), - unsigned char *OUTPUT(unsigned char temp), unsigned char &OUTPUT(unsigned char temp), - signed char *OUTPUT(signed char temp), signed char &OUTPUT(signed char temp), - bool *OUTPUT(bool temp), bool &OUTPUT(bool temp), - float *OUTPUT(float temp), float &OUTPUT(float temp), - double *OUTPUT(double temp), double &OUTPUT(double temp), - long long *OUTPUT($*1_ltype temp), long long &OUTPUT($*1_ltype temp), - unsigned long long *OUTPUT($*1_ltype temp), unsigned long long &OUTPUT($*1_ltype temp) -"$1 = &temp;"; - -%typemap(argout) int *OUTPUT, int &OUTPUT, - short *OUTPUT, short &OUTPUT, - long *OUTPUT, long &OUTPUT, - signed char *OUTPUT, signed char &OUTPUT, - bool *OUTPUT, bool &OUTPUT -{ - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - $result = sv_newmortal(); - sv_setiv($result,(IV) *($1)); - argvi++; -} - -%typemap(argout) unsigned int *OUTPUT, unsigned int &OUTPUT, - unsigned short *OUTPUT, unsigned short &OUTPUT, - unsigned long *OUTPUT, unsigned long &OUTPUT, - unsigned char *OUTPUT, unsigned char &OUTPUT -{ - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - $result = sv_newmortal(); - sv_setuv($result,(UV) *($1)); - argvi++; -} - - - -%typemap(argout) float *OUTPUT, float &OUTPUT, - double *OUTPUT, double &OUTPUT -{ - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - $result = sv_newmortal(); - sv_setnv($result,(double) *($1)); - argvi++; -} - -%typemap(argout) long long *OUTPUT, long long &OUTPUT { - char temp[256]; - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - sprintf(temp,"%lld", (long long)*($1)); - $result = sv_newmortal(); - sv_setpv($result,temp); - argvi++; -} - -%typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT { - char temp[256]; - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - sprintf(temp,"%llu", (unsigned long long)*($1)); - $result = sv_newmortal(); - sv_setpv($result,temp); - argvi++; -} - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Perl array. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - void neg(double *INOUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value. -Rather, the modified input value shows up as the return value of the -function. Thus, to apply this function to a Perl variable you might -do this : - - $x = neg($x); - -*/ - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) unsigned &INOUT = unsigned &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) signed char &INOUT = signed char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; - - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) unsigned *INOUT = unsigned *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; - - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) unsigned &INOUT = unsigned &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) signed char &INOUT = signed char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; - - -/* Overloading information */ - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) bool *INOUT = bool; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) float *INOUT = float; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) bool &INOUT = bool; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) float &INOUT = float; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; - -#endif - -// -------------------------------------------------------------------- -// Special types -// -------------------------------------------------------------------- - - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/php/argcargv.i b/linux/bin/swig/share/swig/4.1.0/php/argcargv.i deleted file mode 100755 index e0093c21..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/argcargv.i +++ /dev/null @@ -1,40 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - int len, i; - zval *val; - zend_array *ar; - if (Z_TYPE($input) != IS_ARRAY) { - SWIG_PHP_Error(E_ERROR, "Type error in '$symname'. Expected array"); - goto fail; - } - ar = Z_ARR($input); - len = zend_array_count(ar); - $1 = ($1_ltype) len; - $2 = (char **) malloc((len+1)*sizeof(char *)); - i = 0; - ZEND_HASH_FOREACH_VAL(ar, val) { - if (Z_TYPE(*val) != IS_STRING) { - SWIG_PHP_Error(E_ERROR, "Array must use strings only, in '$symname'."); - goto fail; - } - if (i == len) { - SWIG_PHP_Error(E_ERROR, "Array is bigger than zend report in '$symname'."); - goto fail; - } - $2[i++] = Z_STRVAL(*val); - } ZEND_HASH_FOREACH_END(); - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = Z_TYPE($input) == IS_ARRAY; -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/linux/bin/swig/share/swig/4.1.0/php/const.i b/linux/bin/swig/share/swig/4.1.0/php/const.i deleted file mode 100755 index a74af0d7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/const.i +++ /dev/null @@ -1,103 +0,0 @@ -/* ----------------------------------------------------------------------------- - * const.i - * - * Typemaps for constants - * ----------------------------------------------------------------------------- */ -%typemap(classconsttab) int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - unsigned char, - signed char, - enum SWIGTYPE %{ - zend_declare_class_constant_long(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, ($1_type)($value)); -%} - -%typemap(classconsttab) bool %{ - zend_declare_class_constant_bool(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, ($1_type)($value)); -%} - -%typemap(classconsttab) float, - double %{ - zend_declare_class_constant_double(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, $value); -%} - -%typemap(classconsttab) char %{ -{ - char swig_char = $value; - zend_declare_class_constant_stringl(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, &swig_char, 1); -} -%} - -%typemap(classconsttab) char *, - const char *, - char [], - const char [] %{ - zend_declare_class_constant_string(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, $value); -%} - -// This creates a zend_object to wrap the pointer, and we can't do that -// before the Zend runtime has been initialised so we delay it until -// RINIT. The downside is it then happens for every request. -%typemap(classconsttab,rinit=1) SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [] %{ -{ - zval z; - ZVAL_UNDEF(&z); - SWIG_SetPointerZval(&z, (void*)($value), $1_descriptor, 0); - zval_copy_ctor(&z); - zend_declare_class_constant(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, &z); -} -%} - -%typemap(classconsttab) SWIGTYPE (CLASS::*) "" - -%typemap(consttab) int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - unsigned char, - signed char, - enum SWIGTYPE - "SWIG_LONG_CONSTANT($symname, ($1_type)($value));"; - -%typemap(consttab) bool - "SWIG_BOOL_CONSTANT($symname, ($1_type)($value));"; - -%typemap(consttab) float, - double - "SWIG_DOUBLE_CONSTANT($symname, $value);"; - -%typemap(consttab) char - "SWIG_CHAR_CONSTANT($symname, $value);"; - -%typemap(consttab) char *, - const char *, - char [], - const char [] - "SWIG_STRING_CONSTANT($symname, $value);"; - -// This creates a zend_object to wrap the pointer, and we can't do that -// before the Zend runtime has been initialised so we delay it until -// RINIT. The downside is it then happens for every request. -%typemap(consttab,rinit=1) SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [] { - zend_constant c; - ZVAL_UNDEF(&c.value); - SWIG_SetPointerZval(&c.value, (void*)($value), $1_descriptor, 0); - zval_copy_ctor(&c.value); - c.name = zend_string_init("$symname", sizeof("$symname") - 1, 0); - SWIG_ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, module_number); - zend_register_constant(&c); -} - -/* Handled as a global variable. */ -%typemap(consttab) SWIGTYPE (CLASS::*) "" diff --git a/linux/bin/swig/share/swig/4.1.0/php/director.swg b/linux/bin/swig/share/swig/4.1.0/php/director.swg deleted file mode 100755 index 55ffff51..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/director.swg +++ /dev/null @@ -1,180 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that PHP proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DIRECTOR_PHP_HEADER_ -#define SWIG_DIRECTOR_PHP_HEADER_ - -#define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -#include -#include -#include - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() { - } - - virtual int get_own() const { - return 0; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem * operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(int own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - int get_own() const { - return _own; - } - - private: - int _own; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - class Director { - private: - /* flag indicating whether the object is owned by PHP or C++ */ - mutable bool swig_disown_flag; - - protected: - // "mutable" so we can get a non-const pointer to it in const methods. - mutable zval swig_self; - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; - - public: - Director(zval *self) : swig_disown_flag(false) { - ZVAL_COPY_VALUE(&swig_self, self); - } - - ~Director() { - if (swig_disown_flag) { - Z_DELREF(swig_self); - } - } - - zend_object *swig_get_self() const { return Z_OBJ(swig_self); } - - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag = true; - Z_ADDREF(swig_self); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, int own) const { - if (vptr && own) { - swig_owner[vptr] = new GCItem_Object(own); - } - } - }; - - /* base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - public: - DirectorException(int code, const char *hdr, const char *msg) : swig_msg(hdr) { - if (msg && msg[0]) { - swig_msg += " "; - swig_msg += msg; - } - // Don't replace an already active PHP exception. - if (!EG(exception)) zend_throw_exception(NULL, swig_msg.c_str(), code); - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - - static void raise(int code, const char *hdr, const char *msg) { - throw DirectorException(code, hdr, msg); - } - }; - - /* attempt to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg) - : DirectorException(E_ERROR, "SWIG director pure virtual method called", msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - /* any php exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException { - public: - DirectorMethodException() - : DirectorException(E_ERROR, "SWIG director method error", NULL) { - } - - DirectorMethodException(const char *msg) - : DirectorException(E_ERROR, "SWIG director method error", msg) { - } - - static void raise(const char *msg) { - throw DirectorMethodException(msg); - } - }; -} - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/php/factory.i b/linux/bin/swig/share/swig/4.1.0/php/factory.i deleted file mode 100755 index 5f2b397e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/factory.i +++ /dev/null @@ -1,109 +0,0 @@ -/* - Implement a more natural wrap for factory methods, for example, if - you have: - - ---- geometry.h -------- - struct Geometry { - enum GeomType{ - POINT, - CIRCLE - }; - - virtual ~Geometry() {} - virtual int draw() = 0; - - // - // Factory method for all the Geometry objects - // - static Geometry *create(GeomType i); - }; - - struct Point : Geometry { - int draw() { return 1; } - double width() { return 1.0; } - }; - - struct Circle : Geometry { - int draw() { return 2; } - double radius() { return 1.5; } - }; - - // - // Factory method for all the Geometry objects - // - Geometry *Geometry::create(GeomType type) { - switch (type) { - case POINT: return new Point(); - case CIRCLE: return new Circle(); - default: return 0; - } - } - ---- geometry.h -------- - - - You can use the %factory with the Geometry::create method as follows: - - %newobject Geometry::create; - %factory(Geometry *Geometry::create, Point, Circle); - %include "geometry.h" - - and Geometry::create will return a 'Point' or 'Circle' instance - instead of the plain 'Geometry' type. For example, in python: - - circle = Geometry.create(Geometry.CIRCLE) - r = circle.radius() - - where circle is a Circle proxy instance. - - NOTES: remember to fully qualify all the type names and don't - use %factory inside a namespace declaration, ie, instead of - - namespace Foo { - %factory(Geometry *Geometry::create, Point, Circle); - } - - use - - %factory(Foo::Geometry *Foo::Geometry::create, Foo::Point, Foo::Circle); - - -*/ - -/* for loop for macro with one argument */ -%define %_formacro_1(macro, arg1,...)macro(arg1) -#if #__VA_ARGS__ != "__fordone__" -%_formacro_1(macro, __VA_ARGS__) -#endif -%enddef - -/* for loop for macro with one argument */ -%define %formacro_1(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef -%define %formacro(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef - -/* for loop for macro with two arguments */ -%define %_formacro_2(macro, arg1, arg2, ...)macro(arg1, arg2) -#if #__VA_ARGS__ != "__fordone__" -%_formacro_2(macro, __VA_ARGS__) -#endif -%enddef - -/* for loop for macro with two arguments */ -%define %formacro_2(macro,...)%_formacro_2(macro, __VA_ARGS__, __fordone__)%enddef - -%define %_factory_dispatch(Type) -if (!dcast) { - Type *dobj = dynamic_cast($1); - if (dobj) { - dcast = 1; - SWIG_SetPointerZval(return_value, SWIG_as_voidptr(dobj), $descriptor(Type *), $owner); - } -}%enddef - -%define %factory(Method,Types...) -%typemap(out, phptype="?SWIGTYPE") Method { - int dcast = 0; - %formacro(%_factory_dispatch, Types) - if (!dcast) { - SWIG_SetPointerZval(return_value, SWIG_as_voidptr($1), $descriptor, $owner); - } -}%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/php/php.swg b/linux/bin/swig/share/swig/4.1.0/php/php.swg deleted file mode 100755 index fd092807..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/php.swg +++ /dev/null @@ -1,594 +0,0 @@ -/* ----------------------------------------------------------------------------- - * php.swg - * - * PHP configuration file - * ----------------------------------------------------------------------------- */ - -// Default to generating PHP type declarations (for PHP >= 8) except for -// cases which are liable to cause compatibility issues with existing -// bindings. -%feature("php:type", "compat"); - -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors -%runtime "phprun.swg" // PHP runtime functions - -%include // PHP initialization routine. - -%include - -// use %init %{ "/*code goes here*/ " %} -// or %minit %{ "/* code goes here*/ " %} to -// insert code in the PHP_MINIT_FUNCTION -#define %minit %insert("init") - -// use %rinit %{ "/* code goes here*/ " %} to -// insert code in the PHP_RINIT_FUNCTION -#define %rinit %insert("rinit") - -// use %shutdown %{ " /*code goes here*/ " %} to -// insert code in the PHP_MSHUTDOWN_FUNCTION -#define %shutdown %insert("shutdown") -#define %mshutdown %insert("shutdown") - -// use %rshutdown %{ " /*code goes here*/" %} to -// insert code in the PHP_RSHUTDOWN_FUNCTION -#define %rshutdown %insert("rshutdown") - -/* Typemaps for input parameters by value */ - -%include - -%pass_by_val(bool, "bool", CONVERT_BOOL_IN); - -%pass_by_val(size_t, "int", CONVERT_INT_IN); - -%pass_by_val(enum SWIGTYPE, "int", CONVERT_INT_IN); - -%pass_by_val(signed int, "int", CONVERT_INT_IN); -%pass_by_val(int,"int", CONVERT_INT_IN); -%pass_by_val(unsigned int,"int", CONVERT_INT_IN); - -%pass_by_val(signed short, "int", CONVERT_INT_IN); -%pass_by_val(short,"int", CONVERT_INT_IN); -%pass_by_val(unsigned short, "int", CONVERT_INT_IN); - -%pass_by_val(signed long, "int", CONVERT_INT_IN); -%pass_by_val(long, "int", CONVERT_INT_IN); -%pass_by_val(unsigned long, "int", CONVERT_INT_IN); - -%pass_by_val(signed long long, "int|string", CONVERT_LONG_LONG_IN); -%pass_by_val(long long, "int|string", CONVERT_LONG_LONG_IN); -%pass_by_val(unsigned long long, "int|string", CONVERT_UNSIGNED_LONG_LONG_IN); - -%pass_by_val(signed char, "int", CONVERT_INT_IN); -%pass_by_val(char, "string", CONVERT_CHAR_IN); -%pass_by_val(unsigned char, "int", CONVERT_INT_IN); - -%pass_by_val(float, "float", CONVERT_FLOAT_IN); - -%pass_by_val(double, "float", CONVERT_FLOAT_IN); - -%pass_by_val(char *, "string", CONVERT_STRING_IN); -%typemap(in) char *& = const char *&; -%typemap(directorout) char *& = const char *&; - -// char array can be in/out, though the passed string may not be big enough... -// so we have to size it -%typemap(in, phptype="string") char[ANY] -%{ - convert_to_string(&$input); - $1 = ($1_ltype) Z_STRVAL($input); -%} - -%typemap(in, phptype="string") (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) %{ - convert_to_string(&$input); - $1 = ($1_ltype) Z_STRVAL($input); - $2 = ($2_ltype) Z_STRLEN($input); -%} - -/* Object passed by value. Convert to a pointer */ -%typemap(in, phptype="SWIGTYPE") SWIGTYPE ($&1_ltype tmp) -%{ - if (SWIG_ConvertPtr(&$input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { - zend_type_error("Expected $&1_descriptor for argument $argnum of $symname"); - return; - } - $1 = *tmp; -%} - -%typemap(directorout) SWIGTYPE ($&1_ltype tmp) -%{ - if (SWIG_ConvertPtr($input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { - zend_type_error("Expected $&1_descriptor for argument $argnum of $symname"); - SWIG_fail; - } - $result = *tmp; -%} - -%typemap(in, phptype="?SWIGTYPE") SWIGTYPE *, - SWIGTYPE [] -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } -%} - -%typemap(directorout) SWIGTYPE * (swig_owntype own), - SWIGTYPE [] (swig_owntype own) -%{ - if (SWIG_ConvertPtrAndOwn($input, (void **)&$result, $1_descriptor, SWIG_POINTER_DISOWN, &own) < 0) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - SWIG_fail; - } - swig_acquire_ownership_obj((void*)$result, own); -%} - -%typemap(in, phptype="SWIGTYPE") SWIGTYPE & -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0 || $1 == NULL) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } -%} -%typemap(in, fragment="") SWIGTYPE && (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) %{ - res = SWIG_ConvertPtr(&$input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $1_descriptor of $symname"); - return; - } else { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } - } - if (!argp) { - zend_type_error("Invalid null reference for argument $argnum of $1_descriptor of $symname"); - return; - } - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -%} - -%typemap(directorout) SWIGTYPE & ($1_ltype tmp), - SWIGTYPE && ($1_ltype tmp) -%{ - if (SWIG_ConvertPtr($input, (void **) &tmp, $1_descriptor, 0) < 0 || tmp == NULL) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - SWIG_fail; - } - $result = tmp; -%} - -%typemap(in, phptype="?SWIGTYPE") SWIGTYPE *const& ($*ltype temp) -%{ - if (SWIG_ConvertPtr(&$input, (void **) &temp, $*1_descriptor, 0) < 0) { - zend_type_error("Expected $*1_descriptor for argument $argnum of $symname"); - return; - } - $1 = ($1_ltype)&temp; -%} - -%typemap(in, phptype="?SWIGTYPE") SWIGTYPE *DISOWN -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, SWIG_POINTER_DISOWN) < 0) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } -%} - -%typemap(argout) SWIGTYPE *, - SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE &&; - -%typemap(in, phptype="?SWIGTYPE") void * -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, 0, 0) < 0) { - /* Allow NULL from php for void* */ - if (Z_ISNULL($input)) { - $1=0; - } else { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } - } -%} - -/* Special case when void* is passed by reference so it can be made to point - to opaque api structs */ -%typemap(in, phptype="?SWIG\\_p_void", byref=1) void ** ($*1_ltype ptr, int force), - void *& ($*1_ltype ptr, int force) -{ - /* If they pass NULL by reference, make it into a void* - This bit should go in arginit if arginit support init-ing scripting args */ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ - if (!(Z_ISREF($input) && Z_ISNULL_P(Z_REFVAL($input)))) { - /* wasn't a pre/ref/thing, OR anything like an int thing */ - zend_throw_exception(zend_ce_type_error, "Type error in argument $arg of $symname", 0); - goto fail; - } - } - force=0; - if (arg1==NULL) { -#ifdef __cplusplus - ptr=new $*1_ltype(); -#else - ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); -#endif - $1=&ptr; - /* have to passback arg$arg too */ - force=1; - } -} -%typemap(argout) void **, - void *& -%{ - if (force$argnum && Z_ISREF($input)) { - SWIG_SetPointerZval(Z_REFVAL($input), (void*) ptr$argnum, $*1_descriptor, 1); - } -%} - -/* Typemap for output values */ - -%typemap(out, phptype="int") - int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - signed char, - unsigned char, - size_t -%{ - RETVAL_LONG($1); -%} - -%typemap(out, phptype="int") enum SWIGTYPE -%{ - RETVAL_LONG((long)$1); -%} - -%typemap(out, phptype="int|string") long long -%{ - if ((long long)LONG_MIN <= $1 && $1 <= (long long)LONG_MAX) { - RETVAL_LONG((long)($1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%lld", (long long)$1)); - } -%} -%typemap(out, phptype="int|string") unsigned long long -%{ - if ($1 <= (unsigned long long)LONG_MAX) { - RETVAL_LONG((long)($1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%llu", (unsigned long long)$1)); - } -%} - -%typemap(out, phptype="int") - const int &, - const unsigned int &, - const short &, - const unsigned short &, - const long &, - const unsigned long &, - const signed char &, - const unsigned char &, - const bool &, - const size_t & -%{ - RETVAL_LONG(*$1); -%} - -%typemap(out, phptype="int") const enum SWIGTYPE & -%{ - RETVAL_LONG((long)*$1); -%} - -%typemap(out, phptype="int") const enum SWIGTYPE && -%{ - RETVAL_LONG((long)*$1); -%} - -%typemap(out, phptype="int|string") const long long & -%{ - if ((long long)LONG_MIN <= *$1 && *$1 <= (long long)LONG_MAX) { - RETVAL_LONG((long)(*$1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%lld", (long long)(*$1))); - } -%} -%typemap(out, phptype="int|string") const unsigned long long & -%{ - if (*$1 <= (unsigned long long)LONG_MAX) { - RETVAL_LONG((long)(*$1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%llu", (unsigned long long)(*$1))); - } -%} - -%typemap(directorin) int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - signed char, - unsigned char, - size_t, - enum SWIGTYPE -%{ - ZVAL_LONG($input,$1); -%} - -%typemap(directorin) enum SWIGTYPE -%{ - ZVAL_LONG($input, (long)$1_name); -%} - -%typemap(directorin) char *, char [] -%{ - if(!$1) { - ZVAL_NULL($input); - } else { - ZVAL_STRING($input, (const char*)$1); - } -%} - -%typemap(out, phptype="bool") bool -%{ - RETVAL_BOOL(($1) ? 1 : 0); -%} - -%typemap(out, phptype="bool") const bool & -%{ - RETVAL_BOOL((*$1) ? 1 : 0); -%} - -%typemap(directorin) bool -%{ - ZVAL_BOOL($input, ($1) ? 1 : 0); -%} - -%typemap(out, phptype="float") float, - double -%{ - RETVAL_DOUBLE($1); -%} - -%typemap(out, phptype="float") const float &, - const double & -%{ - RETVAL_DOUBLE(*$1); -%} - -%typemap(directorin) float, - double -%{ - ZVAL_DOUBLE($input, $1); -%} - -%typemap(out, phptype="string") char -%{ - RETVAL_STRINGL(&$1, 1); -%} - -%typemap(out, phptype="string") const char & -%{ - RETVAL_STRINGL(&*$1, 1); -%} - -%typemap(out, phptype="string") char [] -%{ - RETVAL_STRING((const char *)$1); -%} - -%typemap(out, phptype="?string") char * -%{ - if (!$1) { - RETVAL_NULL(); - } else { - RETVAL_STRING((const char *)$1); - } -%} - -%typemap(out, phptype="?string") char *& -%{ - if (!*$1) { - RETVAL_NULL(); - } else { - RETVAL_STRING((const char *)*$1); - } -%} - -%typemap(out, phptype="?SWIGTYPE") SWIGTYPE * -%{ - SWIG_SetPointerZval($result, (void *)$1, $1_descriptor, $owner); -%} - -%typemap(out, phptype="SWIGTYPE") - SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE && -%{ - SWIG_SetPointerZval($result, (void *)$1, $1_descriptor, $owner); -%} - -%typemap(out, phptype="?SWIGTYPE") SWIGTYPE *const& -%{ - SWIG_SetPointerZval($result, (void *)*$1, $*1_descriptor, $owner); -%} - -%typemap(directorin) SWIGTYPE *, - SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE && -%{ - ZVAL_UNDEF($input); - SWIG_SetPointerZval($input, (void *)&$1, $1_descriptor, $owner); -%} - -%typemap(out, phptype="SWIGTYPE") SWIGTYPE (CLASS::*) -{ - void * p = emalloc(sizeof($1)); - memcpy(p, &$1, sizeof($1)); - SWIG_SetPointerZval($result, (void *)p, $&1_descriptor, 1); -} - -%typemap(in, phptype="SWIGTYPE") SWIGTYPE (CLASS::*) -{ - void * p = SWIG_Z_FETCH_OBJ_P(&$input)->ptr; - memcpy(&$1, p, sizeof($1)); -} - -%typemap(out, phptype="?SWIGTYPE") SWIGTYPE *DYNAMIC -{ - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_SetPointerZval($result, (void *)$1, ty, $owner); -} - -%typemap(out, phptype="SWIGTYPE") SWIGTYPE &DYNAMIC -{ - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_SetPointerZval($result, (void *)$1, ty, $owner); -} - -%typemap(out, phptype="SWIGTYPE") SWIGTYPE -{ -#ifdef __cplusplus - $&1_ltype resultobj = new $1_ltype($1); -#else - $&1_ltype resultobj = ($&1_ltype) malloc(sizeof($1_type)); - memcpy(resultobj, &$1, sizeof($1_type)); -#endif - SWIG_SetPointerZval($result, (void *)resultobj, $&1_descriptor, 1); -} - -%typemap(directorin) SWIGTYPE -%{ - ZVAL_UNDEF($input); - SWIG_SetPointerZval($input, (new $1_ltype(SWIG_STD_MOVE($1))), $&1_descriptor, 1); -%} - -%typemap(out, phptype="void") void "" - -%typemap(out, phptype="string") char [ANY] -{ - size_t len = 0; - while (len < $1_dim0 && $1[len]) ++len; - RETVAL_STRINGL($1, len); -} - -// This typecheck does hard checking for proper argument type. If you want -// an argument to be converted from a different PHP type, you must convert -// it yourself before passing it (e.g. (string)4.7 or (int)"6"). -%define %php_typecheck(_type,_prec,is) -%typemap(typecheck,precedence=_prec) _type, const _type & - " $1 = (Z_TYPE($input) == is);" -%enddef - -// Like %php_typecheck but allows either of two values. -%define %php_typecheck2(_type,_prec,is1,is2) -%typemap(typecheck,precedence=_prec) _type, const _type & - " $1 = (Z_TYPE($input) == is1 || Z_TYPE($input) == is2);" -%enddef - -%php_typecheck(int,SWIG_TYPECHECK_INTEGER,IS_LONG) -%php_typecheck(unsigned int,SWIG_TYPECHECK_UINT32,IS_LONG) -%php_typecheck(short,SWIG_TYPECHECK_INT16,IS_LONG) -%php_typecheck(unsigned short,SWIG_TYPECHECK_UINT16,IS_LONG) -%php_typecheck(long,SWIG_TYPECHECK_INT32,IS_LONG) -%php_typecheck(unsigned long,SWIG_TYPECHECK_UINT32,IS_LONG) -%php_typecheck(long long,SWIG_TYPECHECK_INT64,IS_LONG) -%php_typecheck(unsigned long long,SWIG_TYPECHECK_UINT64,IS_LONG) -%php_typecheck(signed char,SWIG_TYPECHECK_INT8,IS_LONG) -%php_typecheck(unsigned char,SWIG_TYPECHECK_UINT8,IS_LONG) -%php_typecheck(size_t,SWIG_TYPECHECK_SIZE,IS_LONG) -%php_typecheck(enum SWIGTYPE,SWIG_TYPECHECK_INTEGER,IS_LONG) -%php_typecheck2(bool,SWIG_TYPECHECK_BOOL,IS_TRUE,IS_FALSE) -%php_typecheck(float,SWIG_TYPECHECK_FLOAT,IS_DOUBLE) -%php_typecheck(double,SWIG_TYPECHECK_DOUBLE,IS_DOUBLE) -%php_typecheck(char,SWIG_TYPECHECK_CHAR,IS_STRING) - -%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char *, char *& - " $1 = (Z_TYPE($input) == IS_STRING || Z_TYPE($input) == IS_NULL); " - -%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char [] - " $1 = (Z_TYPE($input) == IS_STRING); " - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, SWIG_POINTER_NO_NULL) >= 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE *, - SWIGTYPE [], - SWIGTYPE *const& -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, 0) >= 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE &, - SWIGTYPE && -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, SWIG_POINTER_NO_NULL) >= 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $*1_descriptor, 0) >= 0); -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, 0, 0) >= 0); -} - -/* Exception handling */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short %{ - zend_throw_exception(NULL, "C++ $1_type exception thrown", $1); - goto fail; -%} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] %{ - (void)$1; - zend_throw_exception(NULL, "C++ $1_type exception thrown", 0); - goto fail; -%} - -%typemap(throws) char * %{ - zend_throw_exception(NULL, $1, 0); - goto fail; -%} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* php keywords */ -%include - -/* PHP known interfaces */ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/php/phpinit.swg b/linux/bin/swig/share/swig/4.1.0/php/phpinit.swg deleted file mode 100755 index ae72a10a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/phpinit.swg +++ /dev/null @@ -1,16 +0,0 @@ - -/* ------------------------------------------------------------ - * The start of the PHP initialization function - * ------------------------------------------------------------ */ - -%insert(init) "swiginit.swg" - -%init %{ -SWIG_php_minit { - zend_class_entry SWIGUNUSED internal_ce; - SWIG_InitializeModule((void*)&module_number); -#if PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION == 0 - /* This hack is needed to avoid segfaults. */ - EG(class_table) = CG(class_table); -#endif -%} diff --git a/linux/bin/swig/share/swig/4.1.0/php/phpinterfaces.i b/linux/bin/swig/share/swig/4.1.0/php/phpinterfaces.i deleted file mode 100755 index 5b1da8b7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/phpinterfaces.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * phpinterfaces.i - * - * Define "known" PHP interfaces. - * - * These can be added at MINIT time (which is when PHP loads the extension - * module). - * - * Any interface can be added via phpinterfaces, but looking up the - * zend_class_entry by name has to wait until RINIT time, which means it - * happens for every request. - * ----------------------------------------------------------------------------- */ - -// Note: Abstract interfaces such as "Traversable" can't be used in -// "implements" so are not relevant here. - -%insert(header) %{ - -#define SWIG_PHP_INTERFACE_Iterator_CE zend_ce_iterator -#define SWIG_PHP_INTERFACE_Iterator_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_IteratorAggregate_CE zend_ce_aggregate -#define SWIG_PHP_INTERFACE_IteratorAggregate_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_ArrayAccess_CE zend_ce_arrayaccess -#define SWIG_PHP_INTERFACE_ArrayAccess_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_Serializable_CE zend_ce_serializable -#define SWIG_PHP_INTERFACE_Serializable_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_Countable_CE zend_ce_countable -#define SWIG_PHP_INTERFACE_Countable_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_OuterIterator_CE spl_ce_OuterIterator -#define SWIG_PHP_INTERFACE_OuterIterator_HEADER "ext/spl/spl_iterators.h" - -#define SWIG_PHP_INTERFACE_RecursiveIterator_CE spl_ce_RecursiveIterator -#define SWIG_PHP_INTERFACE_RecursiveIterator_HEADER "ext/spl/spl_iterators.h" - -#define SWIG_PHP_INTERFACE_SeekableIterator_CE spl_ce_SeekableIterator -#define SWIG_PHP_INTERFACE_SeekableIterator_HEADER "ext/spl/spl_iterators.h" - -#define SWIG_PHP_INTERFACE_SplObserver_CE spl_ce_SplObserver -#define SWIG_PHP_INTERFACE_SplObserver_HEADER "ext/spl/spl_observer.h" - -#define SWIG_PHP_INTERFACE_SplSubject_CE spl_ce_SplSubject -#define SWIG_PHP_INTERFACE_SplSubject_HEADER "ext/spl/spl_observer.h" - -#define SWIG_PHP_INTERFACE_DateTimeInterface_CE php_date_get_interface_ce() -#define SWIG_PHP_INTERFACE_DateTimeInterface_HEADER "ext/date/php_date.h" - -// The "json" extension needs to be loaded earlier that us for this to work. -#define SWIG_PHP_INTERFACE_JsonSerializable_CE php_json_serializable_ce -#define SWIG_PHP_INTERFACE_JsonSerializable_HEADER "ext/json/php_json.h" - -// New in PHP 8.0. -#if PHP_MAJOR_VERSION >= 8 -# define SWIG_PHP_INTERFACE_Stringable_CE zend_ce_stringable -# define SWIG_PHP_INTERFACE_Stringable_HEADER "zend_interfaces.h" -#endif - -%} diff --git a/linux/bin/swig/share/swig/4.1.0/php/phpkw.swg b/linux/bin/swig/share/swig/4.1.0/php/phpkw.swg deleted file mode 100755 index 443ac8bf..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/phpkw.swg +++ /dev/null @@ -1,888 +0,0 @@ -/* ----------------------------------------------------------------------------- - * phpkw.swg - * ----------------------------------------------------------------------------- */ - -/* Keyword (case insensitive) */ -#define PHPKW(x) %keywordwarn("'" `x` "' is a PHP keyword",sourcefmt="%(lower)s",rename="c_%s") `x` - -/* Keyword, except ok as a function */ -#define PHPKW_ok_as_function(x) %keywordwarn("'" `x` "' is a PHP keyword, renaming to 'c_" `x` "'",%$not %$isfunction,sourcefmt="%(lower)s",rename="c_%s") `x` - -/* Class (case insensitive) */ -#define PHPCN(x) %keywordwarn("'" `x` "' is a PHP reserved class name",%$isclass,sourcefmt="%(lower)s",rename="c_%s") `x` - -/* Constant (case insensitive) */ -#define PHPBN1a(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "enum conflicts with a built-in constant '"`x`"' in PHP"),%$isenumitem,sourcefmt="%(lower)s") `x` -#define PHPBN1b(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "constant conflicts with a built-in constant '"`x`"' in PHP"),%$isconstant,sourcefmt="%(lower)s") `x` -%define PHPBN1(X) - PHPBN1a(X); PHPBN1b(X) -%enddef - -/* Constant (case sensitive) */ -#define PHPBN2a(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "enum conflicts with a built-in constant '"`x`"' in PHP"),%$isenumitem) `x` -#define PHPBN2b(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "constant conflicts with a built-in constant '"`x`"' in PHP"),%$isconstant) `x` -%define PHPBN2(X) - PHPBN2a(X); PHPBN2b(X) -%enddef - -#define PHPFN(x) %keywordwarn("'" `x` "' is a PHP built-in function",sourcefmt="%(lower)s",%$isfunction,%$not %$ismember,rename="c_%s") `x` - -/* From: http://php.net/manual/en/reserved.keywords.php - * "You cannot use any of the following words as constants, class names, - * function or method names. Using them as variable names is generally OK, but - * could lead to confusion." - */ -/* Check is case insensitive - these *MUST* be listed in lower case here */ -PHPKW(abstract); -PHPKW(and); -PHPKW(as); -PHPKW(break); -PHPKW(callable); -PHPKW(case); -PHPKW(catch); -PHPKW(class); -PHPKW(clone); -PHPKW(const); -PHPKW(continue); -PHPKW(declare); -PHPKW(default); -PHPKW(do); -PHPKW(else); -PHPKW(elseif); -PHPKW(enddeclare); -PHPKW(endfor); -PHPKW(endforeach); -PHPKW(endif); -PHPKW(endswitch); -PHPKW(endwhile); -PHPKW(extends); -PHPKW(final); -PHPKW(finally); -PHPKW(fn); // as of PHP 7.4 -PHPKW(for); -PHPKW(foreach); -PHPKW(function); -PHPKW(global); -PHPKW(goto); -PHPKW(if); -PHPKW(implements); -PHPKW(instanceof); -PHPKW(insteadof); -PHPKW(interface); -PHPKW(match); // as of PHP 8.0 -PHPKW(namespace); -PHPKW(new); -PHPKW(or); -PHPKW(private); -PHPKW(protected); -PHPKW(public); -PHPKW(static); -PHPKW(switch); -PHPKW(throw); -PHPKW(trait); -PHPKW(try); -PHPKW(use); -PHPKW(var); -PHPKW(while); -PHPKW(xor); -PHPKW(yield); - -/* PHP 8.1 made `readonly` a keyword, but (unlike any other keyword it seems) - * it may still be used as a function name. - */ -PHPKW_ok_as_function(readonly); - -// Compile-time "magic" constants -// From: http://php.net/manual/en/reserved.keywords.php -// also at: http://php.net/manual/en/language.constants.predefined.php -/* These *MUST* be listed in lower case here */ -PHPKW(__class__); -PHPKW(__dir__); -PHPKW(__file__); -PHPKW(__function__); -PHPKW(__line__); -PHPKW(__method__); -PHPKW(__namespace__); -PHPKW(__trait__); - -/* We classify these as built-in names since they conflict, but PHP still runs */ - -/* Predefined case-insensitive constants */ -/* These *MUST* be listed in lower case here */ -PHPBN1(null); -PHPBN1(true); -PHPBN1(false); - -/* "Core Predefined Constants" from http://php.net/manual/en/reserved.constants.php */ -/* These are case sensitive */ -PHPBN2(PHP_VERSION); -PHPBN2(PHP_MAJOR_VERSION); -PHPBN2(PHP_MINOR_VERSION); -PHPBN2(PHP_RELEASE_VERSION); -PHPBN2(PHP_VERSION_ID); -PHPBN2(PHP_EXTRA_VERSION); -PHPBN2(PHP_ZTS); -PHPBN2(PHP_DEBUG); -PHPBN2(PHP_MAXPATHLEN); -PHPBN2(PHP_OS); -PHPBN2(PHP_SAPI); -PHPBN2(PHP_EOL); -PHPBN2(PHP_INT_MAX); -PHPBN2(PHP_INT_SIZE); -PHPBN2(PHP_FLOAT_DIG); // Since 7.2.0 -PHPBN2(PHP_FLOAT_EPSILON); // Since 7.2.0 -PHPBN2(PHP_FLOAT_MIN); // Since 7.2.0 -PHPBN2(PHP_FLOAT_MAX); // Since 7.2.0 -PHPBN2(DEFAULT_INCLUDE_PATH); -PHPBN2(PEAR_INSTALL_DIR); -PHPBN2(PEAR_EXTENSION_DIR); -PHPBN2(PHP_EXTENSION_DIR); -PHPBN2(PHP_PREFIX); -PHPBN2(PHP_BINDIR); -PHPBN2(PHP_BINARY); -PHPBN2(PHP_MANDIR); -PHPBN2(PHP_LIBDIR); -PHPBN2(PHP_DATADIR); -PHPBN2(PHP_SYSCONFDIR); -PHPBN2(PHP_LOCALSTATEDIR); -PHPBN2(PHP_CONFIG_FILE_PATH); -PHPBN2(PHP_CONFIG_FILE_SCAN_DIR); -PHPBN2(PHP_SHLIB_SUFFIX); -PHPBN2(PHP_FD_SETSIZE); // Since 7.1.0 -PHPBN2(E_ERROR); -PHPBN2(E_WARNING); -PHPBN2(E_PARSE); -PHPBN2(E_NOTICE); -PHPBN2(E_CORE_ERROR); -PHPBN2(E_CORE_WARNING); -PHPBN2(E_COMPILE_ERROR); -PHPBN2(E_COMPILE_WARNING); -PHPBN2(E_USER_ERROR); -PHPBN2(E_USER_WARNING); -PHPBN2(E_USER_NOTICE); -PHPBN2(E_RECOVERABLE_ERROR); -PHPBN2(E_DEPRECATED); -PHPBN2(E_USER_DEPRECATED); -PHPBN2(E_ALL); -PHPBN2(E_STRICT); -PHPBN2(__COMPILER_HALT_OFFSET__); -// TRUE, FALSE, NULL are listed on the same page, but are actually -// case-insensitive, whereas all the other constants listed there seem to be -// case-sensitive, so we handle TRUE, FALSE, NULL in PHPBN1. -PHPBN2(PHP_OUTPUT_HANDLER_START); -PHPBN2(PHP_OUTPUT_HANDLER_CONT); -PHPBN2(PHP_OUTPUT_HANDLER_END); -/* Since 7.4.0 (Microsoft Windows only) */ -PHPBN2(PHP_WINDOWS_EVENT_CTRL_C); -PHPBN2(PHP_WINDOWS_EVENT_CTRL_BREAK); -/* These don't actually seem to be set (tested on Linux, I guess they're - * Windows only?) */ -PHPBN2(PHP_WINDOWS_NT_DOMAIN_CONTROLLER); -PHPBN2(PHP_WINDOWS_NT_SERVER); -PHPBN2(PHP_WINDOWS_NT_WORKSTATION); -PHPBN2(PHP_WINDOWS_VERSION_BUILD); -PHPBN2(PHP_WINDOWS_VERSION_MAJOR); -PHPBN2(PHP_WINDOWS_VERSION_MINOR); -PHPBN2(PHP_WINDOWS_VERSION_PLATFORM); -PHPBN2(PHP_WINDOWS_VERSION_PRODUCTTYPE); -PHPBN2(PHP_WINDOWS_VERSION_SP_MAJOR); -PHPBN2(PHP_WINDOWS_VERSION_SP_MINOR); -PHPBN2(PHP_WINDOWS_VERSION_SUITEMASK); -/* "Standard Predefined Constants" from http://php.net/manual/en/reserved.constants.php */ -PHPBN2(EXTR_OVERWRITE); -PHPBN2(EXTR_SKIP); -PHPBN2(EXTR_PREFIX_SAME); -PHPBN2(EXTR_PREFIX_ALL); -PHPBN2(EXTR_PREFIX_INVALID); -PHPBN2(EXTR_PREFIX_IF_EXISTS); -PHPBN2(EXTR_IF_EXISTS); -PHPBN2(SORT_ASC); -PHPBN2(SORT_DESC); -PHPBN2(SORT_REGULAR); -PHPBN2(SORT_NUMERIC); -PHPBN2(SORT_STRING); -PHPBN2(CASE_LOWER); -PHPBN2(CASE_UPPER); -PHPBN2(COUNT_NORMAL); -PHPBN2(COUNT_RECURSIVE); -PHPBN2(ASSERT_ACTIVE); -PHPBN2(ASSERT_CALLBACK); -PHPBN2(ASSERT_BAIL); -PHPBN2(ASSERT_WARNING); -PHPBN2(ASSERT_QUIET_EVAL); -PHPBN2(CONNECTION_ABORTED); -PHPBN2(CONNECTION_NORMAL); -PHPBN2(CONNECTION_TIMEOUT); -PHPBN2(INI_USER); -PHPBN2(INI_PERDIR); -PHPBN2(INI_SYSTEM); -PHPBN2(INI_ALL); -PHPBN2(INI_SCANNER_NORMAL); -PHPBN2(INI_SCANNER_RAW); -PHPBN2(M_E); -PHPBN2(M_LOG2E); -PHPBN2(M_LOG10E); -PHPBN2(M_LN2); -PHPBN2(M_LN10); -PHPBN2(M_PI); -PHPBN2(M_PI_2); -PHPBN2(M_PI_4); -PHPBN2(M_1_PI); -PHPBN2(M_2_PI); -PHPBN2(M_2_SQRTPI); -PHPBN2(M_SQRT2); -PHPBN2(M_SQRT1_2); -PHPBN2(M_EULER); -PHPBN2(M_LNPI); -PHPBN2(M_SQRT3); -PHPBN2(M_SQRTPI); -PHPBN2(CRYPT_SALT_LENGTH); -PHPBN2(CRYPT_STD_DES); -PHPBN2(CRYPT_EXT_DES); -PHPBN2(CRYPT_MD5); -PHPBN2(CRYPT_BLOWFISH); -PHPBN2(DIRECTORY_SEPARATOR); -PHPBN2(SEEK_SET); -PHPBN2(SEEK_CUR); -PHPBN2(SEEK_END); -PHPBN2(LOCK_SH); -PHPBN2(LOCK_EX); -PHPBN2(LOCK_UN); -PHPBN2(LOCK_NB); -PHPBN2(HTML_SPECIALCHARS); -PHPBN2(HTML_ENTITIES); -PHPBN2(ENT_COMPAT); -PHPBN2(ENT_QUOTES); -PHPBN2(ENT_NOQUOTES); -PHPBN2(INFO_GENERAL); -PHPBN2(INFO_CREDITS); -PHPBN2(INFO_CONFIGURATION); -PHPBN2(INFO_MODULES); -PHPBN2(INFO_ENVIRONMENT); -PHPBN2(INFO_VARIABLES); -PHPBN2(INFO_LICENSE); -PHPBN2(INFO_ALL); -PHPBN2(CREDITS_GROUP); -PHPBN2(CREDITS_GENERAL); -PHPBN2(CREDITS_SAPI); -PHPBN2(CREDITS_MODULES); -PHPBN2(CREDITS_DOCS); -PHPBN2(CREDITS_FULLPAGE); -PHPBN2(CREDITS_QA); -PHPBN2(CREDITS_ALL); -PHPBN2(STR_PAD_LEFT); -PHPBN2(STR_PAD_RIGHT); -PHPBN2(STR_PAD_BOTH); -PHPBN2(PATHINFO_DIRNAME); -PHPBN2(PATHINFO_BASENAME); -PHPBN2(PATHINFO_EXTENSION); -PHPBN2(PATHINFO_FILENAME); -PHPBN2(PATH_SEPARATOR); -PHPBN2(CHAR_MAX); -PHPBN2(LC_CTYPE); -PHPBN2(LC_NUMERIC); -PHPBN2(LC_TIME); -PHPBN2(LC_COLLATE); -PHPBN2(LC_MONETARY); -PHPBN2(LC_ALL); -PHPBN2(LC_MESSAGES); -PHPBN2(ABDAY_1); -PHPBN2(ABDAY_2); -PHPBN2(ABDAY_3); -PHPBN2(ABDAY_4); -PHPBN2(ABDAY_5); -PHPBN2(ABDAY_6); -PHPBN2(ABDAY_7); -PHPBN2(DAY_1); -PHPBN2(DAY_2); -PHPBN2(DAY_3); -PHPBN2(DAY_4); -PHPBN2(DAY_5); -PHPBN2(DAY_6); -PHPBN2(DAY_7); -PHPBN2(ABMON_1); -PHPBN2(ABMON_2); -PHPBN2(ABMON_3); -PHPBN2(ABMON_4); -PHPBN2(ABMON_5); -PHPBN2(ABMON_6); -PHPBN2(ABMON_7); -PHPBN2(ABMON_8); -PHPBN2(ABMON_9); -PHPBN2(ABMON_10); -PHPBN2(ABMON_11); -PHPBN2(ABMON_12); -PHPBN2(MON_1); -PHPBN2(MON_2); -PHPBN2(MON_3); -PHPBN2(MON_4); -PHPBN2(MON_5); -PHPBN2(MON_6); -PHPBN2(MON_7); -PHPBN2(MON_8); -PHPBN2(MON_9); -PHPBN2(MON_10); -PHPBN2(MON_11); -PHPBN2(MON_12); -PHPBN2(AM_STR); -PHPBN2(PM_STR); -PHPBN2(D_T_FMT); -PHPBN2(D_FMT); -PHPBN2(T_FMT); -PHPBN2(T_FMT_AMPM); -PHPBN2(ERA); -PHPBN2(ERA_YEAR); -PHPBN2(ERA_D_T_FMT); -PHPBN2(ERA_D_FMT); -PHPBN2(ERA_T_FMT); -PHPBN2(ALT_DIGITS); -PHPBN2(INT_CURR_SYMBOL); -PHPBN2(CURRENCY_SYMBOL); -PHPBN2(CRNCYSTR); -PHPBN2(MON_DECIMAL_POINT); -PHPBN2(MON_THOUSANDS_SEP); -PHPBN2(MON_GROUPING); -PHPBN2(POSITIVE_SIGN); -PHPBN2(NEGATIVE_SIGN); -PHPBN2(INT_FRAC_DIGITS); -PHPBN2(FRAC_DIGITS); -PHPBN2(P_CS_PRECEDES); -PHPBN2(P_SEP_BY_SPACE); -PHPBN2(N_CS_PRECEDES); -PHPBN2(N_SEP_BY_SPACE); -PHPBN2(P_SIGN_POSN); -PHPBN2(N_SIGN_POSN); -PHPBN2(DECIMAL_POINT); -PHPBN2(RADIXCHAR); -PHPBN2(THOUSANDS_SEP); -PHPBN2(THOUSEP); -PHPBN2(GROUPING); -PHPBN2(YESEXPR); -PHPBN2(NOEXPR); -PHPBN2(YESSTR); -PHPBN2(NOSTR); -PHPBN2(CODESET); -PHPBN2(LOG_EMERG); -PHPBN2(LOG_ALERT); -PHPBN2(LOG_CRIT); -PHPBN2(LOG_ERR); -PHPBN2(LOG_WARNING); -PHPBN2(LOG_NOTICE); -PHPBN2(LOG_INFO); -PHPBN2(LOG_DEBUG); -PHPBN2(LOG_KERN); -PHPBN2(LOG_USER); -PHPBN2(LOG_MAIL); -PHPBN2(LOG_DAEMON); -PHPBN2(LOG_AUTH); -PHPBN2(LOG_SYSLOG); -PHPBN2(LOG_LPR); -PHPBN2(LOG_NEWS); -PHPBN2(LOG_UUCP); -PHPBN2(LOG_CRON); -PHPBN2(LOG_AUTHPRIV); -PHPBN2(LOG_LOCAL0); -PHPBN2(LOG_LOCAL1); -PHPBN2(LOG_LOCAL2); -PHPBN2(LOG_LOCAL3); -PHPBN2(LOG_LOCAL4); -PHPBN2(LOG_LOCAL5); -PHPBN2(LOG_LOCAL6); -PHPBN2(LOG_LOCAL7); -PHPBN2(LOG_PID); -PHPBN2(LOG_CONS); -PHPBN2(LOG_ODELAY); -PHPBN2(LOG_NDELAY); -PHPBN2(LOG_NOWAIT); -PHPBN2(LOG_PERROR); - -PHPBN2(PREG_BACKTRACK_LIMIT_ERROR); -PHPBN2(PREG_BAD_UTF8_ERROR); -PHPBN2(PREG_INTERNAL_ERROR); -PHPBN2(PREG_NO_ERROR); -PHPBN2(PREG_RECURSION_LIMIT_ERROR); -PHPBN2(UPLOAD_ERR_EXTENSION); -PHPBN2(STREAM_SHUT_RD); -PHPBN2(STREAM_SHUT_WR); -PHPBN2(STREAM_SHUT_RDWR); -PHPBN2(CURLE_FILESIZE_EXCEEDED); -PHPBN2(CURLE_FTP_SSL_FAILED); -PHPBN2(CURLE_LDAP_INVALID_URL); -PHPBN2(CURLFTPAUTH_DEFAULT); -PHPBN2(CURLFTPAUTH_SSL); -PHPBN2(CURLFTPAUTH_TLS); -PHPBN2(CURLFTPSSL_ALL); -PHPBN2(CURLFTPSSL_CONTROL); -PHPBN2(CURLFTPSSL_NONE); -PHPBN2(CURLFTPSSL_TRY); -PHPBN2(CURLOPT_FTP_SSL); -PHPBN2(CURLOPT_FTPSSLAUTH); -PHPBN2(CURLOPT_TCP_NODELAY); -PHPBN2(CURLOPT_TIMEOUT_MS); -PHPBN2(CURLOPT_CONNECTTIMEOUT_MS); -PHPBN2(GMP_VERSION); -PHPBN2(OPENSSL_VERSION_NUMBER); -PHPBN2(SNMP_OID_OUTPUT_FULL); -PHPBN2(SNMP_OID_OUTPUT_NUMERIC); -PHPBN2(MSG_EAGAIN); -PHPBN2(MSG_ENOMSG); - -PHPBN2(CURLOPT_PROGRESSFUNCTION); -PHPBN2(IMG_FILTER_PIXELATE); -PHPBN2(JSON_ERROR_CTRL_CHAR); -PHPBN2(JSON_ERROR_DEPTH); -PHPBN2(JSON_ERROR_NONE); -PHPBN2(JSON_ERROR_STATE_MISMATCH); -PHPBN2(JSON_ERROR_SYNTAX); -PHPBN2(JSON_FORCE_OBJECT); -PHPBN2(JSON_HEX_TAG); -PHPBN2(JSON_HEX_AMP); -PHPBN2(JSON_HEX_APOS); -PHPBN2(JSON_HEX_QUOT); -PHPBN2(LDAP_OPT_NETWORK_TIMEOUT); -PHPBN2(LIBXML_LOADED_VERSION); -PHPBN2(PREG_BAD_UTF8_OFFSET_ERROR); -PHPBN2(BUS_ADRALN); -PHPBN2(BUS_ADRERR); -PHPBN2(BUS_OBJERR); -PHPBN2(CLD_CONTIUNED); -PHPBN2(CLD_DUMPED); -PHPBN2(CLD_EXITED); -PHPBN2(CLD_KILLED); -PHPBN2(CLD_STOPPED); -PHPBN2(CLD_TRAPPED); -PHPBN2(FPE_FLTDIV); -PHPBN2(FPE_FLTINV); -PHPBN2(FPE_FLTOVF); -PHPBN2(FPE_FLTRES); -PHPBN2(FPE_FLTSUB); -PHPBN2(FPE_FLTUND); -PHPBN2(FPE_INTDIV); -PHPBN2(FPE_INTOVF); -PHPBN2(ILL_BADSTK); -PHPBN2(ILL_COPROC); -PHPBN2(ILL_ILLADR); -PHPBN2(ILL_ILLOPC); -PHPBN2(ILL_ILLOPN); -PHPBN2(ILL_ILLTRP); -PHPBN2(ILL_PRVOPC); -PHPBN2(ILL_PRVREG); -PHPBN2(POLL_ERR); -PHPBN2(POLL_HUP); -PHPBN2(POLL_IN); -PHPBN2(POLL_MSG); -PHPBN2(POLL_OUT); -PHPBN2(POLL_PRI); -PHPBN2(SEGV_ACCERR); -PHPBN2(SEGV_MAPERR); -PHPBN2(SI_ASYNCIO); -PHPBN2(SI_KERNEL); -PHPBN2(SI_MESGQ); -PHPBN2(SI_NOINFO); -PHPBN2(SI_QUEUE); -PHPBN2(SI_SIGIO); -PHPBN2(SI_TIMER); -PHPBN2(SI_TKILL); -PHPBN2(SI_USER); -PHPBN2(SIG_BLOCK); -PHPBN2(SIG_SETMASK); -PHPBN2(SIG_UNBLOCK); -PHPBN2(TRAP_BRKPT); -PHPBN2(TRAP_TRACE); - -PHPBN2(ENT_DISALLOWED); -PHPBN2(ENT_HTML401); -PHPBN2(ENT_HTML5); -PHPBN2(ENT_SUBSTITUTE); -PHPBN2(ENT_XML1); -PHPBN2(ENT_XHTML); -PHPBN2(IPPROTO_IP); -PHPBN2(IPPROTO_IPV6); -PHPBN2(IPV6_MULTICAST_HOPS); -PHPBN2(IPV6_MULTICAST_IF); -PHPBN2(IPV6_MULTICAST_LOOP); -PHPBN2(IP_MULTICAST_IF); -PHPBN2(IP_MULTICAST_LOOP); -PHPBN2(IP_MULTICAST_TTL); -PHPBN2(MCAST_JOIN_GROUP); -PHPBN2(MCAST_LEAVE_GROUP); -PHPBN2(MCAST_BLOCK_SOURCE); -PHPBN2(MCAST_UNBLOCK_SOURCE); -PHPBN2(MCAST_JOIN_SOURCE_GROUP); -PHPBN2(MCAST_LEAVE_SOURCE_GROUP); -PHPBN2(CURLOPT_MAX_RECV_SPEED_LARGE); -PHPBN2(CURLOPT_MAX_SEND_SPEED_LARGE); -PHPBN2(LIBXML_HTML_NODEFDTD); -PHPBN2(LIBXML_HTML_NOIMPLIED); -PHPBN2(LIBXML_PEDANTIC); -PHPBN2(OPENSSL_CIPHER_AES_128_CBC); -PHPBN2(OPENSSL_CIPHER_AES_192_CBC); -PHPBN2(OPENSSL_CIPHER_AES_256_CBC); -PHPBN2(OPENSSL_RAW_DATA); -PHPBN2(OPENSSL_ZERO_PADDING); -PHPBN2(PHP_OUTPUT_HANDLER_CLEAN); -PHPBN2(PHP_OUTPUT_HANDLER_CLEANABLE); -PHPBN2(PHP_OUTPUT_HANDLER_DISABLED); -PHPBN2(PHP_OUTPUT_HANDLER_FINAL); -PHPBN2(PHP_OUTPUT_HANDLER_FLUSH); -PHPBN2(PHP_OUTPUT_HANDLER_FLUSHABLE); -PHPBN2(PHP_OUTPUT_HANDLER_REMOVABLE); -PHPBN2(PHP_OUTPUT_HANDLER_STARTED); -PHPBN2(PHP_OUTPUT_HANDLER_STDFLAGS); -PHPBN2(PHP_OUTPUT_HANDLER_WRITE); -PHPBN2(PHP_SESSION_ACTIVE); -PHPBN2(PHP_SESSION_DISABLED); -PHPBN2(PHP_SESSION_NONE); -PHPBN2(STREAM_META_ACCESS); -PHPBN2(STREAM_META_GROUP); -PHPBN2(STREAM_META_GROUP_NAME); -PHPBN2(STREAM_META_OWNER); -PHPBN2(STREAM_META_OWNER_NAME); -PHPBN2(STREAM_META_TOUCH); -PHPBN2(ZLIB_ENCODING_DEFLATE); -PHPBN2(ZLIB_ENCODING_GZIP); -PHPBN2(ZLIB_ENCODING_RAW); -PHPBN2(U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR); -PHPBN2(IDNA_CHECK_BIDI); -PHPBN2(IDNA_CHECK_CONTEXTJ); -PHPBN2(IDNA_NONTRANSITIONAL_TO_ASCII); -PHPBN2(IDNA_NONTRANSITIONAL_TO_UNICODE); -PHPBN2(INTL_IDNA_VARIANT_2003); -PHPBN2(INTL_IDNA_VARIANT_UTS46); -PHPBN2(IDNA_ERROR_EMPTY_LABEL); -PHPBN2(IDNA_ERROR_LABEL_TOO_LONG); -PHPBN2(IDNA_ERROR_DOMAIN_NAME_TOO_LONG); -PHPBN2(IDNA_ERROR_LEADING_HYPHEN); -PHPBN2(IDNA_ERROR_TRAILING_HYPHEN); -PHPBN2(IDNA_ERROR_HYPHEN_3_4); -PHPBN2(IDNA_ERROR_LEADING_COMBINING_MARK); -PHPBN2(IDNA_ERROR_DISALLOWED); -PHPBN2(IDNA_ERROR_PUNYCODE); -PHPBN2(IDNA_ERROR_LABEL_HAS_DOT); -PHPBN2(IDNA_ERROR_INVALID_ACE_LABEL); -PHPBN2(IDNA_ERROR_BIDI); -PHPBN2(IDNA_ERROR_CONTEXTJ); -PHPBN2(JSON_PRETTY_PRINT); -PHPBN2(JSON_UNESCAPED_SLASHES); -PHPBN2(JSON_NUMERIC_CHECK); -PHPBN2(JSON_UNESCAPED_UNICODE); -PHPBN2(JSON_BIGINT_AS_STRING); - -PHPBN2(IMG_AFFINE_TRANSLATE); -PHPBN2(IMG_AFFINE_SCALE); -PHPBN2(IMG_AFFINE_ROTATE); -PHPBN2(IMG_AFFINE_SHEAR_HORIZONTAL); -PHPBN2(IMG_AFFINE_SHEAR_VERTICAL); -PHPBN2(IMG_CROP_DEFAULT); -PHPBN2(IMG_CROP_TRANSPARENT); -PHPBN2(IMG_CROP_BLACK); -PHPBN2(IMG_CROP_WHITE); -PHPBN2(IMG_CROP_SIDES); -PHPBN2(IMG_FLIP_BOTH); -PHPBN2(IMG_FLIP_HORIZONTAL); -PHPBN2(IMG_FLIP_VERTICAL); -PHPBN2(IMG_BELL); -PHPBN2(IMG_BESSEL); -PHPBN2(IMG_BICUBIC); -PHPBN2(IMG_BICUBIC_FIXED); -PHPBN2(IMG_BLACKMAN); -PHPBN2(IMG_BOX); -PHPBN2(IMG_BSPLINE); -PHPBN2(IMG_CATMULLROM); -PHPBN2(IMG_GAUSSIAN); -PHPBN2(IMG_GENERALIZED_CUBIC); -PHPBN2(IMG_HERMITE); -PHPBN2(IMG_HAMMING); -PHPBN2(IMG_HANNING); -PHPBN2(IMG_MITCHELL); -PHPBN2(IMG_POWER); -PHPBN2(IMG_QUADRATIC); -PHPBN2(IMG_SINC); -PHPBN2(IMG_NEAREST_NEIGHBOUR); -PHPBN2(IMG_WEIGHTED4); -PHPBN2(IMG_TRIANGLE); -PHPBN2(JSON_ERROR_RECURSION); -PHPBN2(JSON_ERROR_INF_OR_NAN); -PHPBN2(JSON_ERROR_UNSUPPORTED_TYPE); -PHPBN2(MYSQLI_SERVER_PUBLIC_KEY); - -PHPBN2(LDAP_ESCAPE_DN); -PHPBN2(LDAP_ESCAPE_FILTER); -PHPBN2(OPENSSL_DEFAULT_STREAM_CIPHERS); -PHPBN2(STREAM_CRYPTO_METHOD_ANY_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_ANY_SERVER); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_0_SERVER); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_1_SERVER); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_2_SERVER); -PHPBN2(PGSQL_CONNECT_ASYNC); -PHPBN2(PGSQL_CONNECTION_AUTH_OK); -PHPBN2(PGSQL_CONNECTION_AWAITING_RESPONSE); -PHPBN2(PGSQL_CONNECTION_MADE); -PHPBN2(PGSQL_CONNECTION_SETENV); -PHPBN2(PGSQL_CONNECTION_SSL_STARTUP); -PHPBN2(PGSQL_CONNECTION_STARTED); -PHPBN2(PGSQL_DML_ESCAPE); -PHPBN2(PGSQL_POLLING_ACTIVE); -PHPBN2(PGSQL_POLLING_FAILED); -PHPBN2(PGSQL_POLLING_OK); -PHPBN2(PGSQL_POLLING_READING); -PHPBN2(PGSQL_POLLING_WRITING); - -/* Class names reserved by PHP. */ -/* Check is case insensitive - these *MUST* be listed in lower case here. */ -PHPCN(directory); -PHPCN(stdclass); -PHPCN(__php_incomplete_class); -PHPCN(exception); -PHPCN(errorexception); -PHPCN(php_user_filter); -PHPCN(closure); -PHPCN(generator); -PHPCN(self); -PHPCN(parent); -/* http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.other.classes */ -PHPCN(bool); // As of PHP 7.0 -PHPCN(int); // As of PHP 7.0 -PHPCN(float); // As of PHP 7.0 -PHPCN(string); // As of PHP 7.0 -PHPCN(null); // As of PHP 7.0 -PHPCN(true); // As of PHP 7.0 -PHPCN(false); // As of PHP 7.0 -PHPCN(resource); // As of PHP 7.0 (currently works but reserved) -PHPCN(object); // As of PHP 7.0 (currently works but reserved) -PHPCN(mixed); // As of PHP 7.0 (currently works but reserved) -PHPCN(numeric); // As of PHP 7.0 (currently works but reserved) -/* http://php.net/manual/en/migration71.incompatible.php#migration71.incompatible.invalid-class-names */ -PHPCN(iterable); // As of PHP 7.1 -PHPCN(void); // As of PHP 7.1 -/* Predefined interfaces and classes, introduced in PHP 7.0.0 */ -PHPCN(arithmeticerror); -PHPCN(assertionerror); -PHPCN(divisionbyzeroerror); -PHPCN(error); -PHPCN(throwable); -PHPCN(parseerror); -PHPCN(typeerror); -/* From extensions (which of these are actually predefined depends which - * extensions are loaded by default). */ -PHPCN(xmlwriter); -PHPCN(libxmlerror); -PHPCN(simplexmlelement); -PHPCN(soapclient); -PHPCN(soapvar); -PHPCN(soapserver); -PHPCN(soapfault); -PHPCN(soapparam); -PHPCN(soapheader); -PHPCN(recursiveiteratoriterator); -PHPCN(filteriterator); -PHPCN(recursivefilteriterator); -PHPCN(parentiterator); -PHPCN(limititerator); -PHPCN(cachingiterator); -PHPCN(recursivecachingiterator); -PHPCN(iteratoriterator); -PHPCN(norewinditerator); -PHPCN(appenditerator); -PHPCN(infiniteiterator); -PHPCN(emptyiterator); -PHPCN(arrayobject); -PHPCN(arrayiterator); -PHPCN(recursivearrayiterator); -PHPCN(splfileinfo); -PHPCN(directoryiterator); -PHPCN(recursivedirectoryiterator); -PHPCN(splfileobject); -PHPCN(spltempfileobject); -PHPCN(simplexmliterator); -PHPCN(logicexception); -PHPCN(badfunctioncallexception); -PHPCN(badmethodcallexception); -PHPCN(domainexception); -PHPCN(invalidargumentexception); -PHPCN(lengthexception); -PHPCN(outofrangeexception); -PHPCN(runtimeexception); -PHPCN(outofboundsexception); -PHPCN(overflowexception); -PHPCN(rangeexception); -PHPCN(underflowexception); -PHPCN(unexpectedvalueexception); -PHPCN(splobjectstorage); -PHPCN(reflectionexception); -PHPCN(reflection); -PHPCN(reflectionfunction); -PHPCN(reflectionparameter); -PHPCN(reflectionmethod); -PHPCN(reflectionclass); -PHPCN(reflectionobject); -PHPCN(reflectionproperty); -PHPCN(reflectionextension); -PHPCN(domexception); -PHPCN(domstringlist); -PHPCN(domnamelist); -PHPCN(domimplementationlist); -PHPCN(domimplementationsource); -PHPCN(domimplementation); -PHPCN(domnode); -PHPCN(domnamespacenode); -PHPCN(domdocumentfragment); -PHPCN(domdocument); -PHPCN(domnodelist); -PHPCN(domnamednodemap); -PHPCN(domcharacterdata); -PHPCN(domattr); -PHPCN(domelement); -PHPCN(domtext); -PHPCN(domcomment); -PHPCN(domtypeinfo); -PHPCN(domuserdatahandler); -PHPCN(domdomerror); -PHPCN(domerrorhandler); -PHPCN(domlocator); -PHPCN(domconfiguration); -PHPCN(domcdatasection); -PHPCN(domdocumenttype); -PHPCN(domnotation); -PHPCN(domentity); -PHPCN(domentityreference); -PHPCN(domprocessinginstruction); -PHPCN(domstringextend); -PHPCN(domxpath); -PHPCN(xmlreader); -PHPCN(sqlitedatabase); -PHPCN(sqliteresult); -PHPCN(sqliteunbuffered); -PHPCN(sqliteexception); -PHPCN(datetime); - -/* Built-in PHP functions (incomplete). */ -/* Includes Array Functions - http://php.net/manual/en/ref.array.php */ -/* Check is case insensitive - these *MUST* be listed in lower case here */ -PHPFN(__halt_compiler); -PHPFN(acos); -PHPFN(array); -PHPFN(array_change_key_case); -PHPFN(array_chunk); -PHPFN(array_column); -PHPFN(array_combine); -PHPFN(array_count_values); -PHPFN(array_diff); -PHPFN(array_diff_assoc); -PHPFN(array_diff_key); -PHPFN(array_diff_uassoc); -PHPFN(array_diff_ukey); -PHPFN(array_fill); -PHPFN(array_fill_keys); -PHPFN(array_filter); -PHPFN(array_flip); -PHPFN(array_intersect); -PHPFN(array_intersect_assoc); -PHPFN(array_intersect_key); -PHPFN(array_intersect_uassoc); -PHPFN(array_intersect_ukey); -PHPFN(array_key_exists); -PHPFN(array_keys); -PHPFN(array_map); -PHPFN(array_merge); -PHPFN(array_merge_recursive); -PHPFN(array_multisort); -PHPFN(array_pad); -PHPFN(array_pop); -PHPFN(array_product); -PHPFN(array_push); -PHPFN(array_rand); -PHPFN(array_reduce); -PHPFN(array_replace); -PHPFN(array_replace_recursive); -PHPFN(array_reverse); -PHPFN(array_search); -PHPFN(array_shift); -PHPFN(array_slice); -PHPFN(array_splice); -PHPFN(array_sum); -PHPFN(array_udiff); -PHPFN(array_udiff_assoc); -PHPFN(array_udiff_uassoc); -PHPFN(array_uintersect); -PHPFN(array_uintersect_assoc); -PHPFN(array_uintersect_uassoc); -PHPFN(array_unique); -PHPFN(array_unshift); -PHPFN(array_values); -PHPFN(array_walk); -PHPFN(array_walk_recursive); -PHPFN(arsort); -PHPFN(asin); -PHPFN(asort); -PHPFN(atan); -PHPFN(atan2); -PHPFN(ceil); -PHPFN(compact); -PHPFN(cos); -PHPFN(cosh); -PHPFN(count); -PHPFN(current); -PHPFN(die); // "Language construct" -PHPFN(each); -PHPFN(echo); // "Language construct" -PHPFN(empty); -PHPFN(end); -PHPFN(eval); // "Language construct" -PHPFN(exit); // "Language construct" -PHPFN(exp); -PHPFN(extract); -PHPFN(floor); -PHPFN(fmod); -PHPFN(in_array); -PHPFN(include); // "Language construct" -PHPFN(include_once); // "Language construct" -PHPFN(isset); // "Language construct" -PHPFN(key); -PHPFN(key_exists); -PHPFN(krsort); -PHPFN(ksort); -PHPFN(list); // "Language construct" -PHPFN(log); -PHPFN(log10); -PHPFN(max); -PHPFN(min); -PHPFN(natcasesort); -PHPFN(natsort); -PHPFN(next); -PHPFN(pos); -PHPFN(pow); -PHPFN(prev); -PHPFN(print); // "Language construct" -PHPFN(range); -PHPFN(reset); -PHPFN(rsort); -PHPFN(require); // "Language construct" -PHPFN(require_once); // "Language construct" -PHPFN(return); // "Language construct" -PHPFN(shuffle); -PHPFN(sin); -PHPFN(sinh); -PHPFN(sizeof); -PHPFN(sort); -PHPFN(sqrt); -PHPFN(tan); -PHPFN(tanh); -PHPFN(uasort); -PHPFN(uksort); -PHPFN(unset); // "Language construct" -PHPFN(usort); - -#undef PHPKW -#undef PHPKW_ok_as_function -#undef PHPBN1a -#undef PHPBN1b -#undef PHPBN1 -#undef PHPBN2a -#undef PHPBN2b -#undef PHPBN2 -#undef PHPCN -#undef PHPFN diff --git a/linux/bin/swig/share/swig/4.1.0/php/phppointers.i b/linux/bin/swig/share/swig/4.1.0/php/phppointers.i deleted file mode 100755 index a4ff3c0b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/phppointers.i +++ /dev/null @@ -1,42 +0,0 @@ -%define %pass_by_ref( TYPE, PHP_TYPE, CONVERT_IN, CONVERT_OUT ) -%typemap(in,byref=1,phptype=PHP_TYPE) TYPE *REF ($*1_ltype tmp), - TYPE &REF ($*1_ltype tmp) -%{ - if (Z_ISREF($input)) { - CONVERT_IN(tmp, $*1_ltype, $input); - $1 = &tmp; - } else { - zend_type_error(SWIG_PHP_Arg_Error_Msg($argnum, Expected a reference)); - } -%} -%typemap(argout) TYPE *REF, - TYPE &REF -%{ - if (Z_ISREF($input)) { - CONVERT_OUT(Z_REFVAL($input), tmp$argnum); - } -%} -%enddef - -%pass_by_ref( size_t, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed int, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( int, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( unsigned int, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed short, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( short, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( unsigned short, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed long, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( long, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( unsigned long, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed char, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( char, "string", CONVERT_CHAR_IN, ZVAL_STRING ); -%pass_by_ref( unsigned char, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( float, "float", CONVERT_FLOAT_IN, ZVAL_DOUBLE ); -%pass_by_ref( double, "float", CONVERT_FLOAT_IN, ZVAL_DOUBLE ); - -%pass_by_ref( char *, "string", CONVERT_CHAR_IN, ZVAL_STRING ); diff --git a/linux/bin/swig/share/swig/4.1.0/php/phprun.swg b/linux/bin/swig/share/swig/4.1.0/php/phprun.swg deleted file mode 100755 index d3ad0d26..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/phprun.swg +++ /dev/null @@ -1,272 +0,0 @@ -/* ----------------------------------------------------------------------------- - * phprun.swg - * - * PHP runtime library - * ----------------------------------------------------------------------------- */ - -#define swig_owntype int - -#ifdef __cplusplus -extern "C" { -#endif - -#if PHP_MAJOR_VERSION < 7 -# error These bindings need PHP 7 or later - to generate PHP5 bindings use: SWIG < 4.0.0 and swig -php5 -#endif - -#include "zend_inheritance.h" -#include "zend_exceptions.h" -#include "zend_inheritance.h" - -#if PHP_MAJOR_VERSION == 7 -/* These macros were new in PHP 8.0. For PHP 7.x we define them to give the - * same result except without any type declarations. PHP 7.x supports type - * declarations, but not for the return type, and alternate types aren't - * supported, so we don't try to support these. - */ -# define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(name, byref, num_req, classes, types) \ - ZEND_BEGIN_ARG_INFO_EX(name, 0, byref, num_req) -# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, byref, num_req, types) \ - ZEND_BEGIN_ARG_INFO_EX(name, 0, byref, num_req) - -/* NB We can just ignore `default` here we currently always pass NULL for it - * (this mechanism for specifying default parameter values was new in PHP 8.0 - * so it's not useful while we still want to support PHP7 too). - */ -# define ZEND_ARG_OBJ_TYPE_MASK(byref, name, classes, types, default) \ - ZEND_ARG_INFO(byref, name) -# define ZEND_ARG_TYPE_MASK(byref, name, types, default) \ - ZEND_ARG_INFO(byref, name) -#endif - -#include /* for abort(), used in generated code. */ - -#define SWIG_BOOL_CONSTANT(N, V) REGISTER_BOOL_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) -#define SWIG_LONG_CONSTANT(N, V) REGISTER_LONG_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) -#define SWIG_DOUBLE_CONSTANT(N, V) REGISTER_DOUBLE_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) -#define SWIG_STRING_CONSTANT(N, V) REGISTER_STRING_CONSTANT(#N, (char*)V, CONST_CS | CONST_PERSISTENT) -#define SWIG_CHAR_CONSTANT(N, V) do {\ - char swig_char = (V);\ - REGISTER_STRINGL_CONSTANT(#N, &swig_char, 1, CONST_CS | CONST_PERSISTENT);\ -} while (0) - -/* ZEND_CONSTANT_SET_FLAGS was new in PHP 7.3. */ -#ifdef ZEND_CONSTANT_SET_FLAGS -# define SWIG_ZEND_CONSTANT_SET_FLAGS ZEND_CONSTANT_SET_FLAGS -#else -# define SWIG_ZEND_CONSTANT_SET_FLAGS(C, F, N) do { (C)->flags = (F); (C)->module_number = (N); } while (0) -#endif - -/* zend_object_alloc was new in PHP 7.3. */ -#if PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION < 3 -static zend_always_inline void *zend_object_alloc(size_t obj_size, zend_class_entry *ce) { - void *obj = emalloc(obj_size + zend_object_properties_size(ce)); - memset(obj, 0, obj_size - sizeof(zval)); - return obj; -} -#endif - -/* ZEND_THIS was new in PHP 7.4. */ -#ifndef ZEND_THIS -# define ZEND_THIS &EX(This) -#endif - -#ifdef __cplusplus -} -#endif - -#define SWIG_fail goto fail - -static const char *default_error_msg = "Unknown error occurred"; -static int default_error_code = E_ERROR; - -#define SWIG_PHP_Arg_Error_Msg(argnum,extramsg) "Error in argument " #argnum " "#extramsg - -#define SWIG_PHP_Error(code,msg) do { zend_throw_exception(NULL, msg, code); SWIG_fail; } while (0) - -#define SWIG_contract_assert(expr,msg) \ - do { if (!(expr)) zend_printf("Contract Assert Failed %s\n", msg); } while (0) - -/* Standard SWIG API */ -#define SWIG_GetModule(clientdata) SWIG_Php_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer, *(int*)clientdata) - -static zend_class_entry SWIG_Php_swig_wrapped_interface_ce; - -#if PHP_MAJOR_VERSION == 7 -/* zend_class_implements_interface() was new in PHP 8.0. - * - * We could use instanceof_function_ex(C, I, 1) here for 7.4, but for 7.3 - * and earlier that doesn't work, so instead we just provide a compatibility - * implementation which does what zend_class_implements_interface() does in 8.x - * and use that for all 7.x so there are fewer variants to worry about testing. - */ -static int zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) { - uint32_t i; - if (class_ce->num_interfaces) { - for (i = 0; i < class_ce->num_interfaces; i++) { - if (class_ce->interfaces[i] == interface_ce) { - return 1; - } - } - } - return 0; -} -#endif - -/* used to wrap returned objects in so we know whether they are newobject - and need freeing, or not */ -typedef struct { - void * ptr; - int newobject; - const swig_type_info * type; - zend_object std; -} swig_object_wrapper; - -#define SWIG_Z_FETCH_OBJ_P(zv) swig_php_fetch_object(Z_OBJ_P(zv)) - -static inline -swig_object_wrapper * swig_php_fetch_object(zend_object *obj) { - return (swig_object_wrapper *)((char *)obj - XtOffsetOf(swig_object_wrapper, std)); -} - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) - -static void -SWIG_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject) { - // Return PHP NULL for a C/C++ NULL pointer. - if (!ptr) { - ZVAL_NULL(z); - return; - } - - if (!type->clientdata) { - zend_type_error("Type: %s not registered with zend", type->name); - return; - } - - { - zend_object *obj; - swig_object_wrapper *value; - if (Z_TYPE_P(z) == IS_OBJECT) { - /* The PHP object is already initialised - this is the case when wrapping - * the return value from a PHP constructor. */ - obj = Z_OBJ_P(z); - } else { - zend_class_entry *ce = (zend_class_entry*)(type->clientdata); - obj = ce->create_object(ce); - ZVAL_OBJ(z, obj); - } - value = swig_php_fetch_object(obj); - value->ptr = ptr; - value->newobject = (newobject & 1); - value->type = type; - } -} - -/* We wrap C/C++ pointers as PHP objects. */ -static int -SWIG_ConvertPtrAndOwn(zval *z, void **ptr, swig_type_info *ty, int flags, swig_owntype *own) { - if (own) - *own = 0; - - if (z == NULL) { - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - switch (Z_TYPE_P(z)) { - case IS_OBJECT: { - zend_object *obj = Z_OBJ_P(z); - swig_object_wrapper *value; - if (ty && ty->clientdata == (void*)obj->ce) { - // Object is exactly the class asked for - this handles common cases cheaply, - // and in particular the PHP classes we use to wrap a pointer to a non-class. - } else if (!zend_class_implements_interface(obj->ce, &SWIG_Php_swig_wrapped_interface_ce)) { - // Not an object we've wrapped. - return -1; - } - - /* convert and cast value->ptr from value->type to ptr as ty. */ - value = swig_php_fetch_object(obj); - if (!ty) { - /* They don't care about the target type, so just pass on the pointer! */ - *ptr = value->ptr; - } else { - swig_cast_info *tc = SWIG_TypeCheck(value->type->name, ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, value->ptr, &newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own |= SWIG_CAST_NEW_MEMORY; - } - } else { - *ptr = NULL; - } - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !value->newobject) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (*ptr == NULL) - return SWIG_ERROR; /* should be SWIG_NullReferenceError?? */ - if (flags & SWIG_POINTER_DISOWN) { - value->newobject = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - value->ptr = 0; - } - } - - return SWIG_OK; - } - case IS_NULL: - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - return -1; -} - -static int -SWIG_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags) { - return SWIG_ConvertPtrAndOwn(z, ptr, ty, flags, 0); -} - -static const char const_name[] = "swig_runtime_data_type_pointer"; -static swig_module_info *SWIG_Php_GetModule(void) { - zval *pointer = zend_get_constant_str(const_name, sizeof(const_name) - 1); - if (pointer) { - if (Z_TYPE_P(pointer) == IS_LONG) { - return (swig_module_info *) pointer->value.lval; - } - } - return NULL; -} - -static void SWIG_Php_SetModule(swig_module_info *pointer, int module_number) { - REGISTER_LONG_CONSTANT(const_name, (long) pointer, CONST_CS | CONST_PERSISTENT); -} - -/* Common parts of the "create_object" object handler. */ -static zend_object *SWIG_Php_do_create_object(zend_class_entry *ce, zend_object_handlers *handlers) { - swig_object_wrapper *obj = (swig_object_wrapper*)zend_object_alloc(sizeof(swig_object_wrapper), ce); - zend_object_std_init(&obj->std, ce); - object_properties_init(&obj->std, ce); - obj->std.handlers = handlers; - obj->newobject = 1; - return &obj->std; -} - -/* Common parts of the "free_obj" object handler. - Returns void* pointer if the C/C++ object should be destroyed. */ -static void* SWIG_Php_free_obj(zend_object *object) { - if (object) { - swig_object_wrapper *obj = swig_php_fetch_object(object); - zend_object_std_dtor(&obj->std); - if (obj->newobject) return obj->ptr; - } - return NULL; -} diff --git a/linux/bin/swig/share/swig/4.1.0/php/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/php/std_auto_ptr.i deleted file mode 100755 index 28409165..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/std_auto_ptr.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(&$input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $descriptor(TYPE *) of $symname"); - return; - } else { - zend_type_error("Expected $descriptor(TYPE *) for argument $argnum of $symname"); - return; - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/php/std_common.i b/linux/bin/swig/share/swig/4.1.0/php/std_common.i deleted file mode 100755 index 1b69fc77..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/std_common.i +++ /dev/null @@ -1,9 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; diff --git a/linux/bin/swig/share/swig/4.1.0/php/std_deque.i b/linux/bin/swig/share/swig/4.1.0/php/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/php/std_map.i b/linux/bin/swig/share/swig/4.1.0/php/std_map.i deleted file mode 100755 index fed3cf0b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/std_map.i +++ /dev/null @@ -1,82 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - bool is_empty() const { - return self->empty(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/linux/bin/swig/share/swig/4.1.0/php/std_pair.i b/linux/bin/swig/share/swig/4.1.0/php/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/php/std_string.i b/linux/bin/swig/share/swig/4.1.0/php/std_string.i deleted file mode 100755 index b2039786..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/std_string.i +++ /dev/null @@ -1,90 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string types - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - %typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) string, const string& %{ - $1 = (Z_TYPE($input) == IS_STRING) ? 1 : 0; - %} - - %typemap(in, phptype="string") string %{ - convert_to_string(&$input); - $1.assign(Z_STRVAL($input), Z_STRLEN($input)); - %} - - %typemap(directorout) string %{ - convert_to_string($input); - $result.assign(Z_STRVAL_P($input), Z_STRLEN_P($input)); - %} - - %typemap(out, phptype="string") string %{ - ZVAL_STRINGL($result, $1.data(), $1.size()); - %} - - %typemap(directorin) string, const string& %{ - ZVAL_STRINGL($input, $1.data(), $1.size()); - %} - - %typemap(out, phptype="string") const string & %{ - ZVAL_STRINGL($result, $1->data(), $1->size()); - %} - - %typemap(throws) string, const string& %{ - zend_throw_exception(NULL, $1.c_str(), 0); - goto fail; - %} - - %typemap(in, phptype="string") const string & ($*1_ltype temp) %{ - convert_to_string(&$input); - temp.assign(Z_STRVAL($input), Z_STRLEN($input)); - $1 = &temp; - %} - - /* These next two handle a function which takes a non-const reference to - * a std::string and modifies the string. */ - %typemap(in,byref=1, phptype="string") string & ($*1_ltype temp) %{ - { - zval * p = Z_ISREF($input) ? Z_REFVAL($input) : &$input; - convert_to_string(p); - temp.assign(Z_STRVAL_P(p), Z_STRLEN_P(p)); - $1 = &temp; - } - %} - - %typemap(directorout) string & ($*1_ltype *temp) %{ - convert_to_string($input); - temp = new $*1_ltype(Z_STRVAL_P($input), Z_STRLEN_P($input)); - swig_acquire_ownership(temp); - $result = temp; - %} - - %typemap(argout) string & %{ - if (Z_ISREF($input)) { - ZVAL_STRINGL(Z_REFVAL($input), $1->data(), $1->size()); - } - %} - - /* SWIG will apply the non-const typemap above to const string& without - * this more specific typemap. */ - %typemap(argout) const string & "" -} diff --git a/linux/bin/swig/share/swig/4.1.0/php/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/php/std_unique_ptr.i deleted file mode 100755 index 1bf31595..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/std_unique_ptr.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(&$input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $descriptor(TYPE *) of $symname"); - return; - } else { - zend_type_error("Expected $descriptor(TYPE *) for argument $argnum of $symname"); - return; - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/php/std_vector.i b/linux/bin/swig/share/swig/4.1.0/php/std_vector.i deleted file mode 100755 index 382b37ca..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/std_vector.i +++ /dev/null @@ -1,114 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - void clear(); - %rename(push) push_back; - void push_back(const value_type& x); - %extend { - bool is_empty() const { - return $self->empty(); - } - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - void clear(); - %rename(push) push_back; - void push_back(const value_type& x); - %extend { - bool is_empty() const { - return $self->empty(); - } - bool pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - bool x = self->back(); - self->pop_back(); - return x; - } - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/php/swigmove.i b/linux/bin/swig/share/swig/4.1.0/php/swigmove.i deleted file mode 100755 index b16a3c54..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/swigmove.i +++ /dev/null @@ -1,24 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(&$input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $&1_descriptor of $symname"); - return; - } else { - zend_type_error("Expected $&1_descriptor for argument $argnum of $symname"); - return; - } - } - if (!argp) { - zend_type_error("Invalid null reference for argument $argnum of $&1_descriptor of $symname"); - return; - } - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/linux/bin/swig/share/swig/4.1.0/php/typemaps.i b/linux/bin/swig/share/swig/4.1.0/php/typemaps.i deleted file mode 100755 index 718469ed..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/typemaps.i +++ /dev/null @@ -1,295 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i. - * - * SWIG Typemap library for PHP. - * - * This library provides standard typemaps for modifying SWIG's behavior. - * With enough entries in this file, I hope that very few people actually - * ever need to write a typemap. - * - * Define macros to define the following typemaps: - * - * TYPE *INPUT. Argument is passed in as native variable by value. - * TYPE *OUTPUT. Argument is returned as an array from the function call. - * TYPE *INOUT. Argument is passed in by value, and out as part of returned list - * TYPE *REFERENCE. Argument is passed in as native variable with value - * semantics. Variable value is changed with result. - * Use like this: - * int foo(int *REFERENCE); - * - * $a = 0; - * $rc = foo($a); - * - * Even though $a looks like it's passed by value, - * its value can be changed by foo(). - * ----------------------------------------------------------------------------- */ - -%define BOOL_TYPEMAP(TYPE) -%typemap(in, phptype="bool") TYPE *INPUT(TYPE temp), TYPE &INPUT(TYPE temp) -%{ - convert_to_boolean(&$input); - temp = (Z_TYPE($input) == IS_TRUE); - $1 = &temp; -%} -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" -%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;" -%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT -{ - zval o; - ZVAL_BOOL(&o, temp$argnum); - t_output_helper($result, &o); -} -%typemap(in, phptype="float") TYPE *REFERENCE (TYPE lvalue), TYPE &REFERENCE (TYPE lvalue) -%{ - convert_to_boolean($input); - lvalue = (Z_TYPE_P($input) == IS_TRUE); - $1 = &lvalue; -%} -%typemap(argout) TYPE *REFERENCE, TYPE &REFERENCE -%{ - ZVAL_BOOL(&$arg, lvalue$argnum ? true : false); -%} -%enddef - -%define DOUBLE_TYPEMAP(TYPE) -%typemap(in, phptype="float") TYPE *INPUT(TYPE temp), TYPE &INPUT(TYPE temp) -%{ - temp = (TYPE) zval_get_double(&$input); - $1 = &temp; -%} -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" -%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;" -%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT -{ - zval o; - ZVAL_DOUBLE(&o, temp$argnum); - t_output_helper($result, &o); -} -%typemap(in, phptype="float") TYPE *REFERENCE (TYPE dvalue), TYPE &REFERENCE (TYPE dvalue) -%{ - dvalue = (TYPE) zval_get_double(&$input); - $1 = &dvalue; -%} -%typemap(argout) TYPE *REFERENCE, TYPE &REFERENCE -%{ - ZVAL_DOUBLE(&$arg, (double)(lvalue$argnum)); -%} -%enddef - -%define INT_TYPEMAP(TYPE) -%typemap(in, phptype="int") TYPE *INPUT(TYPE temp), TYPE &INPUT(TYPE temp) -%{ - temp = (TYPE) zval_get_long(&$input); - $1 = &temp; -%} -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" -%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;" -%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT -{ - zval o; - ZVAL_LONG(&o, temp$argnum); - t_output_helper($result, &o); -} -%typemap(in, phptype="int") TYPE *REFERENCE (TYPE lvalue), TYPE &REFERENCE (TYPE lvalue) -%{ - lvalue = (TYPE) zval_get_long(&$input); - $1 = &lvalue; -%} -%typemap(argout) TYPE *REFERENCE, TYPE &REFERENCE -%{ - ZVAL_LONG(&$arg, (long)(lvalue$argnum)); -%} -%enddef - -BOOL_TYPEMAP(bool); - -DOUBLE_TYPEMAP(float); -DOUBLE_TYPEMAP(double); - -INT_TYPEMAP(int); -INT_TYPEMAP(short); -INT_TYPEMAP(long); -INT_TYPEMAP(unsigned int); -INT_TYPEMAP(unsigned short); -INT_TYPEMAP(unsigned long); -INT_TYPEMAP(unsigned char); -INT_TYPEMAP(signed char); - -INT_TYPEMAP(long long); -%typemap(argout,fragment="t_output_helper") long long *OUTPUT -{ - zval o; - if ((long long)LONG_MIN <= temp$argnum && temp$argnum <= (long long)LONG_MAX) { - ZVAL_LONG(&o, (long)temp$argnum); - } else { - ZVAL_NEW_STR(&o, zend_strpprintf(0, "%lld", (long long)temp$argnum)); - } - t_output_helper($result, &o); -} -%typemap(in, phptype="int|string") TYPE *REFERENCE (long long lvalue) -%{ - CONVERT_LONG_LONG_IN(lvalue, long long, $input) - $1 = &lvalue; -%} -%typemap(argout) long long *REFERENCE -%{ - if ((long long)LONG_MIN <= lvalue$argnum && lvalue$argnum <= (long long)LONG_MAX) { - ZVAL_LONG(&$arg, (long)temp$argnum); - } else { - ZVAL_NEW_STR(&$arg, zend_strpprintf(0, "%lld", (long long)lvalue$argnum)); - } -%} -%typemap(argout) long long &OUTPUT -%{ - if ((long long)LONG_MIN <= *arg$argnum && *arg$argnum <= (long long)LONG_MAX) { - ZVAL_LONG($result, (long)(*arg$argnum)); - } else { - ZVAL_NEW_STR($result, zend_strpprintf(0, "%lld", (long long)(*arg$argnum))); - } -%} - -INT_TYPEMAP(unsigned long long); -%typemap(argout,fragment="t_output_helper") unsigned long long *OUTPUT -{ - zval o; - if (temp$argnum <= (unsigned long long)LONG_MAX) { - ZVAL_LONG(&o, temp$argnum); - } else { - ZVAL_NEW_STR(&o, zend_strpprintf(0, "%llu", (unsigned long long)temp$argnum)); - } - t_output_helper($result, &o); -} -%typemap(in, phptype="int|string") TYPE *REFERENCE (unsigned long long lvalue) -%{ - CONVERT_UNSIGNED_LONG_LONG_IN(lvalue, unsigned long long, $input) - $1 = &lvalue; -%} -%typemap(argout) unsigned long long *REFERENCE -%{ - if (lvalue$argnum <= (unsigned long long)LONG_MAX) { - ZVAL_LONG($arg, (long)(lvalue$argnum)); - } else { - ZVAL_NEW_STR((*$arg), zend_strpprintf(0, "%llu", (unsigned long long)lvalue$argnum)); - } -%} -%typemap(argout) unsigned long long &OUTPUT -%{ - if (*arg$argnum <= (unsigned long long)LONG_MAX) { - ZVAL_LONG($result, (long)(*arg$argnum)); - } else { - ZVAL_NEW_STR($result, zend_strpprintf(0, "%llu", (unsigned long long)(*arg$argnum))); - } -%} - -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; - -%typemap(in) bool &INOUT = bool *INPUT; -%typemap(in) float &INOUT = float *INPUT; -%typemap(in) double &INOUT = double *INPUT; - -%typemap(in) int &INOUT = int *INPUT; -%typemap(in) short &INOUT = short *INPUT; -%typemap(in) long &INOUT = long *INPUT; -%typemap(in) long long &INOUT = long long *INPUT; -%typemap(in) long long &INPUT = long long *INPUT; -%typemap(in) unsigned &INOUT = unsigned *INPUT; -%typemap(in) unsigned short &INOUT = unsigned short *INPUT; -%typemap(in) unsigned long &INOUT = unsigned long *INPUT; -%typemap(in) unsigned char &INOUT = unsigned char *INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long *INPUT; -%typemap(in) unsigned long long &INPUT = unsigned long long *INPUT; -%typemap(in) signed char &INOUT = signed char *INPUT; - -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT= double *OUTPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT= long *OUTPUT; -%typemap(argout) long long *INOUT= long long *OUTPUT; -%typemap(argout) unsigned short *INOUT= unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; - -%typemap(argout) bool &INOUT = bool *OUTPUT; -%typemap(argout) float &INOUT = float *OUTPUT; -%typemap(argout) double &INOUT= double *OUTPUT; - -%typemap(argout) int &INOUT = int *OUTPUT; -%typemap(argout) short &INOUT = short *OUTPUT; -%typemap(argout) long &INOUT= long *OUTPUT; -%typemap(argout) long long &INOUT= long long *OUTPUT; -%typemap(argout) unsigned short &INOUT= unsigned short *OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char *OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long *OUTPUT; -%typemap(argout) signed char &INOUT = signed char *OUTPUT; - -%typemap(in, phptype="string") char INPUT[ANY] ( char temp[$1_dim0] ) -%{ - convert_to_string(&$input); - strncpy(temp, Z_STRVAL($input), $1_dim0); - $1 = temp; -%} -%typemap(in,numinputs=0) char OUTPUT[ANY] ( char temp[$1_dim0] ) - "$1 = temp;"; -%typemap(argout,fragment="t_output_helper") char OUTPUT[ANY] -{ - zval o; - ZVAL_STRINGL(&o, temp$argnum, $1_dim0); - t_output_helper($result, &o); -} - -%typemap(in,numinputs=0,phptype="?SWIGTYPE") void **OUTPUT (int force), - void *&OUTPUT (int force) -%{ - /* If they pass NULL by reference, make it into a void* - This bit should go in arginit if arginit support init-ing scripting args */ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ - if (!(Z_ISREF($input) && Z_ISNULL_P(Z_REFVAL($input)))) { - /* wasn't a pre/ref/thing, OR anything like an int thing */ - zend_type_error("Expected reference or NULL for argument $arg of $symname"); - return; - } - } - force=0; - if (arg1==NULL) { -#ifdef __cplusplus - ptr=new $*1_ltype(); -#else - ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); -#endif - $1=&ptr; - /* have to passback arg$arg too */ - force=1; - } -%} - -%typemap(argout) void **OUTPUT, - void *&OUTPUT -%{ - if (force$argnum) { /* pass back arg$argnum through params ($arg) if we can */ - if (!Z_ISREF($arg)) { - SWIG_PHP_Error(E_WARNING, "Parameter $argnum of $symname wasn't passed by reference"); - } else { - SWIG_SetPointerZval(*$arg, (void *) ptr$argnum, $*1_descriptor, 1); - } - } -%} diff --git a/linux/bin/swig/share/swig/4.1.0/php/utils.i b/linux/bin/swig/share/swig/4.1.0/php/utils.i deleted file mode 100755 index 33db942a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/php/utils.i +++ /dev/null @@ -1,115 +0,0 @@ - -%define CONVERT_BOOL_IN(lvar,t,invar) - lvar = (t) zval_is_true(&invar); -%enddef - -%define CONVERT_INT_IN(lvar,t,invar) - lvar = (t) zval_get_long(&invar); -%enddef - -%define CONVERT_LONG_LONG_IN(lvar,t,invar) - switch (Z_TYPE(invar)) { - case IS_DOUBLE: - lvar = (t) Z_DVAL(invar); - break; - case IS_STRING: { - char * endptr; - errno = 0; - lvar = (t) strtoll(Z_STRVAL(invar), &endptr, 10); - if (*endptr == '\0' && !errno) break; - } - /* FALL THRU */ - default: - lvar = (t) zval_get_long(&invar); - } -%enddef - -%define CONVERT_UNSIGNED_LONG_LONG_IN(lvar,t,invar) - switch (Z_TYPE(invar)) { - case IS_DOUBLE: - lvar = (t) Z_DVAL(invar); - break; - case IS_STRING: { - char * endptr; - errno = 0; - lvar = (t) strtoull(Z_STRVAL(invar), &endptr, 10); - if (*endptr == '\0' && !errno) break; - } - /* FALL THRU */ - default: - lvar = (t) zval_get_long(&invar); - } -%enddef - -%define CONVERT_INT_OUT(lvar,invar) - lvar = (t) zval_get_long(&invar); -%enddef - -%define CONVERT_FLOAT_IN(lvar,t,invar) - lvar = (t) zval_get_double(&invar); -%enddef - -%define CONVERT_CHAR_IN(lvar,t,invar) - convert_to_string(&invar); - lvar = (t) Z_STRVAL(invar)[0]; -%enddef - -%define CONVERT_STRING_IN(lvar,t,invar) - if (Z_ISNULL(invar)) { - lvar = (t) 0; - } else { - convert_to_string(&invar); - lvar = (t) Z_STRVAL(invar); - } -%enddef - -%define %pass_by_val( TYPE, PHP_TYPE, CONVERT_IN ) -%typemap(in, phptype=PHP_TYPE) TYPE -%{ - CONVERT_IN($1,$1_ltype,$input); -%} -%typemap(in, phptype=PHP_TYPE) const TYPE & ($*1_ltype temp) -%{ - CONVERT_IN(temp,$*1_ltype,$input); - $1 = &temp; -%} -%typemap(directorout) TYPE -%{ - CONVERT_IN($result, $1_ltype, *$input); -%} -%typemap(directorout) const TYPE & -%{ - $*1_ltype swig_val; - CONVERT_IN(swig_val, $*1_ltype, *$input); - $1_ltype temp = new $*1_ltype(swig_val); - swig_acquire_ownership(temp); - $result = temp; -%} -%typemap(directorfree) const TYPE & -%{ - if (director) { - director->swig_release_ownership(%as_voidptr($input)); - } -%} -%enddef - -%fragment("t_output_helper","header") %{ -static void -t_output_helper(zval *target, zval *o) { - zval tmp; - if (Z_TYPE_P(target) == IS_ARRAY) { - /* it's already an array, just append */ - add_next_index_zval(target, o); - return; - } - if (Z_TYPE_P(target) == IS_NULL) { - /* NULL isn't refcounted */ - ZVAL_COPY_VALUE(target, o); - return; - } - ZVAL_DUP(&tmp, target); - array_init(target); - add_next_index_zval(target, &tmp); - add_next_index_zval(target, o); -} -%} diff --git a/linux/bin/swig/share/swig/4.1.0/pointer.i b/linux/bin/swig/share/swig/4.1.0/pointer.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/python/Makefile.in b/linux/bin/swig/share/swig/4.1.0/python/Makefile.in deleted file mode 100755 index 27c38444..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/Makefile.in +++ /dev/null @@ -1,119 +0,0 @@ -# --------------------------------------------------------------- -# SWIG Python Makefile -# -# This file can be used to build various Python extensions with SWIG. -# By default this file is set up for dynamic loading, but it can -# be easily customized for static extensions by modifying various -# portions of the file. -# -# SRCS = C source files -# CXXSRCS = C++ source files -# OBJCSRCS = Objective-C source files -# OBJS = Additional .o files (compiled previously) -# INTERFACE = SWIG interface file -# TARGET = Name of target module or executable -# -# Many portions of this file were created by the SWIG configure -# script and should already reflect your machine. -#---------------------------------------------------------------- - -SRCS = -CXXSRCS = -OBJCSRCS = -OBJS = -INTERFACE = -WRAPFILE = $(INTERFACE:.i=_wrap.c) -WRAPOBJ = $(INTERFACE:.i=_wrap.o) -TARGET = module@SO@ # Use this kind of target for dynamic loading -#TARGET = mypython # Use this target for static linking - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -CC = @CC@ -CXX = @CXX@ -OBJC = @CC@ -Wno-import # -Wno-import needed for gcc -CFLAGS = -INCLUDES = -LIBS = - -# SWIG Options -# SWIG = location of the SWIG executable -# SWIGOPT = SWIG compiler options -# SWIGCC = Compiler used to compile the wrapper file - -SWIG = $(exec_prefix)/bin/swig -SWIGOPT = -python -SWIGCC = $(CC) - -# SWIG Library files. Uncomment if rebuilding the Python interpreter -#SWIGLIBS = -lembed.i - -# Rules for creating .o files from source. - -COBJS = $(SRCS:.c=.o) -CXXOBJS = $(CXXSRCS:.cxx=.o) -OBJCOBJS = $(OBJCSRCS:.m=.o) -ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) - -# Command that will be used to build the final extension. -BUILD = $(SWIGCC) - -# Uncomment the following if you are using dynamic loading -CCSHARED = @CCSHARED@ -BUILD = @LDSHARED@ - -# Uncomment the following if you are using dynamic loading with C++ and -# need to provide additional link libraries (this is not always required). - -#DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ - -L/usr/local/lib -lg++ -lstdc++ -lgcc - -# Python installation - -PY_INCLUDE = -DHAVE_CONFIG_H @PYINCLUDE@ -PY_LIB = @PYLIB@ - -# Build libraries (needed for static builds) - -LIBM = @LIBM@ -LIBC = @LIBC@ -SYSLIBS = $(LIBM) $(LIBC) @LIBS@ - -# Build options - -BUILD_LIBS = $(LIBS) # Dynamic loading - -# Compilation rules for non-SWIG components - -.SUFFIXES: .c .cxx .m - -.c.o: - $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - -.cxx.o: - $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< - -.m.o: - $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - - -# ---------------------------------------------------------------------- -# Rules for building the extension -# ---------------------------------------------------------------------- - -all: $(TARGET) - -# Convert the wrapper file into an object file - -$(WRAPOBJ) : $(WRAPFILE) - $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDES) $(PY_INCLUDE) - -$(WRAPFILE) : $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIBS) $(INTERFACE) - -$(TARGET): $(WRAPOBJ) $(ALLOBJS) - $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) - -clean: - rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) diff --git a/linux/bin/swig/share/swig/4.1.0/python/README b/linux/bin/swig/share/swig/4.1.0/python/README deleted file mode 100755 index 70968e7d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/README +++ /dev/null @@ -1,103 +0,0 @@ -/* ----------------------------------------------------------------------------- - * - * User interfaces: include these ones as needed - * - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Special types and user helpers - * ----------------------------------------------------------------------------- */ - -argcargv.i Handler for (int argc, char **argv) -attribute.i Convert a pair of set/get methods into a "native" python attribute -ccomplex.i C99 complex type -complex.i C99 or C++ complex type -cstring.i Various forms of C character string handling -cwstring.i Various forms of C wchar_t string handling -embed.i embedding the Python interpreter in something else -file.i FILE C type -implicit.i Allow the use of implicit C++ constructors -wchar.i wchar_t C type - -/* ----------------------------------------------------------------------------- - * C++ STD + STL - * ----------------------------------------------------------------------------- */ - -std_alloc.i allocator -std_basic_string.i basic string -std_char_traits.i char traits -std_complex.i complex -std_deque.i deque -std_except.i exceptions -std_ios.i ios -std_iostream.i istream/ostream -std_list.i list -std_map.i map -std_multimap.i multimap -std_multiset.i multiset -std_pair.i pair -std_set.i set -std_sstream.i string stream -std_streambuf.i streambuf -std_string.i string -std_vector.i vector -std_wios.i wios -std_wiostream.i wistream/wostream -std_wsstream.i wstring stream -std_wstreambuf.i wstreambuf -std_wstring.i wstring - - - -/* ----------------------------------------------------------------------------- -/* - * Implementation files: don't look at them unless you are really drunk - * - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Basic files - * ----------------------------------------------------------------------------- */ - -python.swg Main language file, it just includes what is needed. -pyuserdir.swg User visible directives (%pythonnondynamic, etc) -pymacros.swg Internal macros used for typemaps -pyfragments.swg Allow the user to overload the default fragments -pyopers.swg Python operations (+=, *=, etc) -pythonkw.swg Python keywords and special names -pyinit.swg Python Init method - -/* ----------------------------------------------------------------------------- - * The runtime part - * ----------------------------------------------------------------------------- */ - -pyruntime.swg Main runtime file definition -pyapi.swg SWIG/Python API declarations -pyrun.swg Python run-time code - -/* ----------------------------------------------------------------------------- - * Internal typemap specializations - * ----------------------------------------------------------------------------- */ - -pyswigtype.swg SWIGTYPE -pystrings.swg Char strings (char *) -pywstrings.swg Wchar Strings (wchar_t *) -pyprimtypes.swg Primitive types (shot,int,double,etc) -pycomplex.swg PyComplex and helper for C/C++ complex types -pydocs.swg Typemaps documentation - -/* ----------------------------------------------------------------------------- - * C++ STD + STL - * ----------------------------------------------------------------------------- */ - -pycontainer.swg python container iterators -std_common.i general common code for the STD/STL implementation -std_container.i general common code for the STD/STL containers - - -/*----------------------------------------------------------------------------- - * Backward compatibility and deprecated - * ----------------------------------------------------------------------------- */ - -std_vectora.i vector + allocator (allocators are now supported in STD/STL) -typemaps.i old in/out typemaps (doesn't need to be included) diff --git a/linux/bin/swig/share/swig/4.1.0/python/argcargv.i b/linux/bin/swig/share/swig/4.1.0/python/argcargv.i deleted file mode 100755 index 419803a8..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/argcargv.i +++ /dev/null @@ -1,89 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsArgcArgv","header",fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsArgcArgv(PyObject *input, swig_type_info *ppchar_info, size_t *argc, char ***argv, int *owner) { - void *vptr; - int res = SWIG_ConvertPtr(input, &vptr, ppchar_info, 0); - if (!SWIG_IsOK(res)) { - int list = 0; - PyErr_Clear(); - list = PyList_Check(input); - if (list || PyTuple_Check(input)) { - size_t i = 0; - size_t size = list ? PyList_Size(input) : PyTuple_Size(input); - if (argc) *argc = size; - if (argv) { - *argv = %new_array(size + 1, char*); - for (; i < size; ++i) { - PyObject *obj = list ? PyList_GetItem(input,i) : PyTuple_GetItem(input,i); - char *cptr = 0; size_t sz = 0; int alloc = 0; - res = SWIG_AsCharPtrAndSize(obj, &cptr, &sz, &alloc); - if (SWIG_IsOK(res)) { - if (cptr && sz) { - (*argv)[i] = (alloc == SWIG_NEWOBJ) ? cptr : %new_copy_array(cptr, sz, char); - } else { - (*argv)[i] = 0; - } - } else { - return SWIG_TypeError; - } - } - (*argv)[i] = 0; - if (owner) *owner = 1; - } else { - for (; i < size; ++i) { - PyObject *obj = list ? PyList_GetItem(input,i) : PyTuple_GetItem(input,i); - res = SWIG_AsCharPtrAndSize(obj, 0, 0, 0); - if (!SWIG_IsOK(res)) return SWIG_TypeError; - } - if (owner) *owner = 0; - } - return SWIG_OK; - } else { - return SWIG_TypeError; - } - } else { - /* seems dangerous, but the user asked for it... */ - size_t i = 0; - if (argv) { while (*argv[i] != 0) ++i;} - if (argc) *argc = i; - if (owner) *owner = 0; - return SWIG_OK; - } -} -} - -/* - This typemap works with either a char **, a python list or a python - tuple - */ - -%typemap(in,noblock=0,fragment="SWIG_AsArgcArgv") (int ARGC, char **ARGV) (int res,char **argv = 0, size_t argc = 0, int owner= 0) { - res = SWIG_AsArgcArgv($input, $descriptor(char**), &argc, &argv, &owner); - if (!SWIG_IsOK(res)) { - $1 = 0; $2 = 0; - %argument_fail(SWIG_TypeError, "int ARGC, char **ARGV", $symname, $argnum); - } else { - $1 = %static_cast(argc,$1_ltype); - $2 = %static_cast(argv, $2_ltype); - } -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - int res = SWIG_AsArgcArgv($input, $descriptor(char**), 0, 0, 0); - $1 = SWIG_IsOK(res); -} - -%typemap(freearg,noblock=1) (int ARGC, char **ARGV) { - if (owner$argnum) { - size_t i = argc$argnum; - while (i) { - %delete_array(argv$argnum[--i]); - } - %delete_array(argv$argnum); - } -} - diff --git a/linux/bin/swig/share/swig/4.1.0/python/attribute.i b/linux/bin/swig/share/swig/4.1.0/python/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/boost_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/python/boost_shared_ptr.i deleted file mode 100755 index bfd8787c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/boost_shared_ptr.i +++ /dev/null @@ -1,411 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -%fragment("SWIG_null_deleter_python", "header", fragment="SWIG_null_deleter") { -%#define SWIG_NO_NULL_DELETER_SWIG_BUILTIN_INIT -} - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter_python") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter_python") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter_python") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter_python") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter_python") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter_python") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter_python") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter_python") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - -%typemap(doctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - %{TYPE%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/python/builtin.swg b/linux/bin/swig/share/swig/4.1.0/python/builtin.swg deleted file mode 100755 index 5cff6835..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/builtin.swg +++ /dev/null @@ -1,764 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -SWIGINTERN Py_hash_t -SwigPyObject_hash(PyObject *obj) { - SwigPyObject *sobj = (SwigPyObject *)obj; - void *ptr = sobj->ptr; -#if PY_VERSION_HEX < 0x03020000 - return (Py_hash_t)(Py_ssize_t)ptr; -#else - return (Py_hash_t)ptr; -#endif -} - -SWIGINTERN Py_hash_t -SWIG_PyNumber_AsPyHash(PyObject *obj) { - Py_hash_t result = -1; -#if PY_VERSION_HEX < 0x03020000 - if (PyInt_Check(obj)) - result = PyInt_AsLong(obj); - else if (PyLong_Check(obj)) - result = PyLong_AsLong(obj); -#else - if (PyNumber_Check(obj)) - result = PyNumber_AsSsize_t(obj, NULL); -#endif - else - PyErr_Format(PyExc_TypeError, "Wrong type for hash function"); - return PyErr_Occurred() ? -1 : result; -} - -SWIGINTERN int -SwigPyBuiltin_BadInit(PyObject *self, PyObject *SWIGUNUSEDPARM(args), PyObject *SWIGUNUSEDPARM(kwds)) { - PyErr_Format(PyExc_TypeError, "Cannot create new instances of type '%.300s'", self->ob_type->tp_name); - return -1; -} - -SWIGINTERN void -SwigPyBuiltin_BadDealloc(PyObject *obj) { - SwigPyObject *sobj = (SwigPyObject *)obj; - if (sobj->own) { - PyErr_Format(PyExc_TypeError, "Swig detected a memory leak in type '%.300s': no callable destructor found.", obj->ob_type->tp_name); - } -} - -typedef struct { - PyCFunction get; - PyCFunction set; -} SwigPyGetSet; - -SWIGINTERN PyObject * -SwigPyBuiltin_GetterClosure (PyObject *obj, void *closure) { - SwigPyGetSet *getset; - PyObject *tuple, *result; - if (!closure) - return SWIG_Py_Void(); - getset = (SwigPyGetSet *)closure; - if (!getset->get) - return SWIG_Py_Void(); - tuple = PyTuple_New(0); - assert(tuple); - result = (*getset->get)(obj, tuple); - Py_DECREF(tuple); - return result; -} - -SWIGINTERN PyObject * -SwigPyBuiltin_FunpackGetterClosure (PyObject *obj, void *closure) { - SwigPyGetSet *getset; - PyObject *result; - if (!closure) - return SWIG_Py_Void(); - getset = (SwigPyGetSet *)closure; - if (!getset->get) - return SWIG_Py_Void(); - result = (*getset->get)(obj, NULL); - return result; -} - -SWIGINTERN int -SwigPyBuiltin_SetterClosure (PyObject *obj, PyObject *val, void *closure) { - SwigPyGetSet *getset; - PyObject *tuple, *result; - if (!closure) { - PyErr_Format(PyExc_TypeError, "Missing getset closure"); - return -1; - } - getset = (SwigPyGetSet *)closure; - if (!getset->set) { - PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name); - return -1; - } - tuple = PyTuple_New(1); - assert(tuple); - Py_INCREF(val); - PyTuple_SET_ITEM(tuple, 0, val); - result = (*getset->set)(obj, tuple); - Py_DECREF(tuple); - Py_XDECREF(result); - return result ? 0 : -1; -} - -SWIGINTERN int -SwigPyBuiltin_FunpackSetterClosure (PyObject *obj, PyObject *val, void *closure) { - SwigPyGetSet *getset; - PyObject *result; - if (!closure) { - PyErr_Format(PyExc_TypeError, "Missing getset closure"); - return -1; - } - getset = (SwigPyGetSet *)closure; - if (!getset->set) { - PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name); - return -1; - } - result = (*getset->set)(obj, val); - Py_XDECREF(result); - return result ? 0 : -1; -} - -SWIGINTERN void -SwigPyStaticVar_dealloc(PyDescrObject *descr) { - PyObject_GC_UnTrack(descr); - Py_XDECREF(PyDescr_TYPE(descr)); - Py_XDECREF(PyDescr_NAME(descr)); - PyObject_GC_Del(descr); -} - -SWIGINTERN PyObject * -SwigPyStaticVar_repr(PyGetSetDescrObject *descr) { -#if PY_VERSION_HEX >= 0x03000000 - - return PyUnicode_FromFormat("", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); -#else - return PyString_FromFormat("", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); -#endif -} - -SWIGINTERN int -SwigPyStaticVar_traverse(PyObject *self, visitproc visit, void *arg) { - PyDescrObject *descr; - descr = (PyDescrObject *)self; - Py_VISIT((PyObject*) PyDescr_TYPE(descr)); - return 0; -} - -SWIGINTERN PyObject * -SwigPyStaticVar_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *SWIGUNUSEDPARM(type)) { - if (descr->d_getset->get != NULL) - return descr->d_getset->get(obj, descr->d_getset->closure); -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not readable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); -#else - PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not readable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); -#endif - return NULL; -} - -SWIGINTERN int -SwigPyStaticVar_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value) { - if (descr->d_getset->set != NULL) - return descr->d_getset->set(obj, value, descr->d_getset->closure); -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not writable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); -#else - PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not writable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); -#endif - return -1; -} - -SWIGINTERN int -SwigPyObjectType_setattro(PyObject *typeobject, PyObject *name, PyObject *value) { - PyObject *attribute; - PyTypeObject *type; - descrsetfunc local_set; - - assert(PyType_Check(typeobject)); - type = (PyTypeObject *)typeobject; - attribute = _PyType_Lookup(type, name); - if (attribute != NULL) { - /* Implement descriptor functionality, if any */ - local_set = attribute->ob_type->tp_descr_set; - if (local_set != NULL) - return local_set(attribute, (PyObject *)type, value); -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400S'", type->tp_name, name); -#else - PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400s'", type->tp_name, PyString_AS_STRING(name)); -#endif - } else { -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400S'", type->tp_name, name); -#else - PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400s'", type->tp_name, PyString_AS_STRING(name)); -#endif - } - - return -1; -} - -SWIGINTERN PyTypeObject* -SwigPyStaticVar_Type(void) { - static PyTypeObject staticvar_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#else - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ -#endif - "swig_static_var_getset_descriptor", /* tp_name */ - sizeof(PyGetSetDescrObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyStaticVar_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /* tp_print */ -#else - (Py_ssize_t)0, /* tp_vectorcall_offset */ -#endif - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc)SwigPyStaticVar_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */ - 0, /* tp_doc */ - SwigPyStaticVar_traverse, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - (descrgetfunc)SwigPyStaticVar_get, /* tp_descr_get */ - (descrsetfunc)SwigPyStaticVar_set, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - staticvar_type = tmp; - type_init = 1; - if (PyType_Ready(&staticvar_type) < 0) - return NULL; - } - return &staticvar_type; -} - -SWIGINTERN PyTypeObject* -SwigPyObjectType(void) { - static char swigpyobjecttype_doc[] = "Metaclass for SWIG wrapped types"; - static PyTypeObject swigpyobjecttype_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#else - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ -#endif - "SwigPyObjectType", /* tp_name */ - PyType_Type.tp_basicsize, /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /* tp_print */ -#else - (Py_ssize_t)0, /* tp_vectorcall_offset */ -#endif - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - SwigPyObjectType_setattro, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */ - swigpyobjecttype_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - swigpyobjecttype_type = tmp; - type_init = 1; - swigpyobjecttype_type.tp_base = &PyType_Type; - if (PyType_Ready(&swigpyobjecttype_type) < 0) - return NULL; - } - return &swigpyobjecttype_type; -} - -SWIGINTERN PyGetSetDescrObject * -SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) { - - PyGetSetDescrObject *descr; - descr = (PyGetSetDescrObject *)PyType_GenericAlloc(SwigPyStaticVar_Type(), 0); - assert(descr); - Py_XINCREF(type); - PyDescr_TYPE(descr) = type; - PyDescr_NAME(descr) = PyString_InternFromString(getset->name); - descr->d_getset = getset; - if (PyDescr_NAME(descr) == NULL) { - Py_DECREF(descr); - descr = NULL; - } - return descr; -} - -SWIGINTERN void -SwigPyBuiltin_InitBases (PyTypeObject *type, PyTypeObject **bases) { - Py_ssize_t base_count = 0; - PyTypeObject **b; - PyObject *tuple; - Py_ssize_t i; - - if (!bases[0]) { - bases[0] = SwigPyObject_type(); - bases[1] = NULL; - } - type->tp_base = bases[0]; - Py_INCREF((PyObject *)bases[0]); - for (b = bases; *b != NULL; ++b) - ++base_count; - tuple = PyTuple_New(base_count); - for (i = 0; i < base_count; ++i) { - Py_INCREF((PyObject *)bases[i]); - PyTuple_SET_ITEM(tuple, i, (PyObject *)bases[i]); - } - type->tp_bases = tuple; -} - -SWIGINTERN PyObject * -SwigPyBuiltin_ThisClosure (PyObject *self, void *SWIGUNUSEDPARM(closure)) { - PyObject *result; - result = (PyObject *)SWIG_Python_GetSwigThis(self); - Py_XINCREF(result); - return result; -} - -SWIGINTERN void -SwigPyBuiltin_SetMetaType (PyTypeObject *type, PyTypeObject *metatype) -{ -#if PY_VERSION_HEX >= 0x030900a4 - Py_SET_TYPE(type, metatype); -#else - Py_TYPE(type) = metatype; -#endif -} - - -/* Start of callback function macros for use in PyTypeObject */ - -typedef PyObject *(*SwigPyWrapperFunction)(PyObject *, PyObject *); - -#define SWIGPY_UNARYFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_unaryfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_unaryfunc_closure(wrapper, a); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_unaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -#define SWIGPY_DESTRUCTOR_CLOSURE(wrapper) \ -SWIGINTERN void \ -wrapper##_destructor_closure(PyObject *a) { \ - SwigPyBuiltin_destructor_closure(wrapper, #wrapper, a); \ -} -SWIGINTERN void -SwigPyBuiltin_destructor_closure(SwigPyWrapperFunction wrapper, const char *wrappername, PyObject *a) { - SwigPyObject *sobj; - sobj = (SwigPyObject *)a; - Py_XDECREF(sobj->dict); - if (sobj->own) { - PyObject *o; - PyObject *type = 0, *value = 0, *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - o = wrapper(a, NULL); - if (!o) { - PyObject *deallocname = PyString_FromString(wrappername); - PyErr_WriteUnraisable(deallocname); - Py_DECREF(deallocname); - } - PyErr_Restore(type, value, traceback); - Py_XDECREF(o); - } - if (PyType_IS_GC(a->ob_type)) { - PyObject_GC_Del(a); - } else { - PyObject_Del(a); - } -} - -#define SWIGPY_INQUIRY_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_inquiry_closure(PyObject *a) { \ - return SwigPyBuiltin_inquiry_closure(wrapper, a); \ -} -SWIGINTERN int -SwigPyBuiltin_inquiry_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - PyObject *pyresult; - int result; - pyresult = wrapper(a, NULL); - result = pyresult && PyObject_IsTrue(pyresult) ? 1 : 0; - Py_XDECREF(pyresult); - return result; -} - -#define SWIGPY_GETITERFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_getiterfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_getiterfunc_closure(wrapper, a); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_getiterfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -#define SWIGPY_BINARYFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_binaryfunc_closure(PyObject *a, PyObject *b) { \ - return SwigPyBuiltin_binaryfunc_closure(wrapper, a, b); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_binaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { - PyObject *tuple, *result; - tuple = PyTuple_New(1); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -typedef ternaryfunc ternarycallfunc; - -#define SWIGPY_TERNARYFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ternaryfunc_closure(PyObject *a, PyObject *b, PyObject *c) { \ - return SwigPyBuiltin_ternaryfunc_closure(wrapper, a, b, c); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ternaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { - PyObject *tuple, *result; - tuple = PyTuple_New(2); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_TERNARYCALLFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ternarycallfunc_closure(PyObject *a, PyObject *b, PyObject *c) { \ - return SwigPyBuiltin_ternarycallfunc_closure(wrapper, a, b, c); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ternarycallfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { - (void) c; - return wrapper(a, b); -} - -#define SWIGPY_LENFUNC_CLOSURE(wrapper) \ -SWIGINTERN Py_ssize_t \ -wrapper##_lenfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_lenfunc_closure(wrapper, a); \ -} -SWIGINTERN Py_ssize_t -SwigPyBuiltin_lenfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - PyObject *resultobj; - Py_ssize_t result; - resultobj = wrapper(a, NULL); - result = PyNumber_AsSsize_t(resultobj, NULL); - Py_DECREF(resultobj); - return result; -} - -#define SWIGPY_SSIZESSIZEARGFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ssizessizeargfunc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c) { \ - return SwigPyBuiltin_ssizessizeargfunc_closure(wrapper, a, b, c); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ssizessizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c) { - PyObject *tuple, *result; - tuple = PyTuple_New(2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c)); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_SSIZESSIZEOBJARGPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_ssizessizeobjargproc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) { \ - return SwigPyBuiltin_ssizessizeobjargproc_closure(wrapper, a, b, c, d); \ -} -SWIGINTERN int -SwigPyBuiltin_ssizessizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) { - PyObject *tuple, *resultobj; - int result; - tuple = PyTuple_New(d ? 3 : 2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c)); - if (d) { - Py_INCREF(d); - PyTuple_SET_ITEM(tuple, 2, d); - } - resultobj = wrapper(a, tuple); - result = resultobj ? 0 : -1; - Py_DECREF(tuple); - Py_XDECREF(resultobj); - return result; -} - -#define SWIGPY_SSIZEARGFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) { \ - return SwigPyBuiltin_funpack_ssizeargfunc_closure(wrapper, a, b); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_funpack_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) { - PyObject *tuple, *result; - tuple = PyTuple_New(1); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_FUNPACK_SSIZEARGFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) { \ - return SwigPyBuiltin_ssizeargfunc_closure(wrapper, a, b); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) { - PyObject *arg, *result; - arg = _PyLong_FromSsize_t(b); - result = wrapper(a, arg); - Py_DECREF(arg); - return result; -} - -#define SWIGPY_SSIZEOBJARGPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_ssizeobjargproc_closure(PyObject *a, Py_ssize_t b, PyObject *c) { \ - return SwigPyBuiltin_ssizeobjargproc_closure(wrapper, a, b, c); \ -} -SWIGINTERN int -SwigPyBuiltin_ssizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, PyObject *c) { - PyObject *tuple, *resultobj; - int result; - tuple = PyTuple_New(2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); - resultobj = wrapper(a, tuple); - result = resultobj ? 0 : -1; - Py_XDECREF(resultobj); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_OBJOBJPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_objobjproc_closure(PyObject *a, PyObject *b) { \ - return SwigPyBuiltin_objobjproc_closure(wrapper, a, b); \ -} -SWIGINTERN int -SwigPyBuiltin_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { - int result; - PyObject *pyresult; - PyObject *tuple; - tuple = PyTuple_New(1); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - pyresult = wrapper(a, tuple); - result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1; - Py_XDECREF(pyresult); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_FUNPACK_OBJOBJPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_objobjproc_closure(PyObject *a, PyObject *b) { \ - return SwigPyBuiltin_funpack_objobjproc_closure(wrapper, a, b); \ -} -SWIGINTERN int -SwigPyBuiltin_funpack_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { - int result; - PyObject *pyresult; - pyresult = wrapper(a, b); - result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1; - Py_XDECREF(pyresult); - return result; -} - -#define SWIGPY_OBJOBJARGPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_objobjargproc_closure(PyObject *a, PyObject *b, PyObject *c) { \ - return SwigPyBuiltin_objobjargproc_closure(wrapper, a, b, c); \ -} -SWIGINTERN int -SwigPyBuiltin_objobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { - PyObject *tuple, *resultobj; - int result; - tuple = PyTuple_New(c ? 2 : 1); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - if (c) { - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); - } - resultobj = wrapper(a, tuple); - result = resultobj ? 0 : -1; - Py_XDECREF(resultobj); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_REPRFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_reprfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_reprfunc_closure(wrapper, a); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_reprfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -#define SWIGPY_HASHFUNC_CLOSURE(wrapper) \ -SWIGINTERN Py_hash_t \ -wrapper##_hashfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_hashfunc_closure(wrapper, a); \ -} -SWIGINTERN Py_hash_t -SwigPyBuiltin_hashfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - PyObject *pyresult; - Py_hash_t result; - pyresult = wrapper(a, NULL); - if (!pyresult) - return -1; - result = SWIG_PyNumber_AsPyHash(pyresult); - Py_DECREF(pyresult); - return result; -} - -#define SWIGPY_ITERNEXTFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_iternextfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_iternextfunc_closure(wrapper, a);\ -} -SWIGINTERN PyObject * -SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -/* End of callback function macros for use in PyTypeObject */ - -#ifdef __cplusplus -} -#endif - diff --git a/linux/bin/swig/share/swig/4.1.0/python/carrays.i b/linux/bin/swig/share/swig/4.1.0/python/carrays.i deleted file mode 100755 index 74b2be9c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/carrays.i +++ /dev/null @@ -1,13 +0,0 @@ -%define %array_class(TYPE,NAME) -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "sq_item", functype="ssizeargfunc") NAME::__getitem__; - %feature("python:slot", "sq_ass_item", functype="ssizeobjargproc") NAME::__setitem__; -#endif -%array_class_wrap(TYPE,NAME,__getitem__,__setitem__) -%enddef - -%include - - - - diff --git a/linux/bin/swig/share/swig/4.1.0/python/ccomplex.i b/linux/bin/swig/share/swig/4.1.0/python/ccomplex.i deleted file mode 100755 index b99f96a4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/ccomplex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ccomplex.i - * - * C complex typemaps - * ISO C99: 7.3 Complex arithmetic - * ----------------------------------------------------------------------------- */ - - -%include - -%{ -#include -%} - -#define complex _Complex - -/* C complex constructor */ -#define CCplxConst(r, i) ((r) + I*(i)) - -%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); - -/* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/linux/bin/swig/share/swig/4.1.0/python/cdata.i b/linux/bin/swig/share/swig/4.1.0/python/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/cmalloc.i b/linux/bin/swig/share/swig/4.1.0/python/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/complex.i b/linux/bin/swig/share/swig/4.1.0/python/complex.i deleted file mode 100755 index 4c3b3c5e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/complex.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __cplusplus -%include -#else -%include -#endif - diff --git a/linux/bin/swig/share/swig/4.1.0/python/cpointer.i b/linux/bin/swig/share/swig/4.1.0/python/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/cstring.i b/linux/bin/swig/share/swig/4.1.0/python/cstring.i deleted file mode 100755 index ede9c596..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/cwstring.i b/linux/bin/swig/share/swig/4.1.0/python/cwstring.i deleted file mode 100755 index 2824d9c7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/cwstring.i +++ /dev/null @@ -1,3 +0,0 @@ -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/python/director.swg b/linux/bin/swig/share/swig/4.1.0/python/director.swg deleted file mode 100755 index 9694c623..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/director.swg +++ /dev/null @@ -1,389 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Python proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DIRECTOR_PYTHON_HEADER_ -#define SWIG_DIRECTOR_PYTHON_HEADER_ - -#include -#include -#include -#include -#include - - -/* - Use -DSWIG_PYTHON_DIRECTOR_NO_VTABLE if you don't want to generate a 'virtual - table', and avoid multiple GetAttr calls to retrieve the python - methods. -*/ - -#ifndef SWIG_PYTHON_DIRECTOR_NO_VTABLE -#ifndef SWIG_PYTHON_DIRECTOR_VTABLE -#define SWIG_PYTHON_DIRECTOR_VTABLE -#endif -#endif - - - -/* - Use -DSWIG_DIRECTOR_NO_UEH if you prefer to avoid the use of the - Undefined Exception Handler provided by swig. -*/ -#ifndef SWIG_DIRECTOR_NO_UEH -#ifndef SWIG_DIRECTOR_UEH -#define SWIG_DIRECTOR_UEH -#endif -#endif - - -/* - Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the - native C++ RTTI and dynamic_cast<>. But be aware that directors - could stop working when using this option. -*/ -#ifdef SWIG_DIRECTOR_NORTTI -/* - When we don't use the native C++ RTTI, we implement a minimal one - only for Directors. -*/ -# ifndef SWIG_DIRECTOR_RTDIR -# define SWIG_DIRECTOR_RTDIR - -namespace Swig { - class Director; - SWIGINTERN std::map& get_rtdir_map() { - static std::map rtdir_map; - return rtdir_map; - } - - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *rtdir) { - get_rtdir_map()[vptr] = rtdir; - } - - SWIGINTERNINLINE Director *get_rtdir(void *vptr) { - std::map::const_iterator pos = get_rtdir_map().find(vptr); - Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0; - return rtdir; - } -} -# endif /* SWIG_DIRECTOR_RTDIR */ - -# define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast(ARG)) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast(ARG1), ARG2) - -#else - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) - -#endif /* SWIG_DIRECTOR_NORTTI */ - -extern "C" { - struct swig_type_info; -} - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() {} - - virtual int get_own() const { - return 0; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem * operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(int own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - int get_own() const { - return _own; - } - - private: - int _own; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - template - struct GCArray_T : GCItem { - GCArray_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCArray_T() { - delete[] _ptr; - } - - private: - Type *_ptr; - }; - - /* base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - public: - DirectorException(PyObject *error, const char *hdr ="", const char *msg ="") : swig_msg(hdr) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (msg[0]) { - swig_msg += " "; - swig_msg += msg; - } - if (!PyErr_Occurred()) { - PyErr_SetString(error, what()); - } - SWIG_PYTHON_THREAD_END_BLOCK; - } - - virtual ~DirectorException() throw() { - } - - /* Deprecated, use what() instead */ - const char *getMessage() const { - return what(); - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - - static void raise(PyObject *error, const char *msg) { - throw DirectorException(error, msg); - } - - static void raise(const char *msg) { - raise(PyExc_RuntimeError, msg); - } - }; - - /* type mismatch in the return value from a python method call */ - class DirectorTypeMismatchException : public DirectorException { - public: - DirectorTypeMismatchException(PyObject *error, const char *msg="") - : DirectorException(error, "SWIG director type mismatch", msg) { - } - - DirectorTypeMismatchException(const char *msg="") - : DirectorException(PyExc_TypeError, "SWIG director type mismatch", msg) { - } - - static void raise(PyObject *error, const char *msg) { - throw DirectorTypeMismatchException(error, msg); - } - - static void raise(const char *msg) { - throw DirectorTypeMismatchException(msg); - } - }; - - /* any python exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException { - public: - DirectorMethodException(const char *msg = "") - : DirectorException(PyExc_RuntimeError, "SWIG director method error.", msg) { - } - - static void raise(const char *msg) { - throw DirectorMethodException(msg); - } - }; - - /* attempt to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg = "") - : DirectorException(PyExc_RuntimeError, "SWIG director pure virtual method called", msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - -#if defined(SWIG_PYTHON_THREADS) -/* __THREAD__ is the old macro to activate some thread support */ -# if !defined(__THREAD__) -# define __THREAD__ 1 -# endif -#endif - -#ifdef __THREAD__ -# include "pythread.h" - class Guard { - PyThread_type_lock &mutex_; - - public: - Guard(PyThread_type_lock & mutex) : mutex_(mutex) { - PyThread_acquire_lock(mutex_, WAIT_LOCK); - } - - ~Guard() { - PyThread_release_lock(mutex_); - } - }; -# define SWIG_GUARD(mutex) Guard _guard(mutex) -#else -# define SWIG_GUARD(mutex) -#endif - - /* director base class */ - class Director { - private: - /* pointer to the wrapped python object */ - PyObject *swig_self; - /* flag indicating whether the object is owned by python or c++ */ - mutable bool swig_disown_flag; - - /* decrement the reference count of the wrapped python object */ - void swig_decref() const { - if (swig_disown_flag) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_DECREF(swig_self); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - public: - /* wrap a python object. */ - Director(PyObject *self) : swig_self(self), swig_disown_flag(false) { - } - - /* discard our reference at destruction */ - virtual ~Director() { - swig_decref(); - } - - /* return a pointer to the wrapped python object */ - PyObject *swig_get_self() const { - return swig_self; - } - - /* acquire ownership of the wrapped python object (the sense of "disown" is from python) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag=true; - swig_incref(); - } - } - - /* increase the reference count of the wrapped python object */ - void swig_incref() const { - if (swig_disown_flag) { - Py_INCREF(swig_self); - } - } - - /* methods to implement pseudo protected director members */ - virtual bool swig_get_inner(const char * /* swig_protected_method_name */) const { - return true; - } - - virtual void swig_set_inner(const char * /* swig_protected_method_name */, bool /* swig_val */) const { - } - - /* ownership management */ - private: - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; -#ifdef __THREAD__ - static PyThread_type_lock swig_mutex_own; -#endif - - public: - template - void swig_acquire_ownership_array(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCArray_T(vptr); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, int own) const { - if (vptr && own) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_Object(own); - } - } - - int swig_release_ownership(void *vptr) const { - int own = 0; - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_ownership_map::iterator iter = swig_owner.find(vptr); - if (iter != swig_owner.end()) { - own = iter->second->get_own(); - swig_owner.erase(iter); - } - } - return own; - } - - template - static PyObject *swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args)) { - SwigPyObject *sobj = (SwigPyObject *)pyobj; - sobj->own = 0; - Director *d = SWIG_DIRECTOR_CAST(reinterpret_cast(sobj->ptr)); - if (d) - d->swig_disown(); - return PyWeakref_NewProxy(pyobj, NULL); - } - }; - -#ifdef __THREAD__ - PyThread_type_lock Director::swig_mutex_own = PyThread_allocate_lock(); -#endif -} - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/python/embed.i b/linux/bin/swig/share/swig/4.1.0/python/embed.i deleted file mode 100755 index 3fc2d14e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/embed.i +++ /dev/null @@ -1,120 +0,0 @@ -// -// embed.i -// SWIG file embedding the Python interpreter in something else. -// This file is deprecated and no longer actively maintained, but it still -// seems to work with Python 2.7. Status with Python 3 is unknown. -// -// This file makes it possible to extend Python and all of its -// built-in functions without having to hack its setup script. -// - - -#ifdef AUTODOC -%subsection "embed.i" -%text %{ -This module provides support for building a new version of the -Python executable. This will be necessary on systems that do -not support shared libraries and may be necessary with C++ -extensions. This file contains everything you need to build -a new version of Python from include files and libraries normally -installed with the Python language. - -This module will automatically grab all of the Python modules -present in your current Python executable (including any special -purpose modules you have enabled such as Tkinter). Thus, you -may need to provide additional link libraries when compiling. - -As far as I know, this module is C++ safe. -%} -#endif - -%wrapper %{ -#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) -#define PY_SSIZE_T_CLEAN -#endif - -#if __GNUC__ >= 7 -#pragma GCC diagnostic push -#if defined(__cplusplus) && __cplusplus >=201703L -#pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */ -#endif -#endif - -#include - -#if __GNUC__ >= 7 -#pragma GCC diagnostic pop -#endif - -#ifdef __cplusplus -extern "C" -#endif -void SWIG_init(); /* Forward reference */ - -#define _PyImport_Inittab swig_inittab - -/* Grab Python's inittab[] structure */ - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#undef _PyImport_Inittab - -/* Now define our own version of it. - Hopefully someone does not have more than 1000 built-in modules */ - -struct _inittab SWIG_Import_Inittab[1000]; - -static int swig_num_modules = 0; - -/* Function for adding modules to Python */ - -static void swig_add_module(char *name, void (*initfunc)()) { - SWIG_Import_Inittab[swig_num_modules].name = name; - SWIG_Import_Inittab[swig_num_modules].initfunc = initfunc; - swig_num_modules++; - SWIG_Import_Inittab[swig_num_modules].name = (char *) 0; - SWIG_Import_Inittab[swig_num_modules].initfunc = 0; -} - -/* Function to add all of Python's built-in modules to our interpreter */ - -static void swig_add_builtin() { - int i = 0; - while (swig_inittab[i].name) { - swig_add_module(swig_inittab[i].name, swig_inittab[i].initfunc); - i++; - } -#ifdef SWIGMODINIT - SWIGMODINIT -#endif - /* Add SWIG builtin function */ - swig_add_module(SWIG_name, SWIG_init); -} - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -extern int Py_Main(int, char **); - -#ifdef __cplusplus -} -#endif - -extern struct _inittab *PyImport_Inittab; - -int -main(int argc, char **argv) { - swig_add_builtin(); - PyImport_Inittab = SWIG_Import_Inittab; - return Py_Main(argc,argv); -} - -%} diff --git a/linux/bin/swig/share/swig/4.1.0/python/exception.i b/linux/bin/swig/share/swig/4.1.0/python/exception.i deleted file mode 100755 index bb0b15c9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/exception.i +++ /dev/null @@ -1,6 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) -} diff --git a/linux/bin/swig/share/swig/4.1.0/python/factory.i b/linux/bin/swig/share/swig/4.1.0/python/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/file.i b/linux/bin/swig/share/swig/4.1.0/python/file.i deleted file mode 100755 index 359c34d2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/file.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * file.i - * - * Typemaps for FILE* - * ----------------------------------------------------------------------------- */ - -%types(FILE *); - -/* defining basic methods */ -%fragment("SWIG_AsValFilePtr","header") { -SWIGINTERN int -SWIG_AsValFilePtr(PyObject *obj, FILE **val) { - static swig_type_info* desc = 0; - void *vptr = 0; - if (!desc) desc = SWIG_TypeQuery("FILE *"); - if ((SWIG_ConvertPtr(obj, &vptr, desc, 0)) == SWIG_OK) { - if (val) *val = (FILE *)vptr; - return SWIG_OK; - } -%#if PY_VERSION_HEX < 0x03000000 - if (PyFile_Check(obj)) { - if (val) *val = PyFile_AsFile(obj); - return SWIG_OK; - } -%#endif - return SWIG_TypeError; -} -} - - -%fragment("SWIG_AsFilePtr","header",fragment="SWIG_AsValFilePtr") { -SWIGINTERNINLINE FILE* -SWIG_AsFilePtr(PyObject *obj) { - FILE *val = 0; - SWIG_AsValFilePtr(obj, &val); - return val; -} -} - -/* defining the typemaps */ -%typemaps_asval(%checkcode(POINTER), SWIG_AsValFilePtr, "SWIG_AsValFilePtr", FILE*); diff --git a/linux/bin/swig/share/swig/4.1.0/python/implicit.i b/linux/bin/swig/share/swig/4.1.0/python/implicit.i deleted file mode 100755 index 152c2b05..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/implicit.i +++ /dev/null @@ -1,7 +0,0 @@ -%include -%include - -#warning "This file provides the %implicit directive, which is an old and fragile" -#warning "way to implement the C++ implicit conversion mechanism." -#warning "Try using the more robust '%implicitconv Type;' directive instead." - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyabc.i b/linux/bin/swig/share/swig/4.1.0/python/pyabc.i deleted file mode 100755 index cae1e703..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyabc.i +++ /dev/null @@ -1,14 +0,0 @@ -%define %pythonabc(Type, Abc) - %feature("python:abc", Abc) Type; -%enddef -%pythoncode %{if _swig_python_version_info[0:2] >= (3, 3): - import collections.abc -else: - import collections -%} -%pythonabc(std::vector, "collections.abc.MutableSequence if _swig_python_version_info >= (3, 3) else collections.MutableSequence"); -%pythonabc(std::list, "collections.abc.MutableSequence if _swig_python_version_info >= (3, 3) else collections.MutableSequence"); -%pythonabc(std::map, "collections.abc.MutableMapping if _swig_python_version_info >= (3, 3) else collections.MutableMapping"); -%pythonabc(std::multimap, "collections.abc.MutableMapping if _swig_python_version_info >= (3, 3) else collections.MutableMapping"); -%pythonabc(std::set, "collections.abc.MutableSet if _swig_python_version_info >= (3, 3) else collections.MutableSet"); -%pythonabc(std::multiset, "collections.abc.MutableSet if _swig_python_version_info >= (3, 3) else collections.MutableSet"); diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyapi.swg b/linux/bin/swig/share/swig/4.1.0/python/pyapi.swg deleted file mode 100755 index 19e6979b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyapi.swg +++ /dev/null @@ -1,30 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -#ifdef __cplusplus -} -#endif - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pybackward.swg b/linux/bin/swig/share/swig/4.1.0/python/pybackward.swg deleted file mode 100755 index 8305fc78..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pybackward.swg +++ /dev/null @@ -1,45 +0,0 @@ -/* - adding backward compatibility macros -*/ - -#define SWIG_arg(x...) %arg(x) -#define SWIG_Mangle(x...) %mangle(x) - -#define SWIG_As_frag(Type...) %fragment_name(As, Type) -#define SWIG_As_name(Type...) %symbol_name(As, Type) -#define SWIG_As(Type...) SWIG_As_name(Type) SWIG_AS_CALL_ARGS - -#define SWIG_Check_frag(Type...) %fragment_name(Check, Type) -#define SWIG_Check_name(Type...) %symbol_name(Check, Type) -#define SWIG_Check(Type...) SWIG_Check_name(Type) SWIG_AS_CALL_ARGS - -%define %ascheck_methods(Code, Type...) -%fragment(SWIG_As_frag(Type),"header", fragment=SWIG_AsVal_frag(Type)) { -SWIGINTERNINLINE Type -SWIG_As(Type)(PyObject* obj) -{ - Type v; - int res = SWIG_AsVal(Type)(obj, &v); - if (!SWIG_IsOK(res)) { - /* - this is needed to make valgrind/purify happier. - */ - memset((void*)&v, 0, sizeof(Type)); - SWIG_Error(res, ""); - } - return v; -} -} - -%fragment(SWIG_Check_frag(Type),"header",fragment=SWIG_AsVal_frag(Type)) { -SWIGINTERNINLINE int -SWIG_Check(Type)(PyObject* obj) -{ - int res = SWIG_AsVal(Type)(obj, (Type*)0); - return SWIG_IsOK(res); -} -} -%enddef - -%apply_checkctypes(%ascheck_methods) - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pybuffer.i b/linux/bin/swig/share/swig/4.1.0/python/pybuffer.i deleted file mode 100755 index 2fdaa6d6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pybuffer.i +++ /dev/null @@ -1,119 +0,0 @@ -/* Implementing buffer protocol typemaps */ - -/* %pybuffer_mutable_binary(TYPEMAP, SIZE) - * - * Macro for functions accept mutable buffer pointer with a size. - * This can be used for both input and output. For example: - * - * %pybuffer_mutable_binary(char *buff, int size); - * void foo(char *buff, int size) { - * for(int i=0; i; - - or as a member variable: - - struct A { - SwigPtr_PyObject obj; - A(PyObject *o) : _obj(o) { - } - }; - - or as a input/output value - - SwigPtr_PyObject func(SwigPtr_PyObject obj) { - SwigPtr_PyObject out = PyString_FromFormat("hello %s", PyObject_AsString(obj)); - Py_DECREF(out); - return out; - } - - just remember to pair the object creation with the proper DECREF, - the same as with plain PyObject *ptr, since SwigPtr_PyObject always add - one reference at construction. - - SwigPtr_PyObject is 'visible' at the wrapped side, so you can do: - - - %template(pyvector) std::vector; - - and all the proper typemaps will be used. - -*/ - -namespace swig { - %ignore SwigPtr_PyObject; - struct SwigPtr_PyObject {}; - %apply PyObject * {SwigPtr_PyObject}; - %apply PyObject * const& {SwigPtr_PyObject const&}; - - %typemap(typecheck,precedence=SWIG_TYPECHECK_SWIGOBJECT,noblock=1) SwigPtr_PyObject const& "$1 = ($input != 0);" - - - /* For output */ - %typemap(out,noblock=1) SwigPtr_PyObject { - $result = (PyObject *)$1; - Py_INCREF($result); - } - - %typemap(out,noblock=1) SwigPtr_PyObject const & { - $result = (PyObject *)*$1; - Py_INCREF($result); - } - -} - -%{ -namespace swig { - class SwigPtr_PyObject { - protected: - PyObject *_obj; - - public: - SwigPtr_PyObject() :_obj(0) - { - } - - SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) - { - if (initial_ref) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(item._obj); - Py_XDECREF(_obj); - _obj = item._obj; - SWIG_PYTHON_THREAD_END_BLOCK; - return *this; - } - - ~SwigPtr_PyObject() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XDECREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - operator PyObject *() const - { - return _obj; - } - - PyObject *operator->() const - { - return _obj; - } - }; -} -%} - -/* - SwigVar_PyObject is used to manage 'in the scope' PyObject * variables, - as in - - int func () { - SwigVar_PyObject obj = PyString_FromString("hello"); - } - - ie, 'obj' is created and destructed in the same scope from - a python object that carries at least one reference value. - - SwigVar_PyObject just take care of applying the proper Py_DECREF. - - Hence, this class is purely internal and not visible at the wrapped side. - */ -namespace swig { - %ignore SwigVar_PyObject; - struct SwigVar_PyObject {}; - %apply PyObject * {SwigVar_PyObject}; - %apply PyObject * const& {SwigVar_PyObject const&}; -} - -%{ -namespace swig { - struct SwigVar_PyObject : SwigPtr_PyObject { - SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - - SwigVar_PyObject & operator = (PyObject* obj) - { - Py_XDECREF(_obj); - _obj = obj; - return *this; - } - }; -} -%} - - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/python/pycomplex.swg b/linux/bin/swig/share/swig/4.1.0/python/pycomplex.swg deleted file mode 100755 index 28c96361..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pycomplex.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* - Defines the As/From converters for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header") -{ -SWIGINTERNINLINE PyObject* -SWIG_From(Type)(%ifcplusplus(const Type&, Type) c) -{ - return PyComplex_FromDoubles(Real(c), Imag(c)); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ -SWIGINTERN int -SWIG_AsVal(Type) (PyObject *o, Type* val) -{ - if (PyComplex_Check(o)) { - if (val) *val = Constructor(PyComplex_RealAsDouble(o), PyComplex_ImagAsDouble(o)); - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { -SWIGINTERN int -SWIG_AsVal(Type)(PyObject *o, Type *val) -{ - if (PyComplex_Check(o)) { - double re = PyComplex_RealAsDouble(o); - double im = PyComplex_ImagAsDouble(o); - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0f); - return res; - } - } - return SWIG_TypeError; -} -} - -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) - - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pycontainer.swg b/linux/bin/swig/share/swig/4.1.0/python/pycontainer.swg deleted file mode 100755 index d6fdff08..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pycontainer.swg +++ /dev/null @@ -1,1082 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pycontainer.swg - * - * Python sequence <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Python, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -%{ -#include - -#if PY_VERSION_HEX >= 0x03020000 -# define SWIGPY_SLICEOBJECT PyObject -#else -# define SWIGPY_SLICEOBJECT PySliceObject -#endif -%} - - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - -%include - -/**** The PySequence C++ Wrap ***/ - -%fragment(""); - -%include - -%fragment("container_owner_attribute_init", "init") { - // thread safe initialization - swig::container_owner_attribute(); -} - -%fragment("reference_container_owner", "header", fragment="container_owner_attribute_init") { -namespace swig { - static PyObject* container_owner_attribute() { - static PyObject* attr = SWIG_Python_str_FromChar("__swig_container"); - return attr; - } - - template - struct container_owner { - // By default, do not add the back-reference (for value types) - // Specialization below will check the reference for pointer types. - static bool back_reference(PyObject* /*child*/, PyObject* /*owner*/) { - return false; - } - }; - - template <> - struct container_owner { - /* - * Call to add a back-reference to the owning object when returning a - * reference from a container. Will only set the reference if child - * is a SWIG wrapper object that does not own the pointer. - * - * returns whether the reference was set or not - */ - static bool back_reference(PyObject* child, PyObject* owner) { - SwigPyObject* swigThis = SWIG_Python_GetSwigThis(child); - if (swigThis && (swigThis->own & SWIG_POINTER_OWN) != SWIG_POINTER_OWN) { - return PyObject_SetAttr(child, container_owner_attribute(), owner) != -1; - } - return false; - } - }; -} -} - -%fragment(SWIG_Traits_frag(swig::SwigPtr_PyObject),"header",fragment="StdTraits") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "SwigPtr_PyObject"; } - }; - - template <> struct traits_from { - typedef SwigPtr_PyObject value_type; - static PyObject *from(const value_type& val) { - PyObject *obj = static_cast(val); - Py_XINCREF(obj); - return obj; - } - }; - - template <> - struct traits_check { - static bool check(SwigPtr_PyObject) { - return true; - } - }; - - template <> struct traits_asval { - typedef SwigPtr_PyObject value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} -} - -%fragment(SWIG_Traits_frag(swig::SwigVar_PyObject),"header",fragment="StdTraits") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "SwigVar_PyObject"; } - }; - - template <> struct traits_from { - typedef SwigVar_PyObject value_type; - static PyObject *from(const value_type& val) { - PyObject *obj = static_cast(val); - Py_XINCREF(obj); - return obj; - } - }; - - template <> - struct traits_check { - static bool check(SwigVar_PyObject) { - return true; - } - }; - - template <> struct traits_asval { - typedef SwigVar_PyObject value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} -} - -%fragment("SwigPySequence_Base","header",fragment="",fragment="StdTraits") -{ -%#include - -namespace std { - template <> - struct less - { - bool - operator()(PyObject * v, PyObject *w) const - { - bool res; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false; - /* This may fall into a case of inconsistent - eg. ObjA > ObjX > ObjB - but ObjA < ObjB - */ - if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) ) - { - /* Objects can't be compared, this mostly occurred in Python 3.0 */ - /* Compare their ptr directly for a workaround */ - res = (v < w); - PyErr_Clear(); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } - }; - - template <> - struct less - { - bool - operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const - { - return std::less()(v, w); - } - }; - - template <> - struct less - { - bool - operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const - { - return std::less()(v, w); - } - }; - -} - -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "PyObject *"; } - }; - - template <> struct traits_asval { - typedef PyObject * value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; - - template <> - struct traits_check { - static bool check(PyObject *) { - return true; - } - }; - - template <> struct traits_from { - typedef PyObject * value_type; - static PyObject *from(const value_type& val) { - Py_XINCREF(val); - return val; - } - }; - -} - -namespace swig { - template - inline size_t - check_index(Difference i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - throw std::out_of_range("index out of range"); - } - - template - void - slice_adjust(Difference i, Difference j, Py_ssize_t step, size_t size, Difference &ii, Difference &jj, bool insert = false) { - if (step == 0) { - throw std::invalid_argument("slice step cannot be zero"); - } else if (step > 0) { - // Required range: 0 <= i < size, 0 <= j < size, i <= j - if (i < 0) { - ii = 0; - } else if (i < (Difference)size) { - ii = i; - } else if (insert && (i >= (Difference)size)) { - ii = (Difference)size; - } - if (j < 0) { - jj = 0; - } else { - jj = (j < (Difference)size) ? j : (Difference)size; - } - if (jj < ii) - jj = ii; - } else { - // Required range: -1 <= i < size-1, -1 <= j < size-1, i >= j - if (i < -1) { - ii = -1; - } else if (i < (Difference) size) { - ii = i; - } else if (i >= (Difference)(size-1)) { - ii = (Difference)(size-1); - } - if (j < -1) { - jj = -1; - } else { - jj = (j < (Difference)size ) ? j : (Difference)(size-1); - } - if (ii < jj) - ii = jj; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline void - erase(Sequence* seq, const typename Sequence::iterator& position) { - seq->erase(position); - } - - template - struct traits_reserve { - static void reserve(Sequence & /*seq*/, typename Sequence::size_type /*n*/) { - // This should be specialized for types that support reserve - } - }; - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j, Py_ssize_t step) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj); - - if (step > 0) { - typename Sequence::const_iterator sb = self->begin(); - typename Sequence::const_iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - if (step == 1) { - return new Sequence(sb, se); - } else { - Sequence *sequence = new Sequence(); - swig::traits_reserve::reserve(*sequence, (jj - ii + step - 1) / step); - typename Sequence::const_iterator it = sb; - while (it!=se) { - sequence->push_back(*it); - for (Py_ssize_t c=0; c::reserve(*sequence, (ii - jj - step - 1) / -step); - typename Sequence::const_reverse_iterator sb = self->rbegin(); - typename Sequence::const_reverse_iterator se = self->rbegin(); - std::advance(sb,size-ii-1); - std::advance(se,size-jj-1); - typename Sequence::const_reverse_iterator it = sb; - while (it!=se) { - sequence->push_back(*it); - for (Py_ssize_t c=0; c<-step && it!=se; ++c) - it++; - } - return sequence; - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - if (step > 0) { - if (step == 1) { - size_t ssize = jj - ii; - if (ssize <= is.size()) { - // expanding/staying the same size - swig::traits_reserve::reserve(*self, self->size() - ssize + is.size()); - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator isit = is.begin(); - std::advance(sb,ii); - std::advance(isit, jj - ii); - self->insert(std::copy(is.begin(), isit, sb), isit, is.end()); - } else { - // shrinking - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - sb = self->begin(); - std::advance(sb,ii); - self->insert(sb, is.begin(), is.end()); - } - } else { - size_t replacecount = (jj - ii + step - 1) / step; - if (is.size() != replacecount) { - char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); - throw std::invalid_argument(msg); - } - typename Sequence::const_iterator isit = is.begin(); - typename Sequence::iterator it = self->begin(); - std::advance(it,ii); - for (size_t rc=0; rcend(); ++rc) { - *it++ = *isit++; - for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) - it++; - } - } - } else { - size_t replacecount = (ii - jj - step - 1) / -step; - if (is.size() != replacecount) { - char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); - throw std::invalid_argument(msg); - } - typename Sequence::const_iterator isit = is.begin(); - typename Sequence::reverse_iterator it = self->rbegin(); - std::advance(it,size-ii-1); - for (size_t rc=0; rcrend(); ++rc) { - *it++ = *isit++; - for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) - it++; - } - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j, Py_ssize_t step) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - if (step > 0) { - typename Sequence::iterator sb = self->begin(); - std::advance(sb,ii); - if (step == 1) { - typename Sequence::iterator se = self->begin(); - std::advance(se,jj); - self->erase(sb,se); - } else { - typename Sequence::iterator it = sb; - size_t delcount = (jj - ii + step - 1) / step; - while (delcount) { - it = self->erase(it); - for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) - it++; - delcount--; - } - } - } else { - typename Sequence::reverse_iterator sb = self->rbegin(); - std::advance(sb,size-ii-1); - typename Sequence::reverse_iterator it = sb; - size_t delcount = (ii - jj - step - 1) / -step; - while (delcount) { - it = typename Sequence::reverse_iterator(self->erase((++it).base())); - for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) - it++; - delcount--; - } - } - } -} -} - -%fragment("SwigPySequence_Cont","header", - fragment="StdTraits", - fragment="SwigPySequence_Base", - fragment="SwigPyIterator_T") -{ -namespace swig -{ - template - struct SwigPySequence_Ref - { - SwigPySequence_Ref(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index); - try { - return swig::as(item); - } catch (const std::invalid_argument& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", (int)_index); - if (!PyErr_Occurred()) { - ::%type_error(swig::type_name()); - } - SWIG_Python_AddErrorMsg(msg); - SWIG_Python_AddErrorMsg(e.what()); - throw; - } - } - - SwigPySequence_Ref& operator=(const T& v) - { - PySequence_SetItem(_seq, _index, swig::from(v)); - return *this; - } - - private: - PyObject* _seq; - Py_ssize_t _index; - }; - - template - struct SwigPySequence_ArrowProxy - { - SwigPySequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct SwigPySequence_InputIterator - { - typedef SwigPySequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - - SwigPySequence_InputIterator() - { - } - - SwigPySequence_InputIterator(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - SwigPySequence_ArrowProxy - operator->() const { - return SwigPySequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index) && (_seq == ri._seq); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - PyObject* _seq; - difference_type _index; - }; - - // STL container wrapper around a Python sequence - template - struct SwigPySequence_Cont - { - typedef SwigPySequence_Ref reference; - typedef const SwigPySequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - typedef size_t size_type; - typedef const pointer const_pointer; - typedef SwigPySequence_InputIterator iterator; - typedef SwigPySequence_InputIterator const_iterator; - - SwigPySequence_Cont(PyObject* seq) : _seq(0) - { - if (!PySequence_Check(seq)) { - throw std::invalid_argument("a sequence is expected"); - } - _seq = seq; - Py_INCREF(_seq); - } - - ~SwigPySequence_Cont() - { - Py_XDECREF(_seq); - } - - size_type size() const - { - return static_cast(PySequence_Size(_seq)); - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - Py_ssize_t s = size(); - for (Py_ssize_t i = 0; i < s; ++i) { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i); - if (!swig::check(item)) - return false; - } - return true; - } - - private: - PyObject* _seq; - }; - -} -} - -%define %swig_sequence_iterator(Sequence...) - %swig_sequence_iterator_with_making_function(swig::make_output_iterator,Sequence...) -%enddef - -%define %swig_sequence_forward_iterator(Sequence...) - %swig_sequence_iterator_with_making_function(swig::make_output_forward_iterator,Sequence...) -%enddef - -%define %swig_sequence_iterator_with_making_function(Make_output_iterator,Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - class iterator; - class reverse_iterator; - class const_iterator; - class const_reverse_iterator; - - %typemap(out,noblock=1,fragment="SwigPySequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - $result = SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &)), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); - } - %typemap(out,noblock=1,fragment="SwigPySequence_Cont") - std::pair, std::pair { - $result = PyTuple_New(2); - PyTuple_SetItem($result,0,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).first), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); - PyTuple_SetItem($result,1,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).second), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); - } - - %fragment("SwigPyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="SwigPySequence_Cont") {} - - %typemap(out,noblock=1,fragment="SwigPyPairBoolOutputIterator") - std::pair, std::pair { - $result = PyTuple_New(2); - PyTuple_SetItem($result,0,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).first), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); - PyTuple_SetItem($result,1,SWIG_From(bool)(%static_cast($1,const $type &).second)); - } - - %typemap(in,noblock=1,fragment="SwigPySequence_Cont") - iterator(swig::SwigPyIterator *iter = 0, int res), - reverse_iterator(swig::SwigPyIterator *iter = 0, int res), - const_iterator(swig::SwigPyIterator *iter = 0, int res), - const_reverse_iterator(swig::SwigPyIterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::SwigPyIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="SwigPySequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - swig::SwigPyIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("SwigPySequence_Cont"); - - %newobject iterator(PyObject **PYTHON_SELF); - %extend { - swig::SwigPyIterator* iterator(PyObject **PYTHON_SELF) { - return Make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "tp_iter", functype="getiterfunc") iterator; -#else - %pythoncode %{def __iter__(self): - return self.iterator()%} -#endif - } - -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - - -/**** The python container methods ****/ - -%define %swig_container_methods(Container...) - -/* deprecated in Python 2 */ -#if 1 - %newobject __getslice__; -#endif - %newobject __getitem__(SWIGPY_SLICEOBJECT *slice); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "nb_nonzero", functype="inquiry") __nonzero__; - %feature("python:slot", "sq_length", functype="lenfunc") __len__; -#endif // SWIGPYTHON_BUILTIN - - %extend { - bool __nonzero__() const { - return !(self->empty()); - } - - /* Alias for Python 3 compatibility */ - bool __bool__() const { - return !(self->empty()); - } - - size_type __len__() const { - return self->size(); - } - - // Although __getitem__, front, back actually use a const value_type& return type, the typemaps below - // use non-const so that they can be easily overridden by users if necessary. - %typemap(ret, fragment="reference_container_owner", noblock=1) value_type& __getitem__, value_type& front, value_type& back { - (void)swig::container_owner::category>::back_reference($result, $self); - } - } -%enddef - - - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - - %fragment("SwigPySequence_Base"); - -#if defined(SWIGPYTHON_BUILTIN) - //%feature("python:slot", "sq_item", functype="ssizeargfunc") __getitem__; - //%feature("python:slot", "sq_slice", functype="ssizessizeargfunc") __getslice__; - //%feature("python:slot", "sq_ass_item", functype="ssizeobjargproc") __setitem__; - //%feature("python:slot", "sq_ass_slice", functype="ssizessizeobjargproc") __setslice__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif // SWIGPYTHON_BUILTIN - - %extend { - /* typemap for slice object support */ - %typemap(in) SWIGPY_SLICEOBJECT* { - if (!PySlice_Check($input)) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - $1 = (SWIGPY_SLICEOBJECT *) $input; - } - %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) SWIGPY_SLICEOBJECT* { - $1 = PySlice_Check($input); - } - -/* deprecated in Python 2 */ -#if 1 - Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range, std::invalid_argument) { - return swig::getslice(self, i, j, 1); - } - - void __setslice__(difference_type i, difference_type j) throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, 1, Sequence()); - } - - void __setslice__(difference_type i, difference_type j, const Sequence& v) throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, 1, v); - } - - void __delslice__(difference_type i, difference_type j) throw (std::out_of_range, std::invalid_argument) { - swig::delslice(self, i, j, 1); - } -#endif - - void __delitem__(difference_type i) throw (std::out_of_range, std::invalid_argument) { - swig::erase(self, swig::getpos(self, i)); - } - - /* Overloaded methods for Python 3 compatibility - * (Also useful in Python 2.x) - */ - Sequence* __getitem__(SWIGPY_SLICEOBJECT *slice) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return NULL; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - return swig::getslice(self, id, jd, step); - } - - void __setitem__(SWIGPY_SLICEOBJECT *slice, const Sequence& v) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - swig::setslice(self, id, jd, step, v); - } - - void __setitem__(SWIGPY_SLICEOBJECT *slice) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - swig::delslice(self, id, jd, step); - } - - void __delitem__(SWIGPY_SLICEOBJECT *slice) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - swig::delslice(self, id, jd, step); - } - - } -%enddef - -%define %swig_sequence_methods_non_resizable(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - const value_type& __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, const value_type& x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - -#if defined(SWIGPYTHON_BUILTIN) - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(difference_type i) throw (std::out_of_range, std::invalid_argument) { - swig::erase(self, swig::getpos(self, i)); - } -#endif - - } -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_non_resizable(%arg(Sequence)) - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - void append(const value_type& x) { - self->push_back(x); - } - } -%enddef - -%define %swig_sequence_methods_non_resizable_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - value_type __getitem__(difference_type i) throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, value_type x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - -#if defined(SWIGPYTHON_BUILTIN) - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(difference_type i) throw (std::out_of_range, std::invalid_argument) { - swig::erase(self, swig::getpos(self, i)); - } -#endif - } -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_non_resizable_val(%arg(Sequence)) - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - void append(value_type x) { - self->push_back(x); - } - } -%enddef - - - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="SwigPySequence_Cont") -{ -namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, Seq* seq) { - // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(PyObject *obj, sequence **seq) { - if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(::SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } - } else if (PySequence_Check(obj)) { - try { - SwigPySequence_Cont swigpyseq(obj); - if (seq) { - sequence *pseq = new sequence(); - assign(swigpyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return swigpyseq.check() ? SWIG_OK : SWIG_ERROR; - } - } catch (std::exception& e) { - if (seq) { - if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, e.what()); - } - } - return SWIG_ERROR; - } - } - return SWIG_ERROR; - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static PyObject *from(const sequence& seq) { -%#ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); - } -%#endif - size_type size = seq.size(); - if (size <= (size_type)INT_MAX) { - PyObject *obj = PyTuple_New((Py_ssize_t)size); - Py_ssize_t i = 0; - for (const_iterator it = seq.begin(); it != seq.end(); ++it, ++i) { - PyTuple_SetItem(obj,i,swig::from(*it)); - } - return obj; - } else { - PyErr_SetString(PyExc_OverflowError,"sequence size not valid in python"); - return NULL; - } - } - }; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/python/pydocs.swg b/linux/bin/swig/share/swig/4.1.0/python/pydocs.swg deleted file mode 100755 index 5a25423d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pydocs.swg +++ /dev/null @@ -1,45 +0,0 @@ - -// Documentation for use with the autodoc feature. - -#ifdef SWIG_DOC_DOXYGEN_STYLE -%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) enum SWIGTYPE "@param $1_name enum $1_type" - -%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 *OUTPUT, SWIGTYPE &OUTPUT "@param $1_name $1_type (output)" -#else -%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) enum SWIGTYPE "$1_name: enum $1_type" - -%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 *OUTPUT, SWIGTYPE &OUTPUT "$1_name: $1_type (output)" -#endif - - -// Types to use in Python documentation for the parameters of the given C++ type. -%typemap(doctype) bool "boolean" - -%define int_doctype_for_cppint_type(cppint_type) - %typemap(doctype) cppint_type, unsigned cppint_type "int" -%enddef -%formacro(int_doctype_for_cppint_type, short, int, long, long long) - -%typemap(doctype) size_t "int" - -%typemap(doctype) enum SWIGTYPE "int" - -%typemap(doctype) float, double, long double "float" - -%typemap(doctype) char*, std::string "string" - -%typemap(doctype) SWIGTYPE "$1_basetype" -%typemap(doctype) SWIGTYPE * "$typemap(doctype, $*1_ltype)" -%typemap(doctype) SWIGTYPE & "$typemap(doctype, $*1_ltype)" diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyerrors.swg b/linux/bin/swig/share/swig/4.1.0/python/pyerrors.swg deleted file mode 100755 index 10b694cd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyerrors.swg +++ /dev/null @@ -1,107 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - PyErr_Clear(); - Py_XINCREF(type); - if (tmp) - PyErr_Format(type, "%s %s", tmp, mesg); - else - PyErr_Format(type, "%s", mesg); - Py_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -SWIGRUNTIME int -SWIG_Python_TypeErrorOccurred(PyObject *obj) -{ - PyObject *error; - if (obj) - return 0; - error = PyErr_Occurred(); - return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); -} - -SWIGRUNTIME void -SWIG_Python_RaiseOrModifyTypeError(const char *message) -{ - if (SWIG_Python_TypeErrorOccurred(NULL)) { - /* Use existing TypeError to preserve stacktrace and enhance with given message */ - PyObject *newvalue; - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); -#if PY_VERSION_HEX >= 0x03000000 - newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); -#else - newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); -#endif - if (newvalue) { - Py_XDECREF(value); - PyErr_Restore(type, newvalue, traceback); - } else { - PyErr_Restore(type, value, traceback); - } - } else { - /* Raise TypeError using given message */ - PyErr_SetString(PyExc_TypeError, message); - } -} diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyfragments.swg b/linux/bin/swig/share/swig/4.1.0/python/pyfragments.swg deleted file mode 100755 index 535a45bd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'pyfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the default ones defined by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyhead.swg b/linux/bin/swig/share/swig/4.1.0/python/pyhead.swg deleted file mode 100755 index 6f37160b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyhead.swg +++ /dev/null @@ -1,75 +0,0 @@ -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) -#define PyString_Check(name) PyBytes_Check(name) -#define PyString_FromString(x) PyUnicode_FromString(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -#define PyString_AsString(str) PyBytes_AsString(str) -#define PyString_Size(str) PyBytes_Size(str) -#define PyString_InternFromString(key) PyUnicode_InternFromString(key) -#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE -#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) - -#endif - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#endif - - -SWIGINTERN char* -SWIG_Python_str_AsChar(PyObject *str) -{ -#if PY_VERSION_HEX >= 0x03030000 - return (char *)PyUnicode_AsUTF8(str); -#else - return PyString_AsString(str); -#endif -} - -/* Was useful for Python 3.0.x-3.2.x - now provided only for compatibility - * with any uses in user interface files. */ -#define SWIG_Python_str_DelForPy3(x) - - -SWIGINTERN PyObject* -SWIG_Python_str_FromChar(const char *c) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -/* SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user interface files check for it. */ -# define SWIGPY_USE_CAPSULE -#ifdef SWIGPYTHON_BUILTIN -# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule_builtin" SWIG_TYPE_TABLE_NAME -#else -# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule" SWIG_TYPE_TABLE_NAME -#endif -# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION "." SWIGPY_CAPSULE_ATTR_NAME) - -#if PY_VERSION_HEX < 0x03020000 -#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) -#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyinit.swg b/linux/bin/swig/share/swig/4.1.0/python/pyinit.swg deleted file mode 100755 index 6833b455..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyinit.swg +++ /dev/null @@ -1,325 +0,0 @@ -/* ------------------------------------------------------------ - * The start of the Python initialization function - * ------------------------------------------------------------ */ - -%insert(init) "swiginit.swg" - -#if defined(SWIGPYTHON_BUILTIN) -%fragment(""); // For offsetof -#endif - -#if defined SWIGPYTHON_FASTPROXY && !defined SWIGPYTHON_BUILTIN - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" { -#endif - -/* Method creation and docstring support functions */ - -SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); -SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); -SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); - -#ifdef __cplusplus -} -#endif -%} - -#endif - -%init %{ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - -/* Install Constants */ -SWIGINTERN void -SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } -} - -/* ----------------------------------------------------------------------------- - * Patch %callback methods' docstrings to hold the callback ptrs - * -----------------------------------------------------------------------------*/ - -SWIGINTERN void -SWIG_Python_FixMethods(PyMethodDef *methods, const swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) { - size_t i; - for (i = 0; methods[i].ml_name; ++i) { - const char *c = methods[i].ml_doc; - if (!c) continue; - c = strstr(c, "swig_ptr: "); - if (c) { - int j; - const swig_const_info *ci = 0; - const char *name = c + 10; - for (j = 0; const_table[j].type; ++j) { - if (strncmp(const_table[j].name, name, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - memcpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - memcpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } -} - -#ifdef __cplusplus -} -#endif - -%} - -#if defined SWIGPYTHON_FASTPROXY && !defined SWIGPYTHON_BUILTIN - -%init %{ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Method creation and docstring support functions - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Function to find the method definition with the correct docstring for the - * proxy module as opposed to the low-level API - * ----------------------------------------------------------------------------- */ - -SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) { - /* Find the function in the modified method table */ - size_t offset = 0; - int found = 0; - while (SwigMethods_proxydocs[offset].ml_meth != NULL) { - if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) { - found = 1; - break; - } - offset++; - } - /* Use the copy with the modified docstring if available */ - return found ? &SwigMethods_proxydocs[offset] : NULL; -} - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - -SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } -#if PY_VERSION_HEX >= 0x03000000 - return PyInstanceMethod_New(func); -#else - return PyMethod_New(func, NULL, NULL); -#endif -} - -/* ----------------------------------------------------------------------------- - * Wrapper of PyStaticMethod_New() - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - -SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } - return PyStaticMethod_New(func); -} - -#ifdef __cplusplus -} -#endif - -%} - -#endif - -%init %{ - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 - PyObject* -#else - void -#endif -SWIG_init(void) { - PyObject *m, *d, *md, *globals; - -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { - PyModuleDef_HEAD_INIT, - SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - -#if defined(SWIGPYTHON_BUILTIN) - static SwigPyClientData SwigPyObject_clientdata = {0, 0, 0, 0, 0, 0, 0}; - static PyGetSetDef this_getset_def = { - (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL - }; - static SwigPyGetSet thisown_getset_closure = { - SwigPyObject_own, - SwigPyObject_own - }; - static PyGetSetDef thisown_getset_def = { - (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure - }; - PyTypeObject *builtin_pytype; - int builtin_base_count; - swig_type_info *builtin_basetype; - PyObject *tuple; - PyGetSetDescrObject *static_getset; - PyTypeObject *metatype; - PyTypeObject *swigpyobject; - SwigPyClientData *cd; - PyObject *public_interface, *public_symbol; - PyObject *this_descr; - PyObject *thisown_descr; - PyObject *self = 0; - int i; - - (void)builtin_pytype; - (void)builtin_base_count; - (void)builtin_basetype; - (void)tuple; - (void)static_getset; - (void)self; - - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); - assert(metatype); -#endif - - (void)globals; - - /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ - SWIG_This(); - SWIG_Python_TypeCache(); - SwigPyPacked_type(); -#ifndef SWIGPYTHON_BUILTIN - SwigPyObject_type(); -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule(SWIG_name, SwigMethods); -#endif - - md = d = PyModule_GetDict(m); - (void)md; - - SWIG_InitializeModule(0); - -#ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - if (!cd) { - SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { - PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); -# if PY_VERSION_HEX >= 0x03000000 - return NULL; -# else - return; -# endif - } - - /* All objects have a 'this' attribute */ - this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); - (void)this_descr; - - /* All objects have a 'thisown' attribute */ - thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); - (void)thisown_descr; - - public_interface = PyList_New(0); - public_symbol = 0; - (void)public_symbol; - - PyDict_SetItemString(md, "__all__", public_interface); - Py_DECREF(public_interface); - for (i = 0; SwigMethods[i].ml_name != NULL; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); - for (i = 0; swig_const_table[i].name != 0; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); -#endif - - SWIG_InstallConstants(d,swig_const_table); -%} - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyiterators.swg b/linux/bin/swig/share/swig/4.1.0/python/pyiterators.swg deleted file mode 100755 index cb15e35c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyiterators.swg +++ /dev/null @@ -1,458 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pyiterators.swg - * - * Implement a python 'output' iterator for Python 2.2 or higher. - * - * Users can derive form the SwigPyIterator to implement their - * own iterators. As an example (real one since we use it for STL/STD - * containers), the template SwigPyIterator_T does the - * implementation for generic C++ iterators. - * ----------------------------------------------------------------------------- */ - -%include - -%fragment("SwigPyIterator","header",fragment="") { -namespace swig { - struct stop_iteration { - }; - - struct SwigPyIterator { - private: - SwigPtr_PyObject _seq; - - protected: - SwigPyIterator(PyObject *seq) : _seq(seq) - { - } - - public: - virtual ~SwigPyIterator() {} - - // Access iterator method, required by Python - virtual PyObject *value() const = 0; - - // Forward iterator method, required by Python - virtual SwigPyIterator *incr(size_t n = 1) = 0; - - // Backward iterator method, very common in C++, but not required in Python - virtual SwigPyIterator *decr(size_t /*n*/ = 1) - { - throw stop_iteration(); - } - - // Random access iterator methods, but not required in Python - virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual bool equal (const SwigPyIterator &/*x*/) const - { - throw std::invalid_argument("operation not supported"); - } - - // C++ common/needed methods - virtual SwigPyIterator *copy() const = 0; - - PyObject *next() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads - PyObject *obj = value(); - incr(); - SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads - return obj; - } - - /* Make an alias for Python 3.x */ - PyObject *__next__() - { - return next(); - } - - PyObject *previous() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads - decr(); - PyObject *obj = value(); - SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads - return obj; - } - - SwigPyIterator *advance(ptrdiff_t n) - { - return (n > 0) ? incr(n) : decr(-n); - } - - bool operator == (const SwigPyIterator& x) const - { - return equal(x); - } - - bool operator != (const SwigPyIterator& x) const - { - return ! operator==(x); - } - - SwigPyIterator& operator += (ptrdiff_t n) - { - return *advance(n); - } - - SwigPyIterator& operator -= (ptrdiff_t n) - { - return *advance(-n); - } - - SwigPyIterator* operator + (ptrdiff_t n) const - { - return copy()->advance(n); - } - - SwigPyIterator* operator - (ptrdiff_t n) const - { - return copy()->advance(-n); - } - - ptrdiff_t operator - (const SwigPyIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::SwigPyIterator *"); - init = 1; - } - return desc; - } - }; - -%#if defined(SWIGPYTHON_BUILTIN) - inline PyObject* make_output_iterator_builtin (PyObject *pyself) - { - Py_INCREF(pyself); - return pyself; - } -%#endif -} -} - -%fragment("SwigPyIterator_T","header",fragment="",fragment="SwigPyIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - template - class SwigPyIterator_T : public SwigPyIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef SwigPyIterator_T self_type; - - SwigPyIterator_T(out_iterator curr, PyObject *seq) - : SwigPyIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const SwigPyIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const SwigPyIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyForwardIteratorOpen_T : public SwigPyIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyForwardIteratorOpen_T self_type; - - SwigPyForwardIteratorOpen_T(out_iterator curr, PyObject *seq) - : SwigPyIterator_T(curr, seq) - { - } - - PyObject *value() const { - return from(static_cast(*(base::current))); - } - - SwigPyIterator *copy() const - { - return new self_type(*this); - } - - SwigPyIterator *incr(size_t n = 1) - { - while (n--) { - ++base::current; - } - return this; - } - - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyIteratorOpen_T : public SwigPyForwardIteratorOpen_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyIteratorOpen_T self_type; - - SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq) - : SwigPyForwardIteratorOpen_T(curr, seq) - { - } - - SwigPyIterator *decr(size_t n = 1) - { - while (n--) { - --base::current; - } - return this; - } - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyForwardIteratorClosed_T : public SwigPyIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyForwardIteratorClosed_T self_type; - - SwigPyForwardIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) - : SwigPyIterator_T(curr, seq), begin(first), end(last) - { - } - - PyObject *value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - SwigPyIterator *copy() const - { - return new self_type(*this); - } - - SwigPyIterator *incr(size_t n = 1) - { - while (n--) { - if (base::current == end) { - throw stop_iteration(); - } else { - ++base::current; - } - } - return this; - } - - protected: - out_iterator begin; - out_iterator end; - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyIteratorClosed_T : public SwigPyForwardIteratorClosed_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyForwardIteratorClosed_T base0; - typedef SwigPyIteratorClosed_T self_type; - - SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) - : SwigPyForwardIteratorClosed_T(curr, first, last, seq) - { - } - - SwigPyIterator *decr(size_t n = 1) - { - while (n--) { - if (base::current == base0::begin) { - throw stop_iteration(); - } else { - --base::current; - } - } - return this; - } - }; - - - template - inline SwigPyIterator* - make_output_forward_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) - { - return new SwigPyForwardIteratorClosed_T(current, begin, end, seq); - } - - template - inline SwigPyIterator* - make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) - { - return new SwigPyIteratorClosed_T(current, begin, end, seq); - } - - template - inline SwigPyIterator* - make_output_forward_iterator(const OutIter& current, PyObject *seq = 0) - { - return new SwigPyForwardIteratorOpen_T(current, seq); - } - - template - inline SwigPyIterator* - make_output_iterator(const OutIter& current, PyObject *seq = 0) - { - return new SwigPyIteratorOpen_T(current, seq); - } - -} -} - - -%fragment("SwigPyIterator"); -namespace swig -{ - /* - Throw a StopIteration exception - */ - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws) stop_iteration { - (void)$1; - SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); - SWIG_fail; - } - - /* - Mark methods that return new objects - */ - %newobject SwigPyIterator::copy; - %newobject SwigPyIterator::operator + (ptrdiff_t n) const; - %newobject SwigPyIterator::operator - (ptrdiff_t n) const; - - %nodirector SwigPyIterator; - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:tp_iter") SwigPyIterator "&swig::make_output_iterator_builtin"; - %feature("python:slot", "tp_iternext", functype="iternextfunc") SwigPyIterator::__next__; -#else - %extend SwigPyIterator { - %pythoncode %{def __iter__(self): - return self%} - } -#endif - - %catches(swig::stop_iteration) SwigPyIterator::value() const; - %catches(swig::stop_iteration) SwigPyIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) SwigPyIterator::decr(size_t n = 1); - %catches(std::invalid_argument) SwigPyIterator::distance(const SwigPyIterator &x) const; - %catches(std::invalid_argument) SwigPyIterator::equal (const SwigPyIterator &x) const; - %catches(swig::stop_iteration) SwigPyIterator::__next__(); - %catches(swig::stop_iteration) SwigPyIterator::next(); - %catches(swig::stop_iteration) SwigPyIterator::previous(); - %catches(swig::stop_iteration) SwigPyIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) SwigPyIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) SwigPyIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) SwigPyIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) SwigPyIterator::operator - (ptrdiff_t n) const; - - struct SwigPyIterator - { - protected: - SwigPyIterator(PyObject *seq); - - public: - virtual ~SwigPyIterator(); - - // Access iterator method, required by Python - virtual PyObject *value() const = 0; - - // Forward iterator method, required by Python - virtual SwigPyIterator *incr(size_t n = 1) = 0; - - // Backward iterator method, very common in C++, but not required in Python - virtual SwigPyIterator *decr(size_t n = 1); - - // Random access iterator methods, but not required in Python - virtual ptrdiff_t distance(const SwigPyIterator &x) const; - - virtual bool equal (const SwigPyIterator &x) const; - - // C++ common/needed methods - virtual SwigPyIterator *copy() const = 0; - - PyObject *next(); - PyObject *__next__(); - PyObject *previous(); - SwigPyIterator *advance(ptrdiff_t n); - - bool operator == (const SwigPyIterator& x) const; - bool operator != (const SwigPyIterator& x) const; - SwigPyIterator& operator += (ptrdiff_t n); - SwigPyIterator& operator -= (ptrdiff_t n); - SwigPyIterator* operator + (ptrdiff_t n) const; - SwigPyIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const SwigPyIterator& x) const; - }; -} - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pymacros.swg b/linux/bin/swig/share/swig/4.1.0/python/pymacros.swg deleted file mode 100755 index ab7bace5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pymacros.swg +++ /dev/null @@ -1,4 +0,0 @@ -%include - - - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyname_compat.i b/linux/bin/swig/share/swig/4.1.0/python/pyname_compat.i deleted file mode 100755 index a9630dbe..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyname_compat.i +++ /dev/null @@ -1,85 +0,0 @@ -/* -* From SWIG 1.3.37 we deprecated all SWIG symbols that start with Py, -* since they are inappropriate and discouraged in Python documentation -* (from http://www.python.org/doc/2.5.2/api/includes.html): -* -* "All user visible names defined by Python.h (except those defined by the included -* standard headers) have one of the prefixes "Py" or "_Py". Names beginning with -* "_Py" are for internal use by the Python implementation and should not be used -* by extension writers. Structure member names do not have a reserved prefix. -* -* Important: user code should never define names that begin with "Py" or "_Py". -* This confuses the reader, and jeopardizes the portability of the user code to -* future Python versions, which may define additional names beginning with one -* of these prefixes." -* -* This file defined macros to provide backward compatibility for these deprecated -* symbols. In the case you have these symbols in your interface file, you can simply -* include this file at beginning of it. -* -* However, this file may be removed in future release of SWIG, so using this file to -* keep these inappropriate names in your SWIG interface file is also not recommended. -* Instead, we provide a simple tool for converting your interface files to -* the new naming convention. You can get the tool from the SWIG distribution: -* Tools/pyname_patch.py -*/ - -%fragment("PySequence_Base", "header", fragment="SwigPySequence_Base") {} -%fragment("PySequence_Cont", "header", fragment="SwigPySequence_Cont") {} -%fragment("PySwigIterator_T", "header", fragment="SwigPyIterator_T") {} -%fragment("PyPairBoolOutputIterator", "header", fragment="SwigPyPairBoolOutputIterator") {} -%fragment("PySwigIterator", "header", fragment="SwigPyIterator") {} -%fragment("PySwigIterator_T", "header", fragment="SwigPyIterator_T") {} - -%inline %{ -#define PyMapIterator_T SwigPyMapIterator_T -#define PyMapKeyIterator_T SwigPyMapKeyIterator_T -#define PyMapValueIterator_T SwigPyMapValueIterator_T -#define PyObject_ptr SwigPtr_PyObject -#define PyObject_var SwigVar_PyObject -#define PyOper SwigPyOper -#define PySeq SwigPySeq -#define PySequence_ArrowProxy SwigPySequence_ArrowProxy -#define PySequence_Cont SwigPySequence_Cont -#define PySequence_InputIterator SwigPySequence_InputIterator -#define PySequence_Ref SwigPySequence_Ref -#define PySwigClientData SwigPyClientData -#define PySwigClientData_Del SwigPyClientData_Del -#define PySwigClientData_New SwigPyClientData_New -#define PySwigIterator SwigPyIterator -#define PySwigIteratorClosed_T SwigPyIteratorClosed_T -#define PySwigIteratorOpen_T SwigPyIteratorOpen_T -#define PySwigIterator_T SwigPyIterator_T -#define PySwigObject SwigPyObject -#define PySwigObject_Check SwigPyObject_Check -#define PySwigObject_GetDesc SwigPyObject_GetDesc -#define PySwigObject_New SwigPyObject_New -#define PySwigObject_acquire SwigPyObject_acquire -#define PySwigObject_append SwigPyObject_append -#define PySwigObject_as_number SwigPyObject_as_number -#define PySwigObject_compare SwigPyObject_compare -#define PySwigObject_dealloc SwigPyObject_dealloc -#define PySwigObject_disown SwigPyObject_disown -#define PySwigObject_format SwigPyObject_format -#define PySwigObject_getattr SwigPyObject_getattr -#define PySwigObject_hex SwigPyObject_hex -#define PySwigObject_long SwigPyObject_long -#define PySwigObject_next SwigPyObject_next -#define PySwigObject_oct SwigPyObject_oct -#define PySwigObject_own SwigPyObject_own -#define PySwigObject_repr SwigPyObject_repr -#define PySwigObject_richcompare SwigPyObject_richcompare -#define PySwigObject_type SwigPyObject_type -#define PySwigPacked SwigPyPacked -#define PySwigPacked_Check SwigPyPacked_Check -#define PySwigPacked_New SwigPyPacked_New -#define PySwigPacked_UnpackData SwigPyPacked_UnpackData -#define PySwigPacked_compare SwigPyPacked_compare -#define PySwigPacked_dealloc SwigPyPacked_dealloc -#define PySwigPacked_repr SwigPyPacked_repr -#define PySwigPacked_str SwigPyPacked_str -#define PySwigPacked_type SwigPyPacked_type -#define pyseq swigpyseq -#define pyswigobject_type swigpyobject_type -#define pyswigpacked_type swigpypacked_type -%} diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyopers.swg b/linux/bin/swig/share/swig/4.1.0/python/pyopers.swg deleted file mode 100755 index fd2fcc58..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyopers.swg +++ /dev/null @@ -1,264 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - - The directives in this file apply whether or not you use the - -builtin option to SWIG, but operator overloads are particularly - attractive when using -builtin, because they are much faster - than named methods. - - If you're using the -builtin option to SWIG, and you want to define - python operator overloads beyond the defaults defined in this file, - here's what you need to know: - - There are two ways to define a python slot function: dispatch to a - statically defined function; or dispatch to a method defined on the - operand. - - To dispatch to a statically defined function, use %feature("python:"), - where is the name of a field in a PyTypeObject, PyNumberMethods, - PyMappingMethods, PySequenceMethods, or PyBufferProcs. For example: - - %feature("python:tp_hash") MyClass "myHashFunc"; - - class MyClass { - public: - ... - }; - - %{ - // Note: Py_hash_t was introduced in Python 3.2 - static Py_hash_t myHashFunc(PyObject *pyobj) { - MyClass *cobj; - // Convert pyobj to cobj - return (cobj->field1 * (cobj->field2 << 7)); - } - %} - - NOTE: It is the responsibility of the programmer (that's you) to ensure - that a statically defined slot function has the correct signature. - - If, instead, you want to dispatch to an instance method, you can - use %feature("python:slot"). For example: - - %feature("python:slot", "tp_hash", functype="hashfunc") MyClass::myHashFunc; - - class MyClass { - public: - Py_hash_t myHashFunc () const; - ... - }; - - NOTE: Some python slots use a method signature which does not - match the signature of SWIG-wrapped methods. For those slots, - SWIG will automatically generate a "closure" function to re-marshall - the arguments before dispatching to the wrapped method. Setting - the "functype" attribute of the feature enables SWIG to generate - a correct closure function. - - -------------------------------------------------------------- - - The tp_richcompare slot is a special case: SWIG automatically generates - a rich compare function for all wrapped types. If a type defines C++ - operator overloads for comparison (operator==, operator<, etc.), they - will be called from the generated rich compare function. If you - want to explicitly choose a method to handle a certain comparison - operation, you may use a different feature, %feature("python:compare") - like this: - - %feature("python:compare", "Py_LT") MyClass::lessThan; - - class MyClass { - public: - bool lessThan(const MyClass& other) const; - ... - }; - - ... where "Py_LT" is one of the rich comparison opcodes defined in the - python header file object.h. - - If there's no method defined to handle a particular comparison operation, - the default behavior is to compare pointer values of the wrapped - C++ objects. - - -------------------------------------------------------------- - - - For more information about python slots, including their names and - signatures, you may refer to the python documentation : - - http://docs.python.org/c-api/typeobj.html - - * ------------------------------------------------------------ */ - - -#ifdef __cplusplus - -#if defined(SWIGPYTHON_BUILTIN) -#define %pybinoperator(pyname,oper,functp,slt) %rename(pyname) oper; %pythonmaybecall oper; %feature("python:slot", #slt, functype=#functp) oper; %feature("python:slot", #slt, functype=#functp) pyname; -#define %pycompare(pyname,oper,comptype) %rename(pyname) oper; %pythonmaybecall oper; %feature("python:compare", #comptype) oper; %feature("python:compare", #comptype) pyname; -#else -#define %pybinoperator(pyname,oper,functp,slt) %rename(pyname) oper; %pythonmaybecall oper -#define %pycompare(pyname,oper,comptype) %pybinoperator(pyname,oper,,comptype) -#endif - -%pybinoperator(__add__, *::operator+, binaryfunc, nb_add); -%pybinoperator(__pos__, *::operator+(), unaryfunc, nb_positive); -%pybinoperator(__pos__, *::operator+() const, unaryfunc, nb_positive); -%pybinoperator(__sub__, *::operator-, binaryfunc, nb_subtract); -%pybinoperator(__neg__, *::operator-(), unaryfunc, nb_negative); -%pybinoperator(__neg__, *::operator-() const, unaryfunc, nb_negative); -%pybinoperator(__mul__, *::operator*, binaryfunc, nb_multiply); -%pybinoperator(__mod__, *::operator%, binaryfunc, nb_remainder); -%pybinoperator(__lshift__, *::operator<<, binaryfunc, nb_lshift); -%pybinoperator(__rshift__, *::operator>>, binaryfunc, nb_rshift); -%pybinoperator(__and__, *::operator&, binaryfunc, nb_and); -%pybinoperator(__or__, *::operator|, binaryfunc, nb_or); -%pybinoperator(__xor__, *::operator^, binaryfunc, nb_xor); -%pycompare(__lt__, *::operator<, Py_LT); -%pycompare(__le__, *::operator<=, Py_LE); -%pycompare(__gt__, *::operator>, Py_GT); -%pycompare(__ge__, *::operator>=, Py_GE); -%pycompare(__eq__, *::operator==, Py_EQ); -%pycompare(__ne__, *::operator!=, Py_NE); - -/* Special cases */ -%rename(__invert__) *::operator~; -%feature("python:slot", "nb_invert", functype="unaryfunc") *::operator~; -%rename(__call__) *::operator(); -%feature("python:slot", "tp_call", functype="ternarycallfunc") *::operator(); - -#if defined(SWIGPYTHON_BUILTIN) -%pybinoperator(__nonzero__, *::operator bool, inquiry, nb_nonzero); -%pybinoperator(__truediv__, *::operator/ , binaryfunc, nb_divide); -#else -%feature("shadow") *::operator bool %{ -def __nonzero__(self): - return $action(self) -__bool__ = __nonzero__ -%}; -%rename(__nonzero__) *::operator bool; -%feature("shadow") *::operator/ %{ -def __truediv__(self, *args): - return $action(self, *args) -__div__ = __truediv__ -%}; -%rename(__truediv__) *::operator/; -%pythonmaybecall *::operator/; -#endif - -/* Ignored operators */ -%ignoreoperator(LNOT) operator!; -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; -%ignoreoperator(EQ) *::operator=; -%ignoreoperator(PLUSPLUS) *::operator++; -%ignoreoperator(MINUSMINUS) *::operator--; -%ignoreoperator(ARROWSTAR) *::operator->*; -%ignoreoperator(INDEX) *::operator[]; - -/* - Inplace operator declarations. - - They translate the inplace C++ operators (+=, -=, ...) into the - corresponding python equivalents(__iadd__,__isub__), etc, - disabling the ownership of the input 'this' pointer, and assigning - it to the returning object: - - %feature("del") *::Operator; // disables ownership by generating SWIG_POINTER_DISOWN - %feature("new") *::Operator; // claims ownership by generating SWIG_POINTER_OWN - - This makes the most common case safe, ie: - - A& A::operator+=(int i) { ...; return *this; } - ^^^^ ^^^^^^ - - will work fine, even when the resulting python object shares the - 'this' pointer with the input one. The input object is usually - deleted after the operation, including the shared 'this' pointer, - producing 'strange' seg faults, as reported by Lucriz - (lucriz@sitilandia.it). - - If you have an interface that already takes care of that, ie, you - already are using inplace operators and you are not getting - seg. faults, with the new scheme you could end with 'free' elements - that never get deleted (maybe, not sure, it depends). But if that is - the case, you could recover the old behaviour using - - %feature("del","0") A::operator+=; - %feature("new","0") A::operator+=; - - which recovers the old behaviour for the class 'A', or if you are - 100% sure your entire system works fine in the old way, use: - - %feature("del","") *::operator+=; - %feature("new","") *::operator+=; - - The default behaviour assumes that the 'this' pointer's memory is - already owned by the SWIG object; it relinquishes ownership then - takes it back. This may not be the case though as the SWIG object - might be owned by memory managed elsewhere, eg after calling a - function that returns a C++ reference. In such case you will need - to use the features above to recover the old behaviour too. -*/ - -#if defined(SWIGPYTHON_BUILTIN) -#define %pyinplaceoper(SwigPyOper, Oper, functp, slt) %delobject Oper; %newobject Oper; %feature("python:slot", #slt, functype=#functp) Oper; %rename(SwigPyOper) Oper -#else -#define %pyinplaceoper(SwigPyOper, Oper, functp, slt) %delobject Oper; %newobject Oper; %rename(SwigPyOper) Oper -#endif - -%pyinplaceoper(__iadd__ , *::operator +=, binaryfunc, nb_inplace_add); -%pyinplaceoper(__isub__ , *::operator -=, binaryfunc, nb_inplace_subtract); -%pyinplaceoper(__imul__ , *::operator *=, binaryfunc, nb_inplace_multiply); -%pyinplaceoper(__imod__ , *::operator %=, binaryfunc, nb_inplace_remainder); -%pyinplaceoper(__iand__ , *::operator &=, binaryfunc, nb_inplace_and); -%pyinplaceoper(__ior__ , *::operator |=, binaryfunc, nb_inplace_or); -%pyinplaceoper(__ixor__ , *::operator ^=, binaryfunc, nb_inplace_xor); -%pyinplaceoper(__ilshift__, *::operator <<=, binaryfunc, nb_inplace_lshift); -%pyinplaceoper(__irshift__, *::operator >>=, binaryfunc, nb_inplace_rshift); - -/* Special cases */ -#if defined(SWIGPYTHON_BUILTIN) -%pyinplaceoper(__itruediv__ , *::operator /=, binaryfunc, nb_inplace_divide); -#else -%delobject *::operator /=; -%newobject *::operator /=; -%feature("shadow") *::operator /= %{ -def __itruediv__(self, *args): - return $action(self, *args) -__idiv__ = __itruediv__ -%}; -%rename(__itruediv__) *::operator /=; -#endif - -/* Finally, in python we need to mark the binary operations to fail as - 'maybecall' methods */ - -#define %pybinopermaybecall(oper) %pythonmaybecall __ ## oper ## __; %pythonmaybecall __r ## oper ## __ - -%pybinopermaybecall(add); -%pybinopermaybecall(pos); -%pybinopermaybecall(pos); -%pybinopermaybecall(sub); -%pybinopermaybecall(neg); -%pybinopermaybecall(neg); -%pybinopermaybecall(mul); -%pybinopermaybecall(div); -%pybinopermaybecall(truediv); -%pybinopermaybecall(mod); -%pybinopermaybecall(lshift); -%pybinopermaybecall(rshift); -%pybinopermaybecall(and); -%pybinopermaybecall(or); -%pybinopermaybecall(xor); -%pybinopermaybecall(lt); -%pybinopermaybecall(le); -%pybinopermaybecall(gt); -%pybinopermaybecall(ge); -%pybinopermaybecall(eq); -%pybinopermaybecall(ne); - -#endif - - - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyprimtypes.swg b/linux/bin/swig/share/swig/4.1.0/python/pyprimtypes.swg deleted file mode 100755 index 6a01af17..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyprimtypes.swg +++ /dev/null @@ -1,353 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE PyObject* - SWIG_From_dec(bool)(bool value) -{ - return PyBool_FromLong(value ? 1 : 0); -} -} - -#ifdef SWIG_PYTHON_LEGACY_BOOL -// Default prior to SWIG 3.0.0 -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(PyObject *obj, bool *val) -{ - int r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} -} -#else -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(PyObject *obj, bool *val) -{ - int r; - if (!PyBool_Check(obj)) - return SWIG_ERROR; - r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} -} -#endif - -/* int */ - -%fragment(SWIG_From_frag(int),"header") { -SWIGINTERNINLINE PyObject* - SWIG_From_dec(int)(int value) -{ - return PyInt_FromLong((long) value); -} -} - -/* unsigned int */ - -%fragment(SWIG_From_frag(unsigned int),"header") { -SWIGINTERNINLINE PyObject* - SWIG_From_dec(unsigned int)(unsigned int value) -{ - return PyInt_FromSize_t((size_t) value); -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { - %define_as(SWIG_From_dec(long), PyInt_FromLong) -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(long)(PyObject *obj, long* val) -{ -%#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else -%#endif - if (PyLong_Check(obj)) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - long v = PyInt_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } -%#endif - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE PyObject* -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(%numeric_cast(value,long)); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(PyObject *obj, unsigned long *val) -{ -%#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else -%#endif - if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -%#endif - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_dec(long long)(long long value) -{ - return ((value < LONG_MIN) || (value > LONG_MAX)) ? - PyLong_FromLongLong(value) : PyInt_FromLong(%numeric_cast(value,long)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment=SWIG_AsVal_frag(long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(PyObject *obj, long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - long long v = PyLong_AsLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - long v; - res = SWIG_AsVal(long)(obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - const double mant_min = -mant_max; - double d; - res = SWIG_AsVal(double)(obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, mant_min, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { - if (val) *val = (long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -%#endif - return res; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(%numeric_cast(value,long)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(PyObject *obj, unsigned long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - unsigned long long v = PyLong_AsUnsignedLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - unsigned long v; - res = SWIG_AsVal(unsigned long)(obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - res = SWIG_AsVal(double)(obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -%#endif - return res; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { - %define_as(SWIG_From_dec(double), PyFloat_FromDouble) -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(PyObject *obj, double *val) -{ - int res = SWIG_TypeError; - if (PyFloat_Check(obj)) { - if (val) *val = PyFloat_AsDouble(obj); - return SWIG_OK; -%#if PY_VERSION_HEX < 0x03000000 - } else if (PyInt_Check(obj)) { - if (val) *val = (double) PyInt_AsLong(obj); - return SWIG_OK; -%#endif - } else if (PyLong_Check(obj)) { - double v = PyLong_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - double d = PyFloat_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = d; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); - } else { - PyErr_Clear(); - } - } - } -%#endif - return res; -} -} - - - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyrun.swg b/linux/bin/swig/share/swig/4.1.0/python/pyrun.swg deleted file mode 100755 index 6b119be1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyrun.swg +++ /dev/null @@ -1,1913 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ -# error "This version of SWIG only supports Python >= 2.7" -#endif - -#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03030000 -# error "This version of SWIG only supports Python 3 >= 3.3" -#endif - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) - -#ifdef SWIGPYTHON_BUILTIN -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) -#else -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) -#endif - -#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) - -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -#if defined(SWIGPYTHON_BUILTIN) - -SWIGINTERN void -SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { - PyObject *s = PyString_InternFromString(key); - PyList_Append(seq, s); - Py_DECREF(s); -} - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); - if (public_interface) - SwigPyBuiltin_AddPublicSymbol(public_interface, name); -} - -#else - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); -} - -#endif - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - if (result) { - PyList_SET_ITEM(result, 0, o2); - } else { - Py_DECREF(obj); - return o2; - } - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -} - -/* Unpack the argument tuple */ - -SWIGINTERN Py_ssize_t -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - if (min <= 1 && max >= 1) { - Py_ssize_t i; - objs[0] = args; - for (i = 1; i < max; ++i) { - objs[i] = 0; - } - return 2; - } - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - Py_ssize_t i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -SWIGINTERN int -SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) { - int no_kwargs = 1; - if (kwargs) { - assert(PyDict_Check(kwargs)); - if (PyDict_Size(kwargs) > 0) { - PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name); - no_kwargs = 0; - } - } - return no_kwargs; -} - -/* A functor is a function object with one single object argument */ -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Python-specific SWIG API */ -#define SWIG_newvarlink() SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) - -/* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - -typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; -} swig_globalvar; - -typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; -} swig_varlinkobject; - -SWIGINTERN PyObject * -swig_varlink_repr(PyObject *SWIGUNUSEDPARM(v)) { -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_InternFromString(""); -#else - return PyString_FromString(""); -#endif -} - -SWIGINTERN PyObject * -swig_varlink_str(PyObject *o) { - swig_varlinkobject *v = (swig_varlinkobject *) o; -#if PY_VERSION_HEX >= 0x03000000 - PyObject *str = PyUnicode_InternFromString("("); - PyObject *tail; - PyObject *joined; - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - tail = PyUnicode_FromString(var->name); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - if (var->next) { - tail = PyUnicode_InternFromString(", "); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - } - } - tail = PyUnicode_InternFromString(")"); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; -#else - PyObject *str = PyString_FromString("("); - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - PyString_ConcatAndDel(&str,PyString_FromString(var->name)); - if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); - } - PyString_ConcatAndDel(&str,PyString_FromString(")")); -#endif - return str; -} - -SWIGINTERN void -swig_varlink_dealloc(PyObject *o) { - swig_varlinkobject *v = (swig_varlinkobject *) o; - swig_globalvar *var = v->vars; - while (var) { - swig_globalvar *n = var->next; - free(var->name); - free(var); - var = n; - } -} - -SWIGINTERN PyObject * -swig_varlink_getattr(PyObject *o, char *n) { - swig_varlinkobject *v = (swig_varlinkobject *) o; - PyObject *res = NULL; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->get_attr)(); - break; - } - var = var->next; - } - if (res == NULL && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; -} - -SWIGINTERN int -swig_varlink_setattr(PyObject *o, char *n, PyObject *p) { - swig_varlinkobject *v = (swig_varlinkobject *) o; - int res = 1; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->set_attr)(p); - break; - } - var = var->next; - } - if (res == 1 && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; -} - -SWIGINTERN PyTypeObject* -swig_varlink_type(void) { - static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "swigvarlink", /* tp_name */ - sizeof(swig_varlinkobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) swig_varlink_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /*tp_print*/ -#else - (Py_ssize_t)0, /*tp_vectorcall_offset*/ -#endif - (getattrfunc) swig_varlink_getattr, /* tp_getattr */ - (setattrfunc) swig_varlink_setattr, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) swig_varlink_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - varlink__doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - varlink_type = tmp; - type_init = 1; - if (PyType_Ready(&varlink_type) < 0) - return NULL; - } - return &varlink_type; -} - -/* Create a variable linking object for use later */ -SWIGINTERN PyObject * -SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); - if (result) { - result->vars = 0; - } - return ((PyObject*) result); -} - -SWIGINTERN void -SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v = (swig_varlinkobject *) p; - swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - if (gv) { - size_t size = strlen(name)+1; - gv->name = (char *)malloc(size); - if (gv->name) { - memcpy(gv->name, name, size); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - } - } - v->vars = gv; -} - - -static PyObject *Swig_Globals_global = NULL; - -SWIGINTERN PyObject * -SWIG_globals(void) { - if (Swig_Globals_global == NULL) { - Swig_Globals_global = SWIG_newvarlink(); - } - return Swig_Globals_global; -} - -#ifdef __cplusplus -} -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) -#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) - -#ifdef __cplusplus -extern "C" { -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; - PyTypeObject *pytype; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - int fail = data ? data->implicitconv : 0; - if (fail) - PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); - return fail; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* the newraw method and newargs arguments used to create a new raw instance */ - if (PyClass_Check(obj)) { - data->newraw = 0; - Py_INCREF(obj); - data->newargs = obj; - } else { - data->newraw = PyObject_GetAttrString(data->klass, "__new__"); - if (data->newraw) { - data->newargs = PyTuple_New(1); - if (data->newargs) { - Py_INCREF(obj); - PyTuple_SET_ITEM(data->newargs, 0, obj); - } else { - Py_DECREF(data->newraw); - Py_DECREF(data->klass); - free(data); - return 0; - } - } else { - Py_INCREF(obj); - data->newargs = obj; - } - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - data->delargs = !(PyCFunction_GET_FLAGS(data->destroy) & METH_O); - } else { - data->delargs = 0; - } - data->implicitconv = 0; - data->pytype = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) -{ - Py_XDECREF(data->klass); - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); - free(data); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -#ifdef SWIGPYTHON_BUILTIN - PyObject *dict; -#endif -} SwigPyObject; - - -#ifdef SWIGPYTHON_BUILTIN - -SWIGRUNTIME PyObject * -SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - - if (!sobj->dict) - sobj->dict = PyDict_New(); - - Py_XINCREF(sobj->dict); - return sobj->dict; -} - -#endif - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -SwigPyObject_format(const char* fmt, SwigPyObject *v) -{ - PyObject *res = NULL; - PyObject *args = PyTuple_New(1); - if (args) { - PyObject *val = SwigPyObject_long(v); - if (val) { - PyObject *ofmt; - PyTuple_SET_ITEM(args, 0, val); - ofmt = SWIG_Python_str_FromChar(fmt); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - } - Py_DECREF(args); - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_repr(SwigPyObject *v) -{ - const char *name = SWIG_TypePrettyName(v->ty); - PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); - if (repr && v->next) { - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); - if (nrep) { -# if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -# else - PyString_ConcatAndDel(&repr,nrep); -# endif - } else { - Py_DecRef(repr); - repr = NULL; - } - } - return repr; -} - -/* We need a version taking two PyObject* parameters so it's a valid - * PyCFunction to use in swigobject_methods[]. */ -SWIGRUNTIME PyObject * -SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - return SwigPyObject_repr((SwigPyObject*)v); -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -SWIGRUNTIME PyObject* -SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) -{ - PyObject* res; - if( op != Py_EQ && op != Py_NE ) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); - return res; -} - - -SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); - -#ifdef SWIGPYTHON_BUILTIN -static swig_type_info *SwigPyObject_stype = 0; -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - SwigPyClientData *cd; - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - assert(cd); - assert(cd->pytype); - return cd->pytype; -} -#else -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); - return type; -} -#endif - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN - PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) - return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); -#else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -#endif -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -static PyObject* Swig_Capsule_global = NULL; - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - - /* PyObject_CallFunction() has the potential to silently drop - the active exception. In cases of unnamed temporary - variable or where we just finished iterating over a generator - StopIteration will be active right now, and this needs to - remain true upon return from SwigPyObject_dealloc. So save - and restore. */ - - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); - - if (data->delargs) { - /* we need to create a temporary object to carry the destroy operation */ - PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); - if (tmp) { - res = SWIG_Python_CallFunctor(destroy, tmp); - } else { - res = 0; - } - Py_XDECREF(tmp); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - if (!res) - PyErr_WriteUnraisable(destroy); - - PyErr_Restore(type, value, traceback); - - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - Py_XDECREF(Swig_Capsule_global); - } - Py_XDECREF(next); -#ifdef SWIGPYTHON_BUILTIN - Py_XDECREF(sobj->dict); -#endif - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (!SwigPyObject_Check(next)) { - PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); - return NULL; - } - ((SwigPyObject *)next)->next = sobj->next; - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) { - return NULL; - } else { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { - if (PyObject_IsTrue(val)) { - Py_DECREF(SwigPyObject_acquire(v,args)); - } else { - Py_DECREF(SwigPyObject_disown(v,args)); - } - } - return obj; - } -} - -static PyMethodDef -swigobject_methods[] = { - {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"}, - {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"}, - {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"}, - {"append", SwigPyObject_append, METH_O, "appends another 'this' object"}, - {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"}, - {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"}, - {0, 0, 0, 0} -}; - -SWIGRUNTIME PyTypeObject* -SwigPyObject_TypeOnce(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ -#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#else - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#endif - }; - - static PyTypeObject swigpyobject_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /*tp_print*/ -#else - (Py_ssize_t)0, /*tp_vectorcall_offset*/ -#endif - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - swigpyobject_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpyobject_type) != 0) - return NULL; - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; -#ifdef SWIGPYTHON_BUILTIN - sobj->dict = 0; -#endif - if (own == SWIG_POINTER_OWN) { - /* Obtain a reference to the Python capsule wrapping the module information, so that the - * module information is correctly destroyed after all SWIG python objects have been freed - * by the GC (and corresponding destructors invoked) */ - Py_XINCREF(Swig_Capsule_global); - } - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_TypeOnce(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX>=0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /*tp_print*/ -#else - (Py_ssize_t)0, /*tp_vectorcall_offset*/ -#endif - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - swigpypacked_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpypacked_type) != 0) - return NULL; - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -static PyObject *Swig_This_global = NULL; - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - if (Swig_This_global == NULL) - Swig_This_global = SWIG_Python_str_FromChar("this"); - return Swig_This_global; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - PyObject *obj; - - if (SwigPyObject_Check(pyobj)) - return (SwigPyObject *) pyobj; - -#ifdef SWIGPYTHON_BUILTIN - (void)obj; -# ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - pyobj = PyWeakref_GET_OBJECT(pyobj); - if (pyobj && SwigPyObject_Check(pyobj)) - return (SwigPyObject*) pyobj; - } -# endif - return NULL; -#else - - obj = 0; - -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; -#endif -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - int res; - SwigPyObject *sobj; - int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; - - if (!obj) - return SWIG_ERROR; - if (obj == Py_None && !implicit_conv) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - res = SWIG_ERROR; - - sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !sobj->own) { - res = SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - sobj->ptr = 0; - } - res = SWIG_OK; - } - } else { - if (implicit_conv) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; - } - } - } - return res; -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - swig_cast_info *tc; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - return SWIG_OK; - } -} - -/* Convert a packed pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - } else{ - Py_DECREF(inst); - inst = 0; - } - } -#else - if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { - Py_DECREF(inst); - inst = 0; - } -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *empty_args = PyTuple_New(0); - if (empty_args) { - PyObject *empty_kwargs = PyDict_New(); - if (empty_kwargs) { - inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); - Py_DECREF(empty_kwargs); - if (inst) { - if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { - Py_DECREF(inst); - inst = 0; - } else { - PyType_Modified(Py_TYPE(inst)); - } - } - } - Py_DECREF(empty_args); - } -#else - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } -#endif - } - return inst; -} - -SWIGRUNTIME int -SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) -{ -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - if (dict) { - return PyDict_SetItem(dict, SWIG_This(), swig_this); - } else{ - return -1; - } - } -#endif - return PyObject_SetAttr(inst, SWIG_This(), swig_this); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - Py_DECREF(SwigPyObject_append((PyObject*) sthis, obj[1])); - } else { - if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) - return NULL; - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { - SwigPyClientData *clientdata; - PyObject * robj; - int own; - - if (!ptr) - return SWIG_Py_Void(); - - clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - if (clientdata && clientdata->pytype) { - SwigPyObject *newobj; - if (flags & SWIG_BUILTIN_TP_INIT) { - newobj = (SwigPyObject*) self; - if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); - while (newobj->next) - newobj = (SwigPyObject *) newobj->next; - newobj->next = next_self; - newobj = (SwigPyObject *)next_self; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - } else { - newobj = PyObject_New(SwigPyObject, clientdata->pytype); -#ifdef SWIGPYTHON_BUILTIN - if (newobj) { - newobj->dict = 0; - } -#endif - } - if (newobj) { - newobj->ptr = ptr; - newobj->ty = type; - newobj->own = own; - newobj->next = 0; - return (PyObject*) newobj; - } - return SWIG_Py_Void(); - } - - assert(!(flags & SWIG_BUILTIN_TP_INIT)); - - robj = SwigPyObject_New(ptr, type, own); - if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - Py_DECREF(robj); - robj = inst; - } - return robj; -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -static PyObject *Swig_TypeCache_global = NULL; - -/* The python cached type query */ -SWIGRUNTIME PyObject * -SWIG_Python_TypeCache(void) { - if (Swig_TypeCache_global == NULL) { - Swig_TypeCache_global = PyDict_New(); - } - return Swig_TypeCache_global; -} - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { -#ifdef SWIG_LINK_RUNTIME - static void *type_pointer = (void *)0; - /* first check if module already created */ - if (!type_pointer) { - type_pointer = SWIG_ReturnGlobalTypeList((void *)0); - } -#else - void *type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif - return (swig_module_info *) type_pointer; -} - - -static int interpreter_counter = 0; // how many (sub-)interpreters are using swig_module's types - -SWIGRUNTIME void -SWIG_Python_DestroyModule(PyObject *obj) -{ - swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); - swig_type_info **types = swig_module->types; - size_t i; - if (--interpreter_counter != 0) // another sub-interpreter may still be using the swig_module's types - return; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - ty->clientdata = 0; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); - Swig_This_global = NULL; - Py_DECREF(SWIG_globals()); - Swig_Globals_global = NULL; - Py_DECREF(SWIG_Python_TypeCache()); - Swig_TypeCache_global = NULL; - Swig_Capsule_global = NULL; -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); -#endif - PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); - if (pointer && module) { - if (PyModule_AddObject(module, SWIGPY_CAPSULE_ATTR_NAME, pointer) == 0) { - ++interpreter_counter; - Swig_Capsule_global = pointer; - } else { - Py_DECREF(pointer); - } - } else { - Py_XDECREF(pointer); - } -} - -SWIGRUNTIME swig_type_info * -SWIG_Python_TypeQuery(const char *type) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { - descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); - } else { - swig_module_info *swig_module = SWIG_GetModule(0); - descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); - if (descriptor) { - obj = PyCapsule_New((void*) descriptor, NULL, NULL); - if (obj) { - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); - } - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - const char *errmesg = tmp ? tmp : "Invalid error message"; - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, errmesg); - } else { - PyErr_Format(type, "%s %s", errmesg, mesg); - } - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : ""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - const char *otype = (obj ? obj->ob_type->tp_name : 0); - if (otype) { - PyObject *str = PyObject_Str(obj); - const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; - if (cstr) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", - type, otype, cstr); - } else { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", - type, otype); - } - Py_XDECREF(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { - void *result; - if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { - PyErr_Clear(); - } - return result; -} - -#ifdef SWIGPYTHON_BUILTIN -SWIGRUNTIME int -SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { - PyTypeObject *tp = obj->ob_type; - PyObject *descr; - PyObject *encoded_name; - descrsetfunc f; - int res = -1; - -# ifdef Py_USING_UNICODE - if (PyString_Check(name)) { - name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); - if (!name) - return -1; - } else if (!PyUnicode_Check(name)) -# else - if (!PyString_Check(name)) -# endif - { - PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); - return -1; - } else { - Py_INCREF(name); - } - - if (!tp->tp_dict) { - if (PyType_Ready(tp) != 0) - goto done; - } - - descr = _PyType_Lookup(tp, name); - f = NULL; - if (descr != NULL) - f = descr->ob_type->tp_descr_set; - if (!f) { - if (PyString_Check(name)) { - encoded_name = name; - Py_INCREF(name); - } else { - encoded_name = PyUnicode_AsUTF8String(name); - if (!encoded_name) - goto done; - } - PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); - Py_DECREF(encoded_name); - } else { - res = f(descr, obj, value); - } - - done: - Py_DECREF(name); - return res; -} -#endif - - -#ifdef __cplusplus -} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyruntime.swg b/linux/bin/swig/share/swig/4.1.0/python/pyruntime.swg deleted file mode 100755 index 1d028ada..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyruntime.swg +++ /dev/null @@ -1,49 +0,0 @@ -%insert(runtime) %{ -#if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND) -/* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */ -# include -#endif - -#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) -#define PY_SSIZE_T_CLEAN -#endif - -#if __GNUC__ >= 7 -#pragma GCC diagnostic push -#if defined(__cplusplus) && __cplusplus >=201703L -#pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */ -#endif -#endif - -#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) -/* Use debug wrappers with the Python release dll */ - -#if defined(_MSC_VER) && _MSC_VER >= 1929 -/* Workaround compilation errors when redefining _DEBUG in MSVC 2019 version 16.10 and later - * See https://github.com/swig/swig/issues/2090 */ -# include -#endif - -# undef _DEBUG -# include -# define _DEBUG 1 -#else -# include -#endif - -#if __GNUC__ >= 7 -#pragma GCC diagnostic pop -#endif -%} - -%insert(runtime) "swigrun.swg"; /* SWIG API */ -%insert(runtime) "swigerrors.swg"; /* SWIG errors */ -%insert(runtime) "pyhead.swg"; /* Python includes and fixes */ -%insert(runtime) "pyerrors.swg"; /* Python errors */ -%insert(runtime) "pythreads.swg"; /* Python thread code */ -%insert(runtime) "pyapi.swg"; /* Python API */ -%insert(runtime) "pyrun.swg"; /* Python run-time code */ - -#if defined(SWIGPYTHON_BUILTIN) -%insert(runtime) "builtin.swg"; /* Specialization for classes with single inheritance */ -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/python/pystdcommon.swg b/linux/bin/swig/share/swig/4.1.0/python/pystdcommon.swg deleted file mode 100755 index afa71350..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pystdcommon.swg +++ /dev/null @@ -1,265 +0,0 @@ -%fragment("StdTraits","header",fragment="StdTraitsCommon") -{ -namespace swig { - /* - Traits that provides the from method - */ - template struct traits_from_ptr { - static PyObject *from(Type *val, int owner = 0) { - return SWIG_InternalNewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static PyObject *from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static PyObject *from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static PyObject *from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline PyObject *from(const Type& val) { - return traits_from::from(val); - } - - template - inline PyObject *from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - /* - Traits that provides the asval/as/check method - */ - template - struct traits_asptr { - static int asptr(PyObject *obj, Type **val) { - int res = SWIG_ERROR; - swig_type_info *descriptor = type_info(); - if (val) { - Type *p = 0; - int newmem = 0; - res = descriptor ? SWIG_ConvertPtrAndOwn(obj, (void **)&p, descriptor, 0, &newmem) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (newmem & SWIG_CAST_NEW_MEMORY) { - res |= SWIG_NEWOBJMASK; - } - *val = p; - } - } else { - res = descriptor ? SWIG_ConvertPtr(obj, 0, descriptor, 0) : SWIG_ERROR; - } - return res; - } - }; - - template - inline int asptr(PyObject *obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(PyObject *obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(PyObject *obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(PyObject *obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(PyObject *obj) { - Type v; - int res = asval(obj, &v); - if (!obj || !SWIG_IsOK(res)) { - if (!PyErr_Occurred()) { - ::%type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(PyObject *obj) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - if (!PyErr_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(PyObject *obj) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res)) { - return v; - } else { - if (!PyErr_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(PyObject *obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(PyObject *obj) { - int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(PyObject *obj) { - int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(PyObject *obj) { - return traits_check::category>::check(obj); - } -} -} - -// -// Backward compatibility -// - -#ifdef SWIG_PYTHON_BACKWARD_COMP -%fragment(""); -%{ -PyObject* SwigInt_FromBool(bool b) { - return PyInt_FromLong(b ? 1L : 0L); -} -double SwigNumber_Check(PyObject* o) { - return PyFloat_Check(o) || PyInt_Check(o) || PyLong_Check(o); -} -double SwigNumber_AsDouble(PyObject* o) { - return PyFloat_Check(o) ? PyFloat_AsDouble(o) - : (PyInt_Check(o) ? double(PyInt_AsLong(o)) - : double(PyLong_AsLong(o))); -} -PyObject* SwigString_FromString(const std::string& s) { - return PyString_FromStringAndSize(s.data(),s.size()); -} -std::string SwigString_AsString(PyObject* o) { - return std::string(PyString_AsString(o)); -} -%} - -#endif - - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(PyObject *obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static PyObject *from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(PyObject *obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef - - -#define specialize_std_vector(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_list(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_deque(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_unordered_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_unordered_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) diff --git a/linux/bin/swig/share/swig/4.1.0/python/pystrings.swg b/linux/bin/swig/share/swig/4.1.0/python/pystrings.swg deleted file mode 100755 index 64ed685e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pystrings.swg +++ /dev/null @@ -1,139 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ -%#if PY_VERSION_HEX>=0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (PyBytes_Check(obj)) -%#else - if (PyUnicode_Check(obj)) -%#endif -%#else - if (PyString_Check(obj)) -%#endif - { - char *cstr; Py_ssize_t len; - int ret = SWIG_OK; -%#if PY_VERSION_HEX>=0x03000000 -%#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (!alloc && cptr) { - /* We can't allow converting without allocation, since the internal - representation of string in Python 3 is UCS-2/UCS-4 but we require - a UTF-8 representation. - TODO(bhy) More detailed explanation */ - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (!obj) - return SWIG_TypeError; - if (alloc) - *alloc = SWIG_NEWOBJ; -%#endif - if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) - return SWIG_TypeError; -%#else - if (PyString_AsStringAndSize(obj, &cstr, &len) == -1) - return SWIG_TypeError; -%#endif - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } else { -%#if PY_VERSION_HEX>=0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - *cptr = PyBytes_AsString(obj); -%#else - assert(0); /* Should never reach here with Unicode strings in Python 3 */ -%#endif -%#else - *cptr = SWIG_Python_str_AsChar(obj); - if (!*cptr) - ret = SWIG_TypeError; -%#endif - } - } - if (psize) *psize = len + 1; -%#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - Py_XDECREF(obj); -%#endif - return ret; - } else { -%#if defined(SWIG_PYTHON_2_UNICODE) -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) -%#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" -%#endif -%#if PY_VERSION_HEX<0x03000000 - if (PyUnicode_Check(obj)) { - char *cstr; Py_ssize_t len; - if (!alloc && cptr) { - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (!obj) - return SWIG_TypeError; - if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { - if (cptr) { - if (alloc) *alloc = SWIG_NEWOBJ; - *cptr = %new_copy_array(cstr, len + 1, char); - } - if (psize) *psize = len + 1; - - Py_XDECREF(obj); - return SWIG_OK; - } else { - Py_XDECREF(obj); - } - } -%#endif -%#endif - - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -%#if PY_VERSION_HEX >= 0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, %numeric_cast(size, Py_ssize_t)); -%#else - return PyUnicode_DecodeUTF8(carray, %numeric_cast(size, Py_ssize_t), "surrogateescape"); -%#endif -%#else - return PyString_FromStringAndSize(carray, %numeric_cast(size, Py_ssize_t)); -%#endif - } - } else { - return SWIG_Py_Void(); - } -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/python/python.swg b/linux/bin/swig/share/swig/4.1.0/python/python.swg deleted file mode 100755 index 769d9e10..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/python.swg +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------------------------ - * python.swg - * - * Python configuration module. - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Python keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Python autodoc support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Python classes, for C++ - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Python initialization function - * ------------------------------------------------------------ */ -%include - - -/* ------------------------------------------------------------ - * For backward compatibility - * ------------------------------------------------------------ */ -%include - - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pythonkw.swg b/linux/bin/swig/share/swig/4.1.0/python/pythonkw.swg deleted file mode 100755 index a2103452..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pythonkw.swg +++ /dev/null @@ -1,140 +0,0 @@ -/* - Warnings for Python keywords, built-in names and bad names. -*/ - -#define PYTHONKW(x) %keywordwarn("'" `x` "' is a python keyword", rename="_%s") `x` -#define PYTHONBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in python") `x` - - -/* - Warnings for Python keywords - https://docs.python.org/2/reference/lexical_analysis.html#keywords -*/ - -PYTHONKW(and); -PYTHONKW(as); -PYTHONKW(assert); -PYTHONKW(async); -PYTHONKW(await); -PYTHONKW(break); -PYTHONKW(class); -PYTHONKW(continue); -PYTHONKW(def); -PYTHONKW(del); -PYTHONKW(elif); -PYTHONKW(else); -PYTHONKW(except); -PYTHONKW(exec); -PYTHONKW(finally); -PYTHONKW(for); -PYTHONKW(from); -PYTHONKW(global); -PYTHONKW(if); -PYTHONKW(import); -PYTHONKW(in); -PYTHONKW(is); -PYTHONKW(lambda); -PYTHONKW(not); -PYTHONKW(or); -PYTHONKW(pass); -PYTHONKW(print); -PYTHONKW(raise); -PYTHONKW(return); -PYTHONKW(try); -PYTHONKW(while); -PYTHONKW(with); -PYTHONKW(yield); - -/* - built-in functions - https://docs.python.org/2/library/functions.html - */ - -PYTHONBN(abs); -PYTHONBN(apply); -PYTHONBN(bool); -PYTHONBN(buffer); -PYTHONBN(callable); -PYTHONBN(chr); -PYTHONBN(classmethod); -PYTHONBN(cmp); -PYTHONBN(coerce); -PYTHONBN(compile); -PYTHONBN(complex); -PYTHONBN(delattr); -PYTHONBN(dict); -PYTHONBN(dir); -PYTHONBN(divmod); -PYTHONBN(enumerate); -PYTHONBN(eval); -PYTHONBN(execfile); -PYTHONBN(file); -PYTHONBN(filter); -PYTHONBN(float); -PYTHONBN(frozenset); -PYTHONBN(getattr); -PYTHONBN(globals); -PYTHONBN(hasattr); -PYTHONBN(hash); -PYTHONBN(hex); -PYTHONBN(id); -PYTHONBN(input); -PYTHONBN(int); -PYTHONBN(intern); -PYTHONBN(isinstance); -PYTHONBN(issubclass); -PYTHONBN(iter); -PYTHONBN(len); -PYTHONBN(list); -PYTHONBN(locals); -PYTHONBN(long); -PYTHONBN(map); -PYTHONBN(max); -PYTHONBN(min); -PYTHONBN(object); -PYTHONBN(oct); -PYTHONBN(open); -PYTHONBN(ord); -PYTHONBN(pow); -PYTHONBN(property); -PYTHONBN(range); -PYTHONBN(raw_input); -PYTHONBN(reduce); -PYTHONBN(reload); -PYTHONBN(repr); -PYTHONBN(reversed); -PYTHONBN(round); -PYTHONBN(set); -PYTHONBN(setattr); -PYTHONBN(slice); -PYTHONBN(sorted); -PYTHONBN(staticmethod); -PYTHONBN(str); -PYTHONBN(sum); -PYTHONBN(super); -PYTHONBN(tuple); -PYTHONBN(type); -PYTHONBN(unichr); -PYTHONBN(unicode); -PYTHONBN(vars); -PYTHONBN(xrange); -PYTHONBN(zip); - - -/* - built-in names - boolean type and None -*/ -PYTHONBN(True); -PYTHONBN(False); - -PYTHONKW(None); - - -/* - 'self' is also a bad Name -*/ -PYTHONKW(self); - -#undef PYTHONBN -#undef PYTHONKW diff --git a/linux/bin/swig/share/swig/4.1.0/python/pythreads.swg b/linux/bin/swig/share/swig/4.1.0/python/pythreads.swg deleted file mode 100755 index 8d6c5ab4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pythreads.swg +++ /dev/null @@ -1,68 +0,0 @@ -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# define SWIG_PYTHON_USE_GIL -# endif -# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# if PY_VERSION_HEX < 0x03070000 -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() -# else -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/python/pytuplehlp.swg b/linux/bin/swig/share/swig/4.1.0/python/pytuplehlp.swg deleted file mode 100755 index 32e15803..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pytuplehlp.swg +++ /dev/null @@ -1,8 +0,0 @@ -/* - Helper function to return output types, now we need to use a list - instead of a tuple since all the other types - (std::pair,std::vector,std::list,etc) return tuples. -*/ - -#warning "Deprecated file: Don't use t_output_helper anymore," -#warning "use SWIG_Python_AppendOutput or %append_output instead." diff --git a/linux/bin/swig/share/swig/4.1.0/python/pytypemaps.swg b/linux/bin/swig/share/swig/4.1.0/python/pytypemaps.swg deleted file mode 100755 index 0ae25a68..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pytypemaps.swg +++ /dev/null @@ -1,105 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Python - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ -#ifdef SWIG_PYTHON_LEGACY_BOOL -// Default prior to SWIG 3.0.0 -#undef SWIG_TYPECHECK_BOOL -%define SWIG_TYPECHECK_BOOL 10000 %enddef -#endif - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Python fragments for fundamental types */ -%include - -/* Python fragments for char* strings */ -%include - -/* Backward compatibility output helper */ -%fragment("t_output_helper","header") %{ -#define t_output_helper SWIG_Python_AppendOutput -%} - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* directors are supported in Python */ -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Python types */ -#define SWIG_Object PyObject * -#define VOID_Object SWIG_Py_Void() - -/* Python allows implicit conversion */ -#define %implicitconv_flag $implicitconv - - -/* Overload of the output/constant/exception/dirout handling */ - -/* append output */ -#define SWIG_AppendOutput(result, obj) SWIG_Python_AppendOutput(result, obj) - -/* set constant */ -#if defined(SWIGPYTHON_BUILTIN) -#define SWIG_SetConstant(name, obj) SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, name,obj) -#else -#define SWIG_SetConstant(name, obj) SWIG_Python_SetConstant(d, name,obj) -#endif - -/* raise */ -#define SWIG_Raise(obj, type, desc) SWIG_Python_Raise(obj, type, desc) - -/* Include the unified typemap library */ -%include - - -/* ------------------------------------------------------------ - * Python extra typemaps / typemap overrides - * ------------------------------------------------------------ */ - -/* Get the address of the 'python self' object */ - -%typemap(in,numinputs=0,noblock=1) PyObject **PYTHON_SELF { - $1 = &$self; -} - - -/* Consttab, needed for callbacks, it should be removed later */ - -%typemap(consttab) SWIGTYPE ((*)(ANY)) -{ SWIG_PY_POINTER, "$symname", 0, 0, (void *)($value), &$descriptor } -%typemap(consttab) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY)); - -%typemap(constcode) SWIGTYPE ((*)(ANY)) "" -%typemap(constcode) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY)); - - -/* Smart Pointers */ -%typemap(out,noblock=1) const SWIGTYPE & SMARTPOINTER { - $result = SWIG_NewPointerObj(%new_copy(*$1, $*ltype), $descriptor, SWIG_POINTER_OWN | %newpointer_flags); -} - -%typemap(ret,noblock=1) const SWIGTYPE & SMARTPOINTER, SWIGTYPE SMARTPOINTER { - if ($result) { - PyObject *robj = PyObject_CallMethod($result, (char *)"__deref__", NULL); - if (robj && !PyErr_Occurred()) { - SwigPyObject_append((PyObject *) SWIG_Python_GetSwigThis($result), - (PyObject *) SWIG_Python_GetSwigThis(robj)); - Py_DECREF(robj); - } - } -} - diff --git a/linux/bin/swig/share/swig/4.1.0/python/pyuserdir.swg b/linux/bin/swig/share/swig/4.1.0/python/pyuserdir.swg deleted file mode 100755 index 31107607..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pyuserdir.swg +++ /dev/null @@ -1,242 +0,0 @@ -/* ------------------------------------------------------------------------- - * Special user directives - * ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ - -/* shadow code */ -#define %shadow %insert("shadow") -#define %pythoncode %insert("python") -#define %pythonbegin %insert("pythonbegin") - - -/* ------------------------------------------------------------------------- */ -/* -Use the "nondynamic" feature to make a wrapped class behave as a "nondynamic" -one, ie, a python class that doesn't dynamically add new attributes. - -For example, for the class - -%pythonnondynamic A; -struct A -{ - int a; - int b; -}; - -you will get: - - aa = A() - aa.a = 1 # Ok - aa.b = 1 # Ok - aa.c = 3 # error - -Since nondynamic is a feature, if you use it like - - %pythonnondynamic; - -it will make all the wrapped classes nondynamic ones. - -The implementation is based on this recipe: - - http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252158 - -*/ - -#define %pythonnondynamic %feature("python:nondynamic", "1") -#define %nopythonnondynamic %feature("python:nondynamic", "0") -#define %clearpythonnondynamic %feature("python:nondynamic", "") -#define %pythondynamic %nopythonnondynamic - - -/* ------------------------------------------------------------------------- */ -/* - -Use %pythonmaybecall to flag a method like __add__ or __radd__. These -don't produce an error when called, they just return NotImplemented. - -These methods "may be called" if needed. - -*/ - -#define %pythonmaybecall %feature("python:maybecall", "1") -#define %nopythonmaybecall %feature("python:maybecall", "0") -#define %clearpythonmaybecall %feature("python:maybecall", "") - -/* ------------------------------------------------------------------------- */ -/* - The %pythoncallback feature produce a more natural callback wrapper - than the %callback mechanism, ie, it uses the original name for - the callback and callable objects. - - Just use it as - - %pythoncallback(1) foo; - int foo(int a); - - %pythoncallback(1) A::foo; - struct A { - static int foo(int a); - }; - - int bar(int, int (*pf)(int)); - - then, you can use it as: - - a = foo(1) - b = bar(2, foo) - - c = A.foo(3) - d = bar(4, A.foo) - - - If you use it with a member method - %pythoncallback(1) A::foom; - struct A { - int foom(int a); - }; - - then you can use it as - - r = a.foom(3) # eval the method - mptr = A.foom_cb_ptr # returns the callback pointer - - where the '_cb_ptr' suffix is added for the callback pointer. - -*/ - -#define %pythoncallback %feature("python:callback") -#define %nopythoncallback %feature("python:callback","0") -#define %clearpythoncallback %feature("python:callback","") - -/* ------------------------------------------------------------------------- */ -/* - Support for the old %callback directive name -*/ -#ifdef %callback -#undef %callback -#endif - -#ifdef %nocallback -#undef %nocallback -#endif - -#ifdef %clearcallback -#undef %clearcallback -#endif - -#define %callback(x) %feature("python:callback",`x`) -#define %nocallback %nopythoncallback -#define %clearcallback %clearpythoncallback - -/* ------------------------------------------------------------------------- */ -/* - Thread support - Advance control - -*/ - -#define %nothread %feature("nothread") -#define %thread %feature("nothread","0") -#define %clearnothread %feature("nothread","") - -#define %nothreadblock %feature("nothreadblock") -#define %threadblock %feature("nothreadblock","0") -#define %clearnothreadblock %feature("nothreadblock","") - -#define %nothreadallow %feature("nothreadallow") -#define %threadallow %feature("nothreadallow","0") -#define %clearnothreadallow %feature("nothreadallow","") - - -/* ------------------------------------------------------------------------- */ -/* - Implicit Conversion using the C++ constructor mechanism -*/ - -#define %implicitconv %feature("implicitconv") -#define %noimplicitconv %feature("implicitconv", "0") -#define %clearimplicitconv %feature("implicitconv", "") - - -/* ------------------------------------------------------------------------- */ -/* - Enable keywords parameters -*/ - -#define %kwargs %feature("kwargs") -#define %nokwargs %feature("kwargs", "0") -#define %clearkwargs %feature("kwargs", "") - -/* ------------------------------------------------------------------------- */ -/* - Add python code to the proxy/shadow code - - %pythonprepend - Add code before the C++ function is called - %pythonappend - Add code after the C++ function is called -*/ - -#define %pythonprepend %feature("pythonprepend") -#define %clearpythonprepend %feature("pythonprepend","") - -#define %pythonappend %feature("pythonappend") -#define %clearpythonappend %feature("pythonappend","") - - -/* ------------------------------------------------------------------------- */ -/* - %extend_smart_pointer extend the smart pointer support. - - For example, if you have a smart pointer as: - - template class RCPtr { - public: - ... - RCPtr(Type *p); - Type * operator->() const; - ... - }; - - you use the %extend_smart_pointer directive as: - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - - then, if you have something like: - - RCPtr make_ptr(); - int foo(A *); - - you can do the following: - - a = make_ptr(); - b = foo(a); - - ie, swig will accept a RCPtr object where a 'A *' is - expected. - - Also, when using vectors - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - %template(vector_A) std::vector >; - - you can type - - a = A(); - v = vector_A(2) - v[0] = a - - ie, an 'A *' object is accepted, via implicit conversion, - where a RCPtr object is expected. Additionally - - x = v[0] - - returns (and sets 'x' as) a copy of v[0], making reference - counting possible and consistent. -*/ - -%define %extend_smart_pointer(Type...) -%implicitconv Type; -%apply const SWIGTYPE& SMARTPOINTER { const Type& }; -%apply SWIGTYPE SMARTPOINTER { Type }; -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/python/pywstrings.swg b/linux/bin/swig/share/swig/4.1.0/python/pywstrings.swg deleted file mode 100755 index 0e5a78df..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/pywstrings.swg +++ /dev/null @@ -1,85 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for wchar_t strings - * ------------------------------------------------------------ */ - -%{ -#if PY_VERSION_HEX >= 0x03020000 -# define SWIGPY_UNICODE_ARG(obj) ((PyObject*) (obj)) -#else -# define SWIGPY_UNICODE_ARG(obj) ((PyUnicodeObject*) (obj)) -#endif -%} - -%fragment("SWIG_AsWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor") { -SWIGINTERN int -SWIG_AsWCharPtrAndSize(PyObject *obj, wchar_t **cptr, size_t *psize, int *alloc) -{ - PyObject *tmp = 0; - int isunicode = PyUnicode_Check(obj); -%#if PY_VERSION_HEX < 0x03000000 && !defined(SWIG_PYTHON_STRICT_UNICODE_WCHAR) - if (!isunicode && PyString_Check(obj)) { - tmp = PyUnicode_FromObject(obj); - if (tmp) { - isunicode = 1; - obj = tmp; - } else { - PyErr_Clear(); - return SWIG_TypeError; - } - } -%#endif - if (isunicode) { -%#if PY_VERSION_HEX >= 0x03030000 - Py_ssize_t len = PyUnicode_GetLength(obj); -%#else - Py_ssize_t len = PyUnicode_GetSize(obj); -%#endif - if (cptr) { - Py_ssize_t length; - *cptr = %new_array(len + 1, wchar_t); - length = PyUnicode_AsWideChar(SWIGPY_UNICODE_ARG(obj), *cptr, len); - if (length == -1) { - PyErr_Clear(); - Py_XDECREF(tmp); - return SWIG_TypeError; - } - (*cptr)[length] = 0; - } - if (psize) *psize = (size_t) len + 1; - if (alloc) *alloc = cptr ? SWIG_NEWOBJ : 0; - Py_XDECREF(tmp); - return SWIG_OK; - } else { - swig_type_info* pwchar_descriptor = SWIG_pwchar_descriptor(); - if (pwchar_descriptor) { - void * vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pwchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (wchar_t *)vptr; - if (psize) *psize = vptr ? (wcslen((wchar_t *)vptr) + 1) : 0; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor") { -SWIGINTERNINLINE PyObject * -SWIG_FromWCharPtrAndSize(const wchar_t * carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pwchar_descriptor = SWIG_pwchar_descriptor(); - return pwchar_descriptor ? - SWIG_InternalNewPointerObj(%const_cast(carray,wchar_t *), pwchar_descriptor, 0) : SWIG_Py_Void(); - } else { - return PyUnicode_FromWideChar(carray, %numeric_cast(size, Py_ssize_t)); - } - } else { - return SWIG_Py_Void(); - } -} -} - - diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_alloc.i b/linux/bin/swig/share/swig/4.1.0/python/std_alloc.i deleted file mode 100755 index 35dc051b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_array.i b/linux/bin/swig/share/swig/4.1.0/python/std_array.i deleted file mode 100755 index a3de3125..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_array.i +++ /dev/null @@ -1,91 +0,0 @@ -/* - std::array -*/ - -%fragment("StdArrayTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::array **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::array& vec) { - return traits_from_stdseq >::from(vec); - } - }; - - template - inline void - assign(const SwigPySeq& swigpyseq, std::array* seq) { - if (swigpyseq.size() < seq->size()) - throw std::invalid_argument("std::array cannot be expanded in size"); - else if (swigpyseq.size() > seq->size()) - throw std::invalid_argument("std::array cannot be reduced in size"); - std::copy(swigpyseq.begin(), swigpyseq.end(), seq->begin()); - } - - template - inline void - erase(std::array* SWIGUNUSEDPARM(seq), const typename std::array::iterator& SWIGUNUSEDPARM(position)) { - throw std::invalid_argument("std::array object does not support item deletion"); - } - - // Only limited slicing is supported as std::array is fixed in size - template - inline std::array* - getslice(const std::array* self, Difference i, Difference j, Py_ssize_t step) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj); - - if (step == 1 && ii == 0 && static_cast(jj) == size) { - Sequence *sequence = new Sequence(); - std::copy(self->begin(), self->end(), sequence->begin()); - return sequence; - } else if (step == -1 && static_cast(ii) == (size - 1) && jj == -1) { - Sequence *sequence = new Sequence(); - std::copy(self->rbegin(), self->rend(), sequence->begin()); - return sequence; - } else { - throw std::invalid_argument("std::array object only supports getting a slice that is the size of the array"); - } - } - - template - inline void - setslice(std::array* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - - if (step == 1 && ii == 0 && static_cast(jj) == size) { - std::copy(is.begin(), is.end(), self->begin()); - } else if (step == -1 && static_cast(ii) == (size - 1) && jj == -1) { - std::copy(is.rbegin(), is.rend(), self->begin()); - } else { - throw std::invalid_argument("std::array object only supports setting a slice that is the size of the array"); - } - } - - template - inline void - delslice(std::array* SWIGUNUSEDPARM(self), Difference SWIGUNUSEDPARM(i), Difference SWIGUNUSEDPARM(j), Py_ssize_t SWIGUNUSEDPARM(step)) { - throw std::invalid_argument("std::array object does not support item deletion"); - } - } -%} - -#define %swig_array_methods(Type...) %swig_sequence_methods_non_resizable(Type) -#define %swig_array_methods_val(Type...) %swig_sequence_methods_non_resizable_val(Type); - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/python/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_basic_string.i b/linux/bin/swig/share/swig/4.1.0/python/std_basic_string.i deleted file mode 100755 index e3f524db..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_basic_string.i +++ /dev/null @@ -1,89 +0,0 @@ -#if !defined(SWIG_STD_STRING) -#define SWIG_STD_BASIC_STRING - -%include - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(PyObject* obj, std::string **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::string *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - PyErr_Clear(); - char* buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::string(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } else { - if (val) *val = 0; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromCharPtrAndSize") { -SWIGINTERNINLINE PyObject* - SWIG_From(std::basic_string)(const std::string& s) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } -} - -%include -%typemaps_asptrfromn(%checkcode(STRING), std::basic_string); - -#endif - - -#if !defined(SWIG_STD_WSTRING) - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsWCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(PyObject* obj, std::wstring **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::wstring *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - PyErr_Clear(); - wchar_t *buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsWCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::wstring(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } else { - if (val) *val = 0; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromWCharPtrAndSize") { -SWIGINTERNINLINE PyObject* - SWIG_From(std::basic_string)(const std::wstring& s) { - return SWIG_FromWCharPtrAndSize(s.data(), s.size()); - } -} - -%typemaps_asptrfromn(%checkcode(UNISTRING), std::basic_string); - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_carray.i b/linux/bin/swig/share/swig/4.1.0/python/std_carray.i deleted file mode 100755 index 680d6711..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_carray.i +++ /dev/null @@ -1,54 +0,0 @@ -%include - - -%fragment("StdCarrayTraits","header",fragment="StdSequenceTraits") -{ -namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::carray **array) { - return traits_asptr_stdseq >::asptr(obj, array); - } - }; -} -} - -%warnfilter(SWIGWARN_IGNORE_OPERATOR_INDEX) std::carray::operator[]; - -%extend std::carray { - %fragment(SWIG_Traits_frag(std::carray<_Type, _Size >), "header", - fragment="SwigPyIterator_T", - fragment=SWIG_Traits_frag(_Type), - fragment="StdCarrayTraits") { - namespace swig { - template <> struct traits > { - typedef pointer_category category; - static const char* type_name() { - return "std::carray<" #_Type "," #_Size " >"; - } - }; - } - } - - %typemaps_asptr(SWIG_TYPECHECK_VECTOR, swig::asptr, - SWIG_Traits_frag(std::carray<_Type, _Size >), - std::carray<_Type, _Size >); - - %typemap(out,noblock=1) iterator, const_iterator { - $result = SWIG_NewPointerObj(swig::make_output_iterator((const $type &)$1), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); - } - - inline size_t __len__() const { return self->size(); } - - inline const _Type& __getitem__(size_t i) const { return (*self)[i]; } - - inline void __setitem__(size_t i, const _Type& v) { (*self)[i] = v; } - - - swig::SwigPyIterator* __iter__(PyObject **PYTHON_SELF) { - return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } -} - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_char_traits.i b/linux/bin/swig/share/swig/4.1.0/python/std_char_traits.i deleted file mode 100755 index bf4e6c47..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_common.i b/linux/bin/swig/share/swig/4.1.0/python/std_common.i deleted file mode 100755 index 60576623..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_common.i +++ /dev/null @@ -1,74 +0,0 @@ -%include -%include - - -/* - Generate the traits for a 'primitive' type, such as 'double', - for which the SWIG_AsVal and SWIG_From methods are already defined. -*/ - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(PyObject *obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static PyObject *from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(PyObject *obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static PyObject *from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_complex.i b/linux/bin/swig/share/swig/4.1.0/python/std_complex.i deleted file mode 100755 index c9c46c4c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_complex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); - diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_container.i b/linux/bin/swig/share/swig/4.1.0/python/std_container.i deleted file mode 100755 index d24c1570..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_deque.i b/linux/bin/swig/share/swig/4.1.0/python/std_deque.i deleted file mode 100755 index d9a17470..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_deque.i +++ /dev/null @@ -1,27 +0,0 @@ -/* - Deques -*/ - -%fragment("StdDequeTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::deque **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::deque& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_except.i b/linux/bin/swig/share/swig/4.1.0/python/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_ios.i b/linux/bin/swig/share/swig/4.1.0/python/std_ios.i deleted file mode 100755 index aa6f0994..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_ios.i +++ /dev/null @@ -1,3 +0,0 @@ -%rename(ios_base_in) std::ios_base::in; - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_iostream.i b/linux/bin/swig/share/swig/4.1.0/python/std_iostream.i deleted file mode 100755 index 43d6b0c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_iostream.i +++ /dev/null @@ -1,8 +0,0 @@ -namespace std -{ -%callback(1) endl; -%callback(1) ends; -%callback(1) flush; -} - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_list.i b/linux/bin/swig/share/swig/4.1.0/python/std_list.i deleted file mode 100755 index 24d274b4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_list.i +++ /dev/null @@ -1,28 +0,0 @@ -/* - Lists -*/ - -%fragment("StdListTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::list& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_map.i b/linux/bin/swig/share/swig/4.1.0/python/std_map.i deleted file mode 100755 index e0b7d69d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_map.i +++ /dev/null @@ -1,310 +0,0 @@ -/* - Maps -*/ - -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") -{ - namespace swig { - template - struct from_key_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.first); - } - }; - - template - struct from_value_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.second); - } - }; - - template - struct SwigPyMapIterator_T : SwigPyIteratorClosed_T - { - SwigPyMapIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct SwigPyMapKeyIterator_T : SwigPyMapIterator_T - { - SwigPyMapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapIterator_T(curr, first, last, seq) - { - } - }; - - template - inline SwigPyIterator* - make_output_key_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapKeyIterator_T(current, begin, end, seq); - } - - template > - struct SwigPyMapValueIterator_T : SwigPyMapIterator_T - { - SwigPyMapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline SwigPyIterator* - make_output_value_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapValueIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::map map_type; - static int asptr(PyObject *obj, map_type **val) { - int res = SWIG_ERROR; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq >::asptr(items, val); - } else { - map_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } - }; - - template - struct traits_from > { - typedef std::map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static PyObject *asdict(const map_type& map) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - size_type size = map.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return obj; - } - - static PyObject *from(const map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - return asdict(map); - } - } - }; - } -} - -%define %swig_map_common(Map...) - %swig_sequence_iterator(Map); - %swig_container_methods(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_length", functype="lenfunc") __len__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "tp_iter", functype="getiterfunc") key_iterator; - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; - - %extend { - %newobject iterkeys(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iterkeys(PyObject **PYTHON_SELF) { - return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject itervalues(PyObject **PYTHON_SELF); - swig::SwigPyIterator* itervalues(PyObject **PYTHON_SELF) { - return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject iteritems(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iteritems(PyObject **PYTHON_SELF) { - return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -#else - %extend { - %pythoncode %{def __iter__(self): - return self.key_iterator()%} - %pythoncode %{def iterkeys(self): - return self.key_iterator()%} - %pythoncode %{def itervalues(self): - return self.value_iterator()%} - %pythoncode %{def iteritems(self): - return self.iterator()%} - } -#endif - - %extend { - mapped_type const & __getitem__(const key_type& key) throw (std::out_of_range) { - Map::const_iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - - void __delitem__(const key_type& key) throw (std::out_of_range) { - Map::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - - bool has_key(const key_type& key) const { - Map::const_iterator i = self->find(key); - return i != self->end(); - } - - PyObject* keys() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* keyList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(keyList, j, swig::from(i->first)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return keyList; - } - - PyObject* values() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* valList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(valList, j, swig::from(i->second)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return valList; - } - - PyObject* items() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* itemList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(itemList, j, swig::from(*i)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return itemList; - } - - bool __contains__(const key_type& key) { - return self->find(key) != self->end(); - } - - %newobject key_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* key_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject value_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* value_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -%enddef - -%define %swig_map_methods(Map...) - %swig_map_common(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - (*self)[key] = x; - } - - PyObject* asdict() { - return swig::traits_from< Map >::asdict(*self); - } - } - - -%enddef - - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_multimap.i b/linux/bin/swig/share/swig/4.1.0/python/std_multimap.i deleted file mode 100755 index bbffb6bc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_multimap.i +++ /dev/null @@ -1,93 +0,0 @@ -/* - Multimaps -*/ -%include - -%fragment("StdMultimapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::multimap *multimap) { - typedef typename std::multimap::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::multimap multimap_type; - static int asptr(PyObject *obj, std::multimap **val) { - int res = SWIG_ERROR; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - multimap_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::multimap multimap_type; - typedef typename multimap_type::const_iterator const_iterator; - typedef typename multimap_type::size_type size_type; - - static PyObject *from(const multimap_type& multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new multimap_type(multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = multimap.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_OverflowError, "multimap size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - return obj; - } - } - }; - } -} - -%define %swig_multimap_methods(Type...) - %swig_map_common(Type); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - self->insert(Type::value_type(key,x)); - } - } -%enddef - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_multiset.i b/linux/bin/swig/share/swig/4.1.0/python/std_multiset.i deleted file mode 100755 index ac430334..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_multiset.i +++ /dev/null @@ -1,41 +0,0 @@ -/* - Multisets -*/ - -%include - -%fragment("StdMultisetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::multiset* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_multiset_methods(Set...) %swig_set_methods(Set) - - - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_pair.i b/linux/bin/swig/share/swig/4.1.0/python/std_pair.i deleted file mode 100755 index cf463cb8..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_pair.i +++ /dev/null @@ -1,206 +0,0 @@ -/* - Pairs -*/ -%include - -//#define SWIG_STD_PAIR_ASVAL - -%fragment("StdPairTraits","header",fragment="StdTraits") { - namespace swig { -#ifdef SWIG_STD_PAIR_ASVAL - template - struct traits_asval > { - typedef std::pair value_type; - - static int get_pair(PyObject* first, PyObject* second, - std::pair *val) - { - if (val) { - T *pfirst = &(val->first); - int res1 = swig::asval((PyObject*)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = &(val->second); - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } else { - T *pfirst = 0; - int res1 = swig::asval((PyObject*)first, 0); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asval(PyObject *obj, std::pair *val) { - int res = SWIG_ERROR; - if (PyTuple_Check(obj)) { - if (PyTuple_GET_SIZE(obj) == 2) { - res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val); - } - } else if (PySequence_Check(obj)) { - if (PySequence_Size(obj) == 2) { - swig::SwigVar_PyObject first = PySequence_GetItem(obj,0); - swig::SwigVar_PyObject second = PySequence_GetItem(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = *p; - } - return res; - } - }; - -#else - template - struct traits_asptr > { - typedef std::pair value_type; - - static int get_pair(PyObject* first, PyObject* second, - std::pair **val) - { - if (val) { - value_type *vp = %new_instance(std::pair); - T *pfirst = &(vp->first); - int res1 = swig::asval((PyObject*)first, pfirst); - if (!SWIG_IsOK(res1)) { - %delete(vp); - return res1; - } - U *psecond = &(vp->second); - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) { - %delete(vp); - return res2; - } - *val = vp; - return SWIG_AddNewMask(res1 > res2 ? res1 : res2); - } else { - T *pfirst = 0; - int res1 = swig::asval((PyObject*)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asptr(PyObject *obj, std::pair **val) { - int res = SWIG_ERROR; - if (PyTuple_Check(obj)) { - if (PyTuple_GET_SIZE(obj) == 2) { - res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val); - } - } else if (PySequence_Check(obj)) { - if (PySequence_Size(obj) == 2) { - swig::SwigVar_PyObject first = PySequence_GetItem(obj,0); - swig::SwigVar_PyObject second = PySequence_GetItem(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - -#endif - template - struct traits_from > { - static PyObject *from(const std::pair& val) { - PyObject* obj = PyTuple_New(2); - PyTuple_SetItem(obj,0,swig::from(val.first)); - PyTuple_SetItem(obj,1,swig::from(val.second)); - return obj; - } - }; - } - -#if defined(SWIGPYTHON_BUILTIN) -SWIGINTERN Py_ssize_t -SwigPython_std_pair_len (PyObject *a) -{ - return 2; -} - -SWIGINTERN PyObject* -SwigPython_std_pair_repr (PyObject *o) -{ - PyObject *tuple = PyTuple_New(2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, PyObject_GetAttrString(o, (char*) "first")); - PyTuple_SET_ITEM(tuple, 1, PyObject_GetAttrString(o, (char*) "second")); - PyObject *result = PyObject_Repr(tuple); - Py_DECREF(tuple); - return result; -} - -SWIGINTERN PyObject* -SwigPython_std_pair_getitem (PyObject *a, Py_ssize_t b) -{ - PyObject *result = PyObject_GetAttrString(a, b % 2 ? (char*) "second" : (char*) "first"); - return result; -} - -SWIGINTERN int -SwigPython_std_pair_setitem (PyObject *a, Py_ssize_t b, PyObject *c) -{ - int result = PyObject_SetAttrString(a, b % 2 ? (char*) "second" : (char*) "first", c); - return result; -} -#endif - -} - -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; - -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; - -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; - -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; - -%define %swig_pair_methods(pair...) -#if !defined(SWIGPYTHON_BUILTIN) -%extend { -%pythoncode %{def __len__(self): - return 2 -def __repr__(self): - return str((self.first, self.second)) -def __getitem__(self, index): - if not (index % 2): - return self.first - else: - return self.second -def __setitem__(self, index, val): - if not (index % 2): - self.first = val - else: - self.second = val%} -} -#endif -%enddef - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_set.i b/linux/bin/swig/share/swig/4.1.0/python/std_set.i deleted file mode 100755 index 0ef01199..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_set.i +++ /dev/null @@ -1,67 +0,0 @@ -/* - Sets -*/ - -%fragment("StdSetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::set* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%define %swig_set_methods(set...) - %swig_sequence_iterator(set); - %swig_container_methods(set); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; -#endif - - %extend { - void append(value_type x) { - self->insert(x); - } - - bool __contains__(value_type x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void add(value_type x) { - self->insert(x); - } - - void discard(value_type x) { - self->erase(x); - } - } -%enddef - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/python/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_sstream.i b/linux/bin/swig/share/swig/4.1.0/python/std_sstream.i deleted file mode 100755 index 6647df8c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_sstream.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_streambuf.i b/linux/bin/swig/share/swig/4.1.0/python/std_streambuf.i deleted file mode 100755 index 44b9bb4d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_streambuf.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_string.i b/linux/bin/swig/share/swig/4.1.0/python/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/python/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_unordered_map.i b/linux/bin/swig/share/swig/4.1.0/python/std_unordered_map.i deleted file mode 100755 index 784be4c8..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_unordered_map.i +++ /dev/null @@ -1,296 +0,0 @@ -/* - Unordered Maps -*/ -%include - -%fragment("StdUnorderedMapForwardIteratorTraits","header") -{ - namespace swig { - template - struct SwigPyMapForwardIterator_T : SwigPyForwardIteratorClosed_T - { - SwigPyMapForwardIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyForwardIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct SwigPyMapKeyForwardIterator_T : SwigPyMapForwardIterator_T - { - SwigPyMapKeyForwardIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapForwardIterator_T(curr, first, last, seq) - { - } - }; - - template - inline SwigPyIterator* - make_output_key_forward_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapKeyForwardIterator_T(current, begin, end, seq); - } - - template > - struct SwigPyMapValueForwardIterator_T : SwigPyMapForwardIterator_T - { - SwigPyMapValueForwardIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapForwardIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline SwigPyIterator* - make_output_value_forward_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapValueForwardIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_map *unordered_map) { - typedef typename std::unordered_map::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - unordered_map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_map &seq, typename std::unordered_map::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - typedef std::unordered_map unordered_map_type; - static int asptr(PyObject *obj, unordered_map_type **val) { - int res = SWIG_ERROR; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - unordered_map_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_map unordered_map_type; - typedef typename unordered_map_type::const_iterator const_iterator; - typedef typename unordered_map_type::size_type size_type; - - static PyObject *asdict(const unordered_map_type& map) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - size_type size = map.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return obj; - } - - static PyObject *from(const unordered_map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new unordered_map_type(map), desc, SWIG_POINTER_OWN); - } else { - return asdict(map); - } - } - }; - } -} - -%define %swig_unordered_map_common(Map...) - %swig_sequence_forward_iterator(Map); - %swig_container_methods(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_length", functype="lenfunc") __len__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "tp_iter", functype="getiterfunc") key_iterator; - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; - - %extend { - %newobject iterkeys(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iterkeys(PyObject **PYTHON_SELF) { - return swig::make_output_key_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject itervalues(PyObject **PYTHON_SELF); - swig::SwigPyIterator* itervalues(PyObject **PYTHON_SELF) { - return swig::make_output_value_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject iteritems(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iteritems(PyObject **PYTHON_SELF) { - return swig::make_output_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -#else - %extend { - %pythoncode %{def __iter__(self): - return self.key_iterator()%} - %pythoncode %{def iterkeys(self): - return self.key_iterator()%} - %pythoncode %{def itervalues(self): - return self.value_iterator()%} - %pythoncode %{def iteritems(self): - return self.iterator()%} - } -#endif - - %extend { - mapped_type const & __getitem__(const key_type& key) throw (std::out_of_range) { - Map::const_iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - - void __delitem__(const key_type& key) throw (std::out_of_range) { - Map::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - - bool has_key(const key_type& key) const { - Map::const_iterator i = self->find(key); - return i != self->end(); - } - - PyObject* keys() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "unordered_map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* keyList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(keyList, j, swig::from(i->first)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return keyList; - } - - PyObject* values() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "unordered_map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* valList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(valList, j, swig::from(i->second)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return valList; - } - - PyObject* items() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "unordered_map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* itemList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(itemList, j, swig::from(*i)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return itemList; - } - - bool __contains__(const key_type& key) { - return self->find(key) != self->end(); - } - - %newobject key_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* key_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_key_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject value_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* value_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_value_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -%enddef - -%define %swig_unordered_map_methods(Map...) - %swig_unordered_map_common(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - (*self)[key] = x; - } - - PyObject* asdict() { - return swig::traits_from< Map >::asdict(*self); - } - } - - -%enddef - - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_unordered_multimap.i b/linux/bin/swig/share/swig/4.1.0/python/std_unordered_multimap.i deleted file mode 100755 index bc095ea4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_unordered_multimap.i +++ /dev/null @@ -1,100 +0,0 @@ -/* - Unordered Multimaps -*/ -%include - -%fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multimap *unordered_multimap) { - typedef typename std::unordered_multimap::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - unordered_multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_multimap &seq, typename std::unordered_multimap::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - typedef std::unordered_multimap unordered_multimap_type; - static int asptr(PyObject *obj, std::unordered_multimap **val) { - int res = SWIG_ERROR; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - unordered_multimap_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_multimap unordered_multimap_type; - typedef typename unordered_multimap_type::const_iterator const_iterator; - typedef typename unordered_multimap_type::size_type size_type; - - static PyObject *from(const unordered_multimap_type& unordered_multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new unordered_multimap_type(unordered_multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = unordered_multimap.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_OverflowError, "unordered_multimap size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= unordered_multimap.begin(); i!= unordered_multimap.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - return obj; - } - } - }; - } -} - -%define %swig_unordered_multimap_methods(Type...) - %swig_unordered_map_common(Type); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - self->insert(Type::value_type(key,x)); - } - } -%enddef - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_unordered_multiset.i b/linux/bin/swig/share/swig/4.1.0/python/std_unordered_multiset.i deleted file mode 100755 index b0f3f096..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_unordered_multiset.i +++ /dev/null @@ -1,48 +0,0 @@ -/* - Unordered Multisets -*/ - -%include - -%fragment("StdUnorderedMultisetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multiset* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_multiset &seq, typename std::unordered_multiset::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::unordered_multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::unordered_multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_unordered_multiset_methods(Set...) %swig_unordered_set_methods(Set) - - - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_unordered_set.i b/linux/bin/swig/share/swig/4.1.0/python/std_unordered_set.i deleted file mode 100755 index 79fca6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_unordered_set.i +++ /dev/null @@ -1,67 +0,0 @@ -/* - Unordered Sets -*/ - -%fragment("StdUnorderedSetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_set* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_set &seq, typename std::unordered_set::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::unordered_set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::unordered_set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%define %swig_unordered_set_methods(unordered_set...) - %swig_sequence_forward_iterator(unordered_set); - %swig_container_methods(unordered_set); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; -#endif - - - %extend { - void append(value_type x) { - self->insert(x); - } - - bool __contains__(value_type x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - } -%enddef - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_vector.i b/linux/bin/swig/share/swig/4.1.0/python/std_vector.i deleted file mode 100755 index 2ac41a54..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_vector.i +++ /dev/null @@ -1,34 +0,0 @@ -/* - Vectors -*/ - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_reserve > { - static void reserve(std::vector &seq, typename std::vector::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_vectora.i b/linux/bin/swig/share/swig/4.1.0/python/std_vectora.i deleted file mode 100755 index 3f084bd7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_vectora.i +++ /dev/null @@ -1,31 +0,0 @@ -/* - Vectors + allocators -*/ - -%fragment("StdVectorATraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - typedef std::vector vector_type; - typedef T value_type; - static int asptr(PyObject *obj, vector_type **vec) { - return traits_asptr_stdseq::asptr(obj, vec); - } - }; - - template - struct traits_from > { - typedef std::vector vector_type; - static PyObject *from(const vector_type& vec) { - return traits_from_stdseq::from(vec); - } - }; - } -%} - - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_wios.i b/linux/bin/swig/share/swig/4.1.0/python/std_wios.i deleted file mode 100755 index 930a57dd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_wios.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_wiostream.i b/linux/bin/swig/share/swig/4.1.0/python/std_wiostream.i deleted file mode 100755 index d3a5ee78..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_wiostream.i +++ /dev/null @@ -1,10 +0,0 @@ -namespace std -{ -%callback(1) wendl; -%callback(1) wends; -%callback(1) wflush; -} - -%include -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_wsstream.i b/linux/bin/swig/share/swig/4.1.0/python/std_wsstream.i deleted file mode 100755 index 8843f56d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_wsstream.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_wstreambuf.i b/linux/bin/swig/share/swig/4.1.0/python/std_wstreambuf.i deleted file mode 100755 index c0f09201..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_wstreambuf.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/std_wstring.i b/linux/bin/swig/share/swig/4.1.0/python/std_wstring.i deleted file mode 100755 index ef862813..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/std_wstring.i +++ /dev/null @@ -1,3 +0,0 @@ -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/python/stl.i b/linux/bin/swig/share/swig/4.1.0/python/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/python/swigmove.i b/linux/bin/swig/share/swig/4.1.0/python/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/typemaps.i b/linux/bin/swig/share/swig/4.1.0/python/typemaps.i deleted file mode 100755 index dba63dd5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/typemaps.i +++ /dev/null @@ -1,148 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Python tuple. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Python output of the function would be a tuple containing both -output values. - -*/ - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Python tuple. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Python). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Python variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/python/wchar.i b/linux/bin/swig/share/swig/4.1.0/python/wchar.i deleted file mode 100755 index 308139a3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/python/wchar.i +++ /dev/null @@ -1,21 +0,0 @@ -#ifdef __cplusplus - -%{ -#include -%} - -#else - -%{ -#include -%} - -#endif - -%types(wchar_t *); -%include - -/* - Enable swig wchar support. -*/ -#define SWIG_WCHAR diff --git a/linux/bin/swig/share/swig/4.1.0/r/boost_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/r/boost_shared_ptr.i deleted file mode 100755 index 13f041fb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/boost_shared_ptr.i +++ /dev/null @@ -1,420 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - -%typemap(rtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "$typemap(rtype, TYPE)" - -%typemap(scoercein) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - %{ if (inherits($input, "ExternalReference")) $input = slot($input,"ref"); %} - -%typemap(scoerceout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - %{ $result <- if (is.null($result)) $result - else new("$typemap(rtype, TYPE)", ref=$result); %} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/r/cdata.i b/linux/bin/swig/share/swig/4.1.0/r/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/r/exception.i b/linux/bin/swig/share/swig/4.1.0/r/exception.i deleted file mode 100755 index 39cb0959..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/exception.i +++ /dev/null @@ -1,8 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), -%block(switch (code) {case SWIG_IndexError: return Rf_ScalarLogical(NA_LOGICAL); default: %error(code, msg); SWIG_fail;} )) -} - diff --git a/linux/bin/swig/share/swig/4.1.0/r/r.swg b/linux/bin/swig/share/swig/4.1.0/r/r.swg deleted file mode 100755 index c1ce37c3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/r.swg +++ /dev/null @@ -1,281 +0,0 @@ -/* */ - - -%insert("header") "swiglabels.swg" - -%insert("init") "swiginit.swg" -%insert("runtime") "swigrun.swg" -%insert("runtime") "swigerrors.swg" -%insert("runtime") "rrun.swg" - -%init %{ -SWIGEXPORT void SWIG_init(void) { -%} - -%include - -#define %Rruntime %insert("s") - -#define SWIG_Object SEXP -#define VOID_Object R_NilValue - -#define %append_output(obj) SET_VECTOR_ELT($result, $n, obj) - -%define %set_constant(name, obj) %begin_block - SEXP _obj = obj; - assign(name, _obj); -%end_block %enddef - -%runtime %{ -SWIGINTERN void SWIG_R_Raise(SEXP obj, const char *msg) { - Rf_error(Rf_isString(obj) ? CHAR(Rf_asChar(obj)) : msg); -} -%} - -#define %raise(OBJ, TYPE, DESC) SWIG_R_Raise(OBJ, "C/C++ exception of type " TYPE); return R_NilValue - -%insert("sinit") "srun.swg" - -%insert("sinitroutine") %{ -SWIG_init(); -SWIG_InitializeModule(0); -%} - -%include -%typemap(in) (double *x, int len) %{ - $1 = REAL(x); - $2 = Rf_length(x); -%} - -/* XXX - Need to worry about inheritance, e.g. if B extends A - and we are looking for an A[], then B elements are okay. -*/ -%typemap(scheck) SWIGTYPE[ANY] - %{ -# assert(length($input) > $1_dim0) - assert(all(sapply($input, class) == "$R_class")); - %} - -%typemap(out) void "" - -%typemap(in) int *, int[ANY], - signed int *, signed int[ANY], - unsigned int *, unsigned int[ANY], - short *, short[ANY], - signed short *, signed short[ANY], - unsigned short *, unsigned short[ANY], - long *, long[ANY], - signed long *, signed long[ANY], - unsigned long *, unsigned long[ANY], - long long *, long long[ANY], - signed long long *, signed long long[ANY], - unsigned long long *, unsigned long long[ANY] - -{ -{ int _rswigi; - int _rswiglen = LENGTH($input); - $1 = %static_cast(calloc(sizeof($1_basetype), _rswiglen), $1_ltype); - for (_rswigi=0; _rswigi< _rswiglen; _rswigi++) { - $1[_rswigi] = INTEGER($input)[_rswigi]; - } -} -} - -%typemap(in) float *, float[ANY], - double *, double[ANY] - -{ -{ int _rswigi; - int _rswiglen = LENGTH($input); - $1 = %static_cast(calloc(sizeof($1_basetype), _rswiglen), $1_ltype); - for (_rswigi=0; _rswigi<_rswiglen; _rswigi++) { - $1[_rswigi] = REAL($input)[_rswigi]; - } -} -} - -%typemap(freearg,noblock=1) int *, int[ANY], - signed int *, signed int[ANY], - unsigned int *, unsigned int[ANY], - short *, short[ANY], - signed short *, signed short[ANY], - unsigned short *, unsigned short[ANY], - long *, long[ANY], - signed long *, signed long[ANY], - unsigned long *, unsigned long[ANY], - long long *, long long[ANY], - signed long long *, signed long long[ANY], - unsigned long long *, unsigned long long[ANY], - float *, float[ANY], - double *, double[ANY] -%{ - free($1); -%} - -%typemap(freearg, noblock=1) int *OUTPUT, -signed int *OUTPUT, -unsigned int *OUTPUT, -short *OUTPUT, -signed short *OUTPUT, -unsigned short *OUTPUT, -long *OUTPUT, -signed long *OUTPUT, -unsigned long *OUTPUT, -long long *OUTPUT, -signed long long *OUTPUT, -unsigned long long *OUTPUT, -float *OUTPUT, -double *OUTPUT, -char *OUTPUT, -signed char *OUTPUT, -unsigned char *OUTPUT -{} - - - -/* Should we recycle to make the length correct. - And warn if length() > the dimension. -*/ -%typemap(scheck) SWIGTYPE [ANY] %{ -# assert(length($input) >= $1_dim0) -%} - -/* Handling vector case to avoid warnings, - although we just use the first one. */ -%typemap(scheck) unsigned int %{ - assert(length($input) == 1 && $input >= 0, "All values must be non-negative"); -%} - - -%typemap(scheck) int, long %{ - if(length($input) > 1) { - warning("using only the first element of $input"); - }; -%} - -%include -%include -%include -%include -%include - -%typemap(in,noblock=1) enum SWIGTYPE[ANY] { - $1 = %reinterpret_cast(INTEGER($input), $1_ltype); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char * { - $1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype); -} - -%typemap(freearg,noblock=1) char * { - free($1); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char *[ANY] { - $1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype); -} - -%typemap(freearg,noblock=1) char *[ANY] { - free($1); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char[ANY] { - $1 = SWIG_strdup(CHAR(STRING_ELT($input, 0))); -} - -%typemap(freearg,noblock=1) char[ANY] { - free($1); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char[] { - $1 = SWIG_strdup(CHAR(STRING_ELT($input, 0))); -} - -%typemap(freearg,noblock=1) char[] { - free($1); -} - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)INTEGER($input)[0]; - $1 = &temp; %} - -%typemap(out) const enum SWIGTYPE & %{ $result = Rf_ScalarInteger((int)*$1); %} - -%typemap(memberin) char[] %{ -if ($input) strcpy($1, $input); -else -strcpy($1, ""); -%} - -%typemap(globalin) char[] %{ -if ($input) strcpy($1, $input); -else -strcpy($1, ""); -%} - -%typemap(out,noblock=1) char * - { $result = $1 ? Rf_mkString(%reinterpret_cast($1,char *)) : R_NilValue; } - -%typemap(in,noblock=1) char { -$1 = %static_cast(CHAR(STRING_ELT($input, 0))[0],$1_ltype); -} - -%typemap(out) char - { - char tmp[2] = "x"; - tmp[0] = $1; - $result = Rf_mkString(tmp); - } - - -%typemap(in,noblock=1) int, long -{ - $1 = %static_cast(INTEGER($input)[0], $1_ltype); -} - -%typemap(out,noblock=1) int, long - "$result = Rf_ScalarInteger($1);"; - - -%typemap(in,noblock=1) bool - "$1 = LOGICAL($input)[0] ? true : false;"; - - -%typemap(out,noblock=1) bool - "$result = Rf_ScalarLogical($1);"; - -%typemap(in,noblock=1) - float, - double -{ - $1 = %static_cast(REAL($input)[0], $1_ltype); -} - -/* Why is this here ? */ -/* %typemap(out,noblock=1) unsigned int * - "$result = ScalarReal(*($1));"; */ - -%Rruntime %{ -setMethod('[', "ExternalReference", -function(x,i,j, ..., drop=TRUE) -if (!is.null(x$"__getitem__")) -sapply(i, function(n) x$"__getitem__"(i=as.integer(n-1)))) - -setMethod('[<-' , "ExternalReference", -function(x,i,j, ..., value) -if (!is.null(x$"__setitem__")) { -sapply(1:length(i), function(n) -x$"__setitem__"(i=as.integer(i[n]-1), x=value[n])) -x -}) - -setAs('ExternalReference', 'character', -function(from) {if (!is.null(from$"__str__")) from$"__str__"()}) - -suppressMessages(suppressWarnings(setMethod('print', 'ExternalReference', -function(x) {print(as(x, "character"))}))) -%} - - - diff --git a/linux/bin/swig/share/swig/4.1.0/r/rcontainer.swg b/linux/bin/swig/share/swig/4.1.0/r/rcontainer.swg deleted file mode 100755 index 54b31b39..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/rcontainer.swg +++ /dev/null @@ -1,198 +0,0 @@ - -// -// Common fragments -// - - -/**** The python container methods ****/ - - - -%fragment("StdSequenceTraits","header",fragment="") -{ -%#include -namespace swig { - inline size_t - check_index(ptrdiff_t i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - - throw std::out_of_range("index out of range"); - } - - inline size_t - slice_index(ptrdiff_t i, size_t size) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) { - return (size_t) (i + size); - } else { - throw std::out_of_range("index out of range"); - } - } else { - return ( (size_t) i < size ) ? ((size_t) i) : size; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (jj > ii) { - typename Sequence::const_iterator vb = self->begin(); - typename Sequence::const_iterator ve = self->begin(); - std::advance(vb,ii); - std::advance(ve,jj); - return new Sequence(vb, ve); - } else { - return new Sequence(); - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj < ii) jj = ii; - size_t ssize = jj - ii; - if (ssize <= v.size()) { - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); - std::advance(sb,ii); - std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); - } else { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj > ii) { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - } - } -} -} - -%define %swig_container_methods(Container...) - - %newobject __getslice__; - - %extend { - bool __nonzero__() const { - return !(self->empty()); - } - - size_type __len__() const { - return self->size(); - } - } -%enddef - -%define %swig_sequence_methods_common(Sequence...) -// %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - - %fragment("StdSequenceTraits"); - - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range) { - return swig::getslice(self, i, j); - } - - void __setslice__(difference_type i, difference_type j, const Sequence& v) - throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, v); - } - - void __delslice__(difference_type i, difference_type j) throw (std::out_of_range) { - swig::delslice(self, i, j); - } - - void __delitem__(difference_type i) throw (std::out_of_range) { - self->erase(swig::getpos(self,i)); - } - } -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - const value_type& __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, const value_type& x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - - void append(const value_type& x) { - self->push_back(x); - } - } -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - value_type __getitem__(difference_type i) throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, value_type x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - - void append(value_type x) { - self->push_back(x); - } - } -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/r/rfragments.swg b/linux/bin/swig/share/swig/4.1.0/r/rfragments.swg deleted file mode 100755 index c3b40a90..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/rfragments.swg +++ /dev/null @@ -1,191 +0,0 @@ -/* for raw pointers */ -#define SWIG_ConvertPtr(oc, ptr, ty, flags) SWIG_R_ConvertPtr(oc, ptr, ty, flags) -#define SWIG_ConvertFunctionPtr(oc, ptr, ty) SWIG_R_ConvertPtr(oc, ptr, ty, 0) -#define SWIG_NewPointerObj(ptr, ty, flags) SWIG_R_NewPointerObj(ptr, ty, flags) -#define SWIG_NewFunctionPtrObj(ptr, ty) SWIG_R_NewPointerObj(ptr, ty, 0) - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_R_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, ty) SWIG_R_NewPackedObj(ptr, sz, ty) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, ty, flags) SWIG_ConvertPtr(obj, pptr, ty, flags) -#define SWIG_NewInstanceObj(ptr, ty, flags) SWIG_NewPointerObj(ptr, ty, flags) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_R_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, ty) SWIG_R_NewPackedObj(ptr, sz, ty) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_R_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_R_SetModule(pointer) - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE SEXP -SWIG_From_dec(long)(long value) -{ - return Rf_ScalarInteger((int)value); -} -} - -%fragment(SWIG_AsVal_frag(long),"header") { -SWIGINTERNINLINE int -SWIG_AsVal_dec(long)(SEXP obj, long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -} - - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SEXP -SWIG_From_dec(long long)(long long value) -{ - return Rf_ScalarInteger((int)value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE int -SWIG_AsVal_dec(long long)(SEXP obj, long long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -%#endif -} - -%fragment(SWIG_From_frag(unsigned long),"header") { -SWIGINTERNINLINE SEXP -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return Rf_ScalarInteger((int)value); -} -} - - -%fragment(SWIG_AsVal_frag(unsigned long),"header") { -SWIGINTERNINLINE int -SWIG_AsVal_dec(unsigned long)(SEXP obj, unsigned long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -} - - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SEXP -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return Rf_ScalarInteger((int)value); -} -%#endif -} - - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE int -SWIG_AsVal_dec(unsigned long long)(SEXP obj, unsigned long long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -%#endif -} - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERNINLINE SEXP -SWIG_From_dec(double)(double value) -{ - return Rf_ScalarReal(value); -} -} - - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERNINLINE int -SWIG_AsVal_dec(double)(SEXP obj, double *val) -{ - if (val) *val = Rf_asReal(obj); - return SWIG_OK; -} -} - -%fragment("SWIG_AsCharPtrAndSize", "header") -{ -SWIGINTERN int -SWIG_AsCharPtrAndSize(SEXP obj, char** cptr, size_t* psize, int *alloc) -{ - if (cptr && Rf_isString(obj)) { - char *cstr = %const_cast(CHAR(STRING_ELT(obj, 0)), char *); - int len = strlen(cstr); - - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - } - } else { - *cptr = %reinterpret_cast(malloc(len + 1), char *); - *cptr = strcpy(*cptr, cstr); - } - if (psize) *psize = len + 1; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_strdup","header") -{ -SWIGINTERN char * -SWIG_strdup(const char *str) -{ - char *newstr = %reinterpret_cast(malloc(strlen(str) + 1), char *); - return strcpy(newstr, str); -} -} - -//# This is modified from the R header files - -%fragment("SWIG_FromCharPtrAndSize","header") -{ -SWIGINTERN SEXP -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - SEXP t, c; - if (!carray) return R_NilValue; -/* See R internals document 1.10. - MkCharLen was introduced in 2.7.0. Use that instead of hand - creating vector. - - Starting in 2.8.0 creating strings via vectors was deprecated in - order to allow for use of CHARSXP caches. */ - - Rf_protect(t = Rf_allocVector(STRSXP, 1)); -%#if R_VERSION >= R_Version(2,7,0) - c = Rf_mkCharLen(carray, size); -%#else - c = Rf_allocVector(CHARSXP, size); - strncpy((char *)CHAR(c), carray, size); -%#endif - SET_STRING_ELT(t, 0, c); - Rf_unprotect(1); - return t; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/r/rkw.swg b/linux/bin/swig/share/swig/4.1.0/r/rkw.swg deleted file mode 100755 index c4af7084..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/rkw.swg +++ /dev/null @@ -1,36 +0,0 @@ -/* - Warnings for R keywords, built-in names and bad names. -*/ - -#define RKW(x) %keywordwarn("'" `x` "' is a R keyword", rename="_%s") `x` -#define RSWIGKW(x) %keywordwarn("'" `x` "' is a SWIG R reserved parameter name", rename="_%s") `x` - -/* - Warnings for R reserved words taken from - http://cran.r-project.org/doc/manuals/R-lang.html#Reserved-words -*/ - -RKW(if); -RKW(else); -RKW(repeat); -RKW(while); -RKW(function); -RKW(for); -RKW(in); -RKW(next); -RKW(break); -RKW(TRUE); -RKW(FALSE); -RKW(NULL); -RKW(Inf); -RKW(NaN); -RKW(NA); -RKW(NA_integer_); -RKW(NA_real_); -RKW(NA_complex_); -RKW(NA_character_); - -RSWIGKW(self); - -#undef RKW -#undef RSWIGKW diff --git a/linux/bin/swig/share/swig/4.1.0/r/ropers.swg b/linux/bin/swig/share/swig/4.1.0/r/ropers.swg deleted file mode 100755 index acb99798..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/ropers.swg +++ /dev/null @@ -1,32 +0,0 @@ -#ifdef __cplusplus - -%rename(Equal) operator =; -%rename(PlusEqual) operator +=; -%rename(MinusEqual) operator -=; -%rename(MultiplyEqual) operator *=; -%rename(DivideEqual) operator /=; -%rename(PercentEqual) operator %=; -%rename(Plus) operator +; -%rename(Minus) operator -; -%rename(Multiply) operator *; -%rename(Divide) operator /; -%rename(Percent) operator %; -%rename(Not) operator !; -%rename(IndexIntoConst) operator[](unsigned idx) const; -%rename(IndexInto) operator[](unsigned idx); -%rename(Functor) operator (); -%rename(EqualEqual) operator ==; -%rename(NotEqual) operator !=; -%rename(LessThan) operator <; -%rename(LessThanEqual) operator <=; -%rename(GreaterThan) operator >; -%rename(GreaterThanEqual) operator >=; -%rename(And) operator &&; -%rename(Or) operator ||; -%rename(PlusPlusPrefix) operator++(); -%rename(PlusPlusPostfix) operator++(int); -%rename(MinusMinusPrefix) operator--(); -%rename(MinusMinusPostfix) operator--(int); - - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/r/rrun.swg b/linux/bin/swig/share/swig/4.1.0/r/rrun.swg deleted file mode 100755 index 79844612..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/rrun.swg +++ /dev/null @@ -1,420 +0,0 @@ -/* Remove global namespace pollution */ -#if !defined(SWIG_NO_R_NO_REMAP) -# define R_NO_REMAP -#endif -#if !defined(SWIG_NO_STRICT_R_HEADERS) -# define STRICT_R_HEADERS -#endif - -#include -#include - -#ifdef __cplusplus -#include -extern "C" { -#endif - -/* for raw pointer */ -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_R_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_R_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_R_NewPointerObj(ptr, type, flags) - -#include -#include -#include -#include - -#if R_VERSION >= R_Version(2,6,0) -#define VMAXTYPE void * -#else -#define VMAXTYPE char * -#endif - -/* Last error */ -static int SWIG_lasterror_code = 0; -static char SWIG_lasterror_msg[1024]; -SWIGRUNTIME void SWIG_Error(int code, const char *format, ...) { - va_list arg; - SWIG_lasterror_code = code; - va_start(arg, format); - vsnprintf(SWIG_lasterror_msg, sizeof(SWIG_lasterror_msg), format, arg); - va_end(arg); -} - -SWIGRUNTIME const char *SWIG_ErrorType(int code) { - switch (code) { - case SWIG_MemoryError: - return "SWIG:MemoryError"; - case SWIG_IOError: - return "SWIG:IOError"; - case SWIG_RuntimeError: - return "SWIG:RuntimeError"; - case SWIG_IndexError: - return "SWIG:IndexError"; - case SWIG_TypeError: - return "SWIG:TypeError"; - case SWIG_DivisionByZero: - return "SWIG:DivisionByZero"; - case SWIG_OverflowError: - return "SWIG:OverflowError"; - case SWIG_SyntaxError: - return "SWIG:SyntaxError"; - case SWIG_ValueError: - return "SWIG:ValueError"; - case SWIG_SystemError: - return "SWIG:SystemError"; - case SWIG_AttributeError: - return "SWIG:AttributeError"; - } - return "SWIG:UnknownError"; -} - -#define SWIG_fail goto fail - -/* - This is mainly a way to avoid having lots of local variables that may - conflict with those in the routine. - - Change name to R_SWIG_Callb.... -*/ -typedef struct RCallbackFunctionData { - - SEXP fun; - SEXP userData; - - - SEXP expr; - SEXP retValue; - int errorOccurred; - - SEXP el; /* Temporary pointer used in the construction of the expression to call the R function. */ - - struct RCallbackFunctionData *previous; /* Stack */ - -} RCallbackFunctionData; - -static RCallbackFunctionData *callbackFunctionDataStack; - - -SWIGRUNTIME SEXP -R_SWIG_debug_getCallbackFunctionData() -{ - int n, i; - SEXP ans; - RCallbackFunctionData *p = callbackFunctionDataStack; - - n = 0; - while(p) { - n++; - p = p->previous; - } - - Rf_protect(ans = Rf_allocVector(VECSXP, n)); - for(p = callbackFunctionDataStack, i = 0; i < n; p = p->previous, i++) - SET_VECTOR_ELT(ans, i, p->fun); - - Rf_unprotect(1); - - return(ans); -} - - - -SWIGRUNTIME RCallbackFunctionData * -R_SWIG_pushCallbackFunctionData(SEXP fun, SEXP userData) -{ - RCallbackFunctionData *el; - el = (RCallbackFunctionData *) calloc(1, sizeof(RCallbackFunctionData)); - el->fun = fun; - el->userData = userData; - el->previous = callbackFunctionDataStack; - - callbackFunctionDataStack = el; - - return(el); -} - - -SWIGRUNTIME SEXP -R_SWIG_R_pushCallbackFunctionData(SEXP fun, SEXP userData) -{ - R_SWIG_pushCallbackFunctionData(fun, userData); - return R_NilValue; -} - -SWIGRUNTIME RCallbackFunctionData * -R_SWIG_getCallbackFunctionData() -{ - if(!callbackFunctionDataStack) { - Rf_error("Supposedly impossible error occurred in the SWIG callback mechanism." - " No callback function data set."); - } - - return callbackFunctionDataStack; -} - -SWIGRUNTIME void -R_SWIG_popCallbackFunctionData(int doFree) -{ - RCallbackFunctionData *el = NULL; - if(!callbackFunctionDataStack) - return ; /* Error !!! */ - - el = callbackFunctionDataStack ; - callbackFunctionDataStack = callbackFunctionDataStack->previous; - - if(doFree) - free(el); -} - - -/* - Interface to S function - is(obj, type) - which is to be used to determine if an - external pointer inherits from the right class. - - Ideally, we would like to be able to do this without an explicit call to the is() function. - When the S4 class system uses its own SEXP types, then we will hopefully be able to do this - in the C code. - - Should we make the expression static and preserve it to avoid the overhead of - allocating each time. -*/ -SWIGRUNTIME int -R_SWIG_checkInherits(SEXP obj, SEXP tag, const char *type) -{ - SEXP e, val; - int check_err = 0; - - Rf_protect(e = Rf_allocVector(LANGSXP, 3)); - SETCAR(e, Rf_install("extends")); - - SETCAR(CDR(e), Rf_mkString(CHAR(PRINTNAME(tag)))); - SETCAR(CDR(CDR(e)), Rf_mkString(type)); - - val = R_tryEval(e, R_GlobalEnv, &check_err); - Rf_unprotect(1); - if(check_err) - return(0); - - - return(LOGICAL(val)[0]); -} - - -SWIGRUNTIME void * -R_SWIG_resolveExternalRef(SEXP arg, const char * const type, const char * const argName, Rboolean nullOk) -{ - void *ptr; - SEXP orig = arg; - - if(TYPEOF(arg) != EXTPTRSXP) - arg = GET_SLOT(arg, Rf_mkString("ref")); - - - if(TYPEOF(arg) != EXTPTRSXP) { - Rf_error("argument %s must be an external pointer (from an ExternalReference)", argName); - } - - - ptr = R_ExternalPtrAddr(arg); - - if(ptr == NULL && nullOk == (Rboolean) FALSE) { - Rf_error("the external pointer (of type %s) for argument %s has value NULL", argName, type); - } - - if(type[0] && R_ExternalPtrTag(arg) != Rf_install(type) && strcmp(type, "voidRef") - && !R_SWIG_checkInherits(orig, R_ExternalPtrTag(arg), type)) { - Rf_error("the external pointer for argument %s has tag %s, not the expected value %s", - argName, CHAR(PRINTNAME(R_ExternalPtrTag(arg))), type); - } - - - return(ptr); -} - -SWIGRUNTIME void -R_SWIG_ReferenceFinalizer(SEXP el) -{ - void *ptr = R_SWIG_resolveExternalRef(el, "", "", (Rboolean) 1); - fprintf(stderr, "In R_SWIG_ReferenceFinalizer for %p\n", ptr); - Rf_PrintValue(el); - - if(ptr) { - if(TYPEOF(el) != EXTPTRSXP) - el = GET_SLOT(el, Rf_mkString("ref")); - - if(TYPEOF(el) == EXTPTRSXP) - R_ClearExternalPtr(el); - - free(ptr); - } - - return; -} - -SWIGRUNTIME SEXP -SWIG_MakePtr(void *ptr, const char *typeName, int flags) -{ - SEXP external, r_obj; - - Rf_protect(external = R_MakeExternalPtr(ptr, Rf_install(typeName), R_NilValue)); - Rf_protect(r_obj = NEW_OBJECT(MAKE_CLASS((char *) typeName))); - - if (flags & SWIG_POINTER_OWN) - R_RegisterCFinalizer(external, R_SWIG_ReferenceFinalizer); - - r_obj = SET_SLOT(r_obj, Rf_mkString((char *) "ref"), external); - SET_S4_OBJECT(r_obj); - Rf_unprotect(2); - - return(r_obj); -} - - -SWIGRUNTIME SEXP -R_SWIG_create_SWIG_R_Array(const char *typeName, SEXP ref, int len) -{ - SEXP arr; - -/*XXX remove the char * cast when we can. MAKE_CLASS should be declared appropriately. */ - Rf_protect(arr = NEW_OBJECT(MAKE_CLASS((char *) typeName))); - Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("ref"), ref)); - Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("dims"), Rf_ScalarInteger(len))); - - Rf_unprotect(3); - SET_S4_OBJECT(arr); - return arr; -} - -#define ADD_OUTPUT_ARG(result, pos, value, name) r_ans = AddOutputArgToReturn(pos, value, name, OutputValues); - -SWIGRUNTIME SEXP -AddOutputArgToReturn(int pos, SEXP value, const char *name, SEXP output) -{ - SET_VECTOR_ELT(output, pos, value); - - return(output); -} - -/* Create a new pointer object */ -SWIGRUNTIMEINLINE SEXP -SWIG_R_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - SEXP rptr; - if (!ptr) { - return R_NilValue; - } - rptr = R_MakeExternalPtr(ptr, - R_MakeExternalPtr(type, R_NilValue, R_NilValue), R_NilValue); - SET_S4_OBJECT(rptr); - return rptr; -} - - -/* Convert a pointer value */ -SWIGRUNTIMEINLINE int -SWIG_R_ConvertPtr(SEXP obj, void **ptr, swig_type_info *ty, int flags) { - void *vptr; - if (!obj) return SWIG_ERROR; - if (obj == R_NilValue) { - if (ptr) *ptr = NULL; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - vptr = R_ExternalPtrAddr(obj); - if (ty) { - swig_type_info *to = (swig_type_info*) - R_ExternalPtrAddr(R_ExternalPtrTag(obj)); - if (to == ty) { - if (ptr) *ptr = vptr; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - int newmemory = 0; - if (ptr) *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } - } else { - if (ptr) *ptr = vptr; - } - return SWIG_OK; -} - -SWIGRUNTIME swig_module_info * -SWIG_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - static void *type_pointer = (void *)0; - return (swig_module_info *) type_pointer; -} - -SWIGRUNTIME void -SWIG_SetModule(void *v, swig_module_info *swig_module) { -} - -typedef struct { - void *pack; - swig_type_info *ty; - size_t size; -} RSwigPacked; - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE SEXP RSwigPacked_New(void *ptr, size_t sz, - swig_type_info *ty) { - SEXP rptr; - RSwigPacked *sobj = - (RSwigPacked*) malloc(sizeof(RSwigPacked)); - if (sobj) { - void *pack = malloc(sz); - if (pack) { - memcpy(pack, ptr, sz); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = sz; - } else { - sobj = 0; - } - } - rptr = R_MakeExternalPtr(sobj, R_NilValue, R_NilValue); - return rptr; -} - -SWIGRUNTIME swig_type_info * -RSwigPacked_UnpackData(SEXP obj, void *ptr, size_t size) -{ - RSwigPacked *sobj = - (RSwigPacked *)R_ExternalPtrAddr(obj); - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; -} - -SWIGRUNTIMEINLINE SEXP -SWIG_R_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? RSwigPacked_New((void *) ptr, sz, type) : R_NilValue; -} - -/* Convert a packed pointer value */ - -SWIGRUNTIME int -SWIG_R_ConvertPacked(SEXP obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = RSwigPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -#ifdef __cplusplus -#define SWIG_exception_noreturn(code, msg) do { throw std::runtime_error(msg); } while(0) -#else -#define SWIG_exception_noreturn(code, msg) do { return result; } while(0) -#endif - -#ifdef __cplusplus -} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/r/rstdcommon.swg b/linux/bin/swig/share/swig/4.1.0/r/rstdcommon.swg deleted file mode 100755 index 5f41fd14..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/rstdcommon.swg +++ /dev/null @@ -1,205 +0,0 @@ -%fragment("StdTraits","header",fragment="StdTraitsCommon") -{ -namespace swig { - /* - Traits that provides the from method - */ - - template struct traits_from_ptr { - static SWIG_Object from(Type *val, int owner = 0) { - return SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static SWIG_Object from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static SWIG_Object from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template - inline SWIG_Object from(const Type& val) { - return traits_from::from(val); - } - - template - inline SWIG_Object from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - /* - Traits that provides the asval/as/check method - */ - template - struct traits_asptr { - static int asptr(SWIG_Object obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(SWIG_Object obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(SWIG_Object obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(SWIG_Object obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(SWIG_Object obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(SWIG_Object obj) { - Type v; - int res = asval(obj, &v); - if (!obj || !SWIG_IsOK(res)) { - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(SWIG_Object obj) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(SWIG_Object obj, bool throw_error) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res)) { - return v; - } else { - if (throw_error) - throw std::invalid_argument("bad type"); - return 0; - } - } - }; - - template - inline Type as(SWIG_Object obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(SWIG_Object obj) { - int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(SWIG_Object obj) { - int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(SWIG_Object obj) { - return traits_check::category>::check(obj); - } -} -} - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(SWIG_Object obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static SWIG_Object from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(SWIG_Object obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/r/rtype.swg b/linux/bin/swig/share/swig/4.1.0/r/rtype.swg deleted file mode 100755 index a9c06758..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/rtype.swg +++ /dev/null @@ -1,328 +0,0 @@ - -/* These map the primitive C types to the appropriate R type - for use in class representations. - */ - -%typemap("rtype") int, int *, int & "integer" -%typemap("rtype") long, long *, long & "integer" -%typemap("rtype") float, float*, float & "numeric" -%typemap("rtype") double, double*, double & "numeric" -%typemap("rtype") char *, char ** "character" -%typemap("rtype") char "character" -%typemap("rtype") string, string *, string & "character" -%typemap("rtype") std::string, std::string *, std::string & "character" -%typemap("rtype") bool, bool * "logical" -%typemap("rtype") enum SWIGTYPE "character" -%typemap("rtype") enum SWIGTYPE * "character" -%typemap("rtype") enum SWIGTYPE *const& "character" -%typemap("rtype") enum SWIGTYPE & "character" -%typemap("rtype") const enum SWIGTYPE & "character" -%typemap("rtype") enum SWIGTYPE && "character" -%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("rtypecheck") int, int &, long, long & - %{ (is.integer($arg) || is.numeric($arg)) && length($arg) == 1 %} -%typemap("rtypecheck") int *, long * - %{ is.integer($arg) || is.numeric($arg) %} - - -%typemap("rtypecheck") float, double - %{ is.numeric($arg) && length($arg) == 1 %} -%typemap("rtypecheck") float *, double * - %{ is.numeric($arg) %} - -%typemap("rtypecheck") bool, bool & - %{ is.logical($arg) && length($arg) == 1 %} -%typemap("rtypecheck") bool * - %{ is.logical($arg) %} - -/* - Set up type checks to insure overloading precedence. - We would like non pointer items to shadow pointer items, so that - they get called if length = 1 -*/ - -%typecheck(SWIG_TYPECHECK_BOOL) bool {} -%typecheck(SWIG_TYPECHECK_UINT32) unsigned int {} -%typecheck(SWIG_TYPECHECK_INTEGER) int {} -%typecheck(SWIG_TYPECHECK_FLOAT) float {} -%typecheck(SWIG_TYPECHECK_DOUBLE) double {} - -%typecheck(SWIG_TYPECHECK_BOOL_PTR) bool * {} -%typecheck(SWIG_TYPECHECK_INT32_PTR) int * {} -%typecheck(SWIG_TYPECHECK_FLOAT_PTR) float * {} -%typecheck(SWIG_TYPECHECK_DOUBLE_PTR) double * {} -%typecheck(SWIG_TYPECHECK_CHAR_PTR) char * {} - -%typecheck(SWIG_TYPECHECK_INT32_ARRAY) int[ANY] {} -%typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) float[ANY] {} -%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) double [ANY] {} - -/* Have to be careful that as(x, "numeric") is different from as.numeric(x). - The latter makes a REALSXP, whereas the former leaves an INTSXP as an - INTSXP. -*/ - -/* Force coercion of integer, since by default R sets all constants to - numeric, which means that you can't directly call a function with an - integer using an R numercal literal */ - -%typemap(scoercein) int, int *, int & - %{ $input = as.integer($input); %} -%typemap(scoercein) long, long *, long & - %{ $input = as.integer($input); %} -%typemap(scoercein) float, float*, float &, - double, double *, double & - %{ %} -%typemap(scoercein) char, char *, char & - %{ $input = as($input, "character"); %} -%typemap(scoercein) string, string *, string & - %{ $input = as($input, "character"); %} -%typemap(scoercein) std::string, std::string *, std::string & - %{ $input = as($input, "character"); %} -%typemap(scoercein) enum SWIGTYPE - %{ $input = enumToInteger($input, "$R_class"); %} -%typemap(scoercein) enum SWIGTYPE & - %{ $input = enumToInteger($input, "$*R_class"); %} -%typemap(scoercein) enum SWIGTYPE * - %{ $input = enumToInteger($input, "$R_class"); %} -%typemap(scoercein) enum SWIGTYPE *const - %{ $input = enumToInteger($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE, SWIGTYPE *, SWIGTYPE *const, SWIGTYPE *const&, SWIGTYPE &, SWIGTYPE && - %{ if (inherits($input, "ExternalReference")) $input = slot($input,"ref"); %} - -/* -%typemap(scoercein) SWIGTYPE *, SWIGTYPE *const - %{ $input = coerceIfNotSubclass($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE & - %{ $input = coerceIfNotSubclass($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE && - %{ $input = coerceIfNotSubclass($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE - %{ $input = coerceIfNotSubclass($input, "$&R_class"); %} -*/ - -%typemap(scoercein) SWIGTYPE[ANY] - %{ - if(is.list($input)) - assert(all(sapply($input, class) == "$R_class")); - %} - - -/* **************************************************************** */ - -%typemap(scoercein) bool, bool *, bool & - "$input = as.logical($input);"; -%typemap(scoercein) int, - int *, - int &, - long, - long *, - long & - "$input = as.integer($input);"; - -%typemap(scoercein) char *, string, std::string, -string &, std::string & -%{ $input = as($input, "character"); %} - -%typemap(scoerceout) enum SWIGTYPE - %{ $result = enumFromInteger($result, "$R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE & - %{ $result = enumFromInteger($result, "$*R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE && - %{ $result = enumFromInteger($result, "$R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE * - %{ $result = enumToInteger($result, "$R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE *const - %{ $result = enumToInteger($result, "$R_class"); %} - -%typemap(scoerceout) SEXP %{ %} - -%typemap(scoerceout) SWIGTYPE - %{ $result <- if (is.null($result)) $result - else new("$&R_class", ref=$result); %} - -%typemap(scoerceout) SWIGTYPE & - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - - -%typemap(scoerceout) SWIGTYPE && - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - -%typemap(scoerceout) SWIGTYPE * - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - - -%typemap(scoerceout) SWIGTYPE *const - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - -%typemap(scoerceout) SWIGTYPE *const& - %{ $result <- if (is.null($result)) $result - else new("$*R_class", ref=$result); %} - - -/* Override the SWIGTYPE * above. */ -%typemap(scoerceout) char, - char *, - char &, - float, - double, - float*, - double*, - float &, - double &, - int, - int &, - long, - long &, - bool, - bool &, - string, - std::string, - string &, - std::string &, - void, - signed int, - signed int &, - unsigned int, - unsigned int &, - short, - short &, - unsigned short, - unsigned short &, - long long, - signed long long, - signed long long &, - unsigned long long, - unsigned long long &, - signed long, - signed long &, - unsigned long, - unsigned long &, - signed char, - signed char &, - unsigned char, - unsigned char & - %{ %} - -%apply int {size_t, -std::size_t, -ptrdiff_t, -std::ptrdiff_t, -signed int, -unsigned int, -short, -unsigned short, -signed char, -unsigned char} - -%apply int* {size_t[], -std::size_t[], -ptrdiff_t[], -std::ptrdiff_t[], -signed int[], -unsigned int[], -short[], -unsigned short[], -signed char[], -unsigned char[]} - -%apply int* {size_t[ANY], -std::size_t[ANY], -ptrdiff_t[ANY], -std::ptrdiff_t[ANY], -signed int[ANY], -unsigned int[ANY], -short[ANY], -unsigned short[ANY], -signed char[ANY], -unsigned char[ANY]} - -%apply int* {size_t*, -std::size_t*, -ptrdiff_t*, -std::ptrdiff_t*, -signed int*, -unsigned int*, -short*, -unsigned short*, -signed char*, -unsigned char*} - -%apply long { - long long, - signed long long, - unsigned long long, - signed long, - unsigned long} - -%apply long* { - long long*, - signed long long*, - unsigned long long*, - signed long*, - unsigned long*, - long long[], - signed long long[], - unsigned long long[], - signed long[], - unsigned long[], - long long[ANY], - signed long long[ANY], - unsigned long long[ANY], - signed long[ANY], - unsigned long[ANY]} - -%apply float* { - float[], - float[ANY] -} -%apply double * { - double[], - double[ANY] -} - -%apply bool* { - bool[], - bool[ANY] -} - -#if 0 - Just examining the values for a SWIGTYPE. - -%typemap(scoerceout) SWIGTYPE %{ - - name = $1_name - type = $1_type - ltype = $1_ltype - - mangle = $1_mangle - descriptor = $1_descriptor - - pointer type = $*1_type - pointer ltype = $*1_ltype - - pointer descriptor = $*1_descriptor - basetype = $*_basetype - -%} -#endif - - diff --git a/linux/bin/swig/share/swig/4.1.0/r/srun.swg b/linux/bin/swig/share/swig/4.1.0/r/srun.swg deleted file mode 100755 index 2e8eda11..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/srun.swg +++ /dev/null @@ -1,150 +0,0 @@ -# srun.swg # -# -# This is the basic code that is needed at run time within R to -# provide and define the relevant classes. It is included -# automatically in the generated code by copying the contents of -# srun.swg into the newly created binding code. - - -# This could be provided as a separate run-time library but this -# approach allows the code to be included directly into the -# generated bindings and so removes the need to have and install an -# additional library. We may however end up with multiple copies of -# this and some confusion at run-time as to which class to use. This -# is an issue when we use NAMESPACES as we may need to export certain -# classes. - -###################################################################### - -if(length(getClassDef("RSWIGStruct")) == 0) - setClass("RSWIGStruct", representation("VIRTUAL")) - - - -if(length(getClassDef("ExternalReference")) == 0) -# Should be virtual but this means it loses its slots currently -#representation("VIRTUAL") - setClass("ExternalReference", representation( ref = "externalptr")) - - - -if(length(getClassDef("NativeRoutinePointer")) == 0) - setClass("NativeRoutinePointer", - representation(parameterTypes = "character", - returnType = "character", - "VIRTUAL"), - contains = "ExternalReference") - -if(length(getClassDef("CRoutinePointer")) == 0) - setClass("CRoutinePointer", contains = "NativeRoutinePointer") - - -if(length(getClassDef("EnumerationValue")) == 0) - setClass("EnumerationValue", contains = "integer") - - -if(!isGeneric("copyToR")) - setGeneric("copyToR", - function(value, obj = new(gsub("Ref$", "", class(value)))) - standardGeneric("copyToR" - )) - -setGeneric("delete", function(obj) standardGeneric("delete")) - - -SWIG_createNewRef = -function(className, ..., append = TRUE) -{ - f = get(paste("new", className, sep = "_"), mode = "function") - - f(...) -} - -if(!isGeneric("copyToC")) - setGeneric("copyToC", - function(value, obj = SWIG_createNewRef(class(value))) - standardGeneric("copyToC" - )) - - -# -defineEnumeration = -function(name, .values, where = topenv(parent.frame()), suffix = "Value") -{ - # Mirror the class definitions via the E analogous to .__C__ - defName = paste(".__E__", name, sep = "") - delayedAssign(defName, .values, assign.env = where) - - if(nchar(suffix)) - name = paste(name, suffix, sep = "") - - setClass(name, contains = "EnumerationValue", where = where) -} - -enumToInteger <- function(name,type) -{ - if (is.character(name)) { - ans <- as.integer(get(paste(".__E__", type, sep = ""))[name]) - if (is.na(ans)) {warning("enum not found ", name, " ", type)} - ans - } -} - -enumFromInteger = -function(i,type) -{ - itemlist <- get(paste(".__E__", type, sep="")) - names(itemlist)[match(i, itemlist)] -} - -coerceIfNotSubclass = -function(obj, type) -{ - if(!is(obj, type)) {as(obj, type)} else obj -} - - -setClass("SWIGArray", representation(dims = "integer"), contains = "ExternalReference") - -setMethod("length", "SWIGArray", function(x) x@dims[1]) - - -defineEnumeration("SCopyReferences", - .values = c( "FALSE" = 0, "TRUE" = 1, "DEEP" = 2)) - -assert = -function(condition, message = "") -{ - if(!condition) - stop(message) - - TRUE -} - - -if(FALSE) { -print.SWIGFunction = -function(x, ...) - { - } -} - - -####################################################################### - -R_SWIG_getCallbackFunctionStack = -function() -{ - # No PACKAGE argument as we don't know what the DLL is. - .Call("R_SWIG_debug_getCallbackFunctionData") -} - -R_SWIG_addCallbackFunctionStack = -function(fun, userData = NULL) -{ - # No PACKAGE argument as we don't know what the DLL is. - .Call("R_SWIG_R_pushCallbackFunctionData", fun, userData) -} - - -####################################################################### diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_alloc.i b/linux/bin/swig/share/swig/4.1.0/r/std_alloc.i deleted file mode 100755 index 87fa8d4a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include \ No newline at end of file diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_common.i b/linux/bin/swig/share/swig/4.1.0/r/std_common.i deleted file mode 100755 index cda26231..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_common.i +++ /dev/null @@ -1,73 +0,0 @@ -%include - - -/* - Generate the traits for a 'primitive' type, such as 'double', - for which the SWIG_AsVal and SWIG_From methods are already defined. -*/ - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SEXP obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SEXP from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SEXP obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SEXP from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_container.i b/linux/bin/swig/share/swig/4.1.0/r/std_container.i deleted file mode 100755 index 076c1c6a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_deque.i b/linux/bin/swig/share/swig/4.1.0/r/std_deque.i deleted file mode 100755 index 0c757ab0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include \ No newline at end of file diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_except.i b/linux/bin/swig/share/swig/4.1.0/r/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_list.i b/linux/bin/swig/share/swig/4.1.0/r/std_list.i deleted file mode 100755 index d67ec021..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_list.i +++ /dev/null @@ -1,5 +0,0 @@ -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_map.i b/linux/bin/swig/share/swig/4.1.0/r/std_map.i deleted file mode 100755 index 56057514..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_map.i +++ /dev/null @@ -1,5 +0,0 @@ -%fragment("StdMapTraits","header") -%{ -%} - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_pair.i b/linux/bin/swig/share/swig/4.1.0/r/std_pair.i deleted file mode 100755 index e9803449..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_pair.i +++ /dev/null @@ -1,5 +0,0 @@ -%fragment("StdPairTraits","header") -%{ -%} - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/r/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_string.i b/linux/bin/swig/share/swig/4.1.0/r/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/r/std_vector.i b/linux/bin/swig/share/swig/4.1.0/r/std_vector.i deleted file mode 100755 index 62478fe6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/std_vector.i +++ /dev/null @@ -1,1105 +0,0 @@ -// R specific swig components -/* - Vectors -*/ - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - // vectors of doubles - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(REALSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - NUMERIC_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of floats - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(REALSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - NUMERIC_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of unsigned 8bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 8bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of unsigned 16bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 16bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of 32 bit unsigned int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of 32bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of 64 bit unsigned int -#if defined(SWIGWORDSIZE64) - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 64 bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; -#else - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 64 bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; -#endif - // vectors of bool - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(LGLSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - LOGICAL_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of strings - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector > *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(STRSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - CHARACTER_POINTER(result)[pos] = Rf_mkChar(((*val)[pos]).c_str()); - } - UNPROTECT(1); - return(result); - } - }; - - // catch all that does everything with vectors - template - struct traits_from_ptr< std::vector< T > > { - static SEXP from (std::vector< T > *val, int owner = 0) { - return SWIG_R_NewPointerObj(val, type_info< std::vector< T > >(), owner); - } - }; - ///////////////////////////////////////////////// - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - double *S = NUMERIC_POINTER(obj); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - double *S = NUMERIC_POINTER(obj); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - // 8 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - // 16 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - // 32 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - -#if defined(SWIGWORDSIZE64) - // 64 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - -#else - // 64 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - -#endif - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, LGLSXP)); - int *S = LOGICAL_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > > { - static int asptr(SEXP obj, std::vector > **val) { - std::vector > *p; - // R character vectors are STRSXP containing CHARSXP - // access a CHARSXP using STRING_ELT - int sexpsz = Rf_length(obj); - p = new std::vector >(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, STRSXP)); - //SEXP *S = CHARACTER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - const char * thecstring = CHAR(STRING_ELT(coerced, pos)); - (*p)[pos] = std::basic_string(thecstring); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - // catchall for R to vector conversion - template - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - int res = SWIG_R_ConvertPtr(obj, (void**)&p, type_info< std::vector >(), 0); - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - // now for vectors of vectors. These will be represented as lists of vectors on the - // catch all that does everything with vectors - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(INTSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - INTEGER_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(INTSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - INTEGER_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(REALSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - NUMERIC_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(REALSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - NUMERIC_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(LGLSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - LOGICAL_POINTER(VECTOR_ELT(result, pos))[vpos] = (val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > > { - static SEXP from (std::vector< std::vector > > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(STRSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - CHARACTER_POINTER(VECTOR_ELT(result, pos))[vpos] = Rf_mkChar(val->at(pos).at(vpos).c_str()); - } - } - UNPROTECT(1); - return(result); - } - }; - - template - struct traits_from_ptr< std::vector < std::vector< T > > > { - static SEXP from (std::vector < std::vector< T > > *val, int owner = 0) { - return SWIG_R_NewPointerObj(val, type_info< std::vector < std::vector< T > > >(), owner); - } - }; - - ///////////////////////////////////////////////////////////////// - - // R side - template <> - struct traits_asptr < std::vector< std::vector > > { - static int asptr(SEXP obj, std::vector< std::vector > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(INTEGER_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< int> > > { - static int asptr(SEXP obj, std::vector< std::vector< int> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< int> > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(INTEGER_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< float> > > { - static int asptr(SEXP obj, std::vector< std::vector< float> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< float> > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(NUMERIC_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< double> > > { - static int asptr(SEXP obj, std::vector< std::vector< double> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< double> > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(NUMERIC_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< bool > > > { - static int asptr(SEXP obj, std::vector< std::vector< bool> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< bool > > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(LOGICAL_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - // catchall - template - struct traits_asptr < std::vector< std::vector > > { - static int asptr(SEXP obj, std::vector< std::vector > **val) { - std::vector< std::vector > *p; - Rprintf("vector of vectors - unsupported content\n"); - int res = SWIG_R_ConvertPtr(obj, (void**)&p, type_info< std::vector< std::vector > > (), 0); - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - } -%} - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%define %traits_type_name(Type...) -%fragment(SWIG_Traits_frag(Type), "header", - fragment="StdTraits",fragment="StdVectorTraits") { - namespace swig { - template <> struct traits< Type > { - typedef pointer_category category; - static const char* type_name() { - return #Type; - } - }; - } - } -%enddef - -%include - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector) -%traits_type_name(std::vector) -%typemap("rtypecheck") std::vector, std::vector *, std::vector & - %{ is.numeric($arg) %} -%typemap("rtype") std::vector "numeric" -%typemap("scoercein") std::vector, std::vector *, std::vector & "$input = as.numeric($input);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector) -%traits_type_name(std::vector) - -// reuse these for float -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; - - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -%typemap("rtypecheck") std::vector, std::vector *, std::vector & - %{ is.logical($arg) %} -%typemap("rtype") std::vector "logical" -%typemap("scoercein") std::vector , std::vector & "$input = as.logical($input);" - - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -%typemap("rtypecheck") std::vector, std::vector *, std::vector & - %{ is.integer($arg) || is.numeric($arg) %} - -%typemap("rtype") std::vector "integer" -%typemap("scoercein") std::vector , std::vector *, std::vector & "$input = as.integer($input);" - -// strings -%typemap("rtype") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & "character" - -%typemap("rtypecheck") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & - %{ is.character($arg) %} - -%typemap("scoercein") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & "$input = as.character($input);"; - -%typemap("scoerceout") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & -%{ %} - -// all the related integer vectors -// signed -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -#if defined(SWIGWORDSIZE64) -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#else -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#endif - -// unsigned -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -#if defined(SWIGWORDSIZE64) -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#else -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#endif - -// These R side typemaps are common for integer types -// but we can't use %apply as it will copy the C side ones too -// Also note that we don't seem to be able to use types like -// int_least8_t here. -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; - -#if defined(SWIGWORDSIZE64) -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -#else -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -#endif - - -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; - -#if defined(SWIGWORDSIZE64) -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -#else -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -#endif - -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; - -#if defined(SWIGWORDSIZE64) -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -#else -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -#endif - -/////////////////////////////////////////////////////////////// - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.integer);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.integer);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.numeric);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & - "$input = lapply($input, as.numeric);"; - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.logical);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector > >); -%traits_type_name(std::vector< std::vector > >); -%typemap("rtypecheck") std::vector > >, std::vector > > *, std::vector > > & - %{ is.list($arg) && all(sapply($arg , is.character)) %} -%typemap("rtype") std::vector > >, std::vector > > *, std::vector > > & "list" -%typemap("scoercein") std::vector< std::vector > >, std::vector > > *, std::vector > > & "$input = lapply($input, as.character);" - -// we don't want these to be given R classes as they -// have already been turned into R vectors. -%typemap(scoerceout) std::vector, - std::vector*, - std::vector&, - std::vector , - std::vector*, - std::vector , - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - // vectors of vectors - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector > >, - std::vector< std::vector > >*, - std::vector< std::vector > >& - %{ %} - -#if defined(SWIGWORDSIZE64) -%typemap(scoerceout) std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector& - %{ %} -#else - -%typemap(scoerceout) std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector& - %{ %} - -#endif - -%apply std::vector< std::basic_string > { std::vector }; -%apply std::vector< std::vector< std::basic_string > > { std::vector< std::vector > }; diff --git a/linux/bin/swig/share/swig/4.1.0/r/stl.i b/linux/bin/swig/share/swig/4.1.0/r/stl.i deleted file mode 100755 index 91da6a2b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/stl.i +++ /dev/null @@ -1,9 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/r/swigmove.i b/linux/bin/swig/share/swig/4.1.0/r/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/r/typemaps.i b/linux/bin/swig/share/swig/4.1.0/r/typemaps.i deleted file mode 100755 index 1f9b9c43..00000000 --- a/linux/bin/swig/share/swig/4.1.0/r/typemaps.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/Makefile.swig b/linux/bin/swig/share/swig/4.1.0/ruby/Makefile.swig deleted file mode 100755 index 648b3213..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/Makefile.swig +++ /dev/null @@ -1,42 +0,0 @@ -# File : Makefile.swig -# Makefile for a SWIG module. Use this file if you are -# producing a Ruby extension for general use or distribution. -# -# 1. Prepare extconf.rb. -# 2. Modify this file as appropriate. -# 3. Type 'make -f Makefile.swig' to generate wrapper code and Makefile. -# 4. Type 'make' to build your extension. -# 5. Type 'make install' to install your extension. -# - -MODULE = yourmodule -FEATURE = $(MODULE) -INTERFACE = $(MODULE).i -RUBY = ruby -SWIG = swig - -# for C extension -SWIGOPT = -ruby -WRAPPER = $(MODULE)_wrap.c - -## for C++ extension -#SWIGOPT = -ruby -c++ -#WRAPPER = $(MODULE)_wrap.cc - - -swigall: $(WRAPPER) Makefile - -$(WRAPPER): $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $@ $(INTERFACE) - -Makefile: extconf.rb - $(RUBY) extconf.rb - @if [ -f Makefile ] ; then\ - echo "include Makefile.swig" >> Makefile;\ - fi - -swigclean: - @if [ -f Makefile ] ; then\ - make -f Makefile clean;\ - fi - rm -f Makefile $(WRAPPER) diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/argcargv.i b/linux/bin/swig/share/swig/4.1.0/ruby/argcargv.i deleted file mode 100755 index 24df9c94..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/argcargv.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - - Use it as follows: - - %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) } - - %inline %{ - - int mainApp(size_t argc, const char **argv) { - return argc; - } - - then from ruby: - - $args = ["asdf", "asdf2"] - mainApp(args) - - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - if (rb_obj_is_kind_of($input,rb_cArray)) { - int i; - int size = RARRAY_LEN($input); - $1 = ($1_ltype) size; - $2 = (char **) malloc((size+1)*sizeof(char *)); - VALUE *ptr = RARRAY_PTR($input); - for (i=0; i < size; i++, ptr++) { - $2[i]= StringValuePtr(*ptr); - } - $2[i]=NULL; - } else { - $1 = 0; $2 = 0; - %argument_fail(SWIG_TypeError, "int ARGC, char **ARGV", $symname, $argnum); - } -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = rb_obj_is_kind_of($input,rb_cArray); -} - -%typemap(freearg) (int ARGC, char **ARGV) { - free((char *) $2); -} diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/attribute.i b/linux/bin/swig/share/swig/4.1.0/ruby/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/boost_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/ruby/boost_shared_ptr.i deleted file mode 100755 index 70deae4f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/boost_shared_ptr.i +++ /dev/null @@ -1,401 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE - %{(void)arg1; - delete reinterpret_cast< SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > * >(self);%} - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - swig_ruby_owntype newmem = {0, 0}; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - swig_ruby_owntype newmem = {0, 0}; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - swig_ruby_owntype newmem = {0, 0}; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - swig_ruby_owntype newmem = {0, 0}; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - swig_ruby_owntype newmem = {0, 0}; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - swig_ruby_owntype newmem = {0, 0}; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/carrays.i b/linux/bin/swig/share/swig/4.1.0/ruby/carrays.i deleted file mode 100755 index 8f74cd9b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/carrays.i +++ /dev/null @@ -1,6 +0,0 @@ -%define %array_class(TYPE,NAME) - %array_class_wrap(TYPE,NAME,__getitem__,__setitem__) -%enddef - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/cdata.i b/linux/bin/swig/share/swig/4.1.0/ruby/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/cmalloc.i b/linux/bin/swig/share/swig/4.1.0/ruby/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/cpointer.i b/linux/bin/swig/share/swig/4.1.0/ruby/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/cstring.i b/linux/bin/swig/share/swig/4.1.0/ruby/cstring.i deleted file mode 100755 index ede9c596..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/director.swg b/linux/bin/swig/share/swig/4.1.0/ruby/director.swg deleted file mode 100755 index 9395b818..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/director.swg +++ /dev/null @@ -1,311 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Ruby proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -/* - Use -DSWIG_DIRECTOR_NOUEH if you prefer to avoid the use of the - Undefined Exception Handler provided by swig. -*/ -#ifndef SWIG_DIRECTOR_NOUEH -#ifndef SWIG_DIRECTOR_UEH -#define SWIG_DIRECTOR_UEH -#endif -#endif - -#include -#include -#include -#include - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() { - } - - virtual swig_ruby_owntype get_own() const { - swig_ruby_owntype own = {0, 0}; - return own; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem *operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(swig_ruby_owntype own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - swig_ruby_owntype get_own() const { - return _own; - } - - private: - swig_ruby_owntype _own; - }; - - template - struct GCArray_T : GCItem { - GCArray_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCArray_T() { - delete[] _ptr; - } - - private: - Type *_ptr; - }; - - - /* body args */ - struct body_args { - VALUE recv; - ID id; - int argc; - VALUE *argv; - }; - - /* Base class for director exceptions */ - class DirectorException : public std::exception { - protected: - VALUE swig_error; - std::string swig_msg; - protected: - DirectorException(VALUE error) : swig_error(error) { - } - - DirectorException(VALUE error, const char *hdr, const char *msg ="") : swig_error(error), swig_msg(hdr) { - if (msg[0]) { - swig_msg += " "; - swig_msg += msg; - } - if (swig_msg.size()) { - VALUE str = rb_str_new(swig_msg.data(), swig_msg.size()); - swig_error = rb_exc_new3(error, str); - } else { - swig_error = error; - } - } - - public: - virtual ~DirectorException() throw() { - } - - VALUE getType() const { - return CLASS_OF(swig_error); - } - - VALUE getError() const { - return swig_error; - } - - /* Deprecated, use what() instead */ - const std::string& getMessage() const { - return swig_msg; - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - /* Type mismatch in the return value from a Ruby method call */ - class DirectorTypeMismatchException : public DirectorException { - public: - DirectorTypeMismatchException(VALUE error, const char *msg="") - : DirectorException(error, "SWIG director type mismatch", msg) { - } - - DirectorTypeMismatchException(const char *msg="") - : DirectorException(rb_eTypeError, "SWIG director type mismatch", msg) { - } - - static void raise(VALUE error, const char *msg) { - throw DirectorTypeMismatchException(error, msg); - } - - static void raise(const char *msg) { - throw DirectorTypeMismatchException(msg); - } - }; - - /* Any Ruby exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException { - public: - DirectorMethodException(VALUE error) - : DirectorException(error) { - } - - DirectorMethodException(const char *msg = "") - : DirectorException(rb_eRuntimeError, "SWIG director method error.", msg) { - } - - static void raise(VALUE error) { - throw DirectorMethodException(error); - } - }; - - /* Attempted to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException - { - public: - DirectorPureVirtualException(const char *msg = "") - : DirectorException(rb_eRuntimeError, "SWIG director pure virtual method called", msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - /* Simple thread abstraction for pthreads on win32 */ -#ifdef __THREAD__ -# define __PTHREAD__ -# if defined(_WIN32) || defined(__WIN32__) -# define pthread_mutex_lock EnterCriticalSection -# define pthread_mutex_unlock LeaveCriticalSection -# define pthread_mutex_t CRITICAL_SECTION -# define SWIG_MUTEX_INIT(var) var -# else -# include -# define SWIG_MUTEX_INIT(var) var = PTHREAD_MUTEX_INITIALIZER -# endif -#endif - -#ifdef __PTHREAD__ - struct Guard { - pthread_mutex_t *_mutex; - - Guard(pthread_mutex_t &mutex) : _mutex(&mutex) { - pthread_mutex_lock(_mutex); - } - - ~Guard() { - pthread_mutex_unlock(_mutex); - } - }; -# define SWIG_GUARD(mutex) Guard _guard(mutex) -#else -# define SWIG_GUARD(mutex) -#endif - - /* director base class */ - class Director { - private: - /* pointer to the wrapped Ruby object */ - VALUE swig_self; - /* flag indicating whether the object is owned by Ruby or c++ */ - mutable bool swig_disown_flag; - - public: - /* wrap a Ruby object. */ - Director(VALUE self) : swig_self(self), swig_disown_flag(false) { - } - - /* discard our reference at destruction */ - virtual ~Director() { - } - - /* return a pointer to the wrapped Ruby object */ - VALUE swig_get_self() const { - return swig_self; - } - - /* acquire ownership of the wrapped Ruby object (the sense of "disown" is from Ruby) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag = true; - } - } - - /* ownership management */ - private: - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; -#ifdef __PTHREAD__ - static pthread_mutex_t swig_mutex_own; -#endif - - public: - template - void swig_acquire_ownership_array(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCArray_T(vptr); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, swig_ruby_owntype own) const { - if (vptr && own.datafree) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_Object(own); - } - } - - swig_ruby_owntype swig_release_ownership(void *vptr) const { - swig_ruby_owntype own = {0, 0}; - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_ownership_map::iterator iter = swig_owner.find(vptr); - if (iter != swig_owner.end()) { - own.datafree = iter->second->get_own().datafree; - swig_owner.erase(iter); - } - } - return own; - } - }; -} - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/embed.i b/linux/bin/swig/share/swig/4.1.0/ruby/embed.i deleted file mode 100755 index 9226ef45..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/embed.i +++ /dev/null @@ -1,16 +0,0 @@ -%wrapper %{ - -#include - -int -main(argc, argv) - int argc; - char **argv; -{ - ruby_init(); - ruby_options(argc, argv); - ruby_run(); - return 0; -} - -%} diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/exception.i b/linux/bin/swig/share/swig/4.1.0/ruby/exception.i deleted file mode 100755 index 1e80d96d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/exception.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg);)) -} diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/extconf.rb b/linux/bin/swig/share/swig/4.1.0/ruby/extconf.rb deleted file mode 100755 index 3bac8ccc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/extconf.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'mkmf' - -dir_config('yourlib') - -if have_header('yourlib.h') and have_library('yourlib', 'yourlib_init') - # If you use swig -c option, you may have to link libswigrb. - # have_library('swigrb') - create_makefile('yourlib') -end diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/extra-install.list b/linux/bin/swig/share/swig/4.1.0/ruby/extra-install.list deleted file mode 100755 index 4610fa8f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/extra-install.list +++ /dev/null @@ -1,3 +0,0 @@ -# see top-level Makefile.in -Makefile.swig -extconf.rb diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/factory.i b/linux/bin/swig/share/swig/4.1.0/ruby/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/file.i b/linux/bin/swig/share/swig/4.1.0/ruby/file.i deleted file mode 100755 index f9aaa275..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/file.i +++ /dev/null @@ -1,39 +0,0 @@ -// FILE * -%{ -#ifdef __cplusplus -extern "C" { -#endif - -/* Ruby 1.9 changed the file name of this header */ -#ifdef HAVE_RUBY_IO_H -#include "ruby/io.h" -#else -#include "rubyio.h" -#endif - -#ifdef __cplusplus -} -#endif -%} - -%typemap(in) FILE *READ { - OpenFile *of; - GetOpenFile($input, of); - rb_io_check_readable(of); - $1 = GetReadFile(of); - rb_read_check($1); -} - -%typemap(in) FILE *READ_NOCHECK { - OpenFile *of; - GetOpenFile($input, of); - rb_io_check_readable(of); - $1 = GetReadFile(of); -} - -%typemap(in) FILE *WRITE { - OpenFile *of; - GetOpenFile($input, of); - rb_io_check_writable(of); - $1 = GetWriteFile(of); -} diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/progargcargv.i b/linux/bin/swig/share/swig/4.1.0/ruby/progargcargv.i deleted file mode 100755 index a2843c34..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/progargcargv.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -int PROG_ARGC -char **PROG_ARGV - - Some C function receive argc and argv from C main function. - This typemap provides ignore typemap which pass Ruby ARGV contents - as argc and argv to C function. -*/ - - - -// argc and argv -%typemap(in,numinputs=0) int PROG_ARGC { - $1 = RARRAY_LEN(rb_argv) + 1; -} - -%typemap(in,numinputs=0) char **PROG_ARGV { - int i, n; - VALUE ary = rb_eval_string("[$0] + ARGV"); - n = RARRAY_LEN(ary); - $1 = (char **)malloc(n + 1); - for (i = 0; i < n; i++) { - VALUE v = rb_obj_as_string(RARRAY_PTR(ary)[i]); - $1[i] = (char *)malloc(RSTRING_LEN(v) + 1); - strcpy($1[i], RSTRING_PTR(v)); - } -} - -%typemap(freearg) char **PROG_ARGV { - int i, n = RARRAY_LEN(rb_argv) + 1; - for (i = 0; i < n; i++) free($1[i]); - free($1); -} - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/ruby.swg b/linux/bin/swig/share/swig/4.1.0/ruby/ruby.swg deleted file mode 100755 index d1335974..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/ruby.swg +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------------------------ - * ruby.swg - * - * Ruby configuration module. - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * The Ruby auto rename rules - * ------------------------------------------------------------ */ -#if defined(SWIG_RUBY_AUTORENAME) -/* Class names are CamelCase */ -%rename("%(camelcase)s", %$isclass) ""; - -/* Constants created by %constant or #define are UPPER_CASE */ -%rename("%(uppercase)s", %$isconstant) ""; - -/* SWIG only considers static class members with inline initializers - to be constants. For examples of what is and isn't considered - a constant by SWIG see naming.i in the Ruby test suite. */ -%rename("%(uppercase)s", %$ismember, %$isvariable,%$isimmutable,%$isstatic,%$hasvalue,%$hasconsttype) ""; - -/* Enums are mapped to constants but all we do is make sure the - first letter is uppercase */ -%rename("%(firstuppercase)s", %$isenumitem) ""; - -/* Method names should be lower_case_with_underscores */ -%rename("%(undercase)s", %$isfunction, %$not %$ismemberget, %$not %$ismemberset) ""; -#endif - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Ruby keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Documentation for common Ruby methods - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Ruby initialization function - * ------------------------------------------------------------ */ -%include - - - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyapi.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyapi.swg deleted file mode 100755 index e0077572..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyapi.swg +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Ruby API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -SWIGINTERN VALUE -SWIG_Ruby_AppendOutput(VALUE target, VALUE o) { - if (NIL_P(target)) { - target = o; - } else { - if (TYPE(target) != T_ARRAY) { - VALUE o2 = target; - target = rb_ary_new(); - rb_ary_push(target, o2); - } - rb_ary_push(target, o); - } - return target; -} - -/* For ruby1.8.4 and earlier. */ -#ifndef RUBY_INIT_STACK - RUBY_EXTERN void Init_stack(VALUE* addr); -# define RUBY_INIT_STACK \ - VALUE variable_in_this_stack_frame; \ - Init_stack(&variable_in_this_stack_frame); -#endif - - -#ifdef __cplusplus -} -#endif - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyautodoc.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyautodoc.swg deleted file mode 100755 index 6b0472ce..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyautodoc.swg +++ /dev/null @@ -1,105 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyautodoc.swg - * - * This file implements autodoc typemaps for some common ruby methods. - * ----------------------------------------------------------------------------- */ - -%define AUTODOC(func, str) - %feature("autodoc", str) func; -%enddef - - -AUTODOC(to_i, "Convert $class to an Integer"); -AUTODOC(to_f, "Convert $class to a Float"); -AUTODOC(coerce, "Coerce class to a number"); -AUTODOC(to_a, "Convert $class to an Array"); -AUTODOC(to_s, "Convert class to a String representation"); -AUTODOC(inspect, "Inspect class and its contents"); - -AUTODOC(at, "Return element at a certain index"); -AUTODOC(__getitem__, "Element accessor/slicing"); -AUTODOC(__setitem__, "Element setter/slicing"); -AUTODOC(slice, "Return a slice (portion of) the $class"); - -AUTODOC(push, "Add an element at the end of the $class"); -AUTODOC(pop, "Remove and return element at the end of the $class"); -AUTODOC(shift, "Remove and return element at the beginning of the $class"); -AUTODOC(unshift, "Add one or more elements at the beginning of the $class"); -AUTODOC(first, "Return the first element in $class"); -AUTODOC(last, "Return the last element in $class"); - - -// -// Common Object methods -// -AUTODOC(hash, "Hashing function for class"); -AUTODOC(dup, "Create a duplicate of the class and unfreeze it if needed"); -AUTODOC(clone, "Create a duplicate of the class"); - -// -// Container methods -// -AUTODOC(empty, "Check if $class is empty"); -AUTODOC(size, "Size or Length of the $class"); -AUTODOC(insert, "Insert one or more new elements in the $class"); - -// -// Iterator methods (block) -// -AUTODOC(each, "Iterate thru each element in the $class. A block must be provided"); -AUTODOC(find, "Find an element in the class"); -AUTODOC(each_key, "Iterate thru each key element in the $class. A block must be provided"); -AUTODOC(each_value, "Iterate thru each key element in the $class. A block must be provided"); -AUTODOC(reject, "Iterate thru each element in the $class and reject those that fail a condition returning a new $class. A block must be provided"); -AUTODOC(reject_bang, "Iterate thru each element in the $class and reject those that fail a condition. A block must be provided. $class is modified in place"); -AUTODOC(select, "Iterate thru each element in the $class and select those that match a condition. A block must be provided"); -AUTODOC(delete_at, "Delete an element at a certain index"); -AUTODOC(__delete__, "Delete a matching element"); - - -// -// Hash methods -// -AUTODOC(keys, "Return an Array of key elements"); -AUTODOC(values, "Return an Array of value elements"); -AUTODOC(values_at, "Return an Array of value elements matching the conditions"); - - -// -// Operators -// -#ifdef __cplusplus -AUTODOC(operator==, "Equality comparison operator"); -AUTODOC(operator<=, "Lower or equal comparison operator"); -AUTODOC(operator>=, "Higher or equal comparison operator"); -AUTODOC(operator<, "Lower than comparison operator"); -AUTODOC(operator>, "Higher than comparison operator"); -AUTODOC(operator<<, "Left shifting or appending operator"); -AUTODOC(operator>>, "Right shifting operator or extracting operator"); -AUTODOC(operator+, "Add operator"); -AUTODOC(operator-, "Subtraction operator"); -AUTODOC(operator+(), "Positive operator"); -AUTODOC(operator-(), "Negation operator"); -AUTODOC(operator&, "AND operator"); -AUTODOC(operator|, "OR operator"); -AUTODOC(operator^, "XOR operator"); -AUTODOC(operator~, "Invert operator"); -#endif -AUTODOC(__eq__, "Equality comparison operator"); -AUTODOC(__le__, "Lower or equal comparison operator"); -AUTODOC(__ge__, "Higher or equal comparison operator"); -AUTODOC(__lt__, "Lower than comparison operator"); -AUTODOC(__gt__, "Higher than comparison operator"); -AUTODOC(__lshift__, "Left shifting or appending operator"); -AUTODOC(__rshift__, "Right shifting operator or extracting operator"); -AUTODOC(__add___, "Add operator"); -AUTODOC(__sub__, "Subtraction operator"); -AUTODOC(__pos__, "Positive operator"); -AUTODOC(__neg__, "Negation operator"); -AUTODOC(__and__, "AND operator"); -AUTODOC(__or__, "OR operator"); -AUTODOC(__xor__, "XOR operator"); -AUTODOC(__negate__, "Invert operator"); -AUTODOC(__pow__, "Exponential operator"); -AUTODOC(__divmod__, "Modulo of division"); -AUTODOC(__cmp__, "Comparison operator. Returns < 0 for less than, 0 for equal or > 1 for higher than."); diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyclasses.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyclasses.swg deleted file mode 100755 index c43f38fc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyclasses.swg +++ /dev/null @@ -1,404 +0,0 @@ -#ifdef __cplusplus - -/* - GC_VALUE is used as a replacement of Ruby's VALUE. - GC_VALUE automatically handles registering and unregistering - of the underlying Ruby object with the GC. - - It can be used if you want to create STL containers of VALUEs, such as: - - std::vector< GC_VALUE >; - - or as a member variable: - - struct A { - GC_VALUE _obj; - A(VALUE o) : _obj(o) { - } - }; - - or as a input/output value (not much use for this, as VALUE works just as - well here, thou): - - GC_VALUE func(GC_VALUE obj) { - GC_VALUE out = rb_obj_classname(obj); - return out; - } - - - GC_VALUE is 'visible' at the wrapped side, so you can do: - - %template(RubyVector) std::vector; - - and all the proper typemaps will be used. - -*/ - -%fragment("GC_VALUE_definition","header") { -namespace swig { - class SwigGCReferences { - VALUE _hash; - - SwigGCReferences() : _hash(Qnil) { - } - ~SwigGCReferences() { - if (_hash != Qnil) - rb_gc_unregister_address(&_hash); - } - static void EndProcHandler(VALUE) { - // Ruby interpreter ending - _hash can no longer be accessed. - SwigGCReferences &s_references = instance(); - s_references._hash = Qnil; - } - public: - static SwigGCReferences& instance() { - // Hash of all GC_VALUE's currently in use - static SwigGCReferences s_references; - - return s_references; - } - static void initialize() { - SwigGCReferences &s_references = instance(); - if (s_references._hash == Qnil) { - rb_set_end_proc(&EndProcHandler, Qnil); - s_references._hash = rb_hash_new(); - rb_gc_register_address(&s_references._hash); - } - } - void GC_register(VALUE& obj) { - if (FIXNUM_P(obj) || SPECIAL_CONST_P(obj) || SYMBOL_P(obj)) - return; - if (_hash != Qnil) { - VALUE val = rb_hash_aref(_hash, obj); - unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 0; - ++n; - rb_hash_aset(_hash, obj, INT2NUM(n)); - } - } - void GC_unregister(const VALUE& obj) { - if (FIXNUM_P(obj) || SPECIAL_CONST_P(obj) || SYMBOL_P(obj)) - return; - // this test should not be needed but I've noticed some very erratic - // behavior of none being unregistered in some very rare situations. - if (BUILTIN_TYPE(obj) == T_NONE) - return; - if (_hash != Qnil) { - VALUE val = rb_hash_aref(_hash, obj); - unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 1; - --n; - if (n) - rb_hash_aset(_hash, obj, INT2NUM(n)); - else - rb_hash_delete(_hash, obj); - } - } - }; - - class GC_VALUE { - protected: - VALUE _obj; - - static ID hash_id; - static ID lt_id; - static ID gt_id; - static ID eq_id; - static ID le_id; - static ID ge_id; - - static ID pos_id; - static ID neg_id; - static ID inv_id; - - static ID add_id; - static ID sub_id; - static ID mul_id; - static ID div_id; - static ID mod_id; - - static ID and_id; - static ID or_id; - static ID xor_id; - - static ID lshift_id; - static ID rshift_id; - - struct OpArgs - { - VALUE src; - ID id; - int nargs; - VALUE target; - }; - - - public: - GC_VALUE() : _obj(Qnil) - { - } - - GC_VALUE(const GC_VALUE& item) : _obj(item._obj) - { - SwigGCReferences::instance().GC_register(_obj); - } - - GC_VALUE(VALUE obj) :_obj(obj) - { - SwigGCReferences::instance().GC_register(_obj); - } - - ~GC_VALUE() - { - SwigGCReferences::instance().GC_unregister(_obj); - } - - GC_VALUE & operator=(const GC_VALUE& item) - { - SwigGCReferences::instance().GC_unregister(_obj); - _obj = item._obj; - SwigGCReferences::instance().GC_register(_obj); - return *this; - } - - operator VALUE() const - { - return _obj; - } - - VALUE inspect() const - { - return rb_inspect(_obj); - } - - VALUE to_s() const - { - return rb_inspect(_obj); - } - - static VALUE swig_rescue_swallow(VALUE, VALUE) - { - /* - VALUE errstr = rb_obj_as_string(rb_errinfo()); - printf("Swallowing error: '%s'\n", RSTRING_PTR(StringValue(errstr))); - */ - return Qnil; /* Swallow Ruby exception */ - } - - static VALUE swig_rescue_funcall(VALUE p) - { - OpArgs* args = (OpArgs*) p; - return rb_funcall(args->src, args->id, args->nargs, args->target); - } - - bool relational_equal_op(const GC_VALUE& other, const ID& op_id, bool (*op_func)(const VALUE& a, const VALUE& b)) const - { - if (FIXNUM_P(_obj) && FIXNUM_P(other._obj)) { - return op_func(_obj, other._obj); - } - bool res = false; - VALUE ret = Qnil; - SWIG_RUBY_THREAD_BEGIN_BLOCK; - if (rb_respond_to(_obj, op_id)) { - OpArgs args; - args.src = _obj; - args.id = op_id; - args.nargs = 1; - args.target = VALUE(other); - ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args), - (VALUEFUNC(swig_rescue_swallow)), Qnil); - } - if (ret == Qnil) { - VALUE a = rb_funcall2( _obj, hash_id, 0, 0 ); - VALUE b = rb_funcall2( VALUE(other), hash_id, 0, 0 ); - res = op_func(a, b); - } else { - res = RTEST(ret); - } - SWIG_RUBY_THREAD_END_BLOCK; - return res; - } - - static bool operator_eq(const VALUE& a, const VALUE& b) { return a == b; } - static bool operator_lt(const VALUE& a, const VALUE& b) { return a < b; } - static bool operator_le(const VALUE& a, const VALUE& b) { return a <= b; } - static bool operator_gt(const VALUE& a, const VALUE& b) { return a > b; } - static bool operator_ge(const VALUE& a, const VALUE& b) { return a >= b; } - - bool operator==(const GC_VALUE& other) const { return relational_equal_op(other, eq_id, operator_eq); } - bool operator<(const GC_VALUE& other) const { return relational_equal_op(other, lt_id, operator_lt); } - bool operator<=(const GC_VALUE& other) const { return relational_equal_op(other, le_id, operator_le); } - bool operator>(const GC_VALUE& other) const { return relational_equal_op(other, gt_id, operator_gt); } - bool operator>=(const GC_VALUE& other) const { return relational_equal_op(other, ge_id, operator_ge); } - - bool operator!=(const GC_VALUE& other) const - { - return !(this->operator==(other)); - } - - GC_VALUE unary_op(const ID& op_id) const - { - VALUE ret = Qnil; - SWIG_RUBY_THREAD_BEGIN_BLOCK; - OpArgs args; - args.src = _obj; - args.id = op_id; - args.nargs = 0; - args.target = Qnil; - ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args), - (VALUEFUNC(swig_rescue_swallow)), Qnil); - SWIG_RUBY_THREAD_END_BLOCK; - return ret; - } - - GC_VALUE operator+() const { return unary_op(pos_id); } - GC_VALUE operator-() const { return unary_op(neg_id); } - GC_VALUE operator~() const { return unary_op(inv_id); } - - GC_VALUE binary_op(const GC_VALUE& other, const ID& op_id) const - { - VALUE ret = Qnil; - SWIG_RUBY_THREAD_BEGIN_BLOCK; - OpArgs args; - args.src = _obj; - args.id = op_id; - args.nargs = 1; - args.target = VALUE(other); - ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args), - (VALUEFUNC(swig_rescue_swallow)), Qnil); - SWIG_RUBY_THREAD_END_BLOCK; - return GC_VALUE(ret); - } - - GC_VALUE operator+(const GC_VALUE& other) const { return binary_op(other, add_id); } - GC_VALUE operator-(const GC_VALUE& other) const { return binary_op(other, sub_id); } - GC_VALUE operator*(const GC_VALUE& other) const { return binary_op(other, mul_id); } - GC_VALUE operator/(const GC_VALUE& other) const { return binary_op(other, div_id); } - GC_VALUE operator%(const GC_VALUE& other) const { return binary_op(other, mod_id); } - GC_VALUE operator&(const GC_VALUE& other) const { return binary_op(other, and_id); } - GC_VALUE operator^(const GC_VALUE& other) const { return binary_op(other, xor_id); } - GC_VALUE operator|(const GC_VALUE& other) const { return binary_op(other, or_id); } - GC_VALUE operator<<(const GC_VALUE& other) const { return binary_op(other, lshift_id); } - GC_VALUE operator>>(const GC_VALUE& other) const { return binary_op(other, rshift_id); } - }; - - ID GC_VALUE::hash_id = rb_intern("hash"); - ID GC_VALUE::lt_id = rb_intern("<"); - ID GC_VALUE::gt_id = rb_intern(">"); - ID GC_VALUE::eq_id = rb_intern("=="); - ID GC_VALUE::le_id = rb_intern("<="); - ID GC_VALUE::ge_id = rb_intern(">="); - - ID GC_VALUE::pos_id = rb_intern("+@"); - ID GC_VALUE::neg_id = rb_intern("-@"); - ID GC_VALUE::inv_id = rb_intern("~"); - - ID GC_VALUE::add_id = rb_intern("+"); - ID GC_VALUE::sub_id = rb_intern("-"); - ID GC_VALUE::mul_id = rb_intern("*"); - ID GC_VALUE::div_id = rb_intern("/"); - ID GC_VALUE::mod_id = rb_intern("%"); - - ID GC_VALUE::and_id = rb_intern("&"); - ID GC_VALUE::or_id = rb_intern("|"); - ID GC_VALUE::xor_id = rb_intern("^"); - - ID GC_VALUE::lshift_id = rb_intern("<<"); - ID GC_VALUE::rshift_id = rb_intern(">>"); - - typedef GC_VALUE LANGUAGE_OBJ; - -} // namespace swig - -} // %fragment(GC_VALUE_definition) - - - -namespace swig { - - %apply VALUE {GC_VALUE}; - - // Make sure this is the last typecheck done - %typecheck(999999,fragment="GC_VALUE_definition",noblock=1) GC_VALUE, GC_VALUE&, - const GC_VALUE& { $1 = 1; }; - - /* For input */ - %typemap(in,fragment="GC_VALUE_definition",noblock=1) GC_VALUE* (GC_VALUE r), GC_VALUE& (GC_VALUE r) { - r = $input; $1 = &r; - } - - /* For output */ - %typemap(out,fragment="GC_VALUE_definition",noblock=1) GC_VALUE { - $result = (VALUE)$1; - } - - %typemap(out,fragment="GC_VALUE_definition",noblock=1) GC_VALUE*, GC_VALUE const & { - $result = (VALUE)*$1; - } - - %nodirector GC_VALUE; - - // We ignore the constructor so that user can never create a GC_VALUE - // manually - %ignore GC_VALUE::GC_VALUE; - - struct GC_VALUE { - VALUE inspect() const; - VALUE to_s() const; - GC_VALUE(); - protected: - GC_VALUE(const GC_VALUE&); - ~GC_VALUE(); - }; - - %exception GC_VALUE {}; - - - %ignore LANGUAGE_OBJ; - typedef GC_VALUE LANGUAGE_OBJ; -} - - -%init { - swig::SwigGCReferences::initialize(); -} - - - -// -// Fragment that contains traits to properly deal with GC_VALUE. -// These functions may be invoked as a need of the from(), asval(), -// asptr() and as() template functors, usually used in %typemaps. -// -%fragment(SWIG_Traits_frag(swig::GC_VALUE),"header",fragment="StdTraits",fragment="GC_VALUE_definition") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "GC_VALUE"; } - }; - - template <> struct traits_from { - typedef GC_VALUE value_type; - static VALUE from(const value_type& val) { - return static_cast(val); - } - }; - - template <> - struct traits_check { - static bool check(GC_VALUE) { - return true; - } - }; - - template <> struct traits_asval { - typedef GC_VALUE value_type; - static int asval(VALUE obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} // swig -} // %fragment(traits for swig::GC_VALUE) - - -#endif // __cplusplus - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubycomplex.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubycomplex.swg deleted file mode 100755 index d2aaf6cb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubycomplex.swg +++ /dev/null @@ -1,148 +0,0 @@ -/* - Defines the As/From conversors for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -%fragment("rb_complex_new","header") -{ -%#if !defined(T_COMPLEX) -/* Ruby versions prior to 1.9 did not have native complex numbers. They were an extension in the STD library. */ -SWIGINTERN VALUE rb_complex_new(VALUE x, VALUE y) { - static ID new_id = rb_intern("new"); - static VALUE cComplex = rb_const_get(rb_cObject, rb_intern("Complex")); - return rb_funcall(cComplex, new_id, 2, x, y); -} -%#endif -} - -%fragment("SWIG_Complex_Numbers","header") -{ -%#if !defined(T_COMPLEX) -SWIGINTERN int SWIG_Is_Complex( VALUE obj ) { - static ID real_id = rb_intern("real"); - static ID imag_id = rb_intern("imag"); - return ( (rb_respond_to( obj, real_id ) ) && - (rb_respond_to( obj, imag_id ) ) ); -} -%#else -SWIGINTERN int SWIG_Is_Complex( VALUE obj ) { - return TYPE(obj) == T_COMPLEX; -} -%#endif - -SWIGINTERN VALUE SWIG_Complex_Real(VALUE obj) { - static ID real_id = rb_intern("real"); - return rb_funcall2(obj, real_id, 0, 0); -} - -SWIGINTERN VALUE SWIG_Complex_Imaginary(VALUE obj) { - static ID imag_id = rb_intern("imag"); - return rb_funcall2(obj, imag_id, 0, 0); -} -} - -%init { -%#if !defined(T_COMPLEX) - rb_require("complex"); -%#endif -} - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header",fragment="rb_complex_new") -{ -SWIGINTERNINLINE VALUE -SWIG_From(Type)(%ifcplusplus(const Type&, Type) c) -{ - VALUE re = rb_float_new(Real(c)); - VALUE im = rb_float_new(Imag(c)); - return rb_complex_new(re, im); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double), - fragment="SWIG_Complex_Numbers") -{ -SWIGINTERN int -SWIG_AsVal(Type) (VALUE o, Type* val) -{ - if ( SWIG_Is_Complex( o ) ) { - if (val) { - VALUE real = SWIG_Complex_Real(o); - VALUE imag = SWIG_Complex_Imaginary(o); - double re = 0; - SWIG_AsVal_double( real, &re ); - double im = 0; - SWIG_AsVal_double( imag, &im ); - *val = Constructor(re, im); - } - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float), - fragment=SWIG_AsVal_frag(double), - fragment="SWIG_Complex_Numbers") { -SWIGINTERN int -SWIG_AsVal(Type)(VALUE o, Type *val) -{ - if ( SWIG_Is_Complex( o ) ) { - VALUE real = SWIG_Complex_Real(o); - VALUE imag = SWIG_Complex_Imaginary(o); - double re = 0; - SWIG_AsVal_double( real, &re ); - double im = 0; - SWIG_AsVal_double( imag, &im ); - if ((-FLT_MAX <= re && re <= FLT_MAX) && - (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0f); - return res; - } - } - return SWIG_TypeError; -} -} - -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) - - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubycontainer.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubycontainer.swg deleted file mode 100755 index 597ae83d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubycontainer.swg +++ /dev/null @@ -1,1114 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubycontainer.swg - * - * Ruby sequence <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Ruby, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - -%include - -/**** The RubySequence C++ Wrap ***/ - -%fragment(""); - -%include - - -%fragment("RubySequence_Base","header") -{ -%#include - - -namespace swig { - template < class T > - struct yield - { - bool - operator()( const T& v ) const - { - return RTEST( rb_yield( swig::from< T >(v) ) ); - } - }; - - - inline size_t - check_index(ptrdiff_t i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - - throw std::out_of_range("index out of range"); - } - - inline size_t - slice_index(ptrdiff_t i, size_t size) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) { - return (size_t) (i + size); - } else { - throw std::out_of_range("index out of range"); - } - } else { - return ( (size_t) i < size ) ? ((size_t) i) : size; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline void - resize(Sequence *seq, typename Sequence::size_type n, typename Sequence::value_type x) { - seq->resize(n, x); - } - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, (i == size && j == size)); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (jj > ii) { - typename Sequence::const_iterator vb = self->begin(); - typename Sequence::const_iterator ve = self->begin(); - std::advance(vb,ii); - std::advance(ve,jj); - return new Sequence(vb, ve); - } else { - return new Sequence(); - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj < ii) jj = ii; - size_t ssize = jj - ii; - if (ssize <= v.size()) { - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); - std::advance(sb,ii); - std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); - } else { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj > ii) { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - } - } -} -} - -%fragment("RubySequence_Cont","header", - fragment="", - fragment="StdTraits", - fragment="RubySequence_Base", - fragment="ConstIterator_T") -{ -namespace swig -{ - - /** - * This class is a proxy class for references, used to return and set values - * of an element of a Ruby Array of stuff. - * It can be used by RubySequence_InputIterator to make it work with STL - * algorithms. - */ - template - struct RubySequence_Ref - { - RubySequence_Ref(VALUE seq, int index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - VALUE item = rb_ary_entry(_seq, _index ); - try { - return swig::as(item); - } catch (const std::invalid_argument& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", _index); - VALUE lastErr = rb_gv_get("$!"); - if ( lastErr == Qnil ) { - %type_error(swig::type_name()); - } - VALUE str = rb_str_new2(msg); - str = rb_str_cat2( str, e.what() ); - SWIG_Ruby_ExceptionType( NULL, str ); - throw; - } - } - - RubySequence_Ref& operator=(const T& v) - { - rb_ary_set(_seq, _index, swig::from< T >(v)); - return *this; - } - - private: - VALUE _seq; - int _index; - }; - - - /** - * This class is a proxy to return a pointer to a class, usually - * RubySequence_Ref. - * It can be used by RubySequence_InputIterator to make it work with STL - * algorithms. - */ - template - struct RubySequence_ArrowProxy - { - RubySequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - - /** - * Input Iterator. This adapator class is a random access iterator that - * allows you to use STL algorithms with a Ruby class (a Ruby Array by default). - */ - template > - struct RubySequence_InputIterator - { - typedef RubySequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef ptrdiff_t difference_type; - - RubySequence_InputIterator() - { - } - - RubySequence_InputIterator(VALUE seq, int index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - RubySequence_ArrowProxy - operator->() const { - return RubySequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index) && (_seq == ri._seq); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - VALUE _seq; - difference_type _index; - }; - - - /** - * This adaptor class allows you to use a Ruby Array as if it was an STL - * container, giving it begin(), end(), and iterators. - */ - template - struct RubySequence_Cont - { - typedef RubySequence_Ref reference; - typedef const RubySequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - typedef int size_type; - typedef const pointer const_pointer; - typedef RubySequence_InputIterator iterator; - typedef RubySequence_InputIterator const_iterator; - - RubySequence_Cont(VALUE seq) : _seq(0) - { - if (!rb_obj_is_kind_of(seq, rb_cArray)) { - throw std::invalid_argument("an Array is expected"); - } - _seq = seq; - } - - ~RubySequence_Cont() - { - } - - size_type size() const - { - return RARRAY_LEN(_seq); - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - int s = (int) size(); - for (int i = 0; i < s; ++i) { - VALUE item = rb_ary_entry(_seq, i ); - if (!swig::check(item)) - return false; - } - return true; - } - - private: - VALUE _seq; - }; - -} -} - -/** - * Macros used to typemap an STL iterator -> SWIGIterator conversion. - */ -%define %swig_sequence_iterator(Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - - %typemap(out,noblock=1,fragment="RubySequence_Cont") - const_iterator, const_reverse_iterator { - $result = SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &), - self), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN); - } - - %typemap(out,noblock=1,fragment="RubySequence_Cont") - iterator, reverse_iterator { - $result = SWIG_NewPointerObj(swig::make_nonconst_iterator(%static_cast($1,const $type &), - self), - swig::Iterator::descriptor(),SWIG_POINTER_OWN); - } - - %typemap(out,noblock=1,fragment="RubySequence_Cont") - std::pair { - $result = rb_ary_new2(2); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).first), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).second), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - } - - // std::map/multimap/set allow returning std::pair< iterator, iterator > from - // equal_range, but we cannot still modify the key, so the iterator is - // const. - %typemap(out,noblock=1,fragment="RubySequence_Cont") - std::pair { - $result = rb_ary_new2(2); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).first), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).second), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - } - - - %typemap(in,noblock=1,fragment="RubySequence_Cont") - const_iterator(swig::ConstIterator *iter = 0, int res), - const_reverse_iterator(swig::ConstIterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::ConstIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::ConstIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typemap(in,noblock=1,fragment="RubySequence_Cont") - iterator(swig::Iterator *iter = 0, int res), - reverse_iterator(swig::Iterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::Iterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::Iterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="RubySequence_Cont") - const_iterator, const_reverse_iterator { - swig::ConstIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::ConstIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="RubySequence_Cont") - iterator, reverse_iterator { - swig::ConstIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::Iterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("RubySequence_Cont"); - -// %newobject iterator; -// %newobject const_iterator; -// %extend { -// swig::Iterator* iterator(VALUE* RUBY_SELF) { -// return swig::make_nonconst_iterator($self->begin(), $self->begin(), -// $self->end(), *RUBY_SELF); -// } - -// swig::ConstIterator* const_iterator(VALUE* RUBY_SELF) { -// return swig::make_const_iterator($self->begin(), $self->begin(), -// $self->end(), *RUBY_SELF); -// } -// } -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - - -/**** The Ruby container methods ****/ - - - -%define %swig_container_methods(Container...) - - %extend { - - %newobject dup; - Container* dup() - { - return new Container(*$self); - } - - } - -%enddef - - -/** - * Macro used to define common Ruby printing methods for STL container - */ -%define %swig_sequence_printing_methods(Sequence...) - - %extend { - - VALUE inspect() - { - Sequence::const_iterator i = $self->begin(); - Sequence::const_iterator e = $self->end(); - const char *type_name = swig::type_name< Sequence >(); - VALUE str = rb_str_new2(type_name); - str = rb_str_cat2( str, " [" ); - bool comma = false; - VALUE tmp; - for ( ; i != e; ++i, comma = true ) - { - if (comma) str = rb_str_cat2( str, "," ); - tmp = swig::from< Sequence::value_type >( *i ); - tmp = rb_inspect( tmp ); - str = rb_str_buf_append( str, tmp ); - } - str = rb_str_cat2( str, "]" ); - return str; - } - - VALUE to_a() - { - Sequence::const_iterator i = $self->begin(); - Sequence::const_iterator e = $self->end(); - VALUE ary = rb_ary_new2( std::distance( i, e ) ); - VALUE tmp; - for ( ; i != e; ++i ) - { - tmp = swig::from< Sequence::value_type >( *i ); - rb_ary_push( ary, tmp ); - } - return ary; - } - - VALUE to_s() - { - Sequence::iterator i = $self->begin(); - Sequence::iterator e = $self->end(); - VALUE str = rb_str_new2( "" ); - VALUE tmp; - for ( ; i != e; ++i ) - { - tmp = swig::from< Sequence::value_type >( *i ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - } - return str; - } -} -%enddef - - -/** - * Macro used to add common methods to all STL sequence-type containers - */ -%define %swig_sequence_methods_non_resizable_common(Sequence...) - %swig_container_methods(%arg(Sequence)) - %swig_sequence_iterator(%arg(Sequence)) - %swig_sequence_printing_methods(%arg(Sequence)) - - %fragment("RubySequence_Base"); - - %extend { - - VALUE slice( difference_type i, difference_type length ) throw (std::invalid_argument) { - if ( length < 0 ) - return Qnil; - std::size_t len = $self->size(); - if ( i < 0 ) { - if ( i + static_cast(len) < 0 ) - return Qnil; - else - i = len + i; - } - Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) - j = len; - - VALUE r = Qnil; - try { - r = swig::from< const Sequence* >( swig::getslice(self, i, j) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - - Sequence* each() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE r; - Sequence::const_iterator i = self->begin(); - Sequence::const_iterator e = self->end(); - for ( ; i != e; ++i ) - { - r = swig::from< Sequence::value_type >(*i); - rb_yield(r); - } - - return self; - } - - VALUE __delete2__(const value_type& i) { - VALUE r = Qnil; - return r; - } - - } -%enddef - -%define %swig_sequence_methods_resizable_common(Sequence...) - %extend { - - %newobject select; - Sequence* select() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - Sequence* r = new Sequence(); - Sequence::const_iterator i = $self->begin(); - Sequence::const_iterator e = $self->end(); - for ( ; i != e; ++i ) - { - VALUE v = swig::from< Sequence::value_type >(*i); - if ( RTEST( rb_yield(v) ) ) - $self->insert( r->end(), *i); - } - - return r; - } - - VALUE delete_at(difference_type i) { - VALUE r = Qnil; - try { - Sequence::iterator at = swig::getpos(self, i); - r = swig::from< Sequence::value_type >( *(at) ); - $self->erase(at); - } - catch (const std::out_of_range&) { - } - return r; - } - } -%enddef - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_methods_non_resizable_common(%arg(Sequence)) - %swig_sequence_methods_resizable_common(%arg(Sequence)) -%enddef - -/** - * Macro used to add functions for back insertion of values in - * STL sequence containers - */ -%define %swig_sequence_back_inserters( Sequence... ) - %extend { - - VALUE pop() { - if ($self->empty()) return Qnil; - Sequence::value_type x = self->back(); - $self->pop_back(); - return swig::from< Sequence::value_type >( x ); - } - - %alias push "<<"; - const value_type push( const value_type& e ) { - $self->push_back( e ); - return e; - } - - %newobject reject; - Sequence* reject() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - Sequence* r = new Sequence(); - std::remove_copy_if( $self->begin(), $self->end(), - std::back_inserter(*r), - swig::yield< Sequence::value_type >() ); - return r; - } - - } -%enddef - -%define %swig_sequence_methods_extra(Sequence...) - %extend { - %alias reject_bang "delete_if"; - Sequence* reject_bang() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - $self->erase( std::remove_if( $self->begin(), $self->end(), - swig::yield< Sequence::value_type >() ), $self->end() ); - return $self; - } - } -%enddef - -%define %swig_sequence_methods_non_resizable_accessors(Sequence...) - %extend { - - VALUE at(difference_type i) const { - VALUE r = Qnil; - try { - r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - VALUE __getitem__(difference_type i, difference_type length) const throw (std::invalid_argument) { - if ( length < 0 ) - return Qnil; - std::size_t len = $self->size(); - if ( i < 0 ) { - if ( i + static_cast(len) < 0 ) - return Qnil; - else - i = len + i; - } - Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) - j = len; - - VALUE r = Qnil; - try { - r = swig::from< const Sequence* >( swig::getslice(self, i, j) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - VALUE __getitem__(difference_type i) const { - VALUE r = Qnil; - try { - r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - VALUE __getitem__(VALUE i) const throw (std::invalid_argument) { - if ( rb_obj_is_kind_of( i, rb_cRange ) == Qfalse ) { - rb_raise( rb_eTypeError, "not a valid index or range" ); - } - - static ID id_end = rb_intern("end"); - static ID id_start = rb_intern("begin"); - static ID id_noend = rb_intern("exclude_end?"); - - VALUE start = rb_funcall2( i, id_start, 0, 0 ); - VALUE end = rb_funcall2( i, id_end, 0, 0 ); - bool noend = ( rb_funcall2( i, id_noend, 0, 0 ) == Qtrue ); - - int len = $self->size(); - - int s = NUM2INT( start ); - if ( s < 0 ) { - s = len + s; - if ( s < 0 ) - return Qnil; - } else if ( s > len ) - return Qnil; - - int e = NUM2INT( end ); - if ( e < 0 ) e = len + e; - if ( noend ) e -= 1; - if ( e < 0 ) e = -1; - if ( e >= len ) e = len - 1; - if ( s == len ) e = len - 1; - - return swig::from< Sequence* >( swig::getslice(self, s, e+1) ); - } - - VALUE __setitem__(difference_type i, const value_type& x) throw (std::invalid_argument, std::out_of_range) - { - if ( i >= static_cast( $self->size()) ) - swig::resize( $self, i+1, x ); - else - *(swig::getpos($self, i)) = x; - - return swig::from< Sequence::value_type >( x ); - } - - VALUE __setitem__(difference_type i, difference_type length, const Sequence& v) throw (std::invalid_argument) { - - if ( length < 0 ) - return Qnil; - std::size_t len = $self->size(); - if ( i < 0 ) { - if ( i + static_cast(len) < 0 ) - return Qnil; - else - i = len + i; - } - Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) { - swig::resize( $self, j, *(v.begin()) ); - } - - VALUE r = Qnil; - swig::setslice($self, i, j, v); - r = swig::from< const Sequence* >( &v ); - return r; - } - } -%enddef - -/** - * Macro used to add functions for non resizable sequences - */ -%define %swig_sequence_methods_non_resizable(Sequence...) - %swig_sequence_methods_non_resizable_common(%arg(Sequence)) - %swig_sequence_methods_non_resizable_accessors(%arg(Sequence)) -%enddef - - -/** - * Macro used to add functions for sequences - */ -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_non_resizable_common(%arg(Sequence)) - %swig_sequence_methods_resizable_common(%arg(Sequence)) - %swig_sequence_methods_non_resizable_accessors(%arg(Sequence)) - %swig_sequence_methods_extra(%arg(Sequence)); - %swig_sequence_back_inserters(%arg(Sequence)); -%enddef - -%define %swig_sequence_methods_non_resizable_val(Sequence...) - %swig_sequence_methods_non_resizable(%arg(Sequence)) -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods(%arg(Sequence)) -%enddef - - -/** - * Macro used to add functions for front insertion of - * elements in STL sequence containers that support it. - */ -%define %swig_sequence_front_inserters( Sequence... ) -%extend { - - VALUE shift() - { - if ($self->empty()) return Qnil; - Sequence::value_type x = self->front(); - $self->erase( $self->begin() ); - return swig::from< Sequence::value_type >( x ); - } - - %typemap(in) (int argc, VALUE* argv) { - $1 = argc - 1; - $2 = argv + 1; - } - - Sequence* insert( difference_type pos, int argc, VALUE* argv, ... ) - { - std::size_t len = $self->size(); - std::size_t i = swig::check_index( pos, len, true ); - Sequence::iterator start; - - VALUE elem = argv[0]; - int idx = 0; - try { - Sequence::value_type val = swig::as( elem ); - if ( i >= len ) { - $self->resize(i-1, val); - return $self; - } - start = $self->begin(); - std::advance( start, i ); - $self->insert( start++, val ); - - for ( ++idx; idx < argc; ++idx ) - { - elem = argv[idx]; - val = swig::as( elem ); - $self->insert( start++, val ); - } - - } - catch(const std::invalid_argument &) - { - rb_raise( rb_eArgError, "%s", - Ruby_Format_TypeError( "", - swig::type_name(), - __FUNCTION__, idx+2, elem )); - } - - - return $self; - } - - %typemap(in) (int argc, VALUE* argv) { - $1 = argc; - $2 = argv; - } - - Sequence* unshift( int argc, VALUE* argv, ... ) - { - for ( int idx = argc-1; idx >= 0; --idx ) - { - Sequence::iterator start = $self->begin(); - VALUE elem = argv[idx]; - try { - Sequence::value_type val = swig::as( elem ); - $self->insert( start, val ); - } - catch(const std::invalid_argument &) - { - rb_raise( rb_eArgError, "%s", - Ruby_Format_TypeError( "", - swig::type_name(), - __FUNCTION__, idx+2, elem )); - } - } - - return $self; - } -} -%enddef - - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="RubySequence_Cont", - fragment="GC_VALUE_definition") -{ -namespace swig { - template - inline void - assign(const RubySeq& rubyseq, Seq* seq) { - // seq->assign(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(VALUE obj, sequence **seq) { - if (rb_obj_is_kind_of(obj, rb_cArray) == Qtrue) { - try { - RubySequence_Cont rubyseq(obj); - if (seq) { - sequence *pseq = new sequence(); - assign(rubyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return rubyseq.check() ? SWIG_OK : SWIG_ERROR; - } - } catch (const std::exception& e) { - if (seq) { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - rb_raise(rb_eTypeError, "%s", e.what()); - } - } - return SWIG_ERROR; - } - } else { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } - }; - - // Partial specialization for GC_VALUE's. No need to typecheck each - // element. - template< class Seq > - struct traits_asptr_stdseq< Seq, swig::GC_VALUE > { - typedef Seq sequence; - typedef swig::GC_VALUE value_type; - - static int asptr(VALUE obj, sequence **seq) { - if (rb_obj_is_kind_of(obj, rb_cArray) == Qtrue) { - try { - if (seq) { - RubySequence_Cont rubyseq(obj); - sequence *pseq = new sequence(); - assign(rubyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return true; - } - } catch (const std::exception& e) { - if (seq) { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - rb_raise(rb_eTypeError, "%s", e.what()); - } - } - return SWIG_ERROR; - } - } else { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static VALUE from(const sequence& seq) { -#ifdef SWIG_RUBY_EXTRA_NATIVE_CONTAINERS - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); - } -#endif - size_type size = seq.size(); - if (size <= (size_type)INT_MAX) { - VALUE obj = rb_ary_new2((int)size); - int i = 0; - for (const_iterator it = seq.begin(); - it != seq.end(); ++it, ++i) { - rb_ary_push(obj, swig::from< value_type >(*it)); - } - rb_obj_freeze(obj); // treat as immutable result - return obj; - } else { - rb_raise(rb_eRangeError,"sequence size not valid in ruby"); - return Qnil; - } - } - }; -} -} - - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubycontainer_extended.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubycontainer_extended.swg deleted file mode 100755 index 663dddb8..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubycontainer_extended.swg +++ /dev/null @@ -1,134 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubycontainer_extended.swg - * - * This file contains additional functions that make containers - * behave closer to ruby primitive types. - * However, some of these functions place some restrictions on - * the underlying object inside of the container and the iterator - * (that it has to have an == comparison function, that it has to have - * an = assignment operator, etc). - * ----------------------------------------------------------------------------- */ - -/** - * Macro used to add extend functions that require operator== in object. - * - * @param Container STL container - * @param Type class inside container - * - */ -%define %swig_container_with_equal_operator( Container, Type ) - - VALUE __delete__( const Type& val ) { - VALUE r = Qnil; - Container::iterator e = $self->end(); - Container::iterator i = std::remove( $self->begin(), e, val ); - // remove dangling elements now - $self->erase( i, e ); - - if ( i != e ) - r = swig::from< Type >( val ); - else if ( rb_block_given_p() ) - r = rb_yield(Qnil); - return r; - } - -%enddef // end of %swig_container_with_equal_operator - - - - -/** - * Macro used to add extend functions that require the assignment - * operator (ie. = ) of contained class - * - * @param Container STL container - * @param Type class inside container - * - */ - -%define %swig_container_with_assignment( Container, Type ) - - - // - // map! -- the equivalent of std::transform - // - Container< Type >* map_bang() { - - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "No block given" ); - - VALUE r = Qnil; - Container< Type >::iterator i = $self->begin(); - Container< Type >::iterator e = $self->end(); - - try { - for ( ; i != e; ++i ) - { - r = swig::from< Type >( *i ); - r = rb_yield( r ); - *i = swig::as< Type >( r ); - } - } - catch (const std::invalid_argument&) - { - rb_raise(rb_eTypeError, - "Yield block did not return a valid element for " "Container"); - } - - return $self; - } - - -%enddef // end of %swig_container_with_assignment - - - - - -/** - * Macro used to add all extended functions to a container - * - * @param Container STL container - * @param Type class inside container - * - */ -%define %swig_container_extend( Container, Type ) - -%extend Container< Type > { - - %swig_container_with_assignment( %arg(Container), Type ); - %swig_container_with_equal_operator( %arg(Container), Type ); - -} - -%enddef - - -/** - * Private macro used to add all extended functions to C/C++ - * primitive types - * - * @param Container an STL container, like std::vector (with no class template) - * - */ -%define %__swig_container_extend_primtypes( Container ) - -%swig_container_extend( %arg( Container ), bool ); -%swig_container_extend( %arg( Container ), char ); -%swig_container_extend( %arg( Container ), short ); -%swig_container_extend( %arg( Container ), int ); -%swig_container_extend( %arg( Container ), unsigned short ); -%swig_container_extend( %arg( Container ), unsigned int ); -%swig_container_extend( %arg( Container ), float ); -%swig_container_extend( %arg( Container ), double ); -%swig_container_extend( %arg( Container ), std::complex ); -%swig_container_extend( %arg( Container ), std::string ); -%swig_container_extend( %arg( Container ), swig::GC_VALUE ); - -%enddef - - -%__swig_container_extend_primtypes( std::vector ); -%__swig_container_extend_primtypes( std::deque ); -%__swig_container_extend_primtypes( std::list ); - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubydef.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubydef.swg deleted file mode 100755 index 956aaee0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubydef.swg +++ /dev/null @@ -1 +0,0 @@ -/* empty file added for backward comp. */ diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyerrors.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyerrors.swg deleted file mode 100755 index 434544bc..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyerrors.swg +++ /dev/null @@ -1,154 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - - -/* Define some additional error types */ -#define SWIG_ObjectPreviouslyDeletedError -100 - - -/* Define custom exceptions for errors that do not map to existing Ruby - exceptions. Note this only works for C++ since a global cannot be - initialized by a function in C. For C, fallback to rb_eRuntimeError.*/ - -SWIGINTERN VALUE -getNullReferenceError(void) { - static int init = 0; - static VALUE rb_eNullReferenceError ; - if (!init) { - init = 1; - rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError); - } - return rb_eNullReferenceError; -} - -SWIGINTERN VALUE -getObjectPreviouslyDeletedError(void) { - static int init = 0; - static VALUE rb_eObjectPreviouslyDeleted ; - if (!init) { - init = 1; - rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError); - } - return rb_eObjectPreviouslyDeleted; -} - - -SWIGINTERN VALUE -SWIG_Ruby_ErrorType(int SWIG_code) { - VALUE type; - switch (SWIG_code) { - case SWIG_MemoryError: - type = rb_eNoMemError; - break; - case SWIG_IOError: - type = rb_eIOError; - break; - case SWIG_RuntimeError: - type = rb_eRuntimeError; - break; - case SWIG_IndexError: - type = rb_eIndexError; - break; - case SWIG_TypeError: - type = rb_eTypeError; - break; - case SWIG_DivisionByZero: - type = rb_eZeroDivError; - break; - case SWIG_OverflowError: - type = rb_eRangeError; - break; - case SWIG_SyntaxError: - type = rb_eSyntaxError; - break; - case SWIG_ValueError: - type = rb_eArgError; - break; - case SWIG_SystemError: - type = rb_eFatal; - break; - case SWIG_AttributeError: - type = rb_eRuntimeError; - break; - case SWIG_NullReferenceError: - type = getNullReferenceError(); - break; - case SWIG_ObjectPreviouslyDeletedError: - type = getObjectPreviouslyDeletedError(); - break; - case SWIG_UnknownError: - type = rb_eRuntimeError; - break; - default: - type = rb_eRuntimeError; - } - return type; -} - - -/* This function is called when a user inputs a wrong argument to - a method. - */ -SWIGINTERN -const char* Ruby_Format_TypeError( const char* msg, - const char* type, - const char* name, - const int argn, - VALUE input ) -{ - char buf[128]; - VALUE str; - VALUE asStr; - if ( msg && *msg ) - { - str = rb_str_new2(msg); - } - else - { - str = rb_str_new(NULL, 0); - } - - str = rb_str_cat2( str, "Expected argument " ); - sprintf( buf, "%d of type ", argn-1 ); - str = rb_str_cat2( str, buf ); - str = rb_str_cat2( str, type ); - str = rb_str_cat2( str, ", but got " ); - str = rb_str_cat2( str, rb_obj_classname(input) ); - str = rb_str_cat2( str, " " ); - asStr = rb_inspect(input); - if ( RSTRING_LEN(asStr) > 30 ) - { - str = rb_str_cat( str, StringValuePtr(asStr), 30 ); - str = rb_str_cat2( str, "..." ); - } - else - { - str = rb_str_append( str, asStr ); - } - - if ( name ) - { - str = rb_str_cat2( str, "\n\tin SWIG method '" ); - str = rb_str_cat2( str, name ); - str = rb_str_cat2( str, "'" ); - } - - return StringValuePtr( str ); -} - -/* This function is called when an overloaded method fails */ -SWIGINTERN -void Ruby_Format_OverloadedError( - const int argc, - const int maxargs, - const char* method, - const char* prototypes - ) -{ - const char* msg = "Wrong # of arguments"; - if ( argc <= maxargs ) msg = "Wrong arguments"; - rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n" - "Possible C/C++ prototypes are:\n%s", - msg, method, prototypes); -} diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyfragments.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyfragments.swg deleted file mode 100755 index 3c3b6581..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'rubyfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the ones defined by default by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(VALUE obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyhead.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyhead.swg deleted file mode 100755 index e4d9e214..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyhead.swg +++ /dev/null @@ -1,185 +0,0 @@ -#if __GNUC__ >= 7 -#pragma GCC diagnostic push -#if defined(__cplusplus) -#pragma GCC diagnostic ignored "-Wregister" -#if __GNUC__ >= 10 -#pragma GCC diagnostic ignored "-Wvolatile" -#if __GNUC__ >= 11 -#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" -#endif -#endif -#endif -#endif - -#include - -#if __GNUC__ >= 7 -#pragma GCC diagnostic pop -#endif - -/* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which - * breaks using rb_intern as an lvalue, as SWIG does. We work around this - * issue for now by disabling this. - * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645 - */ -#ifdef rb_intern -# undef rb_intern -#endif - -/* Remove global macros defined in Ruby's win32.h */ -#ifdef write -# undef write -#endif -#ifdef read -# undef read -#endif -#ifdef bind -# undef bind -#endif -#ifdef close -# undef close -#endif -#ifdef connect -# undef connect -#endif - - -/* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */ -#ifndef NUM2LL -#define NUM2LL(x) NUM2LONG((x)) -#endif -#ifndef LL2NUM -#define LL2NUM(x) INT2NUM((long) (x)) -#endif -#ifndef ULL2NUM -#define ULL2NUM(x) UINT2NUM((unsigned long) (x)) -#endif - -/* Ruby 1.7 doesn't (yet) define NUM2ULL() */ -#ifndef NUM2ULL -#ifdef HAVE_LONG_LONG -#define NUM2ULL(x) rb_num2ull((x)) -#else -#define NUM2ULL(x) NUM2ULONG(x) -#endif -#endif - -/* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */ -/* Define these for older versions so we can just write code the new way */ -#ifndef RSTRING_LEN -# define RSTRING_LEN(x) RSTRING(x)->len -#endif -#ifndef RSTRING_PTR -# define RSTRING_PTR(x) RSTRING(x)->ptr -#endif -#ifndef RSTRING_END -# define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x)) -#endif -#ifndef RARRAY_LEN -# define RARRAY_LEN(x) RARRAY(x)->len -#endif -#ifndef RARRAY_PTR -# define RARRAY_PTR(x) RARRAY(x)->ptr -#endif -#ifndef RFLOAT_VALUE -# define RFLOAT_VALUE(x) RFLOAT(x)->value -#endif -#ifndef DOUBLE2NUM -# define DOUBLE2NUM(x) rb_float_new(x) -#endif -#ifndef RHASH_TBL -# define RHASH_TBL(x) (RHASH(x)->tbl) -#endif -#ifndef RHASH_ITER_LEV -# define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev) -#endif -#ifndef RHASH_IFNONE -# define RHASH_IFNONE(x) (RHASH(x)->ifnone) -#endif -#ifndef RHASH_SIZE -# define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries) -#endif -#ifndef RHASH_EMPTY_P -# define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0) -#endif -#ifndef RSTRUCT_LEN -# define RSTRUCT_LEN(x) RSTRUCT(x)->len -#endif -#ifndef RSTRUCT_PTR -# define RSTRUCT_PTR(x) RSTRUCT(x)->ptr -#endif -#ifndef RTYPEDDATA_P -# define RTYPEDDATA_P(x) (TYPE(x) != T_DATA) -#endif - - - -/* - * The following macros are used for providing the correct type of a - * function pointer to the Ruby C API. - * Starting with Ruby 2.7 (corresponding to RB_METHOD_DEFINITION_DECL being - * defined) these macros act transparently due to Ruby's moving away from - * ANYARGS and instead employing strict function signatures. - * - * Note: In case of C (not C++) the macros are transparent even before - * Ruby 2.7 due to the fact that the Ruby C API used function declarators - * with empty parentheses, which allows for an unspecified number of - * arguments. - * - * PROTECTFUNC(f) is used for the function pointer argument of the Ruby - * C API function rb_protect(). - * - * VALUEFUNC(f) is used for the function pointer argument(s) of Ruby C API - * functions like rb_define_method() and rb_define_singleton_method(). - * - * VOIDFUNC(f) is used to typecast a C function that implements either - * the "mark" or "free" stuff for a Ruby Data object, so that it can be - * passed as an argument to Ruby C API functions like Data_Wrap_Struct() - * and Data_Make_Struct(). - * - * SWIG_RUBY_VOID_ANYARGS_FUNC(f) is used for the function pointer - * argument(s) of Ruby C API functions like rb_define_virtual_variable(). - * - * SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer - * argument(s) of Ruby C API functions like st_foreach(). - */ -#if defined(__cplusplus) && !defined(RB_METHOD_DEFINITION_DECL) -# define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f) -# define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f) -# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f) -# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) ((void (*)(ANYARGS))(f)) -# define SWIG_RUBY_INT_ANYARGS_FUNC(f) ((int (*)(ANYARGS))(f)) -#else -# define PROTECTFUNC(f) (f) -# define VALUEFUNC(f) (f) -# define VOIDFUNC(f) (f) -# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f) -# define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f) -#endif - -/* Don't use for expressions have side effect */ -#ifndef RB_STRING_VALUE -#define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s))) -#endif -#ifndef StringValue -#define StringValue(s) RB_STRING_VALUE(s) -#endif -#ifndef StringValuePtr -#define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s)) -#endif -#ifndef StringValueLen -#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s)) -#endif -#ifndef SafeStringValue -#define SafeStringValue(v) do {\ - StringValue(v);\ - rb_check_safe_str(v);\ -} while (0) -#endif - -#ifndef HAVE_RB_DEFINE_ALLOC_FUNC -#define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1) -#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new") -#endif - -static VALUE _mSWIG = Qnil; diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyinit.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyinit.swg deleted file mode 100755 index fc6e039b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyinit.swg +++ /dev/null @@ -1 +0,0 @@ -%insert(initbeforefunc) "swiginit.swg" diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyiterators.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyiterators.swg deleted file mode 100755 index 89fea452..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyiterators.swg +++ /dev/null @@ -1,932 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyiterators.swg - * - * Implement a C++ 'output' iterator for Ruby. - * - * Users can derive form the Iterator to implement their - * own iterators. As an example (real one since we use it for STL/STD - * containers), the template Iterator_T does the - * implementation for generic C++ iterators. - * ----------------------------------------------------------------------------- */ - -%include - - -%fragment("ConstIterator","header",fragment="",fragment="GC_VALUE_definition") { -namespace swig { - struct stop_iteration { - }; - - /** - * Abstract base class used to represent all iterators of STL containers. - */ - struct ConstIterator { - public: - typedef ConstIterator self_type; - - protected: - GC_VALUE _seq; - - protected: - ConstIterator(VALUE seq) : _seq(seq) - { - } - - // Random access iterator methods, but not required in Ruby - virtual ptrdiff_t distance(const ConstIterator &x) const - { - throw std::invalid_argument("distance not supported"); - } - - virtual bool equal (const ConstIterator &x) const - { - throw std::invalid_argument("equal not supported"); - } - - virtual self_type* advance(ptrdiff_t n) - { - throw std::invalid_argument("advance not supported"); - } - - public: - virtual ~ConstIterator() {} - - // Access iterator method, required by Ruby - virtual VALUE value() const { - throw std::invalid_argument("value not supported"); - return Qnil; - }; - - virtual VALUE setValue( const VALUE& v ) { - throw std::invalid_argument("value= not supported"); - return Qnil; - } - - virtual self_type* next( size_t n = 1 ) - { - return this->advance( n ); - } - - virtual self_type* previous( size_t n = 1 ) - { - ptrdiff_t nn = n; - return this->advance( -nn ); - } - - virtual VALUE to_s() const { - throw std::invalid_argument("to_s not supported"); - return Qnil; - } - - virtual VALUE inspect() const { - throw std::invalid_argument("inspect not supported"); - return Qnil; - } - - virtual ConstIterator *dup() const - { - throw std::invalid_argument("dup not supported"); - return NULL; - } - - // - // C++ common/needed methods. We emulate a bidirectional - // operator, to be compatible with all the STL. - // The iterator traits will then tell the STL what type of - // iterator we really are. - // - ConstIterator() : _seq( Qnil ) - { - } - - ConstIterator( const self_type& b ) : _seq( b._seq ) - { - } - - self_type& operator=( const self_type& b ) - { - _seq = b._seq; - return *this; - } - - bool operator == (const ConstIterator& x) const - { - return equal(x); - } - - bool operator != (const ConstIterator& x) const - { - return ! operator==(x); - } - - // Pre-decrement operator - self_type& operator--() - { - return *previous(); - } - - // Pre-increment operator - self_type& operator++() - { - return *next(); - } - - // Post-decrement operator - self_type operator--(int) - { - self_type r = *this; - previous(); - return r; - } - - // Post-increment operator - self_type operator++(int) - { - self_type r = *this; - next(); - return r; - } - - ConstIterator& operator += (ptrdiff_t n) - { - return *advance(n); - } - - ConstIterator& operator -= (ptrdiff_t n) - { - return *advance(-n); - } - - ConstIterator* operator + (ptrdiff_t n) const - { - return dup()->advance(n); - } - - ConstIterator* operator - (ptrdiff_t n) const - { - return dup()->advance(-n); - } - - ptrdiff_t operator - (const ConstIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::ConstIterator *"); - init = 1; - } - return desc; - } - }; - - - /** - * Abstract base class used to represent all non-const iterators of STL containers. - * - */ - struct Iterator : public ConstIterator { - public: - typedef Iterator self_type; - - protected: - Iterator(VALUE seq) : ConstIterator(seq) - { - } - - virtual self_type* advance(ptrdiff_t n) - { - throw std::invalid_argument("operation not supported"); - } - - public: - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::Iterator *"); - init = 1; - } - return desc; - } - - virtual Iterator *dup() const - { - throw std::invalid_argument("dup not supported"); - return NULL; - } - - virtual self_type* next( size_t n = 1 ) - { - return this->advance( n ); - } - - virtual self_type* previous( size_t n = 1 ) - { - ptrdiff_t nn = n; - return this->advance( -nn ); - } - - bool operator == (const ConstIterator& x) const - { - return equal(x); - } - - bool operator != (const Iterator& x) const - { - return ! operator==(x); - } - - Iterator& operator += (ptrdiff_t n) - { - return *advance(n); - } - - Iterator& operator -= (ptrdiff_t n) - { - return *advance(-n); - } - - Iterator* operator + (ptrdiff_t n) const - { - return dup()->advance(n); - } - - Iterator* operator - (ptrdiff_t n) const - { - return dup()->advance(-n); - } - - ptrdiff_t operator - (const Iterator& x) const - { - return x.distance(*this); - } - }; - -} -} - - -%fragment("ConstIterator_T","header",fragment="",fragment="ConstIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - - /** - * Templated base classes for all custom const_iterators. - * - */ - template - class ConstIterator_T : public ConstIterator - { - public: - typedef OutConstIterator const_iter; - typedef typename std::iterator_traits::value_type value_type; - typedef ConstIterator_T self_type; - - protected: - - - virtual bool equal (const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual ptrdiff_t distance(const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual ConstIterator* advance(ptrdiff_t n) - { - std::advance( current, n ); - return this; - } - - public: - ConstIterator_T() : ConstIterator(Qnil) - { - } - - ConstIterator_T(const_iter curr, VALUE seq = Qnil) - : ConstIterator(seq), current(curr) - { - } - - const const_iter& get_current() const - { - return current; - } - - const value_type& operator*() const - { - return *current; - } - - virtual VALUE inspect() const - { - VALUE ret = rb_str_new2("#<"); - ret = rb_str_cat2( ret, rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::const_iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_inspect(cur) ); - ret = rb_str_cat2( ret, ">" ); - return ret; - } - - virtual VALUE to_s() const - { - VALUE ret = rb_str_new2( rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::const_iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_obj_as_string(cur) ); - return ret; - } - - protected: - const_iter current; - }; - - - /** - * Templated base classes for all custom non-const iterators. - * - */ - template - class Iterator_T : public Iterator - { - public: - typedef InOutIterator nonconst_iter; - - // Make this class iterator STL compatible, by using iterator_traits - typedef typename std::iterator_traits::iterator_category iterator_category; - typedef typename std::iterator_traits::value_type value_type; - typedef typename std::iterator_traits::difference_type difference_type; - typedef typename std::iterator_traits::pointer pointer; - typedef typename std::iterator_traits::reference reference; - - typedef Iterator base; - typedef Iterator_T< nonconst_iter > self_type; - - protected: - - virtual bool equal (const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual ptrdiff_t distance(const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( current, n ); - return this; - } - - public: - - Iterator_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator(seq), current(curr) - { - } - - const nonconst_iter& get_current() const - { - return current; - } - - self_type& operator=( const self_type& b ) - { - base::operator=( b ); - return *this; - } - - self_type& operator=( const value_type& b ) - { - *current = b; - return *this; - } - - const value_type& operator*() const - { - return *current; - } - - value_type& operator*() - { - return *current; - } - - virtual VALUE inspect() const - { - VALUE ret = rb_str_new2("#<"); - ret = rb_str_cat2( ret, rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_inspect(cur) ); - ret = rb_str_cat2( ret, ">" ); - return ret; - } - - virtual VALUE to_s() const - { - VALUE ret = rb_str_new2( rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_obj_as_string(cur) ); - return ret; - } - - protected: - nonconst_iter current; - }; - - - /** - * Auxiliary functor to store the value of a ruby object inside - * a reference of a compatible C++ type. ie: Ruby -> C++ - * - */ - template - struct asval_oper - { - typedef ValueType value_type; - typedef bool result_type; - bool operator()(VALUE obj, value_type& v) const - { - return ( swig::asval< value_type >(obj, &v) == SWIG_OK ); - } - }; - - /** - * Auxiliary functor to return a ruby object from a C++ type. - * ie: C++ -> Ruby - * - */ - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef VALUE result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - - /** - * ConstIterator class for a const_iterator with no end() boundaries. - * - */ - template::value_type, - typename FromOper = from_oper > - class ConstIteratorOpen_T : public ConstIterator_T - { - public: - FromOper from; - typedef OutConstIterator const_iter; - typedef ValueType value_type; - typedef ConstIterator_T base; - typedef ConstIteratorOpen_T self_type; - - ConstIteratorOpen_T(const_iter curr, VALUE seq = Qnil) - : ConstIterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - ConstIterator *dup() const - { - return new self_type(*this); - } - }; - - /** - * Iterator class for an iterator with no end() boundaries. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class IteratorOpen_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef IteratorOpen_T self_type; - - public: - IteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - virtual VALUE setValue( const VALUE& v ) - { - value_type& dst = *base::current; - if ( asval(v, dst) ) return v; - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - }; - - /** - * ConstIterator class for a const_iterator where begin() and end() boundaries are known. - * - */ - template::value_type, - typename FromOper = from_oper > - class ConstIteratorClosed_T : public ConstIterator_T - { - public: - FromOper from; - typedef OutConstIterator const_iter; - typedef ValueType value_type; - typedef ConstIterator_T base; - typedef ConstIteratorClosed_T self_type; - - protected: - virtual ConstIterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - ConstIteratorClosed_T(const_iter curr, const_iter first, - const_iter last, VALUE seq = Qnil) - : ConstIterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - ConstIterator *dup() const - { - return new self_type(*this); - } - - - private: - const_iter begin; - const_iter end; - }; - - /** - * Iterator class for a iterator where begin() and end() boundaries are known. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class IteratorClosed_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef IteratorClosed_T self_type; - - protected: - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - IteratorClosed_T(nonconst_iter curr, nonconst_iter first, - nonconst_iter last, VALUE seq = Qnil) - : Iterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - // Iterator setter method, required by Ruby - virtual VALUE setValue( const VALUE& v ) - { - if (base::current == end) - throw stop_iteration(); - - value_type& dst = *base::current; - if ( asval( v, dst ) ) return v; - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - - private: - nonconst_iter begin; - nonconst_iter end; - }; - - /* Partial specialization for bools which don't allow de-referencing */ - template< typename InOutIterator, typename FromOper, typename AsvalOper > - class IteratorOpen_T< InOutIterator, bool, FromOper, AsvalOper > : - public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef bool value_type; - typedef Iterator_T base; - typedef IteratorOpen_T self_type; - - IteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - virtual VALUE setValue( const VALUE& v ) - { - bool tmp = *base::current; - if ( asval( v, tmp ) ) - { - *base::current = tmp; - return v; - } - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - - }; - - /* Partial specialization for bools which don't allow de-referencing */ - template< typename InOutIterator, typename FromOper, typename AsvalOper > - class IteratorClosed_T< InOutIterator, bool, FromOper, AsvalOper > : - public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef bool value_type; - typedef Iterator_T base; - typedef IteratorClosed_T self_type; - - protected: - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - IteratorClosed_T(nonconst_iter curr, nonconst_iter first, - nonconst_iter last, VALUE seq = Qnil) - : Iterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - virtual VALUE setValue( const VALUE& v ) - { - if (base::current == end) - throw stop_iteration(); - - bool tmp = *base::current; - if ( asval( v, tmp ) ) - { - *base::current = tmp; - return v; - } - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - - private: - nonconst_iter begin; - nonconst_iter end; - }; - - - /** - * Helper function used to wrap a bounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline Iterator* - make_nonconst_iterator(const InOutIter& current, const InOutIter& begin, - const InOutIter& end, VALUE seq = Qnil) - { - return new IteratorClosed_T(current, begin, end, seq); - } - - /** - * Helper function used to wrap an unbounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline Iterator* - make_nonconst_iterator(const InOutIter& current, VALUE seq = Qnil) - { - return new IteratorOpen_T(current, seq); - } - - /** - * Helper function used to wrap a bounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline ConstIterator* - make_const_iterator(const OutIter& current, const OutIter& begin, - const OutIter& end, VALUE seq = Qnil) - { - return new ConstIteratorClosed_T(current, begin, end, seq); - } - - /** - * Helper function used to wrap an unbounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline ConstIterator* - make_const_iterator(const OutIter& current, VALUE seq = Qnil) - { - return new ConstIteratorOpen_T(current, seq); - } -} -} - - -%fragment("ConstIterator"); - - -// -// This part is just so SWIG is aware of the base abstract iterator class. -// -namespace swig -{ - /* - Throw a StopIteration exception - */ - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws) stop_iteration { - (void)$1; - SWIG_Ruby_ExceptionType(NULL, Qnil); - SWIG_fail; - } - - /* - Mark methods that return new objects - */ - %newobject ConstIterator::dup; - %newobject ConstIterator::operator + (ptrdiff_t n) const; - %newobject ConstIterator::operator - (ptrdiff_t n) const; - - %nodirector ConstIterator; - - %catches(swig::stop_iteration) ConstIterator::value() const; - %catches(swig::stop_iteration) ConstIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) ConstIterator::decr(size_t n = 1); - %catches(std::invalid_argument) ConstIterator::distance(const ConstIterator &x) const; - %catches(std::invalid_argument) ConstIterator::equal (const ConstIterator &x) const; - %catches(swig::stop_iteration) ConstIterator::next(); - %catches(swig::stop_iteration) ConstIterator::previous(); - %catches(swig::stop_iteration) ConstIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) ConstIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) ConstIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) ConstIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) ConstIterator::operator - (ptrdiff_t n) const; - - - struct ConstIterator - { - protected: - ConstIterator(VALUE seq); - - public: - virtual ~ConstIterator(); - - // Access iterator method, required by Ruby - virtual VALUE value() const; - - // C++ common/needed methods - virtual ConstIterator *dup() const; - - virtual VALUE inspect() const; - virtual VALUE to_s() const; - - virtual ConstIterator* next(size_t n = 1); - virtual ConstIterator* previous(size_t n = 1); - - bool operator == (const ConstIterator& x) const; - ConstIterator* operator + (ptrdiff_t n) const; - ConstIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const ConstIterator& x) const; - }; - - struct Iterator : public ConstIterator - { - %rename("value=") setValue( const VALUE& v ); - virtual VALUE setValue( const VALUE& v ); - - virtual Iterator *dup() const; - - virtual Iterator* next(size_t n = 1); - virtual Iterator* previous(size_t n = 1); - - virtual VALUE inspect() const; - virtual VALUE to_s() const; - - bool operator == (const Iterator& x) const; - Iterator* operator + (ptrdiff_t n) const; - Iterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const Iterator& x) const; - }; - -} - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubykw.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubykw.swg deleted file mode 100755 index 6b4685eb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubykw.swg +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef RUBY_RUBYKW_SWG_ -#define RUBY_RUBYKW_SWG_ - -/* Warnings for Ruby keywords */ -#define RUBYKW(x) %keywordwarn("'" `x` "' is a ruby keyword",rename="C_%s",fullname=1) `x` - -/* - - from http://www.rubycentral.com/book/language.html - -*/ - -RUBYKW(BEGIN); -RUBYKW(END); -RUBYKW(alias); -RUBYKW(and); -RUBYKW(begin); -RUBYKW(break); -RUBYKW(case); -RUBYKW(class); -RUBYKW(def); -RUBYKW("defined"); -RUBYKW(do); -RUBYKW(else); -RUBYKW(elsif); -RUBYKW(end); -RUBYKW(ensure); -RUBYKW(false); -RUBYKW(fatal); -RUBYKW(for); -RUBYKW(if); -RUBYKW(in); -RUBYKW(module); -RUBYKW(next); -RUBYKW(nil); -RUBYKW(not); -RUBYKW(or); -RUBYKW(redo); -RUBYKW(rescue); -RUBYKW(retry); -RUBYKW(return); -RUBYKW(self); -RUBYKW(super); -RUBYKW(then); -RUBYKW(true); -RUBYKW(undef); -RUBYKW(unless); -RUBYKW(until); -RUBYKW(when); -RUBYKW(while); -RUBYKW(yield); - -// RUBYKW(FalseClass); -// RUBYKW(TrueClass); -// RUBYKW(Numeric); -// RUBYKW(Integer); -// RUBYKW(Fixnum); -// RUBYKW(Float); -// RUBYKW(Range); -// RUBYKW(Array); -// RUBYKW(String); -// RUBYKW(IO); -// RUBYKW(File); -// RUBYKW(FileUtils); -// RUBYKW(Find); -// RUBYKW(Struct); -// RUBYKW(OpenStruct); -// RUBYKW(Regexp); - -#undef RUBYKW - -#endif //RUBY_RUBYKW_SWG_ diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubymacros.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubymacros.swg deleted file mode 100755 index de2a52ba..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubymacros.swg +++ /dev/null @@ -1,13 +0,0 @@ - -// Redefine these macros so argument index for ruby is done properly, -// ignoring self and we get some more info about the input. -#define %argfail_fmt(_type,_name,_argn) Ruby_Format_TypeError( "", _type, #_name, _argn, $input ) - -#define %argnullref_fmt(_type,_name,_argn) Ruby_Format_TypeError(%nullref_fmt(), _type, #_name, _argn, $input) - -%{ -#define SWIG_RUBY_THREAD_BEGIN_BLOCK -#define SWIG_RUBY_THREAD_END_BLOCK -%} - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyopers.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyopers.swg deleted file mode 100755 index d1ac8bf0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyopers.swg +++ /dev/null @@ -1,55 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus - -%rename(__add__) *::operator+; -%rename(__pos__) *::operator+(); -%rename(__pos__) *::operator+() const; -%rename(__sub__) *::operator-; -%rename(__neg__) *::operator-(); -%rename(__neg__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__mod__) *::operator%; -%rename(__lshift__) *::operator<<; -%rename(__rshift__) *::operator>>; -%rename(__and__) *::operator&; -%rename(__or__) *::operator|; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__lt__) *::operator<; -%rename(__le__) *::operator<=; -%rename(__gt__) *::operator>; -%rename(__ge__) *::operator>=; -%rename(__eq__) *::operator==; - -/* Special cases */ -%rename(__call__) *::operator(); - -/* Ignored inplace operators */ -%ignoreoperator(NOTEQUAL) operator!=; -%ignoreoperator(PLUSEQ) operator+=; -%ignoreoperator(MINUSEQ) operator-=; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; - -/* Ignored operators */ -%ignoreoperator(LNOT) operator!; -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; -%ignoreoperator(EQ) operator=; -%ignoreoperator(PLUSPLUS) operator++; -%ignoreoperator(MINUSMINUS) operator--; -%ignoreoperator(ARROWSTAR) operator->*; -%ignoreoperator(INDEX) operator[]; - - -#endif /* __cplusplus */ diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyprimtypes.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyprimtypes.swg deleted file mode 100755 index 4b078dee..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyprimtypes.swg +++ /dev/null @@ -1,228 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyprimtypes.swg - * ----------------------------------------------------------------------------- */ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* auxiliary ruby fail method */ - -%fragment("SWIG_ruby_failed","header") -{ -SWIGINTERN VALUE -SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2)) -{ - return Qnil; -} -} - -%define %ruby_aux_method(Type, Method, Action) -SWIGINTERN VALUE SWIG_AUX_##Method##(VALUE arg) -{ - VALUE *args = (VALUE *)arg; - VALUE obj = args[0]; - VALUE type = TYPE(obj); - Type *res = (Type *)(args[1]); - *res = Action; - return obj; -} -%enddef - - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE VALUE -SWIG_From_dec(bool)(bool value) -{ - return value ? Qtrue : Qfalse; -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(int)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(VALUE obj, bool *val) -{ - if (obj == Qtrue) { - if (val) *val = true; - return SWIG_OK; - } else if (obj == Qfalse) { - if (val) *val = false; - return SWIG_OK; - } else { - int res = 0; - if (SWIG_AsVal(int)(obj, &res) == SWIG_OK) { - if (val) *val = res ? true : false; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header", - fragment="") { - %define_as(SWIG_From_dec(long), LONG2NUM) -} - -%fragment(SWIG_AsVal_frag(long),"header",fragment="SWIG_ruby_failed") { -%ruby_aux_method(long, NUM2LONG, type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(long)(VALUE obj, long* val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE VALUE -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return ULONG2NUM(value); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header",fragment="SWIG_ruby_failed") { -%ruby_aux_method(unsigned long, NUM2ULONG, type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(VALUE obj, unsigned long *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - unsigned long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE VALUE -SWIG_From_dec(long long)(long long value) -{ - return LL2NUM(value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_ruby_failed", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -%ruby_aux_method(long long, NUM2LL, type == T_FIXNUM ? NUM2LL(obj) : rb_big2ll(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(long long)(VALUE obj, long long *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - long long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE VALUE -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return ULL2NUM(value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_ruby_failed", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -%ruby_aux_method(long long, NUM2ULL, type == T_FIXNUM ? NUM2ULL(obj) : rb_big2ull(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(VALUE obj, unsigned long long *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - unsigned long long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { - %define_as(SWIG_From_dec(double), rb_float_new) -} - -%fragment(SWIG_AsVal_frag(double),"header",fragment="SWIG_ruby_failed") { -%ruby_aux_method(double, NUM2DBL, NUM2DBL(obj); (void)type) - -SWIGINTERN int -SWIG_AsVal_dec(double)(VALUE obj, double *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) { - double v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2DBL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyrun.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyrun.swg deleted file mode 100755 index 6cac4626..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyrun.swg +++ /dev/null @@ -1,468 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyrun.swg - * - * This file contains the runtime support for Ruby modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 - -/* for raw pointers */ -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags) -#define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own) -#define swig_owntype swig_ruby_owntype - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code) -#define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg) -#define SWIG_fail goto fail - - -/* Ruby-specific SWIG API */ - -#define SWIG_InitRuntime() SWIG_Ruby_InitRuntime() -#define SWIG_define_class(ty) SWIG_Ruby_define_class(ty) -#define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty) -#define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value) -#define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty) - -#include "assert.h" - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - VALUE klass; - VALUE mImpl; - void (*mark)(void *); - void (*destroy)(void *); - int trackObjects; -} swig_class; - - -/* Global pointer used to keep some internal SWIG stuff */ -static VALUE _cSWIG_Pointer = Qnil; -static VALUE swig_runtime_data_type_pointer = Qnil; - -/* Global IDs used to keep some internal SWIG stuff */ -static ID swig_arity_id = 0; -static ID swig_call_id = 0; - -/* - If your swig extension is to be run within an embedded ruby and has - director callbacks, you should set -DRUBY_EMBEDDED during compilation. - This will reset ruby's stack frame on each entry point from the main - program the first time a virtual director function is invoked (in a - non-recursive way). - If this is not done, you run the risk of Ruby trashing the stack. -*/ - -#ifdef RUBY_EMBEDDED - -# define SWIG_INIT_STACK \ - if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \ - ++swig_virtual_calls; -# define SWIG_RELEASE_STACK --swig_virtual_calls; -# define Ruby_DirectorTypeMismatchException(x) \ - rb_raise( rb_eTypeError, "%s", x ); return c_result; - - static unsigned int swig_virtual_calls = 0; - -#else /* normal non-embedded extension */ - -# define SWIG_INIT_STACK -# define SWIG_RELEASE_STACK -# define Ruby_DirectorTypeMismatchException(x) \ - throw Swig::DirectorTypeMismatchException( x ); - -#endif /* RUBY_EMBEDDED */ - - -SWIGRUNTIME VALUE -getExceptionClass(void) { - static int init = 0; - static VALUE rubyExceptionClass ; - if (!init) { - init = 1; - rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception")); - } - return rubyExceptionClass; -} - -/* This code checks to see if the Ruby object being raised as part - of an exception inherits from the Ruby class Exception. If so, - the object is simply returned. If not, then a new Ruby exception - object is created and that will be returned to Ruby.*/ -SWIGRUNTIME VALUE -SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) { - VALUE exceptionClass = getExceptionClass(); - if (rb_obj_is_kind_of(obj, exceptionClass)) { - return obj; - } else { - return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj)); - } -} - -/* Initialize Ruby runtime support */ -SWIGRUNTIME void -SWIG_Ruby_InitRuntime(void) -{ - if (_mSWIG == Qnil) { - _mSWIG = rb_define_module("SWIG"); - swig_call_id = rb_intern("call"); - swig_arity_id = rb_intern("arity"); - } -} - -/* Define Ruby class for C type */ -SWIGRUNTIME void -SWIG_Ruby_define_class(swig_type_info *type) -{ - char *klass_name = (char *) malloc(4 + strlen(type->name) + 1); - sprintf(klass_name, "TYPE%s", type->name); - if (NIL_P(_cSWIG_Pointer)) { - _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject); - rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new"); - } - rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer); - free((void *) klass_name); -} - -/* Create a new pointer object */ -SWIGRUNTIME VALUE -SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags) -{ - int own = flags & SWIG_POINTER_OWN; - int track; - char *klass_name; - swig_class *sklass; - VALUE klass; - VALUE obj; - - if (!ptr) - return Qnil; - - assert(type); - if (type->clientdata) { - sklass = (swig_class *) type->clientdata; - - /* Are we tracking this class and have we already returned this Ruby object? */ - track = sklass->trackObjects; - if (track) { - obj = SWIG_RubyInstanceFor(ptr); - - /* Check the object's type and make sure it has the correct type. - It might not in cases where methods do things like - downcast methods. */ - if (obj != Qnil) { - VALUE value = rb_iv_get(obj, "@__swigtype__"); - const char* type_name = RSTRING_PTR(value); - - if (strcmp(type->name, type_name) == 0) { - return obj; - } - } - } - - /* Create a new Ruby object */ - obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), - ( own ? VOIDFUNC(sklass->destroy) : - (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 ) - ), ptr); - - /* If tracking is on for this class then track this object. */ - if (track) { - SWIG_RubyAddTracking(ptr, obj); - } - } else { - klass_name = (char *) malloc(4 + strlen(type->name) + 1); - sprintf(klass_name, "TYPE%s", type->name); - klass = rb_const_get(_mSWIG, rb_intern(klass_name)); - free((void *) klass_name); - obj = Data_Wrap_Struct(klass, 0, 0, ptr); - } - rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); - - return obj; -} - -/* Create a new class instance (always owned) */ -SWIGRUNTIME VALUE -SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type) -{ - VALUE obj; - swig_class *sklass = (swig_class *) type->clientdata; - obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0); - rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); - return obj; -} - -/* Get type mangle from class name */ -SWIGRUNTIMEINLINE char * -SWIG_Ruby_MangleStr(VALUE obj) -{ - VALUE stype = rb_iv_get(obj, "@__swigtype__"); - if (NIL_P(stype)) - return NULL; - return StringValuePtr(stype); -} - -/* Acquire a pointer value */ -typedef struct { - void (*datafree)(void *); - int own; -} swig_ruby_owntype; - -SWIGRUNTIME swig_ruby_owntype -SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) { - swig_ruby_owntype oldown = {0, 0}; - if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) { - oldown.datafree = RDATA(obj)->dfree; - RDATA(obj)->dfree = own.datafree; - } - return oldown; -} - -/* Convert a pointer value */ -SWIGRUNTIME int -SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, swig_ruby_owntype *own) -{ - char *c; - swig_cast_info *tc; - void *vptr = 0; - - /* Grab the pointer */ - if (NIL_P(obj)) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } else { - if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) { - return SWIG_ERROR; - } - Data_Get_Struct(obj, void, vptr); - } - - if (own) { - own->datafree = RDATA(obj)->dfree; - own->own = 0; - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE)) { - if (!RDATA(obj)->dfree) - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - - /* Check to see if the input object is giving up ownership - of the underlying C struct or C++ object. If so then we - need to reset the destructor since the Ruby object no - longer owns the underlying C++ object.*/ - if (flags & SWIG_POINTER_DISOWN) { - /* Is tracking on for this class? */ - int track = 0; - if (ty && ty->clientdata) { - swig_class *sklass = (swig_class *) ty->clientdata; - track = sklass->trackObjects; - } - - if (track) { - /* We are tracking objects for this class. Thus we change the destructor - * to SWIG_RubyRemoveTracking. This allows us to - * remove the mapping from the C++ to Ruby object - * when the Ruby object is garbage collected. If we don't - * do this, then it is possible we will return a reference - * to a Ruby object that no longer exists thereby crashing Ruby. */ - RDATA(obj)->dfree = SWIG_RubyRemoveTracking; - } else { - RDATA(obj)->dfree = 0; - } - } - - if (flags & SWIG_POINTER_CLEAR) { - DATA_PTR(obj) = 0; - } - - /* Do type-checking if type info was provided */ - if (ty) { - if (ty->clientdata) { - if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) { - if (vptr == 0) { - /* The object has already been deleted */ - return SWIG_ObjectPreviouslyDeletedError; - } - } - } - if ((c = SWIG_MangleStr(obj)) == NULL) { - return SWIG_ERROR; - } - tc = SWIG_TypeCheck(c, ty); - if (!tc) { - return SWIG_ERROR; - } else { - if (ptr) { - if (tc->type == ty) { - *ptr = vptr; - } else { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, vptr, &newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - own->own = own->own | SWIG_CAST_NEW_MEMORY; - } - } - } - } - } else { - if (ptr) - *ptr = vptr; - } - - return SWIG_OK; -} - -/* Check convert */ -SWIGRUNTIMEINLINE int -SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty) -{ - char *c = SWIG_MangleStr(obj); - if (!c) return 0; - return SWIG_TypeCheck(c,ty) != 0; -} - -SWIGRUNTIME VALUE -SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; - *(r++) = '_'; - r = SWIG_PackData(r, ptr, sz); - strcpy(r, type->name); - return rb_str_new2(result); -} - -/* Convert a packed pointer value */ -SWIGRUNTIME int -SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c; - - if (TYPE(obj) != T_STRING) goto type_error; - c = StringValuePtr(obj); - /* Pointer values must start with leading underscore */ - if (*c != '_') goto type_error; - c++; - c = SWIG_UnpackData(c, ptr, sz); - if (ty) { - tc = SWIG_TypeCheck(c, ty); - if (!tc) goto type_error; - } - return SWIG_OK; - - type_error: - return SWIG_ERROR; -} - -SWIGRUNTIME swig_module_info * -SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata)) -{ - VALUE pointer; - swig_module_info *ret = 0; - VALUE verbose = rb_gv_get("VERBOSE"); - - /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */ - rb_gv_set("VERBOSE", Qfalse); - - /* first check if pointer already created */ - pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - if (pointer != Qnil) { - Data_Get_Struct(pointer, swig_module_info, ret); - } - - /* reinstate warnings */ - rb_gv_set("VERBOSE", verbose); - return ret; -} - -SWIGRUNTIME void -SWIG_Ruby_SetModule(swig_module_info *pointer) -{ - /* register a new class */ - VALUE cl = rb_define_class("swig_runtime_data", rb_cObject); - rb_undef_alloc_func(cl); - /* create and store the structure pointer to a global variable */ - swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer); - rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer); -} - -/* This function can be used to check whether a proc or method or similarly - callable function has been passed. Usually used in a %typecheck, like: - - %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) { - $result = SWIG_Ruby_isCallable( $input ); - } - */ -SWIGINTERN -int SWIG_Ruby_isCallable( VALUE proc ) -{ - if ( rb_respond_to( proc, swig_call_id ) ) - return 1; - return 0; -} - -/* This function can be used to check the arity (number of arguments) - a proc or method can take. Usually used in a %typecheck. - Valid arities will be that equal to minimal or those < 0 - which indicate a variable number of parameters at the end. - */ -SWIGINTERN -int SWIG_Ruby_arity( VALUE proc, int minimal ) -{ - if ( rb_respond_to( proc, swig_arity_id ) ) - { - VALUE num = rb_funcall2( proc, swig_arity_id, 0, 0 ); - int arity = NUM2INT(num); - if ( arity < 0 && (arity+1) < -minimal ) return 1; - if ( arity == minimal ) return 1; - return 1; - } - return 0; -} - - -#ifdef __cplusplus -} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyruntime.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyruntime.swg deleted file mode 100755 index 41215614..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyruntime.swg +++ /dev/null @@ -1,9 +0,0 @@ - -%runtime "swiglabels.swg" /* Common C API type-checking code */ -%runtime "swigrun.swg" /* Common C API type-checking code */ -%runtime "swigerrors.swg" /* SWIG errors */ -%runtime "rubyhead.swg" /* Ruby includes and fixes */ -%runtime "rubyerrors.swg" /* Ruby errors */ -%runtime "rubytracking.swg" /* API for tracking C++ classes to Ruby objects */ -%runtime "rubyapi.swg" -%runtime "rubyrun.swg" diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubystdautodoc.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubystdautodoc.swg deleted file mode 100755 index e14f6590..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubystdautodoc.swg +++ /dev/null @@ -1,33 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubystdautodoc.swg - * - * This file contains autodocs for standard STL functions. - * ----------------------------------------------------------------------------- */ - -// -// For STL autodocumentation -// -AUTODOC(c_str, "Convert class to a String representation"); -AUTODOC(begin, "Return an iterator to the beginning of the $class"); -AUTODOC(end, "Return an iterator to past the end of the $class"); -AUTODOC(rbegin, "Return a reverse iterator to the beginning (the end) of the $class"); -AUTODOC(rend, "Return a reverse iterator to past the end (past the beginning) of the $class"); -AUTODOC(length, "Size or Length of the $class"); -AUTODOC(replace, "Replace all or a portion of the $class"); -AUTODOC(resize, "Resize the size of the $class"); -AUTODOC(capacity, "Reserved capacity of the $class"); -AUTODOC(reserve, "Reserve memory in the $class for a number of elements"); -AUTODOC(erase, "Delete a portion of the $class"); -AUTODOC(max_size, "Maximum size of elements allowed in the $class"); -AUTODOC(iterator, "Return an iterator to the $class"); -AUTODOC(empty, "Check if the $class is empty or not"); -AUTODOC(rfind, "Find an element in reverse usually starting from the end of the $class"); -AUTODOC(assign, "Assign a new $class or portion of it"); -AUTODOC(front, "Return the first element in $class"); -AUTODOC(back, "Return the last element in $class"); -AUTODOC(second, "Return the second element in $class"); -AUTODOC(push_front, "Add an element at the beginning of the $class"); -AUTODOC(push_back, "Add an element at the end of the $class"); -AUTODOC(pop_front, "Remove and return element at the beginning of the $class"); -AUTODOC(pop_back, "Remove and return an element at the end of the $class"); -AUTODOC(clear, "Clear $class contents"); diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubystdcommon.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubystdcommon.swg deleted file mode 100755 index 99dd7f81..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubystdcommon.swg +++ /dev/null @@ -1,199 +0,0 @@ - -/* ------------------------------------------------------------ - * The Ruby classes, for C++ - * ------------------------------------------------------------ */ -%include -%include - -%fragment("StdTraits","header",fragment="StdTraitsCommon",fragment="StdTraitsForwardDeclaration") -{ - -namespace swig { - /* - Traits that provides the from method - */ - template struct traits_from_ptr { - static VALUE from(Type *val, int owner = 0) { - return SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static VALUE from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static VALUE from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static VALUE from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline VALUE from(const Type& val) { - return traits_from::from(val); - } - - template - inline VALUE from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - /* - Traits that provides the asval/as/check method - */ - template - struct traits_asptr { - static int asptr(VALUE obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(VALUE obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(VALUE obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(VALUE obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(VALUE obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(VALUE obj) { - Type v; - int res = asval(obj, &v); - if (!SWIG_IsOK(res)) { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(VALUE obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(VALUE obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(VALUE obj) { - return traits_as< Type, typename traits< Type >::category >::as(obj); - } - - template - struct traits_check { - static bool check(VALUE obj) { - int res = asval(obj, (Type *)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(VALUE obj) { - int res = asptr(obj, (Type **)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(VALUE obj) { - return traits_check::category>::check(obj); - } -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubystdcommon_forward.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubystdcommon_forward.swg deleted file mode 100755 index 4120b38e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubystdcommon_forward.swg +++ /dev/null @@ -1,15 +0,0 @@ -%fragment("StdTraitsForwardDeclaration","header") -{ -namespace swig { - template struct traits_asptr; - template struct traits_asval; - struct pointer_category; - template struct traits_as; - template struct traits_from; - template struct traits_from_ptr; - template struct noconst_traits; - template swig_type_info* type_info(); - template const char* type_name(); - template VALUE from(const Type& val); -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubystdfunctors.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubystdfunctors.swg deleted file mode 100755 index 5150333c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubystdfunctors.swg +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @file rubystdfunctors.swg - * @date Sun May 6 00:44:33 2007 - * - * @brief This file provides unary and binary functors for STL - * containers, that will invoke a Ruby proc or method to do - * their operation. - * - * You can use them in a swig file like: - * - * %include - * %include - * - * %template< IntSet > std::set< int, swig::BinaryPredicate<> >; - * - * - * which will then allow calling them from Ruby either like: - * - * # order of set is defined by C++ default - * a = IntSet.new - * - * # sort order defined by Ruby proc - * b = IntSet.new( proc { |a,b| a > b } ) - * - */ - -%include rubyclasses.swg - - -namespace swig { - - %apply GC_VALUE { UnaryPredicate, BinaryPredicate, UnaryFunction, - BinaryFunction }; - - %typecheck(SWIG_TYPECHECK_POINTER,noblock=1) - UnaryPredicate, UnaryPredicate&, UnaryFunction, UnaryFunction& - { - $1 = SWIG_Ruby_isCallable($input) && SWIG_Ruby_arity($input, 1); - } - - %typecheck(SWIG_TYPECHECK_POINTER,noblock=1) - BinaryPredicate, BinaryPredicate&, BinaryFunction, BinaryFunction& { - $1 = SWIG_Ruby_isCallable($input) && SWIG_Ruby_arity($input, 2); - } - - %typemap(in,noblock=1) BinaryFunction&, BinaryFunction { - $1 = new swig::BinaryFunction< >($input); - } - %typemap(in,noblock=1) UnaryFunction&, UnaryFunction { - $1 = new swig::UnaryFunction< >($input); - } - - %typemap(in,noblock=1) BinaryPredicate&, BinaryPredicate { - $1 = new swig::BinaryPredicate<>($input); - } - - %typemap(in,noblock=1) UnaryPredicate&, UnaryPredicate { - $1 = new swig::UnaryPredicate< >($input); - } - - - %ignore BinaryFunction; - template< class _T = GC_VALUE > - struct BinaryFunction { - }; - - %ignore UnaryFunction; - template< class _T = GC_VALUE > - struct UnaryFunction { - }; - - %ignore BinaryPredicate; - template< class _T = GC_VALUE > - struct BinaryPredicate { - }; - - %ignore UnaryPredicate; - template< class _T = GC_VALUE > - struct UnaryPredicate { - - }; - -} - - -%fragment("StdFunctors","header",fragment="StdTraits",fragment="GC_VALUE_definition") -{ -namespace swig { - - static ID call_id = rb_intern("call"); - - template > - struct BinaryPredicate : GC_VALUE - { - BinaryPredicate(VALUE obj = Qnil) : GC_VALUE(obj) { } - bool operator()(_T a, _T b) const - { - if (_obj != Qnil) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from(a); - VALUE arg2 = swig::from(b); - VALUE res = rb_funcall( _obj, swig::call_id, 2, arg1, arg2); - SWIG_RUBY_THREAD_END_BLOCK; - return RTEST(res); - } else { - return _DefaultFunc()(a, b); - } - } - }; - - template > - struct BinaryFunction : GC_VALUE - { - BinaryFunction(VALUE obj = Qnil) : GC_VALUE(obj) { } - _T operator()(_T a, _T b) const - { - if (_obj != Qnil) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from(a); - VALUE arg2 = swig::from(b); - VALUE res = rb_funcall( _obj, swig::call_id, 2, arg1, arg2); - SWIG_RUBY_THREAD_END_BLOCK; - return swig::as<_T >(res); - } else { - return _DefaultFunc()(a, b); - } - } - }; - - template< class _T = GC_VALUE > - struct UnaryPredicate : GC_VALUE - { - UnaryPredicate(VALUE obj = Qnil) : GC_VALUE(obj) { } - bool operator()(_T a) const - { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from<_T >(a); - VALUE res = rb_funcall( _obj, swig::call_id, 1, arg1); - SWIG_RUBY_THREAD_END_BLOCK; - return RTEST(res); - } - }; - - template< class _T = GC_VALUE > - struct UnaryFunction : GC_VALUE - { - UnaryFunction(VALUE obj = Qnil) : GC_VALUE(obj) { } - _T operator()(_T a) const - { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from(a); - VALUE res = rb_funcall( _obj, swig::call_id, 1, VALUE(arg1)); - SWIG_RUBY_THREAD_END_BLOCK; - return swig::as< _T >(res); - } - }; - -} // namespace swig - -} - - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubystrings.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubystrings.swg deleted file mode 100755 index 3adf0008..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubystrings.swg +++ /dev/null @@ -1,57 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc) -{ - if (TYPE(obj) == T_STRING) { - char *cstr = StringValuePtr(obj); - size_t size = RSTRING_LEN(obj) + 1; - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, size, char); - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } - } - if (psize) *psize = size; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *)vptr; - if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE VALUE -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > LONG_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_NewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : Qnil; - } else { - return rb_str_new(carray, %numeric_cast(size,long)); - } - } else { - return Qnil; - } -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubytracking.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubytracking.swg deleted file mode 100755 index 1edcc568..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubytracking.swg +++ /dev/null @@ -1,136 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubytracking.swg - * - * This file contains support for tracking mappings from - * Ruby objects to C++ objects. This functionality is needed - * to implement mark functions for Ruby's mark and sweep - * garbage collector. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(ST_DATA_T_DEFINED) -/* Needs to be explicitly included for Ruby 1.8 and earlier */ -#include -#endif - -/* Ruby 1.8 actually assumes the first case. */ -#if SIZEOF_VOIDP == SIZEOF_LONG -# define SWIG2NUM(v) LONG2NUM((unsigned long)v) -# define NUM2SWIG(x) (unsigned long)NUM2LONG(x) -#elif SIZEOF_VOIDP == SIZEOF_LONG_LONG -# define SWIG2NUM(v) LL2NUM((unsigned long long)v) -# define NUM2SWIG(x) (unsigned long long)NUM2LL(x) -#else -# error sizeof(void*) is not the same as long or long long -#endif - -/* Global hash table to store Trackings from C/C++ - structs to Ruby Objects. -*/ -static st_table* swig_ruby_trackings = NULL; - -static VALUE swig_ruby_trackings_count(ID id, VALUE *var) { - return SWIG2NUM(swig_ruby_trackings->num_entries); -} - - -/* Setup a hash table to store Trackings */ -SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) { - /* Create a hash table to store Trackings from C++ - objects to Ruby objects. */ - - /* Try to see if some other .so has already created a - tracking hash table, which we keep hidden in an instance var - in the SWIG module. - This is done to allow multiple DSOs to share the same - tracking table. - */ - VALUE trackings_value = Qnil; - /* change the variable name so that we can mix modules - compiled with older SWIG's - this used to be called "@__trackings__" */ - ID trackings_id = rb_intern( "@__safetrackings__" ); - VALUE verbose = rb_gv_get("VERBOSE"); - rb_gv_set("VERBOSE", Qfalse); - trackings_value = rb_ivar_get( _mSWIG, trackings_id ); - rb_gv_set("VERBOSE", verbose); - - /* The trick here is that we have to store the hash table - pointer in a Ruby variable. We do not want Ruby's GC to - treat this pointer as a Ruby object, so we convert it to - a Ruby numeric value. */ - if (trackings_value == Qnil) { - /* No, it hasn't. Create one ourselves */ - swig_ruby_trackings = st_init_numtable(); - rb_ivar_set( _mSWIG, trackings_id, SWIG2NUM(swig_ruby_trackings) ); - } else { - swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value); - } - - rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", - VALUEFUNC(swig_ruby_trackings_count), - SWIG_RUBY_VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL)); -} - -/* Add a Tracking from a C/C++ struct to a Ruby object */ -SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) { - /* Store the mapping to the global hash table. */ - st_insert(swig_ruby_trackings, (st_data_t)ptr, object); -} - -/* Get the Ruby object that owns the specified C/C++ struct */ -SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) { - /* Now lookup the value stored in the global hash table */ - VALUE value; - - if (st_lookup(swig_ruby_trackings, (st_data_t)ptr, &value)) { - return value; - } else { - return Qnil; - } -} - -/* Remove a Tracking from a C/C++ struct to a Ruby object. It - is very important to remove objects once they are destroyed - since the same memory address may be reused later to create - a new object. */ -SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) { - /* Delete the object from the hash table */ - st_delete(swig_ruby_trackings, (st_data_t *)&ptr, NULL); -} - -/* This is a helper method that unlinks a Ruby object from its - underlying C++ object. This is needed if the lifetime of the - Ruby object is longer than the C++ object. */ -SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) { - VALUE object = SWIG_RubyInstanceFor(ptr); - - if (object != Qnil) { - // object might have the T_ZOMBIE type, but that's just - // because the GC has flagged it as such for a deferred - // destruction. Until then, it's still a T_DATA object. - DATA_PTR(object) = 0; - } -} - -/* This is a helper method that iterates over all the trackings - passing the C++ object pointer and its related Ruby object - to the passed callback function. */ - -/* Proxy method to abstract the internal trackings datatype */ -static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) { - ((void (*) (void *, VALUE))meth)((void *)ptr, (VALUE)obj); - return ST_CONTINUE; -} - -SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) { - st_foreach(swig_ruby_trackings, - SWIG_RUBY_INT_ANYARGS_FUNC(swig_ruby_internal_iterate_callback), - (st_data_t)meth); -} - -#ifdef __cplusplus -} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubytypemaps.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubytypemaps.swg deleted file mode 100755 index 3837df07..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubytypemaps.swg +++ /dev/null @@ -1,62 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Ruby - * ------------------------------------------------------------ */ -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ -/* bool is dangerous in Ruby, change precedence */ -#undef SWIG_TYPECHECK_BOOL -%define SWIG_TYPECHECK_BOOL 10000 %enddef - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Ruby fragments for primitive types */ -%include - -/* Ruby fragments for char* strings */ -%include - -/* Backward compatibility output helper */ -%fragment("output_helper","header") %{ -#define output_helper SWIG_Ruby_AppendOutput -%} - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* Directors are supported in Ruby */ -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Ruby types */ -#define SWIG_Object VALUE -#define VOID_Object Qnil - -/* Overload of the output/constant/exception handling */ - -/* append output */ -#define SWIG_AppendOutput(result,obj) SWIG_Ruby_AppendOutput(result, obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) rb_define_const($module, name, obj) - -/* raise */ -#define SWIG_Raise(obj, type, desc) rb_exc_raise(SWIG_Ruby_ExceptionType(desc, obj)) - -/* Get the address of the 'Ruby self' object */ - -%typemap(in,numinputs=0,noblock=1) VALUE* RUBY_SELF { - $1 = &self; -} - -/* Include the unified typemap library */ -%include - - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubyuserdir.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubyuserdir.swg deleted file mode 100755 index 1689c7f0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubyuserdir.swg +++ /dev/null @@ -1,20 +0,0 @@ -#define %alias %feature("alias") -#define %freefunc %feature("freefunc") -#define %markfunc %feature("markfunc") -#define %mixin %feature("mixin") -#define %predicate %feature("predicate", "1") -#define %bang %feature("bang", "1") -#define %trackobjects %feature("trackobjects") -#define %nooutput %feature("outputs","0") -#define %initstack %feature("initstack", "1") -#define %ignorestack %feature("initstack", "0") - -/* ------------------------------------------------------------------------- */ -/* - Enable keywords parameters -*/ - -#define %kwargs %feature("kwargs") -#define %nokwargs %feature("kwargs", "0") -#define %clearkwargs %feature("kwargs", "") - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/rubywstrings.swg b/linux/bin/swig/share/swig/4.1.0/ruby/rubywstrings.swg deleted file mode 100755 index 7da6f4bf..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/rubywstrings.swg +++ /dev/null @@ -1,58 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubywstrings.swg - * - * utility methods for wchar_t strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_AsCharPtrAndSize",fragment="SWIG_ruby_wstring_encoding_init") { -SWIGINTERN int -SWIG_AsWCharPtrAndSize(VALUE obj, wchar_t **cptr, size_t *psize, int *alloc) -{ - rb_encoding* wstr_enc = swig_ruby_wstring_encoding; - - if (TYPE(obj) == T_STRING) { - VALUE rstr = rb_str_conv_enc(obj, rb_enc_get(obj), wstr_enc); - wchar_t* cstr = (wchar_t*) StringValuePtr(rstr); - size_t size = RSTRING_LEN(rstr) / sizeof(wchar_t) + 1; - - if ( RSTRING_LEN(rstr) % sizeof(wchar_t) != 0 ) { - rb_raise(rb_eRuntimeError, - "The length of the byte sequence of converted string is not a multiplier of sizeof(wchar_t). Invalid byte sequence is given. Or invalid SWIG_RUBY_WSTRING_ENCODING is given when compiling this binding."); - } - if (cptr && alloc) { - *alloc = SWIG_NEWOBJ; - *cptr = %new_array(size, wchar_t); - memmove(*cptr, cstr, RSTRING_LEN(rstr)); - } - if (psize) *psize = size; - - return SWIG_OK; - } else { - return SWIG_TypeError; - } -} -} - -%fragment("SWIG_FromWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_FromCharPtrAndSize",fragment="SWIG_ruby_wstring_encoding_init") { -SWIGINTERNINLINE VALUE -SWIG_FromWCharPtrAndSize(const wchar_t * carray, size_t size) -{ - rb_encoding* wstr_enc = swig_ruby_wstring_encoding; - rb_encoding* rb_enc = swig_ruby_internal_encoding; - - if (carray && size <= LONG_MAX/sizeof(wchar_t)) { - VALUE rstr = rb_str_new( (const char*)carray, %numeric_cast(size*sizeof(wchar_t),long) ); - rb_encoding* new_enc = rb_default_internal_encoding(); - - rb_enc_associate(rstr, wstr_enc); - if ( !new_enc ) { - new_enc = rb_enc; - } - return rb_str_conv_enc(rstr, wstr_enc, new_enc); - } else { - return Qnil; - } -} -} - - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_alloc.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_alloc.i deleted file mode 100755 index 35dc051b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_array.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_array.i deleted file mode 100755 index a4d3ef54..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_array.i +++ /dev/null @@ -1,102 +0,0 @@ -/* - std::array -*/ - -%fragment("StdArrayTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::array **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::array& vec) { - return traits_from_stdseq >::from(vec); - } - }; - - template - inline void - assign(const RubySeq& rubyseq, std::array* seq) { - if (rubyseq.size() < seq->size()) - throw std::invalid_argument("std::array cannot be expanded in size"); - else if (rubyseq.size() > seq->size()) - throw std::invalid_argument("std::array cannot be reduced in size"); - std::copy(rubyseq.begin(), rubyseq.end(), seq->begin()); - } - - template - inline void - resize(std::array *seq, typename std::array::size_type n, typename std::array::value_type x) { - throw std::invalid_argument("std::array is a fixed size container and does not support resizing"); - } - - // Only limited slicing is supported as std::array is fixed in size - template - inline std::array* - getslice(const std::array* self, Difference i, Difference j) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, (i == size && j == size)); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (ii == 0 && jj == size) { - Sequence *sequence = new Sequence(); - std::copy(self->begin(), self->end(), sequence->begin()); - return sequence; - } else { - throw std::invalid_argument("std::array object only supports getting a slice that is the size of the array"); - } - } - - template - inline void - setslice(std::array* self, Difference i, Difference j, const InputSeq& v) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (ii == 0 && jj == size) { - std::copy(v.begin(), v.end(), self->begin()); - } else { - throw std::invalid_argument("std::array object only supports setting a slice that is the size of the array"); - } - } - - template - inline void - delslice(std::array* self, Difference i, Difference j) { - throw std::invalid_argument("std::array object does not support item deletion"); - } - } -%} - - -%define %swig_array_methods(Type...) - %swig_sequence_methods_non_resizable(Type) -%enddef - -%define %swig_array_methods_val(Type...) - %swig_sequence_methods_non_resizable_val(Type); -%enddef - - -%mixin std::array "Enumerable"; -%ignore std::array::push_back; -%ignore std::array::pop_back; - - -%rename("delete") std::array::__delete__; -%rename("reject!") std::array::reject_bang; -%rename("map!") std::array::map_bang; -%rename("empty?") std::array::empty; -%rename("include?" ) std::array::__contains__ const; -%rename("has_key?" ) std::array::has_key const; - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_basic_string.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_basic_string.i deleted file mode 100755 index ba13ba76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_basic_string.i +++ /dev/null @@ -1,92 +0,0 @@ -#if !defined(SWIG_STD_STRING) -#define SWIG_STD_BASIC_STRING - -%include - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - - -%traits_swigtype(std::basic_string); -%fragment(SWIG_Traits_frag(std::basic_string)); - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(VALUE obj, std::string **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::string *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - char* buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::string(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromCharPtrAndSize") { -SWIGINTERNINLINE VALUE - SWIG_From(std::basic_string)(const std::string& s) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } -} - -%ignore std::basic_string::operator!=; -%ignore std::basic_string::operator+=; - -%include -%typemaps_asptrfromn(%checkcode(STRING), std::basic_string); - -#endif - - -#if !defined(SWIG_STD_WSTRING) - -%traits_swigtype(std::basic_string); -%fragment(SWIG_Traits_frag(std::basic_string)); - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsWCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(VALUE obj, std::wstring **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::wstring *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - wchar_t *buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsWCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::wstring(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromWCharPtrAndSize") { -SWIGINTERNINLINE VALUE - SWIG_From(std::basic_string)(const std::wstring& s) { - return SWIG_FromWCharPtrAndSize(s.data(), s.size()); - } -} - -%typemaps_asptrfromn(%checkcode(UNISTRING), std::basic_string); - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_char_traits.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_char_traits.i deleted file mode 100755 index bf4e6c47..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_common.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_common.i deleted file mode 100755 index 0cf9ce10..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_common.i +++ /dev/null @@ -1,74 +0,0 @@ -%include -%include -%include - - -/* - Generate the traits for a 'primitive' type, such as 'double', - for which the SWIG_AsVal and SWIG_From methods are already defined. -*/ - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(VALUE obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static VALUE from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(VALUE obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static VALUE from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_complex.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_complex.i deleted file mode 100755 index ef4e8a10..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_complex.i +++ /dev/null @@ -1,29 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); - - - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_container.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_container.i deleted file mode 100755 index 85379505..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_deque.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_deque.i deleted file mode 100755 index b70f34ee..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_deque.i +++ /dev/null @@ -1,30 +0,0 @@ -/* - Deques -*/ - -%fragment("StdDequeTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::deque **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::deque& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%ignore std::deque::push_back; -%ignore std::deque::pop_back; - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_except.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_functors.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_functors.i deleted file mode 100755 index 54ee97b5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_functors.i +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file std_functors.i - * @date Sun May 6 00:44:33 2007 - * - * @brief This file provides unary and binary functors for STL - * containers, that will invoke a Ruby proc or method to do - * their operation. - * - * You can use them in a swig file like: - * - * %include - * %include - * - * %template< IntSet > std::set< int, swig::BinaryPredicate >; - * - * - * which will then allow calling them from Ruby either like: - * - * # order of set is defined by C++ default - * a = IntSet.new - * - * # sort order defined by Ruby proc - * b = IntSet.new( proc { |a,b| a > b } ) - * - */ - -%include - -%fragment("StdFunctors"); diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_ios.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_ios.i deleted file mode 100755 index 7aafae28..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_ios.i +++ /dev/null @@ -1,14 +0,0 @@ - -#pragma SWIG nowarn=801 - -%rename(ios_base_in) std::ios_base::in; - -AUTODOC(cerr, "Standard C++ error stream"); -AUTODOC(cout, "Standard C++ output stream"); -AUTODOC(cin, "Standard C++ input stream"); -AUTODOC(clog, "Standard C++ logging stream"); -AUTODOC(endl, "Add an end line to stream"); -AUTODOC(ends, "Ends stream"); -AUTODOC(flush, "Flush stream"); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_iostream.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_iostream.i deleted file mode 100755 index ee36bec4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_iostream.i +++ /dev/null @@ -1,12 +0,0 @@ -namespace std -{ -%callback("%s") endl; -%callback("%s") ends; -%callback("%s") flush; -} - -%warnfilter(365) operator+=; -%warnfilter(802) std::basic_iostream; // turn off multiple inheritance warning - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_list.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_list.i deleted file mode 100755 index b0b4928e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_list.i +++ /dev/null @@ -1,42 +0,0 @@ -/* - Lists -*/ - -%fragment("StdListTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static VALUE from(const std::list& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%ignore std::list::push_back; -%ignore std::list::pop_back; - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%mixin std::list "Enumerable"; - -%rename("delete") std::list::__delete__; -%rename("reject!") std::list::reject_bang; -%rename("map!") std::list::map_bang; -%rename("empty?") std::list::empty; -%rename("include?" ) std::list::__contains__ const; -%rename("has_key?" ) std::list::has_key const; - -%alias std::list::push "<<"; - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_map.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_map.i deleted file mode 100755 index 6dd2ffa7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_map.i +++ /dev/null @@ -1,424 +0,0 @@ -// -// Maps -// -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") -{ - namespace swig { - template - struct from_key_oper - { - typedef const ValueType& argument_type; - typedef VALUE result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.first); - } - }; - - template - struct from_value_oper - { - typedef const ValueType& argument_type; - typedef VALUE result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.second); - } - }; - - template - struct MapIterator_T : ConstIteratorClosed_T - { - MapIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq) - : ConstIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct MapKeyIterator_T : MapIterator_T - { - MapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq) - : MapIterator_T(curr, first, last, seq) - { - } - }; - - template - inline ConstIterator* - make_output_key_iterator(const OutIter& current, const OutIter& begin, - const OutIter& end, VALUE seq = 0) - { - return new MapKeyIterator_T(current, begin, end, seq); - } - - template > - struct MapValueIterator_T : MapIterator_T - { - MapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq) - : MapIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline ConstIterator* - make_output_value_iterator(const OutIter& current, const OutIter& begin, - const OutIter& end, VALUE seq = 0) - { - return new MapValueIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::map map_type; - static int asptr(VALUE obj, map_type **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_HASH ) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - map_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static VALUE from(const map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - size_type size = map.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise( rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - rb_hash_aset(obj, key, val); - } - return obj; - } - } - }; - } -} - -%define %swig_map_common(Map...) - %swig_container_methods(%arg(Map)); - // %swig_sequence_iterator(%arg(Map)); - - %extend { - - VALUE __delete__(const key_type& key) { - Map::iterator i = self->find(key); - if (i != self->end()) { - self->erase(i); - return swig::from( key ); - } - else { - return Qnil; - } - } - - bool has_key(const key_type& key) const { - Map::const_iterator i = self->find(key); - return i != self->end(); - } - - VALUE keys() { - Map::size_type size = self->size(); - int rubysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE ary = rb_ary_new2(rubysize); - Map::const_iterator i = self->begin(); - Map::const_iterator e = self->end(); - for ( ; i != e; ++i ) { - rb_ary_push( ary, swig::from(i->first) ); - } - return ary; - } - - Map* each() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE k, v; - Map::iterator i = self->begin(); - Map::iterator e = self->end(); - for ( ; i != e; ++i ) - { - const Map::key_type& key = i->first; - const Map::mapped_type& val = i->second; - - k = swig::from(key); - v = swig::from(val); - rb_yield_values(2, k, v); - } - - return self; - } - - %newobject select; - Map* select() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - Map* r = new Map; - Map::iterator i = $self->begin(); - Map::iterator e = $self->end(); - for ( ; i != e; ++i ) - { - VALUE k = swig::from(i->first); - VALUE v = swig::from(i->second); - if ( RTEST( rb_yield_values(2, k, v) ) ) - $self->insert(r->end(), *i); - } - - return r; - } - - %typemap(in) (int argc, VALUE* argv) { - $1 = argc; - $2 = argv; - } - - VALUE values_at(int argc, VALUE* argv, ...) { - - VALUE r = rb_ary_new(); - ID id = rb_intern("[]"); - swig_type_info* type = swig::type_info< Map >(); - VALUE me = SWIG_NewPointerObj( $self, type, 0 ); - for ( int i = 0; i < argc; ++i ) - { - VALUE key = argv[i]; - VALUE tmp = rb_funcall( me, id, 1, key ); - rb_ary_push( r, tmp ); - } - - return r; - } - - - Map* each_key() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE r; - Map::iterator i = self->begin(); - Map::iterator e = self->end(); - for ( ; i != e; ++i ) - { - r = swig::from( i->first ); - rb_yield(r); - } - - return self; - } - - VALUE values() { - Map::size_type size = self->size(); - int rubysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE ary = rb_ary_new2(rubysize); - Map::const_iterator i = self->begin(); - Map::const_iterator e = self->end(); - for ( ; i != e; ++i ) { - rb_ary_push( ary, swig::from(i->second) ); - } - return ary; - } - - Map* each_value() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE r; - Map::iterator i = self->begin(); - Map::iterator e = self->end(); - for ( ; i != e; ++i ) - { - r = swig::from( i->second ); - rb_yield(r); - } - - return self; - } - - VALUE entries() { - Map::size_type size = self->size(); - int rubysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE ary = rb_ary_new2(rubysize); - Map::const_iterator i = self->begin(); - Map::const_iterator e = self->end(); - for ( ; i != e; ++i ) { - rb_ary_push( ary, swig::from >(*i) ); - } - return ary; - } - - bool __contains__(const key_type& key) { - return self->find(key) != self->end(); - } - - %newobject key_iterator(VALUE *RUBY_SELF); - swig::ConstIterator* key_iterator(VALUE *RUBY_SELF) { - return swig::make_output_key_iterator($self->begin(), $self->begin(), - $self->end(), *RUBY_SELF); - } - - %newobject value_iterator(VALUE *RUBY_SELF); - swig::ConstIterator* value_iterator(VALUE *RUBY_SELF) { - return swig::make_output_value_iterator($self->begin(), $self->begin(), - $self->end(), *RUBY_SELF); - } - - } -%enddef - -%define %swig_map_methods(Map...) - %swig_map_common(Map) - %extend { - VALUE __getitem__(const key_type& key) const { - Map::const_iterator i = self->find(key); - if ( i != self->end() ) - return swig::from( i->second ); - else - return Qnil; - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - (*self)[key] = x; - } - - VALUE inspect() - { - Map::const_iterator i = $self->begin(); - Map::const_iterator e = $self->end(); - const char *type_name = swig::type_name< Map >(); - VALUE str = rb_str_new2( type_name ); - str = rb_str_cat2( str, " {" ); - bool comma = false; - VALUE tmp; - for ( ; i != e; ++i, comma = true ) - { - if (comma) str = rb_str_cat2( str, "," ); - tmp = swig::from< Map::key_type >( i->first ); - tmp = rb_inspect( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, "=>" ); - tmp = swig::from< Map::mapped_type >( i->second ); - tmp = rb_inspect( tmp ); - str = rb_str_buf_append( str, tmp ); - } - str = rb_str_cat2( str, "}" ); - return str; - } - - VALUE to_a() - { - Map::const_iterator i = $self->begin(); - Map::const_iterator e = $self->end(); - VALUE ary = rb_ary_new2( std::distance( i, e ) ); - VALUE tmp; - for ( ; i != e; ++i ) - { - // @todo: improve -- this should just be swig::from(*i) - tmp = swig::from< std::pair >( *i ); - rb_ary_push( ary, tmp ); - } - return ary; - } - - VALUE to_s() - { - Map::iterator i = $self->begin(); - Map::iterator e = $self->end(); - VALUE str = rb_str_new2( "" ); - VALUE tmp; - for ( ; i != e; ++i ) - { - // @todo: improve -- this should just be swig::from(*i) - tmp = swig::from< std::pair >( *i ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - } - return str; - } - - } -%enddef - - -%mixin std::map "Enumerable"; - - -%rename("delete") std::map::__delete__; -%rename("reject!") std::map::reject_bang; -%rename("map!") std::map::map_bang; -%rename("empty?") std::map::empty; -%rename("include?" ) std::map::__contains__ const; -%rename("has_key?" ) std::map::has_key const; - -%alias std::map::push "<<"; - - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_multimap.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_multimap.i deleted file mode 100755 index 5d8e33e9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_multimap.i +++ /dev/null @@ -1,226 +0,0 @@ -/* - Multimaps -*/ -%include - -%fragment("StdMultimapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::multimap *multimap) { - typedef typename std::multimap::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::multimap multimap_type; - static int asptr(VALUE obj, std::multimap **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_HASH ) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - return traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - multimap_type *p; - res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info(),0); - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::multimap multimap_type; - typedef typename multimap_type::const_iterator const_iterator; - typedef typename multimap_type::size_type size_type; - - static VALUE from(const multimap_type& multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new multimap_type(multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = multimap.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, - "multimap size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - - VALUE oldval = rb_hash_aref( obj, key ); - if ( oldval == Qnil ) - rb_hash_aset(obj, key, val); - else { - // Multiple values for this key, create array if needed - // and add a new element to it. - VALUE ary; - if ( TYPE(oldval) == T_ARRAY ) - ary = oldval; - else - { - ary = rb_ary_new2(2); - rb_ary_push( ary, oldval ); - rb_hash_aset( obj, key, ary ); - } - rb_ary_push( ary, val ); - } - - } - return obj; - } - } - }; - } -} - -%define %swig_multimap_methods(MultiMap...) - %swig_map_common(%arg(MultiMap)); - - %extend { - VALUE __getitem__(const key_type& key) const { - std::pair r = $self->equal_range(key); - if ( r.first != r.second ) - { - VALUE ary = rb_ary_new(); - for (MultiMap::const_iterator i = r.first ; i != r.second; ++i ) - { - rb_ary_push( ary, swig::from( i->second ) ); - } - if ( RARRAY_LEN(ary) == 1 ) - return RARRAY_PTR(ary)[0]; - return ary; - } - else - return Qnil; - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - self->insert(MultiMap::value_type(key,x)); - } - - VALUE inspect() - { - MultiMap::iterator i = $self->begin(); - MultiMap::iterator e = $self->end(); - const char *type_name = swig::type_name< MultiMap >(); - VALUE str = rb_str_new2( type_name ); - str = rb_str_cat2( str, " {" ); - VALUE tmp; - while ( i != e ) - { - const MultiMap::key_type& key = i->first; - const MultiMap::key_type& oldkey = key; - tmp = swig::from( key ); - str = rb_str_buf_append( str, rb_inspect(tmp) ); - str = rb_str_cat2( str, "=>" ); - - VALUE vals = rb_ary_new(); - for ( ; i != e && key == oldkey; ++i ) - { - const MultiMap::mapped_type& val = i->second; - tmp = swig::from( val ); - rb_ary_push( vals, tmp ); - } - - if ( RARRAY_LEN(vals) == 1 ) - { - str = rb_str_buf_append( str, rb_inspect(tmp) ); - } - else - { - str = rb_str_buf_append( str, rb_inspect(vals) ); - } - } - str = rb_str_cat2( str, "}" ); - return str; - } - - VALUE to_a() - { - MultiMap::const_iterator i = $self->begin(); - MultiMap::const_iterator e = $self->end(); - VALUE ary = rb_ary_new2( std::distance( i, e ) ); - VALUE tmp; - while ( i != e ) - { - const MultiMap::key_type& key = i->first; - const MultiMap::key_type& oldkey = key; - tmp = swig::from( key ); - rb_ary_push( ary, tmp ); - - VALUE vals = rb_ary_new(); - for ( ; i != e && key == oldkey; ++i ) - { - const MultiMap::mapped_type& val = i->second; - tmp = swig::from( val ); - rb_ary_push( vals, tmp ); - } - - if ( RARRAY_LEN(vals) == 1 ) - { - rb_ary_push( ary, tmp ); - } - else - { - rb_ary_push( ary, vals ); - } - } - return ary; - } - - VALUE to_s() - { - MultiMap::iterator i = $self->begin(); - MultiMap::iterator e = $self->end(); - VALUE str = rb_str_new2( "" ); - VALUE tmp; - while ( i != e ) - { - const MultiMap::key_type& key = i->first; - const MultiMap::key_type& oldkey = key; - tmp = swig::from( key ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - - VALUE vals = rb_ary_new(); - for ( ; i != e && key == oldkey; ++i ) - { - const MultiMap::mapped_type& val = i->second; - tmp = swig::from( val ); - rb_ary_push( vals, tmp ); - } - - tmp = rb_obj_as_string( vals ); - str = rb_str_buf_append( str, tmp ); - } - return str; - } - } -%enddef - - -%mixin std::multimap "Enumerable"; - -%rename("delete") std::multimap::__delete__; -%rename("reject!") std::multimap::reject_bang; -%rename("map!") std::multimap::map_bang; -%rename("empty?") std::multimap::empty; -%rename("include?" ) std::multimap::__contains__ const; -%rename("has_key?" ) std::multimap::has_key const; - -%alias std::multimap::push "<<"; - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_multiset.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_multiset.i deleted file mode 100755 index 252ae10d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_multiset.i +++ /dev/null @@ -1,50 +0,0 @@ -/* - Multisets -*/ - -%include - -%fragment("StdMultisetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::multiset* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static VALUE from(const std::multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_multiset_methods(Set...) %swig_set_methods(Set) - -%mixin std::multiset "Enumerable"; - -%rename("delete") std::multiset::__delete__; -%rename("reject!") std::multiset::reject_bang; -%rename("map!") std::multiset::map_bang; -%rename("empty?") std::multiset::empty; -%rename("include?" ) std::multiset::__contains__ const; -%rename("has_key?" ) std::multiset::has_key const; - -%alias std::multiset::push "<<"; - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_pair.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_pair.i deleted file mode 100755 index 38a4ffb9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_pair.i +++ /dev/null @@ -1,212 +0,0 @@ -/* - Pairs -*/ -%include - -//#define SWIG_STD_PAIR_ASVAL - -%fragment("StdPairTraits","header",fragment="StdTraits") { - namespace swig { - - template - struct traits_asval > { - typedef std::pair value_type; - - static int get_pair(VALUE first, VALUE second, - std::pair *val) - { - if (val) { - T *pfirst = &(val->first); - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = &(val->second); - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } else { - T *pfirst = 0; - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asval(VALUE obj, std::pair *val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_ARRAY ) { - if (RARRAY_LEN(obj) == 2) { - VALUE first = rb_ary_entry(obj,0); - VALUE second = rb_ary_entry(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = *p; - } - return res; - } - }; - - template - struct traits_asptr > { - typedef std::pair value_type; - - static int get_pair(VALUE first, VALUE second, - std::pair **val) - { - if (val) { - value_type *vp = %new_instance(std::pair); - T *pfirst = &(vp->first); - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) { - %delete(vp); - return res1; - } - U *psecond = &(vp->second); - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) { - %delete(vp); - return res2; - } - *val = vp; - return SWIG_AddNewMask(res1 > res2 ? res1 : res2); - } else { - T *pfirst = 0; - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asptr(VALUE obj, std::pair **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_ARRAY ) { - if ( RARRAY_LEN(obj) == 2) { - VALUE first = rb_ary_entry(obj,0); - VALUE second = rb_ary_entry(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - - - template - struct traits_from > { - static VALUE _wrap_pair_second( VALUE self ) - { - std::pair< typename swig::noconst_traits::noconst_type,U>* p = NULL; - swig::asptr( self, &p ); - return swig::from( p->second ); - } - - static VALUE _wrap_pair_second_eq( VALUE self, VALUE arg ) - { - std::pair< typename swig::noconst_traits::noconst_type,U>* p = NULL; - swig::asptr( self, &p ); - return swig::from( p->second ); - } - - static VALUE from(const std::pair& val) { - VALUE obj = rb_ary_new2(2); - rb_ary_push(obj, swig::from::noconst_type>(val.first)); - rb_ary_push(obj, swig::from(val.second)); - rb_define_singleton_method(obj, "second", - VALUEFUNC(_wrap_pair_second), 0 ); - rb_define_singleton_method(obj, "second=", - VALUEFUNC(_wrap_pair_second_eq), 1 ); - rb_obj_freeze(obj); // treat as immutable tuple - return obj; - } - }; - - } -} - -// Missing typemap -%typemap(in) std::pair* (int res) { - res = swig::asptr( $input, &$1 ); - if (!SWIG_IsOK(res)) - %argument_fail(res, "$1_type", $symname, $argnum); -} - - -%define %swig_pair_methods(pair...) - -%extend { - VALUE inspect() const - { - VALUE tmp; - const char *type_name = swig::type_name< pair >(); - VALUE str = rb_str_new2( type_name ); - str = rb_str_cat2( str, " (" ); - tmp = swig::from( $self->first ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, "," ); - tmp = swig::from( $self->second ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, ")" ); - return str; - } - - VALUE to_s() const - { - VALUE tmp; - VALUE str = rb_str_new2( "(" ); - tmp = swig::from( $self->first ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, "," ); - tmp = swig::from( $self->second ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, ")" ); - return str; - } - - VALUE __getitem__( int index ) - { - if (( index % 2 ) == 0 ) - return swig::from( $self->first ); - else - return swig::from( $self->second ); - } - - VALUE __setitem__( int index, VALUE obj ) - { - int res; - if (( index % 2 ) == 0 ) - { - res = swig::asval( obj, &($self->first) ); - } - else - { - res = swig::asval(obj, &($self->second) ); - } - if (!SWIG_IsOK(res)) - rb_raise( rb_eArgError, "invalid item for " #pair ); - return obj; - } - - } // extend - -%enddef - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_queue.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_queue.i deleted file mode 100755 index 2a16d9cf..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_queue.i +++ /dev/null @@ -1,33 +0,0 @@ -/* - Queues -*/ - -%fragment("StdQueueTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::queue **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::queue& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%rename("delete") std::queue::__delete__; -%rename("reject!") std::queue::reject_bang; -%rename("map!") std::queue::map_bang; -%rename("empty?") std::queue::empty; -%rename("include?" ) std::queue::__contains__ const; -%rename("has_key?" ) std::queue::has_key const; - -%alias std::queue::push "<<"; - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_set.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_set.i deleted file mode 100755 index 1b425c6b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_set.i +++ /dev/null @@ -1,228 +0,0 @@ -/* - Sets -*/ - -%fragment("StdSetTraits","header",fragment="",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::set* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static VALUE from(const std::set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - - - /** - * Set Iterator class for an iterator with no end() boundaries. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class SetIteratorOpen_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef SetIteratorOpen_T self_type; - - public: - SetIteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - // no setValue allowed - - Iterator *dup() const - { - return new self_type(*this); - } - }; - - - /** - * Set Iterator class for a iterator where begin() and end() boundaries - are known. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class SetIteratorClosed_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef SetIteratorClosed_T self_type; - - protected: - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - SetIteratorClosed_T(nonconst_iter curr, nonconst_iter first, - nonconst_iter last, VALUE seq = Qnil) - : Iterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - // no setValue allowed - - - Iterator *dup() const - { - return new self_type(*this); - } - - private: - nonconst_iter begin; - nonconst_iter end; - }; - - // Template specialization to construct a closed iterator for sets - // this turns a nonconst iterator into a const one for ruby to avoid - // allowing the user to change the value - template< typename InOutIter > - inline Iterator* - make_set_nonconst_iterator(const InOutIter& current, - const InOutIter& begin, - const InOutIter& end, - VALUE seq = Qnil) - { - return new SetIteratorClosed_T< InOutIter >(current, - begin, end, seq); - } - - // Template specialization to construct an open iterator for sets - // this turns a nonconst iterator into a const one for ruby to avoid - // allowing the user to change the value - template< typename InOutIter > - inline Iterator* - make_set_nonconst_iterator(const InOutIter& current, - VALUE seq = Qnil) - { - return new SetIteratorOpen_T< InOutIter >(current, seq); - } - - } -%} - -%define %swig_sequence_methods_extra_set(Sequence...) - %extend { - %alias reject_bang "delete_if"; - Sequence* reject_bang() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - for ( Sequence::iterator i = $self->begin(); i != $self->end(); ) { - VALUE r = swig::from< Sequence::value_type >(*i); - Sequence::iterator current = i++; - if ( RTEST( rb_yield(r) ) ) - $self->erase(current); - } - - return self; - } - } -%enddef - -%define %swig_set_methods(set...) - - %swig_sequence_methods_common(%arg(set)); - %swig_sequence_methods_extra_set(%arg(set)); - - %fragment("RubyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="RubySequence_Cont") {} - -// Redefine std::set iterator/reverse_iterator typemap -%typemap(out,noblock=1) iterator, reverse_iterator { - $result = SWIG_NewPointerObj((swig::make_set_nonconst_iterator<$type>($1, self)), swig::Iterator::descriptor(), SWIG_POINTER_OWN); - } - -// Redefine std::set std::pair typemap - %typemap(out,noblock=1,fragment="RubyPairBoolOutputIterator") - std::pair { - $result = rb_ary_new2(2); - rb_ary_push($result, SWIG_NewPointerObj((swig::make_set_nonconst_iterator($1.first)), swig::Iterator::descriptor(), SWIG_POINTER_OWN)); - rb_ary_push($result, SWIG_From(bool)(%static_cast($1,const $type &).second)); - } - - %extend { - %alias push "<<"; - value_type push(const value_type& x) { - self->insert(x); - return x; - } - - bool __contains__(const value_type& x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - }; -%enddef - - -%mixin std::set "Enumerable"; - - - -%rename("delete") std::set::__delete__; -%rename("reject!") std::set::reject_bang; -%rename("map!") std::set::map_bang; -%rename("empty?") std::set::empty; -%rename("include?" ) std::set::__contains__ const; -%rename("has_key?" ) std::set::has_key const; - -%alias std::set::push "<<"; - - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_shared_ptr.i deleted file mode 100755 index 086e3081..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_shared_ptr.i +++ /dev/null @@ -1,144 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include -%include - - -%fragment("StdSharedPtrTraits","header",fragment="StdTraitsForwardDeclaration",fragment="") -{ -namespace swig { - /* - Template specialization for functions defined in rubystdcommon.swg. Special handling for shared_ptr - is required as, shared_ptr * is used rather than the usual T *, see shared_ptr.i. - */ - template - struct traits_asptr > { - static int asptr(VALUE obj, std::shared_ptr **val) { - int res = SWIG_ERROR; - swig_type_info *descriptor = type_info >(); - if (val) { - std::shared_ptr *p = 0; - swig_ruby_owntype newmem = {0, 0}; - res = descriptor ? SWIG_ConvertPtrAndOwn(obj, (void **)&p, descriptor, 0, &newmem) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (*val) { - **val = p ? *p : std::shared_ptr(); - } else { - *val = p; - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - // Upcast for pointers to shared_ptr in this generic framework has not been implemented - res = SWIG_ERROR; - } - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) - delete p; - } - } else { - res = descriptor ? SWIG_ConvertPtr(obj, 0, descriptor, 0) : SWIG_ERROR; - } - return res; - } - }; - - template - struct traits_asval > { - static int asval(VALUE obj, std::shared_ptr *val) { - if (val) { - std::shared_ptr ret; - std::shared_ptr *p = &ret; - int res = traits_asptr >::asptr(obj, &p); - if (!SWIG_IsOK(res)) - return res; - *val = ret; - return SWIG_OK; - } else { - return traits_asptr >::asptr(obj, (std::shared_ptr **)(0)); - } - } - }; - - template - struct traits_asval *> { - static int asval(VALUE obj, std::shared_ptr **val) { - if (val) { - typedef typename noconst_traits >::noconst_type noconst_type; - if (*val) { - noconst_type ret; - noconst_type *p = &ret; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) - **(const_cast(val)) = ret; - return res; - } else { - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) - *val = p; - return res; - } - } else { - return traits_asptr >::asptr(obj, (std::shared_ptr **)(0)); - } - } - }; - - template - struct traits_as, pointer_category> { - static std::shared_ptr as(VALUE obj) { - std::shared_ptr ret; - std::shared_ptr *v = &ret; - int res = traits_asptr >::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return ret; - } else { - - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) - SWIG_Error(SWIG_TypeError, swig::type_name >()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as *, pointer_category> { - static std::shared_ptr * as(VALUE obj) { - std::shared_ptr *p = 0; - int res = traits_asptr >::asptr(obj, &p); - if (SWIG_IsOK(res)) { - return p; - } else { - - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) - SWIG_Error(SWIG_TypeError, swig::type_name *>()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_from_ptr > { - static VALUE from(std::shared_ptr *val, int owner = 0) { - if (val && *val) { - return SWIG_NewPointerObj(val, type_info >(), owner); - } else { - return Qnil; - } - } - }; - - /* - The descriptors in the shared_ptr typemaps remove the const qualifier for the SWIG type system. - Remove const likewise here, otherwise SWIG_TypeQuery("std::shared_ptr") will return NULL. - */ - template - struct traits_from > { - static VALUE from(const std::shared_ptr& val) { - std::shared_ptr p = std::const_pointer_cast(val); - return swig::from(p); - } - }; -} -} - -%fragment("StdSharedPtrTraits"); diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_sstream.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_sstream.i deleted file mode 100755 index 537a3ae5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_sstream.i +++ /dev/null @@ -1,2 +0,0 @@ - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_stack.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_stack.i deleted file mode 100755 index 7df48ef1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_stack.i +++ /dev/null @@ -1,35 +0,0 @@ -/* - Stacks -*/ - -%fragment("StdStackTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::stack **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::stack& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - - -%rename("delete") std::stack::__delete__; -%rename("reject!") std::stack::reject_bang; -%rename("map!") std::stack::map_bang; -%rename("empty?") std::stack::empty; -%rename("include?" ) std::stack::__contains__ const; -%rename("has_key?" ) std::stack::has_key const; - -%alias std::stack::push "<<"; - - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_streambuf.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_streambuf.i deleted file mode 100755 index 44b9bb4d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_streambuf.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_string.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_string.i deleted file mode 100755 index f9ecd8e8..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_string.i +++ /dev/null @@ -1,7 +0,0 @@ - -%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::basic_string; - -AUTODOC(substr, "Return a portion of the String"); - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_map.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_map.i deleted file mode 100755 index 3c6b6502..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_map.i +++ /dev/null @@ -1,83 +0,0 @@ -// -// Maps -// -%include - -%fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_map *map) { - typedef typename std::unordered_map::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::unordered_map map_type; - static int asptr(VALUE obj, map_type **val) { - int res = SWIG_ERROR; - if (TYPE(obj) == T_HASH) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - map_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static VALUE from(const map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - size_type size = map.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - rb_hash_aset(obj, key, val); - } - return obj; - } - } - }; - } -} - -#define %swig_unordered_map_common(Map...) %swig_map_common(Map) -#define %swig_unordered_map_methods(Map...) %swig_map_methods(Map) - -%rename("delete") std::unordered_map::__delete__; -%rename("reject!") std::unordered_map::reject_bang; -%rename("map!") std::unordered_map::map_bang; -%rename("empty?") std::unordered_map::empty; -%rename("include?") std::unordered_map::__contains__ const; -%rename("has_key?") std::unordered_map::has_key const; - -%mixin std::unordered_map "Enumerable"; -%alias std::unordered_map::push "<<"; - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_multimap.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_multimap.i deleted file mode 100755 index c3261f9e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_multimap.i +++ /dev/null @@ -1,100 +0,0 @@ -/* - Multimaps -*/ -%include - -%fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_multimap *multimap) { - typedef typename std::unordered_multimap::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::unordered_multimap multimap_type; - static int asptr(VALUE obj, std::unordered_multimap **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_HASH ) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - return traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - multimap_type *p; - res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info(),0); - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_multimap multimap_type; - typedef typename multimap_type::const_iterator const_iterator; - typedef typename multimap_type::size_type size_type; - - static VALUE from(const multimap_type& multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new multimap_type(multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = multimap.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, - "multimap_ size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - - VALUE oldval = rb_hash_aref(obj, key); - if (oldval == Qnil) { - rb_hash_aset(obj, key, val); - } else { - // Multiple values for this key, create array if needed - // and add a new element to it. - VALUE ary; - if (TYPE(oldval) == T_ARRAY) { - ary = oldval; - } else { - ary = rb_ary_new2(2); - rb_ary_push(ary, oldval); - rb_hash_aset(obj, key, ary); - } - rb_ary_push(ary, val); - } - } - return obj; - } - } - }; - } -} - -#define %swig_unordered_multimap_methods(MultiMap...) %swig_multimap_methods(MultiMap) - -%mixin std::unordered_multimap "Enumerable"; - -%rename("delete") std::unordered_multimap::__delete__; -%rename("reject!") std::unordered_multimap::reject_bang; -%rename("map!") std::unordered_multimap::map_bang; -%rename("empty?") std::unordered_multimap::empty; -%rename("include?" ) std::unordered_multimap::__contains__ const; -%rename("has_key?" ) std::unordered_multimap::has_key const; - -%alias std::unordered_multimap::push "<<"; - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_multiset.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_multiset.i deleted file mode 100755 index dae13eef..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_multiset.i +++ /dev/null @@ -1,50 +0,0 @@ -/* - Multisets -*/ - -%include - -%fragment("StdUnorderedMultisetTraits","header",fragment="StdUnorderedSetTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_multiset* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::unordered_multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static VALUE from(const std::unordered_multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_unordered_multiset_methods(Set...) %swig_unordered_set_methods(Set) - -%mixin std::unordered_multiset "Enumerable"; - -%rename("delete") std::unordered_multiset::__delete__; -%rename("reject!") std::unordered_multiset::reject_bang; -%rename("map!") std::unordered_multiset::map_bang; -%rename("empty?") std::unordered_multiset::empty; -%rename("include?") std::unordered_multiset::__contains__ const; -%rename("has_key?") std::unordered_multiset::has_key const; - -%alias std::unordered_multiset::push "<<"; - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_set.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_set.i deleted file mode 100755 index e8e1b087..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_unordered_set.i +++ /dev/null @@ -1,50 +0,0 @@ -/* - Sets -*/ - -%include - -%fragment("StdUnorderedSetTraits","header",fragment="",fragment="StdSetTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_set* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::unordered_set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static VALUE from(const std::unordered_set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_unordered_set_methods(set...) %swig_set_methods(set) - -%mixin std::unordered_set "Enumerable"; - -%rename("delete") std::unordered_set::__delete__; -%rename("reject!") std::unordered_set::reject_bang; -%rename("map!") std::unordered_set::map_bang; -%rename("empty?") std::unordered_set::empty; -%rename("include?" ) std::unordered_set::__contains__ const; -%rename("has_key?" ) std::unordered_set::has_key const; - -%alias std::unordered_set::push "<<"; - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_vector.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_vector.i deleted file mode 100755 index 67fdcd1f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_vector.i +++ /dev/null @@ -1,52 +0,0 @@ -/* - Vectors -*/ - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - - - -%define %swig_vector_methods(Type...) - %swig_sequence_methods(Type) - %swig_sequence_front_inserters(Type); -%enddef - -%define %swig_vector_methods_val(Type...) - %swig_sequence_methods_val(Type); - %swig_sequence_front_inserters(Type); -%enddef - - -%mixin std::vector "Enumerable"; -%ignore std::vector::push_back; -%ignore std::vector::pop_back; - - -%rename("delete") std::vector::__delete__; -%rename("reject!") std::vector::reject_bang; -%rename("map!") std::vector::map_bang; -%rename("empty?") std::vector::empty; -%rename("include?" ) std::vector::__contains__ const; -%rename("has_key?" ) std::vector::has_key const; - -%alias std::vector::push "<<"; - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_vectora.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_vectora.i deleted file mode 100755 index 1708361e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_vectora.i +++ /dev/null @@ -1,36 +0,0 @@ -/* - Vectors + allocators -*/ - -%fragment("StdVectorATraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - typedef std::vector vector_type; - typedef T value_type; - static int asptr(VALUE obj, vector_type **vec) { - return traits_asptr_stdseq::asptr(obj, vec); - } - }; - - template - struct traits_from > { - typedef std::vector vector_type; - static VALUE from(const vector_type& vec) { - return traits_from_stdseq::from(vec); - } - }; - } -%} - - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%mixin std::vector "Enumerable"; -%ignore std::vector::push_back; -%ignore std::vector::pop_back; -%alias std::vector::push "<<"; - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/std_wstring.i b/linux/bin/swig/share/swig/4.1.0/ruby/std_wstring.i deleted file mode 100755 index c5d168a0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/std_wstring.i +++ /dev/null @@ -1,63 +0,0 @@ -%{ -#if defined(__linux__) -#include -#if BYTE_ORDER == LITTLE_ENDIAN -#define SWIG_RUBY_ENDIAN "LE" -#elif BYTE_ORDER == BIG_ENDIAN -#define SWIG_RUBY_ENDIAN "BE" -#endif -#else -#define SWIG_RUBY_ENDIAN "LE" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_RUBY_ENCODING_H -#include "ruby/encoding.h" -#endif - -/** - * The internal encoding of std::wstring is defined based on - * the size of wchar_t. If it is not appropriate for your library, - * SWIG_RUBY_WSTRING_ENCODING must be given when compiling. - */ -#ifndef SWIG_RUBY_WSTRING_ENCODING - -#if WCHAR_MAX == 0x7fff || WCHAR_MAX == 0xffff -#define SWIG_RUBY_WSTRING_ENCODING "UTF-16" SWIG_RUBY_ENDIAN -#elif WCHAR_MAX == 0x7fffffff || WCHAR_MAX == 0xffffffff -#define SWIG_RUBY_WSTRING_ENCODING "UTF-32" SWIG_RUBY_ENDIAN -#else -#error unsupported wchar_t size. SWIG_RUBY_WSTRING_ENCODING must be given. -#endif - -#endif - -/** - * If Encoding.default_internal is nil, this encoding will be used - * when converting from std::wstring to String object in Ruby. - */ -#ifndef SWIG_RUBY_INTERNAL_ENCODING -#define SWIG_RUBY_INTERNAL_ENCODING "UTF-8" -#endif - -static rb_encoding *swig_ruby_wstring_encoding; -static rb_encoding *swig_ruby_internal_encoding; - -#ifdef __cplusplus -} -#endif -%} - -%fragment("SWIG_ruby_wstring_encoding_init", "init") { - swig_ruby_wstring_encoding = rb_enc_find( SWIG_RUBY_WSTRING_ENCODING ); - swig_ruby_internal_encoding = rb_enc_find( SWIG_RUBY_INTERNAL_ENCODING ); -} - -%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::basic_string; - -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/stl.i b/linux/bin/swig/share/swig/4.1.0/ruby/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/swigmove.i b/linux/bin/swig/share/swig/4.1.0/ruby/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/timeval.i b/linux/bin/swig/share/swig/4.1.0/ruby/timeval.i deleted file mode 100755 index 94a75c80..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/timeval.i +++ /dev/null @@ -1,69 +0,0 @@ -/* - struct timeval * - time_t - - Ruby has builtin class Time. INPUT/OUTPUT typemap for timeval and - time_t is provided. - -*/ -%{ -#ifdef __cplusplus -extern "C" { -#endif -#ifdef HAVE_SYS_TIME_H -# include -struct timeval rb_time_timeval(VALUE); -#endif -#ifdef __cplusplus -} -#endif -%} - -%typemap(in) struct timeval *INPUT (struct timeval temp) -{ - if (NIL_P($input)) - $1 = NULL; - else { - temp = rb_time_timeval($input); - $1 = &temp; - } -} - -%typemap(in,numinputs=0) struct timeval *OUTPUT(struct timeval temp) -{ - $1 = &temp; -} - -%typemap(argout) struct timeval *OUTPUT -{ - $result = rb_time_new($1->tv_sec, $1->tv_usec); -} - -%typemap(out) struct timeval * -{ - $result = rb_time_new($1->tv_sec, $1->tv_usec); -} - -%typemap(out) struct timespec * -{ - $result = rb_time_new($1->tv_sec, $1->tv_nsec / 1000); -} - -// time_t -%typemap(in) time_t -{ - if (NIL_P($input)) - $1 = (time_t)-1; - else - $1 = NUM2LONG(rb_funcall2($input, rb_intern("tv_sec"), 0, 0)); -} - -%typemap(typecheck) time_t -{ - $1 = (NIL_P($input) || TYPE(rb_funcall($input, rb_intern("respond_to?"), 1, ID2SYM(rb_intern("tv_sec")))) == T_TRUE); -} - -%typemap(out) time_t -{ - $result = rb_time_new($1, 0); -} diff --git a/linux/bin/swig/share/swig/4.1.0/ruby/typemaps.i b/linux/bin/swig/share/swig/4.1.0/ruby/typemaps.i deleted file mode 100755 index 68343646..00000000 --- a/linux/bin/swig/share/swig/4.1.0/ruby/typemaps.i +++ /dev/null @@ -1,314 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * - * These mappings provide support for input/output arguments and - * common uses for C/C++ pointers. INOUT mappings allow for C/C++ - * pointer variables in addition to input/output arguments. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_USE_OLD_TYPEMAPS) -%include -#else - -/* -The SWIG typemap library provides a language independent mechanism for -supporting output arguments, input values, and other C function -calling mechanisms. The primary use of the library is to provide a -better interface to certain C function--especially those involving -pointers. -*/ - -// ------------------------------------------------------------------------ -// Pointer handling -// -// These mappings provide support for input/output arguments and common -// uses for C/C++ pointers. -// ------------------------------------------------------------------------ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -%define INPUT_TYPEMAP(type, converter) -%typemap(in) type *INPUT($*1_ltype temp), type &INPUT($*1_ltype temp) -{ - temp = ($*1_ltype) converter($input); - $1 = &temp; -} -%typemap(typecheck) type *INPUT = type; -%typemap(typecheck) type &INPUT = type; -%enddef - -INPUT_TYPEMAP(float, NUM2DBL); -INPUT_TYPEMAP(double, NUM2DBL); -INPUT_TYPEMAP(int, NUM2INT); -INPUT_TYPEMAP(short, NUM2SHRT); -INPUT_TYPEMAP(long, NUM2LONG); -INPUT_TYPEMAP(long long, NUM2LL); -INPUT_TYPEMAP(unsigned int, NUM2UINT); -INPUT_TYPEMAP(unsigned short, NUM2USHRT); -INPUT_TYPEMAP(unsigned long, NUM2ULONG); -INPUT_TYPEMAP(unsigned long long, NUM2ULL); -INPUT_TYPEMAP(unsigned char, NUM2UINT); -INPUT_TYPEMAP(signed char, NUM2INT); -INPUT_TYPEMAP(bool, RTEST); - -#undef INPUT_TYPEMAP - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a array element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Ruby Array. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include typemaps.i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Ruby output of the function would be a Array containing both -output values. -*/ - -%define OUTPUT_TYPEMAP(type, converter, convtype) -%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 { - VALUE o = converter(convtype (*$1)); - $result = output_helper($result, o); -} -%enddef - -OUTPUT_TYPEMAP(int, INT2NUM, (int)); -OUTPUT_TYPEMAP(short, INT2NUM, (int)); -OUTPUT_TYPEMAP(long, INT2NUM, (long)); -OUTPUT_TYPEMAP(long long, LL2NUM, (long long)); -OUTPUT_TYPEMAP(unsigned int, UINT2NUM, (unsigned int)); -OUTPUT_TYPEMAP(unsigned short, UINT2NUM, (unsigned int)); -OUTPUT_TYPEMAP(unsigned long, UINT2NUM, (unsigned long)); -OUTPUT_TYPEMAP(unsigned long long, ULL2NUM, (unsigned long long)); -OUTPUT_TYPEMAP(unsigned char, UINT2NUM, (unsigned int)); -OUTPUT_TYPEMAP(signed char, INT2NUM, (int)); -OUTPUT_TYPEMAP(float, rb_float_new, (double)); -OUTPUT_TYPEMAP(double, rb_float_new, (double)); - -#undef OUTPUT_TYPEMAP - -%typemap(in,numinputs=0) bool *OUTPUT(bool temp), bool &OUTPUT(bool temp) "$1 = &temp;" -%typemap(argout, fragment="output_helper") bool *OUTPUT, bool &OUTPUT { - VALUE o = (*$1) ? Qtrue : Qfalse; - $result = output_helper($result, o); -} - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Ruby array. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - void neg(double *INOUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Ruby). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Ruby variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned &INOUT = unsigned &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) signed char &INOUT = signed char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned *INOUT = unsigned *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned &INOUT = unsigned &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) signed char &INOUT = signed char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; - -/* Overloading information */ - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) float *INOUT = float; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) float &INOUT = float; - -#endif - -// -------------------------------------------------------------------- -// Special types -// -------------------------------------------------------------------- -%include -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/runtime.swg b/linux/bin/swig/share/swig/4.1.0/runtime.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/boost_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/scilab/boost_shared_ptr.i deleted file mode 100755 index 87c89b5f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/boost_shared_ptr.i +++ /dev/null @@ -1,401 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/carrays.i b/linux/bin/swig/share/swig/4.1.0/scilab/carrays.i deleted file mode 100755 index 014de37f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/carrays.i +++ /dev/null @@ -1,5 +0,0 @@ -%define %array_class(TYPE,NAME) - %array_class_wrap(TYPE,NAME,__paren__,__paren_asgn__) -%enddef - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/cmalloc.i b/linux/bin/swig/share/swig/4.1.0/scilab/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/cpointer.i b/linux/bin/swig/share/swig/4.1.0/scilab/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/exception.i b/linux/bin/swig/share/swig/4.1.0/scilab/exception.i deleted file mode 100755 index 17f4175c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/exception.i +++ /dev/null @@ -1,6 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), SWIG_Scilab_Error(code, msg);) -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/matrix.i b/linux/bin/swig/share/swig/4.1.0/scilab/matrix.i deleted file mode 100755 index 0936d936..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/matrix.i +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Matrix typemaps - * - */ - -%include -%include -%include -%include - - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/sciarray.swg b/linux/bin/swig/share/swig/4.1.0/scilab/sciarray.swg deleted file mode 100755 index c00e3837..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/sciarray.swg +++ /dev/null @@ -1,115 +0,0 @@ -/* -------------------------------------------------------------------------- - * - * Arrays typemaps - * - * --------------------------------------------------------------------------*/ - -%{ -#include -%} - -%define %scilab_asarray_withallocatecopy(TYPEMAPTYPE, FRAGMENTNAME, CTYPE, TEMPDATATYPE) -%typemap(TYPEMAPTYPE, fragment="FRAGMENTNAME") CTYPE { - size_t i = 0; - int iRows = 0; - int iCols = 0; - TEMPDATATYPE *pTempData = NULL; - if (FRAGMENTNAME(pvApiCtx, $input, &iRows, &iCols, &pTempData, fname)) { - return SWIG_ERROR; - } - $1 = ($1_ltype)MALLOC(sizeof($*1_ltype) * iRows * iCols); - for (i = 0; i < iRows * iCols; i++) { - $1[i] = ($*1_ltype) pTempData[i]; - } -} -%enddef - -%define %scilab_asarrayandsize_withcopy(TYPEMAPTYPE, FRAGMENTNAME, CTYPE, TEMPDATATYPE) -%typemap(TYPEMAPTYPE, fragment="FRAGMENTNAME") CTYPE { - int iRows = 0; - int iCols = 0; - TEMPDATATYPE *pTempData = NULL; - if (FRAGMENTNAME(pvApiCtx, $input, &iRows, &iCols, &pTempData, fname)) { - return SWIG_ERROR; - } - if (iRows*iCols <= $1_dim0) { - size_t i; - for (i = 0; i < $1_dim0; i++) { - $1[i] = ($*1_ltype) pTempData[i]; - } - } - else { - char errmsg[100]; - sprintf(errmsg, "Size of input data (%d) is too big (maximum is %d)", - iRows*iCols, $1_dim0); - SWIG_exception_fail(SWIG_OverflowError, errmsg); - } -} -%enddef - -%define %scilab_fromarrayandsize(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - %set_output(FRAGMENTNAME(pvApiCtx, $result, 1, $1_dim0, $1)); -} -%enddef - -%define %scilab_array_typemaps(CTYPE, ASARRAY_FRAGMENT, FROMARRAY_FRAGMENT, TEMPDATATYPE) - %scilab_asarrayandsize_withcopy(varin, ASARRAY_FRAGMENT, CTYPE[ANY], TEMPDATATYPE); - %scilab_asarray_withallocatecopy(in, ASARRAY_FRAGMENT, CTYPE[ANY], TEMPDATATYPE); - %scilab_fromarrayandsize(varout, FROMARRAY_FRAGMENT, CTYPE[ANY]); - %scilab_fromarrayandsize(out, FROMARRAY_FRAGMENT, CTYPE[ANY]); - - %apply SWIGTYPE[] { CTYPE[] }; - %scilab_asarray_withallocatecopy(in, ASARRAY_FRAGMENT, CTYPE[], TEMPDATATYPE); -%enddef - - -// Double -%scilab_array_typemaps(double, SWIG_SciDouble_AsDoubleArrayAndSize, - SWIG_SciDouble_FromDoubleArrayAndSize, double); - -// Signed char - -%scilab_array_typemaps(signed char, SWIG_SciDoubleOrInt8_AsSignedCharArrayAndSize, - SWIG_SciDouble_FromSignedCharArrayAndSize, signed char); - -// Unsigned char -%scilab_array_typemaps(unsigned char, SWIG_SciDoubleOrUint8_AsUnsignedCharArrayAndSize, - SWIG_SciDouble_FromUnsignedCharArrayAndSize, unsigned char); - -// Short -%scilab_array_typemaps(short, SWIG_SciDoubleOrInt16_AsShortArrayAndSize, - SWIG_SciDouble_FromShortArrayAndSize, short); - -// Unsigned short -%scilab_array_typemaps(unsigned short, SWIG_SciDoubleOrUint16_AsUnsignedShortArrayAndSize, - SWIG_SciDouble_FromUnsignedShortArrayAndSize, unsigned short); - -// Int -%scilab_array_typemaps(int, SWIG_SciDoubleOrInt32_AsIntArrayAndSize, - SWIG_SciDouble_FromIntArrayAndSize, int); - -// Unsigned int -%scilab_array_typemaps(unsigned int, SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize, - SWIG_SciDouble_FromUnsignedIntArrayAndSize, unsigned int); - -// Long -%scilab_array_typemaps(long, SWIG_SciDoubleOrInt32_AsIntArrayAndSize, - SWIG_SciDouble_FromLongArrayAndSize, int); - -// Unsigned long -%scilab_array_typemaps(unsigned long, SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize, - SWIG_SciDouble_FromUnsignedLongArrayAndSize, unsigned int); - -// Float -%scilab_array_typemaps(float, SWIG_SciDouble_AsFloatArrayAndSize, - SWIG_SciDouble_FromFloatArrayAndSize, float); - -// Bool -%scilab_array_typemaps(bool, SWIG_SciBoolean_AsIntArrayAndSize, - SWIG_SciBoolean_FromBoolArrayAndSize, int); - -// Char * -%scilab_array_typemaps(char *, SWIG_SciString_AsCharPtrArrayAndSize, - SWIG_SciString_FromCharPtrArrayAndSize, char *); - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scibool.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scibool.swg deleted file mode 100755 index 9aed88ec..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scibool.swg +++ /dev/null @@ -1,156 +0,0 @@ -/* - * C-type: bool - * Scilab type: boolean scalar - */ -%fragment(SWIG_AsVal_frag(bool), "header") { -SWIGINTERN int -SWIG_AsVal_dec(bool)(SwigSciObject iVar, bool *pbValue) { - SciErr sciErr; - int iRet = 0; - int *piAddrVar = NULL; - int iTempValue = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (!isBooleanType(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean expected.\n"), SWIG_Scilab_GetFuncName(), iVar); - return SWIG_ERROR; - } - - if (!isScalar(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A boolean expected.\n"), SWIG_Scilab_GetFuncName(), iVar); - return SWIG_ERROR; - } - - iRet = getScalarBoolean(pvApiCtx, piAddrVar, &iTempValue); - if (iRet) { - return SWIG_ERROR; - } - - *pbValue = iTempValue; - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(bool), "header") { -SWIGINTERN int -SWIG_From_dec(bool)(bool bValue) { - if (createScalarBoolean(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) - + SWIG_Scilab_GetOutputPosition(), bValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: bool[] - * Scilab type: boolean matrix - */ -%fragment("SWIG_SciBoolean_AsBoolArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_AsBoolArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, bool **pbValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - int *piValue = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isBooleanType(pvApiCtx, piAddrVar)) { - int i; - sciErr = getMatrixOfBoolean(pvApiCtx, piAddrVar, iRows, iCols, &piValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - *pbValue = (bool*) malloc((*iRows) * (*iCols) * sizeof(bool)); - for (i = 0; i < (*iRows) * (*iCols); i++) - (*pbValue)[i] = piValue[i] != 0; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciBoolean_FromBoolArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_FromBoolArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, bool *pbValue) { - SciErr sciErr; - int *piValue = NULL; - int i; - - piValue = (int*) malloc(iRows * iCols * sizeof(int)); - for (i = 0; i < iRows * iCols; i++) - piValue[i] = pbValue[i]; - - sciErr = createMatrixOfBoolean(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, piValue); - if(sciErr.iErr) { - printError(&sciErr, 0); - free(piValue); - return SWIG_ERROR; - } - - free(piValue); - return SWIG_OK; -} -} - -/* - * C-type: int[] - * Scilab type: boolean matrix - */ -%fragment("SWIG_SciBoolean_AsIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_AsIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, int **piValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isBooleanType(pvApiCtx, piAddrVar)) { - sciErr = getMatrixOfBoolean(pvApiCtx, piAddrVar, iRows, iCols, piValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciBoolean_FromIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_FromIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, int *piValue) { - SciErr sciErr; - - sciErr = createMatrixOfBoolean(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, piValue); - if(sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scichar.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scichar.swg deleted file mode 100755 index 5edbf5b7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scichar.swg +++ /dev/null @@ -1,292 +0,0 @@ -/* - * C-type: char or char* - * Scilab type: string - */ - -/* - * CHAR - */ - -%fragment(SWIG_AsVal_frag(char), "header", fragment="SWIG_SciString_AsChar") { -#define SWIG_AsVal_char(scilabValue, valuePointer) SWIG_SciString_AsChar(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciString_AsChar", "header") { -SWIGINTERN int -SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - char *pstValue = NULL; - int iRet; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isStringType(pvApiCtx, piAddrVar) == 0) - { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - iRet = getAllocatedSingleString(pvApiCtx, piAddrVar, &pstValue); - if (iRet) { - return SWIG_ERROR; - } - - if (pcValue != NULL) { - *pcValue = pstValue[0]; - } - - freeAllocatedSingleString(pstValue); - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(char), "header", fragment="SWIG_SciString_FromChar") { -#define SWIG_From_char(value) SWIG_SciString_FromChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value) -} -%fragment("SWIG_SciString_FromChar", "header") { -SWIGINTERN int -SWIG_SciString_FromChar(void *pvApiCtx, int iVarOut, char chValue) { - char *pchValue = (char*)malloc(sizeof(char) * 2); - pchValue[0] = chValue; - pchValue[1] = '\0'; - - if (createSingleString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, pchValue)) - return SWIG_ERROR; - - free(pchValue); - return SWIG_OK; -} -} - -/* - * CHAR * -*/ - -%fragment("SWIG_AsCharArray", "header", fragment = "SWIG_SciString_AsCharPtr") { -#define SWIG_AsCharArray(scilabValue, charPtrPointer, charPtrLength) SWIG_SciString_AsCharPtr(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciString_AsCharPtr", "header") { -SWIGINTERN int -SWIG_SciString_AsCharPtr(void *pvApiCtx, int iVar, char *pcValue, int iLength, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - char* pcTmpValue = NULL; - int iRet; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - iRet = getAllocatedSingleString(pvApiCtx, piAddrVar, &pcTmpValue); - if (iRet) { - return SWIG_ERROR; - } - - if (pcValue != NULL) { - strncpy(pcValue, pcTmpValue, iLength); - } - - freeAllocatedSingleString(pcTmpValue); - return SWIG_OK; -} -} - -%fragment("SWIG_AsCharPtrAndSize", "header", fragment = "SWIG_SciString_AsCharPtrAndSize") { -#define SWIG_AsCharPtrAndSize(scilabValue, charPtrPointer, charPtrLength, allocMemory) SWIG_SciString_AsCharPtrAndSize(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, allocMemory, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciString_AsCharPtrAndSize", "header") { -SWIGINTERN int -SWIG_SciString_AsCharPtrAndSize(void *pvApiCtx, int iVar, char **pcValue, size_t *piLength, int *alloc, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - char *pstString = NULL; - int iRows = 0; - int iCols = 0; - int iLen = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isScalar(pvApiCtx, piAddrVar) == 0 || isStringType(pvApiCtx, piAddrVar) == 0) - { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &iLen, NULL); - if (sciErr.iErr) - { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - pstString = %new_array(iLen + 1, char); - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &iLen, &pstString); - if (sciErr.iErr) - { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - // TODO: return SWIG_ERROR if pcValue NULL (now returning SWIG_ERROR fails some typechecks) - if (pcValue) { - *pcValue = pstString; - } - - if (alloc != NULL) { - *alloc = SWIG_NEWOBJ; - } - - if (piLength != NULL) { - *piLength = strlen(pstString); - } - - return SWIG_OK; -} -} - -%fragment("SWIG_FromCharPtr", "header", fragment = "SWIG_SciString_FromCharPtr") { -#define SWIG_FromCharPtr(charPtr) SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr) -} -%fragment("SWIG_SciString_FromCharPtr", "header") { -SWIGINTERN int -SWIG_SciString_FromCharPtr(void *pvApiCtx, int iVarOut, const char *pchValue) { - if (pchValue) { - SciErr sciErr; - const char* pstStrings[1]; - pstStrings[0] = pchValue; - - sciErr = createMatrixOfString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, 1, 1, pstStrings); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - int iRet = createEmptyMatrix(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut); - if (iRet) { - return SWIG_ERROR; - } - } - - return SWIG_OK; -} -} - -/* - * CHAR * ARRAY - */ - -%fragment("SWIG_SciString_AsCharPtrArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciString_AsCharPtrArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, char ***charPtrArray, char *fname) { - SciErr sciErr; - int i = 0; - int *piAddrVar = NULL; - int* piLength = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, iRows, iCols, NULL, NULL); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - piLength = (int*) malloc((*iRows) * (*iCols) * sizeof(int)); - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, iRows, iCols, piLength, NULL); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - *charPtrArray = (char**) malloc((*iRows) * (*iCols) * sizeof(char*)); - for(i = 0 ; i < (*iRows) * (*iCols); i++) { - (*charPtrArray)[i] = (char*) malloc(sizeof(char) * (piLength[i] + 1)); - } - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, iRows, iCols, piLength, *charPtrArray); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - free(piLength); - return SWIG_OK; -} -} - -%fragment("SWIG_SciString_FromCharPtrArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciString_FromCharPtrArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, char **charPtrArray) { - SciErr sciErr; - - sciErr = createMatrixOfString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, (const char* const*) charPtrArray); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_FromCharPtrAndSize", "header", fragment = "SWIG_SciString_FromCharPtr") { -#define SWIG_FromCharPtrAndSize(charPtr, charPtrLength) SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr) -} - - -/* - * Char* Scilab variable - */ - -%fragment(SWIG_CreateScilabVariable_frag(char), "wrapper") { -SWIGINTERN int -SWIG_CreateScilabVariable_dec(char)(void *pvApiCtx, const char* psVariableName, const char cVariableValue) { - SciErr sciErr; - char sValue[2]; - const char* psStrings[1]; - - sValue[0] = cVariableValue; - sValue[1] = '\0'; - psStrings[0] = sValue; - - sciErr = createNamedMatrixOfString(pvApiCtx, psVariableName, 1, 1, psStrings); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - return SWIG_OK; -} -} - -%fragment(SWIG_CreateScilabVariable_frag(charptr), "wrapper") { -SWIGINTERN int -SWIG_CreateScilabVariable_dec(charptr)(void *pvApiCtx, const char* psVariableName, const char* psVariableValue) { - SciErr sciErr; - const char* psStrings[1]; - psStrings[0] = psVariableValue; - - sciErr = createNamedMatrixOfString(pvApiCtx, psVariableName, 1, 1, psStrings); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - return SWIG_OK; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scicontainer.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scicontainer.swg deleted file mode 100755 index f6078690..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scicontainer.swg +++ /dev/null @@ -1,445 +0,0 @@ -/* ----------------------------------------------------------------------------- - * scicontainer.swg - * - * Scilab list <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Scilab, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - - -// #define (SWIG_SCILAB_EXTRA_NATIVE_CONTAINERS) -// if defined: sequences in return are converted from/to Scilab lists or matrices -// if not defined: sequences are passed from/to Scilab as pointers - -%{ -#define SWIG_STD_NOASSIGN_STL -%} - -%include -%include - -%{ -#include -%} - -%include -%include - -%fragment("SciSequence_Cont", "header", - fragment="StdTraits", - fragment="SwigSciIterator_T", - fragment=SWIG_Traits_Sequence_frag(ptr), - fragment=SWIG_Traits_SequenceItem_frag(ptr)) -{ -namespace swig -{ - template - struct SciSequence_Ref - { - SciSequence_Ref(const SwigSciObject& seq, int index) - : _seq(seq), _index(index) - { - if (traits_as_sequence::get(_seq, &piSeqAddr) != SWIG_OK) - { - throw std::invalid_argument("Cannot get sequence data."); - } - } - - operator T () const - { - return traits_asval_sequenceitem::asval(_seq, piSeqAddr, _index); - } - - SciSequence_Ref& operator=(const T& v) - { - // TODO - return *this; - } - - private: - SwigSciObject _seq; - int _index; - void *piSeqAddr; - }; - - - template - struct SciSequence_ArrowProxy - { - SciSequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct SwigSciSequence_InputIterator - { - typedef SwigSciSequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - - SwigSciSequence_InputIterator() - { - } - - SwigSciSequence_InputIterator(const SwigSciObject& seq, int index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - SciSequence_ArrowProxy - operator->() const { - return SciSequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - SwigSciObject _seq; - difference_type _index; - }; - - template - struct SciSequence_Cont - { - typedef SciSequence_Ref reference; - typedef const SciSequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - typedef int size_type; - typedef const pointer const_pointer; - typedef SwigSciSequence_InputIterator iterator; - typedef SwigSciSequence_InputIterator const_iterator; - - SciSequence_Cont(const SwigSciObject& seq) : _seq(seq) - { - } - - ~SciSequence_Cont() - { - } - - size_type size() const - { - int iSeqSize; - if (traits_as_sequence::size(_seq, &iSeqSize) == SWIG_OK) - { - return iSeqSize; - } - else - { - return SWIG_ERROR; - } - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - private: - SwigSciObject _seq; - }; -} -} - -%define %swig_sequence_iterator(Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - class iterator; - class reverse_iterator; - class const_iterator; - class const_reverse_iterator; - - %typemap(out,noblock=1,fragment="SciSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - %set_output(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &)), - swig::SciSwigIterator::descriptor(),SWIG_POINTER_OWN)); - } - %typemap(out,fragment="SciSequence_Cont") - std::pair, std::pair { - // TODO: return a Scilab list from the pair (see code for Octave) - } - - %fragment("SciSwigPairBoolOutputIterator", "header", - fragment=SWIG_From_frag(bool), fragment="SciSequence_Cont") {} - - %typemap(out,fragment="SciSwigPairBoolOutputIterator") - std::pair, std::pair { - // TODO: return a Scilab list from the pair (see code for Octave) - } - - %typemap(in,noblock=1,fragment="SciSequence_Cont") - iterator(swig::SciSwigIterator *iter = 0, int res), - reverse_iterator(swig::SciSwigIterator *iter = 0, int res), - const_iterator(swig::SciSwigIterator *iter = 0, int res), - const_reverse_iterator(swig::SciSwigIterator *iter = 0, int res) { - res = SWIG_ConvertPtr((SwigSciObject)$input, %as_voidptrptr(&iter), swig::SciSwigIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::SwigSciIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="SciSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - swig::SciSwigIterator *iter = 0; - int res = SWIG_ConvertPtr((SwigSciObject)$input, %as_voidptrptr(&iter), swig::SciSwigIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("SciSequence_Cont"); -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - -// The Scilab container methods - -%define %swig_container_methods(Container...) -%enddef - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="SciSequence_Cont") -{ -namespace swig { - template - inline void - assign(const SciSeq& sciSeq, Seq* seq) { -%#ifdef SWIG_STD_NOASSIGN_STL - typedef typename SciSeq::value_type value_type; - typename SciSeq::const_iterator it = sciSeq.begin(); - for (;it != sciSeq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } -%#else - seq->assign(sciSeq.begin(), sciSeq.end()); -%#endif - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(const SwigSciObject& obj, sequence **seq) - { - swig_type_info *typeInfo = swig::type_info(); - if (typeInfo) - { - sequence *p; - if (SWIG_ConvertPtr(obj, (void**)&p, typeInfo, 0) == SWIG_OK) - { - if (seq) - *seq = p; - return SWIG_OLDOBJ; - } - } - - if (traits_as_sequence::check(obj) == SWIG_OK) - { - try - { - SciSequence_Cont sciSeq(obj); - if (seq) - { - *seq = new sequence(); - assign(sciSeq, *seq); - return SWIG_NEWOBJ; - } - else - { - return SWIG_ERROR; - } - } - catch (std::exception& e) - { - SWIG_exception(SWIG_RuntimeError, e.what()); - return SWIG_ERROR; - } - } - else - { - return SWIG_ERROR; - } - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static SwigSciObject from(const sequence& seq) - { - %#ifdef SWIG_SCILAB_EXTRA_NATIVE_CONTAINERS - swig_type_info *typeInfo = swig::type_info(); - if (typeInfo) - { - return SWIG_NewPointerObj(new sequence(seq), typeInfo, SWIG_POINTER_OWN); - } - %#endif - - try - { - void *data; - size_type size = seq.size(); - if (traits_from_sequence::create(size, &data) == SWIG_OK) { - const_iterator it; - int index = 0; - for (it = seq.begin(); it != seq.end(); ++it) - { - traits_from_sequenceitem::from(data, index, *it); - index++; - } - return traits_from_sequence::set(size, data); - } - return SWIG_OK; - } - catch (std::exception& e) - { - SWIG_exception(SWIG_RuntimeError, e.what()); - return SWIG_ERROR; - } - } - }; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scidouble.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scidouble.swg deleted file mode 100755 index 1b826330..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scidouble.swg +++ /dev/null @@ -1,108 +0,0 @@ -/* - * DOUBLE SCALAR - */ -%fragment(SWIG_AsVal_frag(double), "header", fragment="SWIG_SciDouble_AsDouble") { -%#define SWIG_AsVal_double(scilabValue, valuePointer) SWIG_SciDouble_AsDouble(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_AsDouble", "header") { -SWIGINTERN int -SWIG_SciDouble_AsDouble(void *pvApiCtx, SwigSciObject iVar, double *pdblValue, char *fname) { - SciErr sciErr; - int iRet = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (!isDoubleType(pvApiCtx, piAddrVar) || isVarComplex(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - if (!isScalar(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A real expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - iRet = getScalarDouble(pvApiCtx, piAddrVar, pdblValue); - if (iRet) { - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(double), "header", fragment="SWIG_SciDouble_FromDouble") { -%#define SWIG_From_double(scilabValue) SWIG_SciDouble_FromDouble(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromDouble", "header") { -SWIGINTERN int -SWIG_SciDouble_FromDouble(void *pvApiCtx, int iVarOut, double dblValue, char *fname) { - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, dblValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * DOUBLE ARRAY - */ - -%fragment("SWIG_SciDouble_AsDoubleArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_AsDoubleArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, double **pdValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar) && !isVarComplex(pvApiCtx, piAddrVar)) { - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, pdValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromDoubleArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromDoubleArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, double *pdblValue) { - SciErr sciErr; - sciErr = createMatrixOfDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, pdblValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_CreateScilabVariable_frag(double), "wrapper") { -SWIGINTERN int -SWIG_CreateScilabVariable_dec(double)(void *pvApiCtx, const char* psVariableName, const double dVariableValue) { - SciErr sciErr; - sciErr = createNamedMatrixOfDouble(pvApiCtx, psVariableName, 1, 1, &dVariableValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - return SWIG_OK; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scienum.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scienum.swg deleted file mode 100755 index cc1f7c97..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scienum.swg +++ /dev/null @@ -1,31 +0,0 @@ -/* - * C-type: enum - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(Enum), "header", fragment="SWIG_Int_AsEnum") { -%#define SWIG_AsVal_Enum(scilabValue, valuePointer) SWIG_Int_AsEnum(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_AsEnum", "header", fragment="SWIG_SciDoubleOrInt32_AsInt") { -SWIGINTERN int -SWIG_Int_AsEnum(void *pvApiCtx, int iVar, int *enumValue, char *fname) { - int iValue = 0; - if (SWIG_SciDoubleOrInt32_AsInt(pvApiCtx, iVar, &iValue, fname) != SWIG_OK) - return SWIG_ERROR; - *enumValue = iValue; - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(Enum), "header", fragment="SWIG_Int_FromEnum") { -%#define SWIG_From_Enum(scilabValue) SWIG_Int_FromEnum(pvApiCtx, SWIG_Scilab_GetOutputPosition(), (int)scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_FromEnum", "header", fragment="SWIG_SciDouble_FromInt") { -SWIGINTERN int -SWIG_Int_FromEnum(void *pvApiCtx, int iVarOut, int enumValue, char *fname) { - if (SWIG_SciDouble_FromInt(pvApiCtx, iVarOut, enumValue, fname) != SWIG_OK) - return SWIG_ERROR; - SWIG_Scilab_SetOutput(pvApiCtx, iVarOut); - return SWIG_OK; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/sciexception.swg b/linux/bin/swig/share/swig/4.1.0/scilab/sciexception.swg deleted file mode 100755 index 1d653b31..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/sciexception.swg +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Exception typemaps (throws) - */ - -%include - -%typemap(throws, noblock=1) int, unsigned int, signed int, - int&,unsigned int&, signed int&, - long, unsigned long, signed long, - short, unsigned short,signed short, - long long, unsigned long long, - unsigned char, signed char, - long&, unsigned long&, signed long&, - short&, unsigned short&, signed short&, - long long&, unsigned long long&, - unsigned char&, signed char&, - size_t, size_t&, - ptrdiff_t, ptrdiff_t& { - char obj[20]; - sprintf(obj, "%d", (int)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) enum SWIGTYPE { - char obj[20]; - sprintf(obj, "%d", (int)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) float, double, - float&, double& { - char obj[20]; - sprintf(obj, "%5.3f", (double)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) bool, bool& { - SWIG_Scilab_Raise_Ex($1 ? "true" : "false", "$type", $descriptor); -} - -%typemap(throws, noblock=1) char*, char[ANY] { - SWIG_Scilab_Raise_Ex($1, "$type", $descriptor); -} - -%typemap(throws, noblock=1) char, char& { - char obj[2]; - sprintf(obj, "%c", (char)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) SWIGTYPE, - SWIGTYPE*, - SWIGTYPE [ANY], - SWIGTYPE & { - SWIG_Scilab_Raise_Ex((char*)NULL, "$type", $descriptor); -} - -%typemap(throws, noblock=1) (...) { - SWIG_exception(SWIG_RuntimeError, "unknown exception"); -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scifloat.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scifloat.swg deleted file mode 100755 index f0af17c0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scifloat.swg +++ /dev/null @@ -1,83 +0,0 @@ -/* - * FLOAT SCALAR - */ - -%fragment(SWIG_AsVal_frag(float), "header", fragment=SWIG_AsVal_frag(double)) { -SWIGINTERN int -SWIG_AsVal_dec(float)(SwigSciObject iVar, float *pfValue) { - double dblValue = 0.0; - if(SWIG_AsVal_dec(double)(iVar, &dblValue) != SWIG_OK) { - return SWIG_ERROR; - } - if (pfValue) - *pfValue = (float) dblValue; - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(float), "header") { -SWIGINTERN int -SWIG_From_dec(float)(float flValue) { - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) - + SWIG_Scilab_GetOutputPosition(), (double)flValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_AsFloatArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_AsFloatArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, float **pfValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - double *pdValue = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar) && !isVarComplex(pvApiCtx, piAddrVar)) { - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - *pfValue = (float *) malloc((*iRows) * (*iCols) * sizeof(float)); - for (i=0; i < (*iRows) * (*iCols); i++) - (*pfValue)[i] = (float) pdValue[i]; - - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } -} -} - -%fragment("SWIG_SciDouble_FromFloatArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromFloatArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, float *pfValue) { - SciErr sciErr; - double *pdValue; - int i; - - pdValue = (double *) malloc(iRows * iCols * sizeof(double)); - for (i = 0; i < iRows * iCols; i++) - pdValue[i] = pfValue[i]; - - sciErr = createMatrixOfDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, pdValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - free(pdValue); - return SWIG_OK; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/sciint.swg b/linux/bin/swig/share/swig/4.1.0/scilab/sciint.swg deleted file mode 100755 index 2d699356..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/sciint.swg +++ /dev/null @@ -1,202 +0,0 @@ -/* - * C-type: int - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(int), "header", fragment="SWIG_SciDoubleOrInt32_AsInt", fragment="") { -%#define SWIG_AsVal_int(scilabValue, valuePointer) SWIG_SciDoubleOrInt32_AsInt(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDoubleOrInt32_AsInt", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt32_AsInt(void *pvApiCtx, SwigSciObject iVar, int *piValue, char *fname) -{ - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - if (piValue) { - int iPrec = 0; - int *piData = NULL; - - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - sciErr = getMatrixOfInteger32(pvApiCtx, piAddrVar, &iRows, &iCols, &piData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - *piValue = *piData; - } - } - else if (iType == sci_matrix) { - if (piValue) { - double *pdData = NULL; - double dValue = 0.0f; - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < INT_MIN) || (dValue > INT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *piValue = (int) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(int), "header", fragment="SWIG_SciDouble_FromInt") { -%#define SWIG_From_int(scilabValue) SWIG_SciDouble_FromInt(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromInt", "header") { -SWIGINTERN int -SWIG_SciDouble_FromInt(void *pvApiCtx, int iVarOut, int iValue, char *fname){ - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) - + iVarOut, (double) iValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: int[] - * Scilab type: double or int32 matrix - */ -%fragment("SWIG_SciDoubleOrInt32_AsIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt32_AsIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, int **piValue, char *fname) { - SciErr sciErr; - int iType = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *piValue = (int*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*piValue)[i] = (int) pdData[i]; - } - else if (iType == sci_ints) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - sciErr = getMatrixOfInteger32(pvApiCtx, piAddrVar, iRows, iCols, piValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const int *piData) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i - -%fragment("SciSwigIterator","header",fragment="") { -namespace swig { - struct stop_iteration { - }; - - struct SciSwigIterator { - private: - SwigSciObject _seq; - - protected: - SciSwigIterator(SwigSciObject seq) : _seq(seq) - { - } - - public: - virtual ~SciSwigIterator() {} - - virtual SwigSciObject value() const = 0; - - virtual SciSwigIterator *incr(size_t n = 1) = 0; - - virtual SciSwigIterator *decr(size_t n = 1) - { - throw stop_iteration(); - } - - virtual ptrdiff_t distance(const SciSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual bool equal (const SciSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual SciSwigIterator *copy() const = 0; - - SwigSciObject next() - { - SwigSciObject obj = value(); - incr(); - return obj; - } - - SwigSciObject previous() - { - decr(); - return value(); - } - - SciSwigIterator *advance(ptrdiff_t n) - { - return (n > 0) ? incr(n) : decr(-n); - } - - bool operator == (const SciSwigIterator& x) const - { - return equal(x); - } - - bool operator != (const SciSwigIterator& x) const - { - return ! operator==(x); - } - - SciSwigIterator* operator ++ () { - incr(); - return this; - } - - SciSwigIterator* operator -- () { - decr(); - return this; - } - - SciSwigIterator* operator + (ptrdiff_t n) const - { - return copy()->advance(n); - } - - SciSwigIterator* operator - (ptrdiff_t n) const - { - return copy()->advance(-n); - } - - ptrdiff_t operator - (const SciSwigIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::SciSwigIterator *"); - init = 1; - } - return desc; - } - }; -} -} - -%fragment("SwigSciIterator_T","header",fragment="",fragment="SciSwigIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - template - class SwigSciIterator_T : public SciSwigIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef SwigSciIterator_T self_type; - - SwigSciIterator_T(out_iterator curr, SwigSciObject seq) - : SciSwigIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const SciSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const SciSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef SwigSciObject result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - template::value_type, - typename FromOper = from_oper > - class SciSwigIteratorOpen_T : public SwigSciIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigSciIterator_T base; - typedef SciSwigIteratorOpen_T self_type; - - SciSwigIteratorOpen_T(out_iterator curr, SwigSciObject seq) - : SwigSciIterator_T(curr, seq) - { - } - - SwigSciObject value() const { - return from(static_cast(*(base::current))); - } - - SciSwigIterator *copy() const - { - return new self_type(*this); - } - - SciSwigIterator *incr(size_t n = 1) - { - while (n--) { - ++base::current; - } - return this; - } - - SciSwigIterator *decr(size_t n = 1) - { - while (n--) { - --base::current; - } - return this; - } - }; - - template::value_type, - typename FromOper = from_oper > - class SciSwigIteratorClosed_T : public SwigSciIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigSciIterator_T base; - typedef SciSwigIteratorClosed_T self_type; - - SciSwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, SwigSciObject seq) - : SwigSciIterator_T(curr, seq), begin(first), end(last) - { - } - - SwigSciObject value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - SciSwigIterator *copy() const - { - return new self_type(*this); - } - - SciSwigIterator *incr(size_t n = 1) - { - while (n--) { - if (base::current == end) { - throw stop_iteration(); - } else { - ++base::current; - } - } - return this; - } - - SciSwigIterator *decr(size_t n = 1) - { - while (n--) { - if (base::current == begin) { - throw stop_iteration(); - } else { - --base::current; - } - } - return this; - } - - private: - out_iterator begin; - out_iterator end; - }; - - template - inline SciSwigIterator* - make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, SwigSciObject seq = SwigSciObject()) - { - return new SciSwigIteratorClosed_T(current, begin, end, seq); - } - - template - inline SciSwigIterator* - make_output_iterator(const OutIter& current, SwigSciObject seq = SwigSciObject()) - { - return new SciSwigIteratorOpen_T(current, seq); - } -} -} - - -%fragment("SciSwigIterator"); -namespace swig -{ -// Throw a StopIteration exception - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws, noblock=1) stop_iteration - { - SWIG_Scilab_Raise(0, "stop_iteration", NULL); - return SWIG_ERROR; - } - -// Mark methods that return new objects - %newobject SciSwigIterator::copy; - %newobject SciSwigIterator::operator + (ptrdiff_t n) const; - %newobject SciSwigIterator::operator - (ptrdiff_t n) const; - - %nodirector SciSwigIterator; - - %catches(swig::stop_iteration) SciSwigIterator::value() const; - %catches(swig::stop_iteration) SciSwigIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) SciSwigIterator::decr(size_t n = 1); - %catches(std::invalid_argument) SciSwigIterator::distance(const SciSwigIterator &x) const; - %catches(std::invalid_argument) SciSwigIterator::equal (const SciSwigIterator &x) const; - %catches(swig::stop_iteration) SciSwigIterator::next(); - %catches(swig::stop_iteration) SciSwigIterator::previous(); - %catches(swig::stop_iteration) SciSwigIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) SciSwigIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) SciSwigIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) SciSwigIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) SciSwigIterator::operator - (ptrdiff_t n) const; - - %ignore SciSwigIterator::operator==; - %ignore SciSwigIterator::operator!=; - %ignore SciSwigIterator::operator++; - %ignore SciSwigIterator::operator--; - %ignore SciSwigIterator::operator+; - %ignore SciSwigIterator::operator-; - - struct SciSwigIterator - { - protected: - SciSwigIterator(SwigSciObject seq); - - public: - virtual ~SciSwigIterator(); - - virtual SwigSciObject value() const = 0; - - virtual SciSwigIterator *incr(size_t n = 1) = 0; - - virtual SciSwigIterator *decr(size_t n = 1); - - virtual ptrdiff_t distance(const SciSwigIterator &x) const; - - virtual bool equal (const SciSwigIterator &x) const; - - virtual SciSwigIterator *copy() const = 0; - - SwigSciObject next(); - SwigSciObject previous(); - SciSwigIterator *advance(ptrdiff_t n); - - bool operator == (const SciSwigIterator& x) const; - bool operator != (const SciSwigIterator& x) const; - SciSwigIterator* operator ++ (); - SciSwigIterator* operator -- (); - SciSwigIterator* operator + (ptrdiff_t n) const; - SciSwigIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const SciSwigIterator& x) const; - }; -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scilab.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scilab.swg deleted file mode 100755 index 3b5f6e81..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scilab.swg +++ /dev/null @@ -1,6 +0,0 @@ -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scilist.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scilist.swg deleted file mode 100755 index 513f40b6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scilist.swg +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Scilab list related functions - * - */ - -%fragment("SWIG_ScilabList", "header") -{ -SWIGINTERN int -SWIG_GetScilabList(SwigSciObject obj, int **piListAddr) -{ - SciErr sciErr; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -SWIGINTERN int -SWIG_GetScilabListSize(SwigSciObject obj, int *piListSize) -{ - SciErr sciErr; - int *piListAddr; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getListItemNumber(pvApiCtx, piListAddr, piListSize); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -SWIGINTERN int -SWIG_GetScilabListAndSize(SwigSciObject obj, int **piListAddr, int *piListSize) -{ - SciErr sciErr; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getListItemNumber(pvApiCtx, *piListAddr, piListSize); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -SWIGINTERN int -SWIG_CheckScilabList(SwigSciObject obj) -{ - SciErr sciErr; - int *piListAddr; - int iType; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piListAddr, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if ((iType != sci_list) && (iType != sci_tlist) && (iType != sci_mlist)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A list is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -} - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scilong.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scilong.swg deleted file mode 100755 index 4e55be53..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scilong.swg +++ /dev/null @@ -1,123 +0,0 @@ -/* - * C-type: long - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(long), "header", fragment="SWIG_SciDoubleOrInt32_AsLong", fragment="") { -%#define SWIG_AsVal_long(scilabValue, valuePointer) SWIG_SciDoubleOrInt32_AsLong(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()); -} -%fragment("SWIG_SciDoubleOrInt32_AsLong", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt32_AsLong(void *pvApiCtx, SwigSciObject iVar, long *plValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - int iPrec = 0; - int *piData = NULL; - - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - sciErr = getMatrixOfInteger32(pvApiCtx, piAddrVar, &iRows, &iCols, &piData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - *plValue = (long) *piData; - } - else if (iType == sci_matrix) { - double *pdData = NULL; - double dValue = 0.0f; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < LONG_MIN) || (dValue > LONG_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *plValue = (long) dValue; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(long), "header", fragment="SWIG_SciDouble_FromLong") { -%#define SWIG_From_long(scilabValue) SWIG_SciDouble_FromLong(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromLong", "header") { -SWIGINTERN int -SWIG_SciDouble_FromLong(void *pvApiCtx, int iVarOut, long lValue, char *fname) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) lValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - - -%fragment("SWIG_SciDouble_FromLongArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromLongArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const long *plData) { - SciErr sciErr; - int i; - double *pdValues = NULL; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i - -// in (bool *IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, bool *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, bool *IN) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (bool *IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, bool *IN) - -%typemap(in, noblock=1) (int IN_SIZE, bool *IN) (int rowCount, int colCount) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (bool**) malloc(sizeof(bool*)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(freearg, noblock=1) (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - free(*$1); - free($1); - free($2); - free($3); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int*) malloc(sizeof(int)); - $3 = (bool**) malloc(sizeof(bool*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ - free($1); - free($2); - free(*$3); - free($3); -} - - -// out (bool **OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (bool **OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit, noblock=1) (bool **OUT, int *OUT_SIZE) -{ - $1 = (bool**) malloc(sizeof(bool*)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (bool **OUT, int *OUT_SIZE) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (bool **OUT, int *OUT_SIZE) -{ - free(*$1); - free($1); - free($2); -} - - -// out (int *OUT_SIZE, bool **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, bool **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, bool **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (bool**) malloc(sizeof(bool*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (int *OUT_SIZE, bool **OUT) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_SIZE, bool **OUT) -{ - free($1); - free(*$2); - free($2); -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scimatrixchar.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scimatrixchar.swg deleted file mode 100755 index 37f68339..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scimatrixchar.swg +++ /dev/null @@ -1,199 +0,0 @@ -/* - * C-type: char* - * Scilab type: string matrix - */ - -%include - -// in (char **IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, char **IN) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, char **IN) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (char **IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, char **IN) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN) (int rowCount, int colCount) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (char***) malloc(sizeof(char**)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - { - int i; - for (i = 0; i < (*$2) * (*$3); i++) - free((*$1)[i]); - } - free(*$1); - free($1); - free($2); - free($3); -} - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ - $1 = (char***) malloc(sizeof(char**)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int**) malloc(sizeof(int*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ - free($1); - free($2); - { - int i; - for (i = 0; i < (*$1) * (*$2); i++) - free((*$3)[i]); - } - free(*$3); - free($3); -} - - -// out (char ***OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (char ***OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit, noblock=1) (char ***OUT, int *OUT_SIZE) -{ - $1 = (char***) malloc(sizeof(char**)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(freearg, noblock=1) (char ***OUT, int *OUT_SIZE) -{ - { - int i; - for (i = 0; i < *$2; i++) - free((*$1)[i]); - } - free(*$1); - free($1); - free($2); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (char ***OUT, int *OUT_SIZE) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, char **IN) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, 1, &$1, &$2, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// out (int *OUT_SIZE, char ***OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, char ***OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, char ***OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (char***) malloc(sizeof(char**)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (int *OUT_SIZE, char ***OUT) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_SIZE, char ***OUT) -{ - free($1); - { - int i; - for (i = 0; i < *$1; i++) - free((*$2)[i]); - } - free(*$2); - free($2); -} - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scimatrixdouble.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scimatrixdouble.swg deleted file mode 100755 index 9444a807..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scimatrixdouble.swg +++ /dev/null @@ -1,170 +0,0 @@ -/* - * C-type: double array - * Scilab type: double matrix - */ - -%include - -// in (double *IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, double *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, double *IN) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (double *IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, double *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_SIZE, double *IN) (int rowCount, int colCount) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (double**) malloc(sizeof(double*)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(freearg, noblock=1) (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - free(*$1); - free($1); - free($2); - free($3); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int*) malloc(sizeof(int)); - $3 = (double**) malloc(sizeof(double*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (int *IN_ROWCOUNT, int *IN_COLCOUNT, double **OUT) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) -{ - free($1); - free($2); - free(*$3); - free($3); -} - - -// out (double **OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (double **OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit, noblock=1) (double **OUT, int *OUT_SIZE) -{ - $1 = (double**) malloc(sizeof(double*)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (double **OUT, int *OUT_SIZE) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (double **OUT, int *OUT_SIZE) -{ - free(*$1); - free($1); - free($2); -} - - -// out (int *OUT_SIZE, double **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, double **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, double **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (double**) malloc(sizeof(double*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (int *OUT_SIZE, double **OUT) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_SIZE, double **OUT) -{ - free($1); - free(*$2); - free($2); -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scimatrixint.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scimatrixint.swg deleted file mode 100755 index e304d4f6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scimatrixint.swg +++ /dev/null @@ -1,175 +0,0 @@ -/* - * C-type: int array - * Scilab type: 32-bit integer matrix - */ - -%include - -// in (int *IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, int *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, int *IN) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - - -// in (int *IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - - -// in (int IN_SIZE, int *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_SIZE, int *IN) (int rowCount, int colCount) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (int**) malloc(sizeof(int*)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - free(*$1); - free($1); - free($2); - free($3); -} - - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int**) malloc(sizeof(int*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ - free($1); - free($2); - free(*$3); - free($3); -} - - -// out (int **OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (int **OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit) (int **OUT, int *OUT_SIZE) -{ - $1 = (int**) malloc(sizeof(int*)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int **OUT, int *OUT_SIZE) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int **OUT, int *OUT_SIZE) -{ - free(*$1); - free($1); - free($2); -} - - -// out (int *OUT_SIZE, int **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, int **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, int **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int**) malloc(sizeof(int*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int *OUT_SIZE, int **OUT) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *IN_SIZE, int **OUT) -{ - free($1); - free(*$2); - free($2); -} - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scimisctypes.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scimisctypes.swg deleted file mode 100755 index fe75e156..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scimisctypes.swg +++ /dev/null @@ -1,69 +0,0 @@ -// Other primitive such as size_t and ptrdiff_t - -/* - * C-type: size_t - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(size_t), "header", fragment="SWIG_Int_AsSize") { -%#define SWIG_AsVal_size_t(scilabValue, valuePointer) SWIG_Int_AsSize(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_AsSize", "header", fragment=SWIG_AsVal_frag(int)) -{ -SWIGINTERN int -SWIG_Int_AsSize(void *pvApiCtx, SwigSciObject iVar, size_t *piValue, char *fname) { - int iValue = 0; - if (SWIG_AsVal_dec(int)(iVar, &iValue) != SWIG_OK) - return SWIG_ERROR; - - if (piValue) - *piValue = (size_t) iValue; - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(size_t), "header", fragment="SWIG_Int_FromSize") { -%#define SWIG_From_size_t(scilabValue) SWIG_Int_FromSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_FromSize", "header", fragment=SWIG_From_frag(int)) -{ -SWIGINTERN int -SWIG_Int_FromSize(void *pvApiCtx, int iVarOut, size_t iValue, char *fname) { - return SWIG_From_dec(int)((int)iValue); -} -} - -/* - * C-type: ptrdiff_t - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(ptrdiff_t), "header", fragment="SWIG_Int_AsPtrDiff") { -%#define SWIG_AsVal_ptrdiff_t(scilabValue, valuePointer) SWIG_Int_AsPtrDiff(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_AsPtrDiff", "header", fragment=SWIG_AsVal_frag(int)) -{ -SWIGINTERN int -SWIG_Int_AsPtrDiff(void *pvApiCtx, SwigSciObject iVar, ptrdiff_t *piValue, char *fname) { - int iValue = 0; - if (SWIG_AsVal_dec(int)(iVar, &iValue) != SWIG_OK) - return SWIG_ERROR; - - if (piValue) - *piValue = (ptrdiff_t) iValue; - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(ptrdiff_t), "header", fragment="SWIG_Int_FromPtrDiff") { -%#define SWIG_From_ptrdiff_t(scilabValue) SWIG_Int_FromPtrDiff(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_FromPtrDiff", "header", fragment=SWIG_From_frag(int)) { -SWIGINTERN int -SWIG_Int_FromPtrDiff(void *pvApiCtx, int iVarOut, ptrdiff_t iValue, char *fname) { - return SWIG_From_dec(int)((int)iValue); -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scipointer.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scipointer.swg deleted file mode 100755 index 94ca4ef3..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scipointer.swg +++ /dev/null @@ -1,32 +0,0 @@ -/* - * POINTER - */ -%fragment("SWIG_ConvertPtr", "header") { -#define SWIG_ConvertPtr(scilabValue, voidPointer, pointerDescriptor, flags) SwigScilabPtrToObject(pvApiCtx, scilabValue, voidPointer, pointerDescriptor, flags, SWIG_Scilab_GetFuncName()) -} - -%fragment("SWIG_NewPointerObj", "header") { -#define SWIG_NewPointerObj(pointer, pointerDescriptor, flags) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, flags, NULL) -} - -/* - * FUNCTION POINTER - */ -%fragment("SWIG_ConvertFunctionPtr", "header") { -#define SWIG_ConvertFunctionPtr(scilabValue, voidPointer, pointerDescriptor) SwigScilabPtrToObject(pvApiCtx, scilabValue, voidPointer, pointerDescriptor, 0, SWIG_Scilab_GetFuncName()) -} - -%fragment("SWIG_NewFunctionPtrObj", "header") { -#define SWIG_NewFunctionPtrObj(pointer, pointerDescriptor) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, 0, NULL) -} -// No fragment used here, the functions "SwigScilabPtrToObject" and "SwigScilabPtrFromObject" are defined in sciruntime.swg - -/* - * C++ member pointers, ie, member methods - */ -%fragment("SWIG_NewMemberObj", "header") { -#define SWIG_NewMemberObj(ptr, sz, tp) SWIG_Scilab_NewMemberObj(pvApiCtx, $result, ptr, sz, tp) -} -%fragment("SWIG_ConvertMember", "header") { -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Scilab_ConvertPacked(pvApiCtx, obj, ptr, sz, ty, SWIG_Scilab_GetFuncName()) -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/sciprimtypes.swg b/linux/bin/swig/share/swig/4.1.0/scilab/sciprimtypes.swg deleted file mode 100755 index b5e30d93..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/sciprimtypes.swg +++ /dev/null @@ -1,23 +0,0 @@ -%include -%include - -%include - -%include -%include - -%include -%include - -%include -%include - -%include -%include -%include - -%include - -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scirun.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scirun.swg deleted file mode 100755 index 586d5f16..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scirun.swg +++ /dev/null @@ -1,532 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Scilab support runtime - * -----------------------------------------------------------------------------*/ - -/* Scilab version macro */ - -#include "version.h" -#define SWIG_SCILAB_VERSION (SCI_VERSION_MAJOR * 100) + (SCI_VERSION_MINOR * 10) + SCI_VERSION_MAINTENANCE - -/* Scilab standard headers */ - -#ifdef __cplusplus -extern "C" { -#endif -#include "api_scilab.h" -#if SWIG_SCILAB_VERSION < 540 -#define __USE_DEPRECATED_STACK_FUNCTIONS__ -#include "stack-c.h" -#endif -#if SWIG_SCILAB_VERSION < 600 -#include "MALLOC.h" -#endif -#include "Scierror.h" -#include "localization.h" -#include "freeArrayOfString.h" -#include -#include -#ifdef __cplusplus -} -#endif - -/* Gateway signature */ - -#if SWIG_SCILAB_VERSION >= 600 -#define SWIG_GatewayParameters char* fname, void *pvApiCtx -#define SWIG_GatewayArguments fname, pvApiCtx -#else -#define SWIG_GatewayParameters char* fname, unsigned long fname_len -#define SWIG_GatewayArguments fname, fname_len -#endif - -/* Function name management functions */ - -#include -static char *SwigFuncName = NULL; -static char *SWIG_Scilab_GetFuncName(void) { - return SwigFuncName; -} -static void SWIG_Scilab_SetFuncName(char *funcName) { - free(SwigFuncName); - SwigFuncName = NULL; - if (funcName) { - SwigFuncName = (char *)malloc(strlen(funcName) + 1); - if (SwigFuncName) - strcpy(SwigFuncName, funcName); - } -} - -/* Api context management functions */ - -#if SWIG_SCILAB_VERSION >= 600 -static void *pvApiCtx = NULL; -static void SWIG_Scilab_SetApiContext(void *apiCtx) { - pvApiCtx = apiCtx; -} -#else -#define SWIG_Scilab_SetApiContext(apiCtx) -#endif - -/* Argument management functions */ - -#if SWIG_SCILAB_VERSION >= 540 -#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) -#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) -#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) -#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) -#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos -#else -#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument) -#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckRhs(minInputArgument, 256) -#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument) -#define SWIG_NbInputArgument(pvApiCtx) Rhs -#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) LhsVar(outputArgumentPos) = argumentPos -#endif - -typedef int SwigSciObject; - -static int SwigOutputPosition = -1; -static int SWIG_Scilab_GetOutputPosition(void) { - return SwigOutputPosition; -} -static void SWIG_Scilab_SetOutputPosition(int outputPosition) { - SwigOutputPosition = outputPosition; -} - -SWIGRUNTIME int -SWIG_Scilab_SetOutput(void *pvApiCtx, SwigSciObject output) { - int outputPosition = SWIG_Scilab_GetOutputPosition(); - if (outputPosition < 0) - return SWIG_ERROR; - SWIG_AssignOutputArgument(pvApiCtx, outputPosition, - SWIG_NbInputArgument(pvApiCtx) + outputPosition); - return SWIG_OK; -} - -/* Error functions */ - -#define SCILAB_API_ARGUMENT_ERROR 999 - -SWIGINTERN const char* -SWIG_Scilab_ErrorType(int code) { - switch(code) { - case SWIG_MemoryError: - return "MemoryError"; - case SWIG_IOError: - return "IOError"; - case SWIG_RuntimeError: - return "RuntimeError"; - case SWIG_IndexError: - return "IndexError"; - case SWIG_TypeError: - return "TypeError"; - case SWIG_DivisionByZero: - return "ZeroDivisionError"; - case SWIG_OverflowError: - return "OverflowError"; - case SWIG_SyntaxError: - return "SyntaxError"; - case SWIG_ValueError: - return "ValueError"; - case SWIG_SystemError: - return "SystemError"; - case SWIG_AttributeError: - return "AttributeError"; - default: - return "RuntimeError"; - } -} -#define SWIG_ErrorType(code) SWIG_Scilab_ErrorType(code) - -#ifndef SWIG_SCILAB_ERROR -#define SWIG_SCILAB_ERROR 20000 -#endif - -SWIGINTERN void -SWIG_Scilab_Error(int code, const char *msg) { - Scierror(SWIG_SCILAB_ERROR - code, _("SWIG/Scilab: %s: %s\n"), SWIG_Scilab_ErrorType(code), msg); -} - -#define SWIG_Error(code, msg) SWIG_Scilab_Error(code, msg) - -#define SWIG_fail return SWIG_ERROR; - -SWIGRUNTIME void -SWIG_Scilab_Raise_Ex(const char *obj, const char *type, swig_type_info *descriptor) { - if (type) { - if (obj) - Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occurred: %s\n", type, obj); - else - Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occurred.\n", type); - } -} - -SWIGRUNTIME void -SWIG_Scilab_Raise(const int obj, const char *type, swig_type_info *descriptor) { - Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occurred.\n", type); -} - -/* Module initialization */ - -static int swig_module_initialized = 0; - -SWIGRUNTIME int -SWIG_Module_Initialized() { - return swig_module_initialized; -} - -/* Pointer conversion functions */ - -SWIGRUNTIME swig_type_info * -SWIG_Scilab_TypeQuery(const char *name); - -SWIGINTERN int -SwigScilabCheckPtr(void *pvApiCtx, int iVar, swig_type_info *descriptor, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - int iType = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_mlist) { - int iItemCount = 0; - void *pvTypeinfo = NULL; - - sciErr = getListItemNumber(pvApiCtx, piAddrVar, &iItemCount); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iItemCount < 3) { - return SWIG_ERROR; - } - - sciErr = getPointerInList(pvApiCtx, piAddrVar, 2, &pvTypeinfo); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (descriptor) { - swig_cast_info *cast = SWIG_TypeCheck(SWIG_TypeName((swig_type_info*)pvTypeinfo), descriptor); - return (cast != NULL); - } - else { - return SWIG_ERROR; - } - } - else { - return (iType == sci_pointer); - } -} - -SWIGINTERN int -SwigScilabPtrToObject(void *pvApiCtx, int iVar, void **pvObj, swig_type_info *descriptor, int flags, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - int iType = 0; - void *pvPtr = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_mlist) { - int iItemCount = 0; - void *pvTypeinfo = NULL; - - sciErr = getListItemNumber(pvApiCtx, piAddrVar, &iItemCount); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iItemCount < 3) { - return SWIG_ERROR; - } - - sciErr = getPointerInList(pvApiCtx, piAddrVar, 2, &pvTypeinfo); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getPointerInList(pvApiCtx, piAddrVar, 3, &pvPtr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (pvPtr) { - if (descriptor) { - swig_cast_info *cast = SWIG_TypeCheck(SWIG_TypeName((swig_type_info *)pvTypeinfo), descriptor); - if (cast) { - int newmemory = 0; - pvPtr = SWIG_TypeCast(cast, pvPtr, &newmemory); - // TODO newmemory - } - else { - return SWIG_ERROR; - } - } - } - } - else if (iType == sci_pointer) { - sciErr = getPointer(pvApiCtx, piAddrVar, &pvPtr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - return SWIG_ERROR; - } - - if (pvObj) { - *pvObj = pvPtr; - if (pvPtr) - return SWIG_OK; - else - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - else { - return SWIG_ERROR; - } -} - -SWIGRUNTIMEINLINE int -SwigScilabPtrFromObject(void *pvApiCtx, int iVarOut, void *pvObj, swig_type_info *descriptor, int flags, const char *pstTypeName) { - SciErr sciErr; - - if (descriptor) { - int *piMListAddr = NULL; - - sciErr = createMList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, 3, &piMListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (pstTypeName == NULL) { - pstTypeName = SWIG_TypeName(descriptor); - } - - sciErr = createMatrixOfStringInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 1, 1, 1, &pstTypeName); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = createPointerInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 2, descriptor); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = createPointerInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 3, pvObj); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - sciErr = createPointer(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, pvObj); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - - return SWIG_OK; -} - -/* Pointer argument conversions */ - - -SWIGRUNTIME int -SWIG_Scilab_ConvertPacked(void *pvApiCtx, int iVar, void *ptr, int sz, swig_type_info *ty, char *fname) { - swig_cast_info *tc; - int *piAddrVar = NULL; - char *pstString = NULL; - char *pstStringPtr = NULL; - SciErr sciErr; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (getAllocatedSingleString(pvApiCtx, piAddrVar, &pstString)) { - return SWIG_ERROR; - } - - /* Pointer values must start with leading underscore */ - if (*pstString != '_') { - freeAllocatedSingleString(pstString); - return SWIG_ERROR; - } - - pstStringPtr = pstString; - pstStringPtr++; - pstStringPtr = (char*)SWIG_UnpackData(pstStringPtr, ptr, sz); - - if (ty) { - if (!pstStringPtr) { - freeAllocatedSingleString(pstString); - return SWIG_ERROR; - } - tc = SWIG_TypeCheck(pstStringPtr, ty); - if (!tc) { - freeAllocatedSingleString(pstString); - return SWIG_ERROR; - } - } - - freeAllocatedSingleString(pstString); - return SWIG_OK; -} - -SWIGRUNTIME int -SWIG_Scilab_NewMemberObj(void *pvApiCtx, int iVarOut, void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - - if ((2*sz + 1 + strlen(type->name)) > 1000) { - return SWIG_ERROR; - } - *(r++) = '_'; - r = SWIG_PackData(r, ptr, sz); - strcpy(r, type->name); - - if (createSingleString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, &result[0])) - return SWIG_ERROR; - - return SWIG_OK; -} - - - - -/* - * Pointer utility functions - */ - -#include - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT int SWIG_this(SWIG_GatewayParameters) { - void *ptrValue = NULL; - if (SwigScilabPtrToObject(pvApiCtx, 1, &ptrValue, NULL, 0, fname) == SWIG_OK) { - SWIG_Scilab_SetOutputPosition(1); - return SWIG_Scilab_SetOutput(pvApiCtx, - createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + 1, - (double)(uintptr_t)ptrValue)); - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The value is not a pointer.\n"), fname, 1); - return SWIG_ERROR; - } -} - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT int SWIG_ptr(SWIG_GatewayParameters) { - if (SWIG_NbInputArgument(pvApiCtx) > 0) { - SciErr sciErr; - int *piAddrVar1 = NULL; - int iTypeVar1 = 0; - char *pstInputPtrTypeName = NULL; - char *pstOutputMListTypeName = NULL; - if (SWIG_NbInputArgument(pvApiCtx) > 2) { - int *piAddrVar2 = NULL; - int *piAddrVar3 = NULL; - sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddrVar2); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (getAllocatedSingleString(pvApiCtx, piAddrVar2, &pstInputPtrTypeName)) { - return SWIG_ERROR; - } - sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddrVar3); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (getAllocatedSingleString(pvApiCtx, piAddrVar3, &pstOutputMListTypeName)) { - return SWIG_ERROR; - } - } - - sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddrVar1); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - sciErr = getVarType(pvApiCtx, piAddrVar1, &iTypeVar1); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if ((iTypeVar1 == sci_pointer) || (iTypeVar1 == sci_mlist)) { - void *ptrValue = NULL; - if (SwigScilabPtrToObject(pvApiCtx, 1, &ptrValue, SWIG_Scilab_TypeQuery(pstInputPtrTypeName), 0, (char *) "SWIG_ptr") == SWIG_OK) { - SWIG_Scilab_SetOutputPosition(1); - return SWIG_Scilab_SetOutput(pvApiCtx, - SwigScilabPtrFromObject(pvApiCtx, 1, ptrValue, SWIG_Scilab_TypeQuery(pstInputPtrTypeName), 0, pstOutputMListTypeName)); - } - else { - return SWIG_ERROR; - } - } - else if (iTypeVar1 == sci_matrix) { - double dValue = 0; - if (getScalarDouble(pvApiCtx, piAddrVar1, &dValue) == 0) { - if (dValue != (uintptr_t)dValue) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a pointer.\n"), fname, 1); - return SWIG_ValueError; - } - if ((dValue < 0) || (dValue > ULONG_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a pointer.\n"), fname, 1); - return SWIG_OverflowError; - } - SWIG_Scilab_SetOutputPosition(1); - return SWIG_Scilab_SetOutput(pvApiCtx, - SwigScilabPtrFromObject(pvApiCtx, 1, (void *) (uintptr_t)dValue, SWIG_Scilab_TypeQuery(pstInputPtrTypeName), 0, pstOutputMListTypeName)); - } - else { - return SWIG_TypeError; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A mlist, pointer or a double expected.\n"), (char *) "SWIG_ptr", 1); - return SWIG_TypeError; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: A mlist, pointer, or a double expected.\n"), "SWIG_ptr", 1); - return SWIG_TypeError; - } -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/sciruntime.swg b/linux/bin/swig/share/swig/4.1.0/scilab/sciruntime.swg deleted file mode 100755 index e772926f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/sciruntime.swg +++ /dev/null @@ -1,47 +0,0 @@ -%insert(runtime) "swigrun.swg"; -%insert(runtime) "swigerrors.swg"; - -%insert(runtime) "scirun.swg"; - -%insert(init) %{ -/* Module management functions */ - -#define SWIG_GetModule(clientdata) SWIG_Scilab_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Scilab_SetModule(pointer) - -SWIGRUNTIME swig_module_info* -SWIG_Scilab_GetModule(void) { - return NULL; -} - -SWIGRUNTIME void -SWIG_Scilab_SetModule(swig_module_info *swig_module) { -} -%} - -%insert(init) "swiginit.swg" - -%insert(init) %{ -SWIGRUNTIME swig_type_info * -SWIG_Scilab_TypeQuery(const char *name) { - if (SWIG_Module_Initialized()) { - if (name) { - return SWIG_TypeQuery(name); - } - } - else { - SWIG_Error(SWIG_RuntimeError, "the module is not initialized"); - } - return NULL; -} -%} - -%insert(init) %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT int SWIG__Init(SWIG_GatewayParameters) { - SWIG_InitializeModule(NULL); - SWIG_CreateScilabVariables(pvApiCtx); - swig_module_initialized = 1; -%} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scisequence.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scisequence.swg deleted file mode 100755 index 5fe0fdbe..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scisequence.swg +++ /dev/null @@ -1,195 +0,0 @@ -/* - * - * Scilab sequence conversions - * - */ - -#define SWIG_Traits_Sequence_frag(Type) %fragment_name(AsVal_Traits_Sequence, Type) - -#define SWIG_AsCheck_Sequence_frag(Type...) %fragment_name(AsCheck_Sequence, Type) -#define SWIG_AsCheck_Sequence_dec(Type...) %symbol_name(AsCheck_Sequence, Type) -#define SWIG_AsGet_Sequence_frag(Type...) %fragment_name(AsGet_Sequence, Type) -#define SWIG_AsGet_Sequence_dec(Type...) %symbol_name(AsGet_Sequence, Type) -#define SWIG_AsSize_Sequence_frag(Type...) %fragment_name(AsSize_Sequence, Type) -#define SWIG_AsSize_Sequence_dec(Type...) %symbol_name(AsSize_Sequence, Type) -#define SWIG_FromCreate_Sequence_frag(Type...) %fragment_name(FromCreate_Sequence, Type) -#define SWIG_FromCreate_Sequence_dec(Type...) %symbol_name(FromCreate_Sequence, Type) -#define SWIG_FromSet_Sequence_frag(Type...) %fragment_name(FromSet_Sequence, Type) -#define SWIG_FromSet_Sequence_dec(Type...) %symbol_name(FromSet_Sequence, Type) - -#define SWIG_Traits_SequenceItem_frag(Type) %fragment_name(AsVal_Traits_SequenceItem, Type) -#define SWIG_AsVal_SequenceItem_frag(Type...) %fragment_name(AsVal_SequenceItem, Type) -#define SWIG_AsVal_SequenceItem_dec(Type...) %symbol_name(AsVal_SequenceItem, Type) -#define SWIG_From_SequenceItem_frag(Type...) %fragment_name(From_SequenceItem, Type) -#define SWIG_From_SequenceItem_dec(Type...) %symbol_name(From_SequenceItem, Type) - -%include -%include -%include -%include -%include -%include - -// -// Sequence conversion -// - -%fragment(SWIG_Traits_Sequence_frag(ptr), "header", - fragment=SWIG_AsCheck_Sequence_frag(ptr), - fragment=SWIG_AsGet_Sequence_frag(ptr), - fragment=SWIG_AsSize_Sequence_frag(ptr), - fragment=SWIG_FromCreate_Sequence_frag(ptr), - fragment=SWIG_FromSet_Sequence_frag(ptr), - fragment="StdTraits", - fragment="") { - -namespace swig { - // Error returned for sequence containers of default item type - template struct traits_as_sequence { - static int check(SwigSciObject obj) { - throw std::invalid_argument("The container data type is not supported."); - } - static int get(SwigSciObject obj, void **sequence) { - throw std::invalid_argument("The container data type is not supported."); - } - static int size(SwigSciObject obj, int *size) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - template struct traits_from_sequence { - static int create(int size, void **sequence) { - throw std::invalid_argument("The container data type is not supported."); - } - static SwigSciObject set(int size, void *sequence) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - - // Support sequence containers of pointers - template struct traits_as_sequence { - static int check(SwigSciObject obj) { - return SWIG_AsCheck_Sequence_dec(ptr)(obj); - } - static int get(SwigSciObject obj, void **sequence) { - return SWIG_AsGet_Sequence_dec(ptr)(obj, (int **)sequence); - } - static int size(SwigSciObject obj, int *size) { - return SWIG_AsSize_Sequence_dec(ptr)(obj, size); - } - }; - template struct traits_from_sequence { - static int create(int size, void **sequence) { - return SWIG_FromCreate_Sequence_dec(ptr)(size, (uintptr_t **)sequence); - } - static SwigSciObject set(int size, void *sequence) { - return SWIG_FromSet_Sequence_dec(ptr)(size, (uintptr_t *)sequence); - } - }; -} -} - -%define %traits_sequence(CppType, ScilabType) - %fragment(SWIG_Traits_Sequence_frag(CppType), "header", - fragment=SWIG_Traits_Sequence_frag(ptr), - fragment=SWIG_AsCheck_Sequence_frag(CppType), - fragment=SWIG_AsGet_Sequence_frag(CppType), - fragment=SWIG_AsSize_Sequence_frag(CppType), - fragment=SWIG_FromCreate_Sequence_frag(CppType), - fragment=SWIG_FromSet_Sequence_frag(CppType)) { - -namespace swig { - template <> struct traits_as_sequence { - static int check(SwigSciObject obj) { - return SWIG_AsCheck_Sequence_dec(CppType)(obj); - } - static int get(SwigSciObject obj, void **sequence) { - return SWIG_AsGet_Sequence_dec(CppType)(obj, (ScilabType **)sequence); - } - static int size(SwigSciObject obj, int *size) { - return SWIG_AsSize_Sequence_dec(CppType)(obj, size); - } - }; - template <> struct traits_from_sequence { - static int create(int size, void **sequence) { - return SWIG_FromCreate_Sequence_dec(CppType)(size, (ScilabType **)sequence); - } - static SwigSciObject set(int size, void *sequence) { - return SWIG_FromSet_Sequence_dec(CppType)(size, (ScilabType *)sequence); - } - }; -} -} -%enddef - - -// -// Sequence item conversion -// - -%fragment(SWIG_Traits_SequenceItem_frag(ptr), "header", - fragment=SWIG_AsVal_SequenceItem_frag(ptr), - fragment=SWIG_From_SequenceItem_frag(ptr), - fragment="StdTraits", - fragment="") { - -namespace swig { - // Error returned for sequence containers of default item type - template struct traits_asval_sequenceitem { - static T asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - template struct traits_from_sequenceitem { - static int from(void *pSequence, int iItemIndex, T itemValue) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - - // Support sequence containers of pointers - template struct traits_asval_sequenceitem { - static T* asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - return static_cast(SWIG_AsVal_SequenceItem_dec(ptr)(obj, (int *)pSequence, iItemIndex)); - } - }; - template struct traits_from_sequenceitem { - static int from(void *pSequence, int iItemIndex, T *itemValue) { - return SWIG_From_SequenceItem_dec(ptr)((uintptr_t *)pSequence, iItemIndex, (uintptr_t) itemValue); - } - }; -} -} - -%define %traits_sequenceitem(CppType, ScilabType) - %fragment(SWIG_Traits_SequenceItem_frag(CppType), "header", - fragment=SWIG_Traits_SequenceItem_frag(ptr), - fragment=SWIG_AsVal_SequenceItem_frag(CppType), - fragment=SWIG_From_SequenceItem_frag(CppType)) { - -namespace swig { - template <> struct traits_asval_sequenceitem { - static CppType asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - return SWIG_AsVal_SequenceItem_dec(CppType)(obj, (ScilabType *)pSequence, iItemIndex); - } - }; - template <> struct traits_from_sequenceitem { - static int from(void *pSequence, int iItemIndex, CppType itemValue) { - return SWIG_From_SequenceItem_dec(CppType)((ScilabType *)pSequence, iItemIndex, itemValue); - } - }; -} -} -%enddef - -%define %add_traits_sequence(CppType, ScilabType) - %traits_sequence(CppType, ScilabType); - %fragment(SWIG_Traits_Sequence_frag(CppType)); - %traits_sequenceitem(CppType, ScilabType); - %fragment(SWIG_Traits_SequenceItem_frag(CppType)); -%enddef - -%add_traits_sequence(int, int); -%add_traits_sequence(double, double); -%add_traits_sequence(float, float); -%add_traits_sequence(std::string, char*); -%add_traits_sequence(bool, int); - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scisequencebool.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scisequencebool.swg deleted file mode 100755 index b7d07844..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scisequencebool.swg +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Scilab matrix of bool <-> C++ bool container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(bool), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(bool)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isBooleanType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(bool), "header", - fragment="SWIG_SciBoolean_AsIntArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(bool)(SwigSciObject obj, int **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciBoolean_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(bool), "header", - fragment="SWIG_SciBoolean_AsIntArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(bool)(SwigSciObject obj, int *piSize) { - int *piMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciBoolean_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &piMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: An integer vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(bool), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(bool)(int size, int **pSequence) { - *pSequence = new int[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(bool), "header", - fragment="SWIG_SciBoolean_FromIntArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(bool)(int size, int *pSequence) { - SwigSciObject obj = SWIG_SciBoolean_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (int *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(bool), "header") { - -SWIGINTERN bool -SWIG_AsVal_SequenceItem_dec(bool)(SwigSciObject obj, int *pSequence, int iItemIndex) { - return (bool) pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(bool), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(bool)(int *pSequence, int iItemIndex, bool itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scisequencedouble.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scisequencedouble.swg deleted file mode 100755 index 29cc52d6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scisequencedouble.swg +++ /dev/null @@ -1,99 +0,0 @@ -/* - * - * Scilab matrix of double <-> C++ double container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(double), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(double)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A double is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(double), "header", - fragment="SWIG_SciDouble_AsDoubleArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(double)(SwigSciObject obj, double **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(double), "header", - fragment="SWIG_SciDouble_AsDoubleArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(double)(SwigSciObject obj, int *piSize) { - double *pdblMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &pdblMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A double vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(double), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(double)(int size, double **pSequence) { - *pSequence = new double[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(double), "header", - fragment="SWIG_SciDouble_FromDoubleArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(double)(int size, double *pSequence) { - SwigSciObject obj = SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (double *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(double), "header") { - -SWIGINTERN double -SWIG_AsVal_SequenceItem_dec(double)(SwigSciObject obj, double *pSequence, int iItemIndex) { - return pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(double), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(double)(double *pSequence, int iItemIndex, double itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scisequencefloat.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scisequencefloat.swg deleted file mode 100755 index 41d37e55..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scisequencefloat.swg +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Scilab matrix of float <-> C++ float container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(float), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(float)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A double is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(float), "header", - fragment="SWIG_SciDouble_AsFloatArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(float)(SwigSciObject obj, float **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciDouble_AsFloatArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(float), "header", - fragment="SWIG_SciDouble_AsFloatArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(float)(SwigSciObject obj, int *piSize) { - float *pdblMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciDouble_AsFloatArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &pdblMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A float vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(float), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(float)(int size, float **pSequence) { - *pSequence = new float[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(float), "header", - fragment="SWIG_SciDouble_FromFloatArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(float)(int size, float *pSequence) { - SwigSciObject obj = SWIG_SciDouble_FromFloatArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (float *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(float), "header") { - -SWIGINTERN float -SWIG_AsVal_SequenceItem_dec(float)(SwigSciObject obj, float *pSequence, int iItemIndex) { - return pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(float), "header") { -SWIGINTERN int -SWIG_From_SequenceItem_dec(float)(float *pSequence, int iItemIndex, float itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scisequenceint.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scisequenceint.swg deleted file mode 100755 index 3a9f7bf6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scisequenceint.swg +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * Scilab matrix of int <-> C++ int container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(int), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(int)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - int iType = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if ((iType == sci_matrix) || (iType == sci_ints)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: An integer is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(int), "header", - fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") { -SWIGINTERN int -SWIG_AsGet_Sequence_dec(int)(SwigSciObject obj, int **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(int), "header", - fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(int)(SwigSciObject obj, int *piSize) { - int *piMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &piMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: An integer vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(int), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(int)(int size, int **pSequence) { - *pSequence = new int[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(int), "header", - fragment="SWIG_SciDouble_FromIntArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(int)(int size, int *pSequence) { - SwigSciObject obj = SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (int *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(int), "header") { - -SWIGINTERN int -SWIG_AsVal_SequenceItem_dec(int)(SwigSciObject obj, int *pSequence, int iItemIndex) { - return pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(int), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(int)(int *pSequence, int iItemIndex, int itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scisequencepointer.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scisequencepointer.swg deleted file mode 100755 index b3618e94..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scisequencepointer.swg +++ /dev/null @@ -1,123 +0,0 @@ -/* - * - * Scilab list of pointer <-> C++ pointer container - * - */ - -%include - -%fragment("", "header") { -%#include -} - -%fragment(SWIG_AsCheck_Sequence_frag(ptr), "header", - fragment="SWIG_ScilabList") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(ptr)(SwigSciObject obj) { - return SWIG_CheckScilabList(obj); -} -} - -%fragment(SWIG_AsGet_Sequence_frag(ptr), "header", - fragment="SWIG_ScilabList") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(ptr)(SwigSciObject obj, int **piSequence) { - return SWIG_GetScilabList(obj, piSequence); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(ptr), "header", - fragment="SWIG_ScilabList") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(ptr)(SwigSciObject obj, int *piSize) { - return SWIG_GetScilabListSize(obj, piSize); -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(ptr), "header", - fragment="") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(ptr)(int size, uintptr_t **pSequence) { - *pSequence = new uintptr_t[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(ptr), "header", - fragment="") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(ptr)(int size, uintptr_t *pSequence) { - SciErr sciErr; - int *piListAddr; - - int iVarOut = SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); - - sciErr = createList(pvApiCtx, iVarOut, size, &piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - for (int i=0; i C++ std::string container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(std::string), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(std::string)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isStringType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A string is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(std::string), "header", - fragment="SWIG_SciString_AsCharPtrArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(std::string)(SwigSciObject obj, char ***pSequence) { - int iRows = 0; - int iCols = 0; - return (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, obj, &iRows, &iCols, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(std::string), "header", - fragment="SWIG_SciString_AsCharPtrArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(std::string)(SwigSciObject obj, int *piSize) { - char **pstMatrix; - int iCols = 0; - int iRows = 0; - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, obj, &iRows, &iCols, &pstMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - *piSize = iRows * iCols; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(std::string), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(std::string)(int size, char ***pSequence) { - *pSequence = new char*[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(std::string), "header", - fragment="SWIG_SciString_FromCharPtrArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(std::string)(int size, char **pSequence) { - SwigSciObject obj = SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (char **)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(std::string), "header") { - -SWIGINTERN std::string -SWIG_AsVal_SequenceItem_dec(std::string)(SwigSciObject obj, char **pSequence, int iItemIndex) { - return std::string(pSequence[iItemIndex]); -} -} - -%fragment(SWIG_From_SequenceItem_frag(std::string), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(std::string)(char **pSequence, int iItemIndex, std::string itemValue) { - char *pChar = new char((int) itemValue.size() + 1); - strcpy(pChar, itemValue.c_str()); - pSequence[iItemIndex] = pChar; - return SWIG_OK; -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scishort.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scishort.swg deleted file mode 100755 index 3d2f0f97..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scishort.swg +++ /dev/null @@ -1,188 +0,0 @@ -/* - * C-type: short - * Scilab type: double or int16 - */ - -%fragment(SWIG_AsVal_frag(short), "header", fragment="SWIG_SciDoubleOrInt16_AsShort", fragment="") { -#define SWIG_AsVal_short(scilabValue, valuePointer) SWIG_SciDoubleOrInt16_AsShort(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDoubleOrInt16_AsShort", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt16_AsShort(void *pvApiCtx, int iVar, short *psValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - int iPrec = 0; - short *psData = NULL; - - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT16) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - sciErr = getMatrixOfInteger16(pvApiCtx, piAddrVar, &iRows, &iCols, &psData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - *psValue = *psData; - } - else if (iType == sci_matrix) { - double *pdData = NULL; - double dValue = 0.0f; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 16-bit signed integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < SHRT_MIN) || (dValue > SHRT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 16-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *psValue = (short) dValue; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(short), "header", fragment="SWIG_SciDouble_FromShort") { -#define SWIG_From_short(scilabValue) SWIG_SciDouble_FromShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromShort", "header") { -SWIGINTERN int -SWIG_SciDouble_FromShort(void *pvApiCtx, int iVarOut, short sValue, char *fname) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) sValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: short[] - * Scilab type: double or int16 matrix - */ -%fragment("SWIG_SciDoubleOrInt16_AsShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt16_AsShortArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, short **psValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *psValue = (short*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*psValue)[i] = (short) pdData[i]; - } - else if (iType == sci_ints) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT16) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfInteger16(pvApiCtx, piAddrVar, iRows, iCols, psValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} -%fragment("SWIG_SciDouble_FromShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromShortArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, short *psValue) { - SciErr sciErr; - int i; - double *pdValues = NULL; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i SCHAR_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 8-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *pscValue = (signed char) dValue; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(signed char), "header", fragment="SWIG_SciDouble_FromSignedChar") { -#define SWIG_From_signed_SS_char(scilabValue) SWIG_SciDouble_FromSignedChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue) -} -%fragment("SWIG_SciDouble_FromSignedChar", "header") { -SWIGINTERN int -SWIG_SciDouble_FromSignedChar(void *pvApiCtx, int iVarOut, signed char scValue) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) scValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: signed char[] - * Scilab type: double or int8 matrix - */ -%fragment("SWIG_SciDoubleOrInt8_AsSignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt8_AsSignedCharArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, signed char **pscValue, char *fname) { - SciErr sciErr; - int iType = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *pscValue = (signed char*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*pscValue)[i] = (signed char) pdData[i]; - } - else if (iType == sci_ints) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT8) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfInteger8(pvApiCtx, piAddrVar, iRows, iCols, (char **)pscValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromSignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromSignedCharArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const signed char *pscValue) { - SciErr sciErr; - int i; - double *pdValues = NULL; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i struct traits_from_ptr { - static SwigSciObject from(Type *val, int owner = 0) { - return SWIG_OK; //SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static SwigSciObject from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static SwigSciObject from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static SwigSciObject from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline SwigSciObject from(const Type& val) { - return traits_from::from(val); - } - - template - inline SwigSciObject from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - // Traits that provides the asval/as/check method - template - struct traits_asptr { - static int asptr(const SwigSciObject& obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(const SwigSciObject& obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(const SwigSciObject& obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) - return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(const SwigSciObject& obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(const SwigSciObject& obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(const SwigSciObject& obj) { - Type v; - int res = asval(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - %type_error(swig::type_name()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type as(const SwigSciObject& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - %type_error(swig::type_name()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(const SwigSciObject& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - %type_error(swig::type_name()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(const SwigSciObject& obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(const SwigSciObject& obj) { - int res = asval(obj, (Type *)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(const SwigSciObject& obj) { - int res = asptr(obj, (Type **)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(const SwigSciObject& obj) { - return traits_check::category>::check(obj); - } -} -} - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(const SwigSciObject& obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static SwigSciObject from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(const SwigSciObject& obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef - - -#define specialize_std_vector(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_list(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_deque(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/scitypemaps.swg b/linux/bin/swig/share/swig/4.1.0/scilab/scitypemaps.swg deleted file mode 100755 index 99fdce7b..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/scitypemaps.swg +++ /dev/null @@ -1,259 +0,0 @@ -// Scilab fragments for primitive types -%include - -%include - -// Scilab object type -#define SWIG_Object int - -#define %append_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR -#define %set_constant(name, obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR // Name is managed by the function name -#define %raise(obj, type, desc) SWIG_Scilab_Raise(obj, type, desc) -#define %set_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR -#define %set_varoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR -#define %set_argoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR - -// Include the unified typemap library -%include - -/* ---------------------------------------------------------------------------*/ -/* Generic typmemaps */ -/* */ -/* This typemap is used when Scilab does not store this type directly */ -/* For example, a 'float' is stored in Scilab as a 'double' */ -/* So we read a 'double' in Scilab and cast it to a 'float' */ -/* ---------------------------------------------------------------------------*/ - -%define %scilab_in_typemap_withcast(TYPEMAPTYPE, FRAGMENTNAME, CTYPE, TEMPTYPE, TEMPINIT) -%typemap(TYPEMAPTYPE, fragment="FRAGMENTNAME") CTYPE { - TEMPTYPE tempValue = TEMPINIT; - if(FRAGMENTNAME(pvApiCtx, $input, &tempValue, SWIG_Scilab_GetFuncName()) != SWIG_OK) { - return SWIG_ERROR; - } - $1 = (CTYPE) tempValue; -} -%enddef -%define %scilab_inptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $input, %as_voidptrptr(&$1), SWIG_Scilab_GetFuncName()) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_out_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, $1) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_outptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, %as_voidptr($1)) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_varout_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, $value) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_varoutptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, %as_voidptr($value)) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_in_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $input, &$1, SWIG_Scilab_GetFuncName()) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - - -/* ---------------------------------------------------------------------------*/ -/* Array typmemaps */ -/* ---------------------------------------------------------------------------*/ - -%include - - -/* ---------------------------------------------------------------------------*/ -/* Enum typemaps */ -/* ---------------------------------------------------------------------------*/ - -%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Enum)) enum SWIGTYPE (int val) { - if (SWIG_AsVal_dec(Enum)($input, &val) != SWIG_OK) { - return SWIG_ERROR; - } - $1 = %static_cast(val, $1_ltype); -} - -%typemap(out, fragment=SWIG_From_frag(Enum)) enum SWIGTYPE { - if (SWIG_From_dec(Enum)($1) != SWIG_OK) { - return SWIG_ERROR; - } -} - -/* ---------------------------------------------------------------------------*/ -/* Typecheck typemaps */ -/* ---------------------------------------------------------------------------*/ - -%define %scilab_typecheck_generic(PRECEDENCE, TYPE_CHECK_FUNCTION, TYPE) -%typecheck(PRECEDENCE) TYPE { - int *piAddrVar = NULL; - SciErr sciErr = getVarAddressFromPosition(pvApiCtx, $input, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - $1 = TYPE_CHECK_FUNCTION(pvApiCtx, piAddrVar); -} -%enddef - -%fragment("SWIG_Check_SciDoubleOrInt", "header") { -SWIGINTERN int -SWIG_Check_SciDoubleOrInt(void *pvApiCtx, SwigSciObject iVar, int iIntegerType) { - int *piAddrVar = NULL; - int ret = 0; - SciErr sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return 0; - } - ret = isIntegerType(pvApiCtx, piAddrVar); - if (ret == 1) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return 0; - } - ret = (iPrec == iIntegerType) ? 1 : 0; - } - else { - ret = isDoubleType(pvApiCtx, piAddrVar); - } - return ret; -} -} - -/* Scilab equivalent for C integers can be sci_intXX or sci_matrix */ -%define %scilab_typecheck_integer(PRECEDENCE, INTTYPE, TYPE) -%typecheck(PRECEDENCE, fragment="SWIG_Check_SciDoubleOrInt") TYPE { - $1 = SWIG_Check_SciDoubleOrInt(pvApiCtx, $input, INTTYPE); -} -%enddef - -%define %scilab_typecheck_pointer(PRECEDENCE, TYPE) -%typecheck(PRECEDENCE) TYPE { - $1 = SwigScilabCheckPtr(pvApiCtx, $input, $descriptor, SWIG_Scilab_GetFuncName()); -} -%enddef - - -// Double (and Float) have priority over before Integer type. - -// Primitive types -%scilab_typecheck_pointer(SWIG_TYPECHECK_VOIDPTR, SWIGTYPE *) -%scilab_typecheck_pointer(SWIG_TYPECHECK_POINTER, SWIGTYPE *) -%scilab_typecheck_generic(SWIG_TYPECHECK_BOOL, isBooleanType, bool) -%scilab_typecheck_generic(16, isDoubleType, double) -%scilab_typecheck_generic(17, isDoubleType, float) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT8, SCI_INT8, signed char) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT8, SCI_UINT8, unsigned char) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT16, SCI_INT16, short) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT16, SCI_UINT16, unsigned short) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, int) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, long) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT32, SCI_UINT32, unsigned int) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT32, SCI_UINT32, unsigned long) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, enum SWIGTYPE) -%scilab_typecheck_generic(SWIG_TYPECHECK_CHAR, isStringType, char) - -// Arrays -%scilab_typecheck_generic(SWIG_TYPECHECK_BOOL_ARRAY, isBooleanType, bool) -%scilab_typecheck_generic(1016, isDoubleType, double [ANY]) -%scilab_typecheck_generic(1017, isDoubleType, float [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT8_ARRAY, SCI_INT8, signed char [ANY]) -%scilab_typecheck_integer(1026, SCI_UINT8, unsigned char [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT16_ARRAY, SCI_INT16, short [ANY]) -%scilab_typecheck_integer(1036, SCI_UINT16, unsigned short [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32_ARRAY, SCI_INT32, int [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32_ARRAY, SCI_INT32, long [ANY]) -%scilab_typecheck_integer(1046, SCI_UINT32, unsigned int [ANY]) -%scilab_typecheck_integer(1046, SCI_UINT32, unsigned long [ANY]) -%scilab_typecheck_generic(SWIG_TYPECHECK_CHAR_ARRAY, isStringType, char [ANY]) -%scilab_typecheck_generic(SWIG_TYPECHECK_STRING_ARRAY, isStringType, char *[ANY]) -%scilab_typecheck_generic(SWIG_TYPECHECK_STRING_ARRAY, isStringType, char **) - - -/* ---------------------------------------------------------------------------*/ -/* %scilabconstcode() feature typemaps */ -/* ---------------------------------------------------------------------------*/ - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(double)) double -%{ - if (SWIG_CreateScilabVariable_double(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(int)) int -%{ - if (SWIG_CreateScilabVariable_int(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(uint)) unsigned int -%{ - if (SWIG_CreateScilabVariable_uint(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(int)) long -%{ - if (SWIG_CreateScilabVariable_int(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(uint)) unsigned long -%{ - if (SWIG_CreateScilabVariable_uint(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(char)) char -%{ - if (SWIG_CreateScilabVariable_char(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(charptr)) char * -%{ - if (SWIG_CreateScilabVariable_charptr(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(double)) enum SWIGTYPE -%{ - if (SWIG_CreateScilabVariable_double(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - - -/* ---------------------------------------------------------------------------*/ -/* Exception typmemaps */ -/* ---------------------------------------------------------------------------*/ - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/sciunsignedchar.swg b/linux/bin/swig/share/swig/4.1.0/scilab/sciunsignedchar.swg deleted file mode 100755 index f7338958..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/sciunsignedchar.swg +++ /dev/null @@ -1,190 +0,0 @@ -/* - * C-type: unsigned char - * Scilab type: double or uint8 - */ -%fragment(SWIG_AsVal_frag(unsigned char), "header", fragment="SWIG_SciDoubleOrUint8_AsUnsignedChar", fragment="") { -#define SWIG_AsVal_unsigned_SS_char(scilabValue, valuePointer) SWIG_SciDoubleOrUint8_AsUnsignedChar(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDoubleOrUint8_AsUnsignedChar", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint8_AsUnsignedChar(void *pvApiCtx, int iVar, unsigned char *pucValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int iPrec = 0; - int *piAddrVar = NULL; - unsigned char *pucData = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - if (pucValue) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_UINT8) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger8(pvApiCtx, piAddrVar, &iRows, &iCols, &pucData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - *pucValue = *pucData; - } - } - else if (iType == sci_matrix) { - if (pucValue) { - double *pdData = NULL; - double dValue = 0.0f; - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 8-bit unsigned integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < 0) || (dValue > UCHAR_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 8-bit unsigned integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *pucValue = (unsigned char) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(unsigned char), "header", fragment="SWIG_SciDouble_FromUnsignedChar") { -#define SWIG_From_unsigned_SS_char(value) SWIG_SciDouble_FromUnsignedChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value) -} -%fragment("SWIG_SciDouble_FromUnsignedChar", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedChar(void *pvApiCtx, int iVarOut, unsigned char ucValue) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) ucValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: unsigned char[] - * Scilab type: double or uint8 matrix - */ -%fragment("SWIG_SciDoubleOrUint8_AsUnsignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint8_AsUnsignedCharArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, unsigned char **pucValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *pucValue = (unsigned char*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*pucValue)[i] = (unsigned char) pdData[i]; - } - else if (iType == sci_ints) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iPrec != SCI_UINT8) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger8(pvApiCtx, piAddrVar, iRows, iCols, pucValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromUnsignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedCharArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const unsigned char *pucValues) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i UINT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 32-bit unsigned integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *puiValue = (unsigned int) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(unsigned int), "header", fragment="SWIG_SciDouble_FromUnsignedInt") { -%#define SWIG_From_unsigned_SS_int(scilabValue) SWIG_SciDouble_FromUnsignedInt(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromUnsignedInt", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedInt(void *pvApiCtx, int iVarOut, unsigned int uiValue, char *fname) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) uiValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: unsigned int[] - * Scilab type: uint32 vector - */ -%fragment("SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, unsigned int **puiValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *puiValue = (unsigned int*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*puiValue)[i] = (unsigned int) pdData[i]; - } - else if (iType == sci_ints) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iPrec != SCI_UINT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger32(pvApiCtx, piAddrVar, iRows, iCols, puiValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromUnsignedIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, unsigned int *puiValues) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i USHRT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 16-bit unsigned integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *pusValue = (unsigned short) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(unsigned short), "header", fragment="SWIG_SciDouble_FromUnsignedShort") { -%#define SWIG_From_unsigned_SS_short(scilabValue) SWIG_SciDouble_FromUnsignedShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromUnsignedShort", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedShort(void *pvApiCtx, int iVarOut, unsigned short usValue, char *fname) { - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) usValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: unsigned short[] - * Scilab type: uint16 vector - */ -%fragment("SWIG_SciDoubleOrUint16_AsUnsignedShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint16_AsUnsignedShortArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, unsigned short **pusValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *pusValue = (unsigned short*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*pusValue)[i] = (unsigned short) pdData[i]; - } - else if (iType == sci_ints) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iPrec != SCI_UINT16) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger16(pvApiCtx, piAddrVar, iRows, iCols, pusValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromUnsignedShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedShortArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, unsigned short *pusValues) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_basic_string.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_basic_string.i deleted file mode 100755 index b5735381..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_basic_string.i +++ /dev/null @@ -1,45 +0,0 @@ -/* - * C++: basic_string - * Scilab: string - */ - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - -%fragment(SWIG_AsPtr_frag(std::basic_string), "header", fragment="SWIG_SciString_AsCharPtrAndLength") { -SWIGINTERN int -SWIG_AsPtr_dec(std::basic_string)(int _iVar, std::basic_string **_pstValue) { - char* buf = 0; - size_t len = 0; - int alloc = SWIG_OLDOBJ; - - if (SWIG_IsOK((SWIG_SciString_AsCharPtrAndSize(pvApiCtx, _iVar, &buf, &len, &alloc, SWIG_Scilab_GetFuncName())))) { - if (buf) { - if (_pstValue) { - *_pstValue = new std::string(buf, len - 1); - } - if (alloc == SWIG_NEWOBJ) { - delete[] buf; - } - return SWIG_NEWOBJ; - } else { - if (_pstValue) { - *_pstValue = NULL; - } - return SWIG_OLDOBJ; - } - } else { - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string), "header", fragment="SWIG_SciString_FromCharPtr") { -SWIGINTERN int -SWIG_From_dec(std::basic_string)(std::basic_string _pstValue) { - return SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), _pstValue.c_str()); -} -} - -%include - - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_char_traits.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_char_traits.i deleted file mode 100755 index bf4e6c47..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_common.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_common.i deleted file mode 100755 index 97cfa7b0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_common.i +++ /dev/null @@ -1,72 +0,0 @@ -%include -%include - - -// Generate the traits for a 'primitive' type, such as 'double', -// for which the SWIG_AsVal and SWIG_From methods are already defined. - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SwigSciObject obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SwigSciObject from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SwigSciObject obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SwigSciObject from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_container.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_container.i deleted file mode 100755 index a1e037b8..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_container.i +++ /dev/null @@ -1,3 +0,0 @@ -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_deque.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_deque.i deleted file mode 100755 index d2ca597a..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_deque.i +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * C++ type : STL deque - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdDequeTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::deque **deq) { - return traits_asptr_stdseq >::asptr(obj, deq); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::deque& deq) { - return traits_from_stdseq >::from(deq); - } - }; - } -%} - - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_except.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_list.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_list.i deleted file mode 100755 index 75d002d4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_list.i +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * C++ type : STL list - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdListTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(SwigSciObject obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::list &lis) { - return traits_from_stdseq >::from(lis); - } - }; - } -%} - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_map.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_map.i deleted file mode 100755 index 07eb63fd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_map.i +++ /dev/null @@ -1,79 +0,0 @@ -// -// SWIG typemaps for std::map -// -// Common implementation - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_multiset.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_multiset.i deleted file mode 100755 index 67e17926..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_multiset.i +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * C++ type : STL multiset - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdMultisetTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::multiset **multiset) { - return traits_asptr_stdseq >::asptr(obj, multiset); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::multiset& multiset) { - return traits_from_stdseq >::from(multiset); - } - }; - } -%} - -#define %swig_multiset_methods(Set...) %swig_sequence_methods(Type) -#define %swig_multiset_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_pair.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_pair.i deleted file mode 100755 index 39ef008d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * Typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_set.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_set.i deleted file mode 100755 index 9070e2d6..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_set.i +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * C++ type : STL set - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdSetTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::set **set) { - return traits_asptr_stdseq >::asptr(obj, set); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::set& set) { - return traits_from_stdseq >::from(set); - } - }; - } -%} - - -#define %swig_set_methods(Type...) %swig_sequence_methods(Type) -#define %swig_set_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_string.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_string.i deleted file mode 100755 index 8736c2a2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_string.i +++ /dev/null @@ -1,47 +0,0 @@ -/* - * POINTER - */ -%fragment(SWIG_AsPtr_frag(std::string), "header", fragment="SWIG_SciString_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr_dec(std::string)(int iVar, std::string **pstValue) { - char* buf = 0; - size_t size = 0; - int alloc = SWIG_OLDOBJ; - - if (SWIG_IsOK((SWIG_SciString_AsCharPtrAndSize(pvApiCtx, iVar, &buf, &size, &alloc, SWIG_Scilab_GetFuncName())))) { - if (buf) { - if (pstValue) { - *pstValue = new std::string(buf, size); - } - if (alloc == SWIG_NEWOBJ) { - delete[] buf; - } - return SWIG_NEWOBJ; - } else { - if (pstValue) { - *pstValue = NULL; - } - return SWIG_OLDOBJ; - } - } else { - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::string), "header", fragment="SWIG_SciString_FromCharPtr") { -SWIGINTERN int -SWIG_From_dec(std::string)(std::string pstValue) { - return SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pstValue.c_str()); -} -} - -%include - -%typemap(throws, noblock=1) std::string { - SWIG_Scilab_Raise_Ex($1.c_str(), "$type", $&descriptor); -} - -%typemap(throws, noblock=1) const std::string & { - SWIG_Scilab_Raise_Ex($1.c_str(), "$type", $descriptor); -} diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/std_vector.i b/linux/bin/swig/share/swig/4.1.0/scilab/std_vector.i deleted file mode 100755 index 6eaeeca5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/std_vector.i +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * C++ type : STL vector - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdVectorTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/stl.i b/linux/bin/swig/share/swig/4.1.0/scilab/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/swigmove.i b/linux/bin/swig/share/swig/4.1.0/scilab/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/scilab/typemaps.i b/linux/bin/swig/share/swig/4.1.0/scilab/typemaps.i deleted file mode 100755 index 9d713874..00000000 --- a/linux/bin/swig/share/swig/4.1.0/scilab/typemaps.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps -%define %scilab_input_typemap(Type) -%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Type)) Type *INPUT(Type temp)(int ecode), Type &INPUT(Type temp)(int ecode) { - ecode = SWIG_AsVal_dec(Type)($input, &temp); - if (!SWIG_IsOK(ecode)) { - %argument_fail(ecode, "$type", $symname, $argnum); - } - $1 = &temp; -} - -%typemap(freearg, noblock=1) Type *INPUT, Type &INPUT { -} - -%typemap(typecheck) Type *INPUT, Type &INPUT { -} -%enddef - -// OUTPUT typemaps -%define %scilab_output_typemap(Type) -%typemap(argout, noblock=1, fragment=SWIG_From_frag(Type)) Type *OUTPUT, Type &OUTPUT { - %set_output(SWIG_From_dec(Type)(*$1)); -} -%enddef - -// INOUT typemaps -%define %scilab_inout_typemap(Type) - %typemap(in) Type *INOUT = Type *INPUT; - %typemap(in) Type &INOUT = Type &INPUT; - %typemap(argout) Type *INOUT = Type *OUTPUT; - %typemap(argout) Type &INOUT = Type &OUTPUT; -%enddef - - -%define %scilab_inout_typemaps(Type) - %scilab_input_typemap(%arg(Type)) - %scilab_output_typemap(%arg(Type)) - %scilab_inout_typemap(%arg(Type)) -%enddef - -%scilab_inout_typemaps(double); -%scilab_inout_typemaps(signed char); -%scilab_inout_typemaps(unsigned char); -%scilab_inout_typemaps(short); -%scilab_inout_typemaps(unsigned short); -%scilab_inout_typemaps(int); -%scilab_inout_typemaps(unsigned int); -%scilab_inout_typemaps(long); -%scilab_inout_typemaps(unsigned long); -%scilab_inout_typemaps(bool); -%scilab_inout_typemaps(float); - -//%apply_ctypes(%scilab_inout_typemaps); - - - - - diff --git a/linux/bin/swig/share/swig/4.1.0/shared_ptr.i b/linux/bin/swig/share/swig/4.1.0/shared_ptr.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/README b/linux/bin/swig/share/swig/4.1.0/std/README old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/_std_deque.i b/linux/bin/swig/share/swig/4.1.0/std/_std_deque.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_alloc.i b/linux/bin/swig/share/swig/4.1.0/std/std_alloc.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_array.i b/linux/bin/swig/share/swig/4.1.0/std/std_array.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_basic_string.i b/linux/bin/swig/share/swig/4.1.0/std/std_basic_string.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_carray.swg b/linux/bin/swig/share/swig/4.1.0/std/std_carray.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_char_traits.i b/linux/bin/swig/share/swig/4.1.0/std/std_char_traits.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_common.i b/linux/bin/swig/share/swig/4.1.0/std/std_common.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_container.i b/linux/bin/swig/share/swig/4.1.0/std/std_container.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_deque.i b/linux/bin/swig/share/swig/4.1.0/std/std_deque.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_except.i b/linux/bin/swig/share/swig/4.1.0/std/std_except.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_ios.i b/linux/bin/swig/share/swig/4.1.0/std/std_ios.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_iostream.i b/linux/bin/swig/share/swig/4.1.0/std/std_iostream.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_list.i b/linux/bin/swig/share/swig/4.1.0/std/std_list.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_map.i b/linux/bin/swig/share/swig/4.1.0/std/std_map.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_multimap.i b/linux/bin/swig/share/swig/4.1.0/std/std_multimap.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_multiset.i b/linux/bin/swig/share/swig/4.1.0/std/std_multiset.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_pair.i b/linux/bin/swig/share/swig/4.1.0/std/std_pair.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_queue.i b/linux/bin/swig/share/swig/4.1.0/std/std_queue.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_set.i b/linux/bin/swig/share/swig/4.1.0/std/std_set.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_sstream.i b/linux/bin/swig/share/swig/4.1.0/std/std_sstream.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_stack.i b/linux/bin/swig/share/swig/4.1.0/std/std_stack.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_streambuf.i b/linux/bin/swig/share/swig/4.1.0/std/std_streambuf.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_string.i b/linux/bin/swig/share/swig/4.1.0/std/std_string.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_unordered_map.i b/linux/bin/swig/share/swig/4.1.0/std/std_unordered_map.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_unordered_multimap.i b/linux/bin/swig/share/swig/4.1.0/std/std_unordered_multimap.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_unordered_multiset.i b/linux/bin/swig/share/swig/4.1.0/std/std_unordered_multiset.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_unordered_set.i b/linux/bin/swig/share/swig/4.1.0/std/std_unordered_set.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_vector.i b/linux/bin/swig/share/swig/4.1.0/std/std_vector.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_vectora.i b/linux/bin/swig/share/swig/4.1.0/std/std_vectora.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_wios.i b/linux/bin/swig/share/swig/4.1.0/std/std_wios.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_wiostream.i b/linux/bin/swig/share/swig/4.1.0/std/std_wiostream.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_wsstream.i b/linux/bin/swig/share/swig/4.1.0/std/std_wsstream.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_wstreambuf.i b/linux/bin/swig/share/swig/4.1.0/std/std_wstreambuf.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std/std_wstring.i b/linux/bin/swig/share/swig/4.1.0/std/std_wstring.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/std_except.i b/linux/bin/swig/share/swig/4.1.0/std_except.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/stdint.i b/linux/bin/swig/share/swig/4.1.0/stdint.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/stl.i b/linux/bin/swig/share/swig/4.1.0/stl.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swig.swg b/linux/bin/swig/share/swig/4.1.0/swig.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swigarch.i b/linux/bin/swig/share/swig/4.1.0/swigarch.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swigerrors.swg b/linux/bin/swig/share/swig/4.1.0/swigerrors.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swigfragments.swg b/linux/bin/swig/share/swig/4.1.0/swigfragments.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swiginit.swg b/linux/bin/swig/share/swig/4.1.0/swiginit.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swiglabels.swg b/linux/bin/swig/share/swig/4.1.0/swiglabels.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swigrun.i b/linux/bin/swig/share/swig/4.1.0/swigrun.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swigrun.swg b/linux/bin/swig/share/swig/4.1.0/swigrun.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swigwarn.swg b/linux/bin/swig/share/swig/4.1.0/swigwarn.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/swigwarnings.swg b/linux/bin/swig/share/swig/4.1.0/swigwarnings.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/Makefile.in b/linux/bin/swig/share/swig/4.1.0/tcl/Makefile.in deleted file mode 100755 index 019091c9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/Makefile.in +++ /dev/null @@ -1,122 +0,0 @@ -# --------------------------------------------------------------- -# SWIG Tcl Makefile -# -# This file can be used to build various Tcl extensions with SWIG. -# By default this file is set up for dynamic loading, but it can -# be easily customized for static extensions by modifying various -# portions of the file. -# -# SRCS = C source files -# CXXSRCS = C++ source files -# OBJCSRCS = Objective-C source files -# OBJS = Additional .o files (compiled previously) -# INTERFACE = SWIG interface file -# TARGET = Name of target module or executable -# -# Many portions of this file were created by the SWIG configure -# script and should already reflect your machine. However, you -# may need to modify the Makefile to reflect your specific -# application. -#---------------------------------------------------------------- - -SRCS = -CXXSRCS = -OBJCSRCS = -OBJS = -INTERFACE = -WRAPFILE = $(INTERFACE:.i=_wrap.c) -WRAPOBJ = $(INTERFACE:.i=_wrap.o) -TARGET = module@SO@ # Use this kind of target for dynamic loading -#TARGET = my_tclsh # Use this target for static linking - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -CC = @CC@ -CXX = @CXX@ -OBJC = @CC@ -Wno-import # -Wno-import needed for gcc -CFLAGS = -INCLUDES = -LIBS = - -# SWIG Options -# SWIG = location of the SWIG executable -# SWIGOPT = SWIG compiler options -# SWIGCC = Compiler used to compile the wrapper file - -SWIG = $(exec_prefix)/bin/swig -SWIGOPT = -tcl -SWIGCC = $(CC) - -# SWIG Library files. Uncomment if rebuilding tclsh -#SWIGLIBS = -ltclsh.i - -# Rules for creating .o files from source. - -COBJS = $(SRCS:.c=.o) -CXXOBJS = $(CXXSRCS:.cxx=.o) -OBJCOBJS = $(OBJCSRCS:.m=.o) -ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) - -# Command that will be used to build the final extension. -BUILD = $(SWIGCC) - -# Uncomment the following if you are using dynamic loading -CCSHARED = @CCSHARED@ -BUILD = @LDSHARED@ - -# Uncomment the following if you are using dynamic loading with C++ and -# need to provide additional link libraries (this is not always required). - -#DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ - -L/usr/local/lib -lg++ -lstdc++ -lgcc - -# Tcl installation (where is Tcl located) - -TCL_INCLUDE = @TCLINCLUDE@ -TCL_LIB = @TCLLIB@ - -# Build libraries (needed for static builds) - -LIBM = @LIBM@ -LIBC = @LIBC@ -SYSLIBS = $(LIBM) $(LIBC) @LIBS@ - -# Build options (uncomment only one of these) - -BUILD_LIBS = $(LIBS) # Dynamic loading -#BUILD_LIBS = $(TCL_LIB) -ltcl $(LIBS) $(SYSLIBS) # tclsh - -# Compilation rules for non-SWIG components - -.SUFFIXES: .c .cxx .m - -.c.o: - $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - -.cxx.o: - $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< - -.m.o: - $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - - -# ---------------------------------------------------------------------- -# Rules for building the extension -# ---------------------------------------------------------------------- - -all: $(TARGET) - -# Convert the wrapper file into an object file - -$(WRAPOBJ) : $(WRAPFILE) - $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDES) $(TCL_INCLUDE) - -$(WRAPFILE) : $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIBS) $(INTERFACE) - -$(TARGET): $(WRAPOBJ) $(ALLOBJS) - $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) - -clean: - rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/argcargv.i b/linux/bin/swig/share/swig/4.1.0/tcl/argcargv.i deleted file mode 100755 index bbe149ef..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/argcargv.i +++ /dev/null @@ -1,29 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - int i, nitems; - Tcl_Obj **listobjv; - if (Tcl_ListObjGetElements(interp, $input, &nitems, &listobjv) == TCL_ERROR) { - SWIG_exception_fail(SWIG_ValueError, "in method '$symname', Expecting list of argv"); - goto fail; - } - $1 = ($1_ltype) nitems; - $2 = (char **) malloc((nitems+1)*sizeof(char *)); - for (i = 0; i < nitems; i++) { - $2[i] = Tcl_GetStringFromObj(listobjv[i], NULL); - } - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - int len; - $1 = Tcl_ListObjLength(interp, $input, &len) == TCL_OK; -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/attribute.i b/linux/bin/swig/share/swig/4.1.0/tcl/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/carrays.i b/linux/bin/swig/share/swig/4.1.0/tcl/carrays.i deleted file mode 100755 index 0236672d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/carrays.i +++ /dev/null @@ -1,4 +0,0 @@ -%include - - - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/cdata.i b/linux/bin/swig/share/swig/4.1.0/tcl/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/cmalloc.i b/linux/bin/swig/share/swig/4.1.0/tcl/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/cpointer.i b/linux/bin/swig/share/swig/4.1.0/tcl/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/cstring.i b/linux/bin/swig/share/swig/4.1.0/tcl/cstring.i deleted file mode 100755 index ede9c596..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/cwstring.i b/linux/bin/swig/share/swig/4.1.0/tcl/cwstring.i deleted file mode 100755 index b17ca763..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/cwstring.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/exception.i b/linux/bin/swig/share/swig/4.1.0/tcl/exception.i deleted file mode 100755 index 4d22797c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/exception.i +++ /dev/null @@ -1,6 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); return TCL_ERROR;)) -} diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/factory.i b/linux/bin/swig/share/swig/4.1.0/tcl/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_auto_ptr.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_auto_ptr.i deleted file mode 100755 index b24809af..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_common.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_common.i deleted file mode 100755 index 0718facb..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_common.i +++ /dev/null @@ -1,17 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%types(std::size_t); -%apply size_t { std::size_t }; -%apply const unsigned long& { const std::size_t& }; - -%types(std::ptrdiff_t); -%apply long { std::ptrdiff_t }; -%apply const long& { const std::ptrdiff_t& }; - - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_deque.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_except.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_map.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_map.i deleted file mode 100755 index 2c7f40ac..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_map.i +++ /dev/null @@ -1,79 +0,0 @@ -// -// SWIG typemaps for std::map -// -// Common implementation - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_pair.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_pair.i deleted file mode 100755 index 39ef008d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * Typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_string.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_string.i deleted file mode 100755 index 5b31b28c..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_string.i +++ /dev/null @@ -1,2 +0,0 @@ -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_unique_ptr.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_unique_ptr.i deleted file mode 100755 index 0ea324cd..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_vector.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_vector.i deleted file mode 100755 index a74bf3a1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_vector.i +++ /dev/null @@ -1,436 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Tcl as much as possible, namely, to allow the user to pass and -// be returned Tcl lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector< T >), f(const std::vector< T >&), f(const std::vector< T >*): -// the parameter being read-only, either a Tcl list or a -// previously wrapped std::vector< T > can be passed. -// -- f(std::vector< T >&), f(std::vector< T >*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector< T > f(): -// the vector is returned by copy; therefore, a Tcl list of T:s -// is returned which is most easily used in other Tcl functions procs -// -- std::vector< T >& f(), std::vector< T >* f(), const std::vector< T >& f(), -// const std::vector< T >* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%fragment(""); -%fragment(""); -%fragment(""); -%{ -#include - -SWIGINTERN Tcl_Obj* SwigString_FromString(const std::string &s) { - return Tcl_NewStringObj(s.data(), (int)s.length()); -} - -SWIGINTERN int Tcl_GetBoolFromObj(Tcl_Interp *interp, Tcl_Obj *o, bool *val) { - int v; - int res = Tcl_GetBooleanFromObj(interp, o, &v); - if (res == TCL_OK) { - *val = v ? true : false; - } - return res; -} - -SWIGINTERN int SwigString_AsString(Tcl_Interp *interp, Tcl_Obj *o, std::string *val) { - int len; - const char* temp = Tcl_GetStringFromObj(o, &len); - (void)interp; - if (temp == NULL) - return TCL_ERROR; - val->assign(temp, len); - return TCL_OK; -} - -// behaviour of this is such as the real Tcl_GetIntFromObj -template -int SwigInt_As(Tcl_Interp *interp, Tcl_Obj *o, Type *val) { - int temp_val, return_val; - return_val = Tcl_GetIntFromObj(interp, o, &temp_val); - *val = (Type) temp_val; - return return_val; -} - -// behaviour of this is such as the real Tcl_GetDoubleFromObj -template -int SwigDouble_As(Tcl_Interp *interp, Tcl_Obj *o, Type *val) { - int return_val; - double temp_val; - return_val = Tcl_GetDoubleFromObj(interp, o, &temp_val); - *val = (Type) temp_val; - return return_val; -} - -%} - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector< T > (std::vector< T > *v) { - Tcl_Obj **listobjv; - int nitems; - int i; - T* temp; - - if (SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0){ - $1 = *v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - $1 = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if ((SWIG_ConvertPtr(listobjv[i],(void **) &temp, - $descriptor(T *),0)) != 0) { - char message[] = - "list of " #T " expected"; - Tcl_SetResult(interp, message, TCL_VOLATILE); - return TCL_ERROR; - } - $1.push_back(*temp); - } - } - } - - %typemap(in) const vector< T >* (std::vector< T > *v, std::vector< T > w), - const vector< T >& (std::vector< T > *v, std::vector< T > w) { - Tcl_Obj **listobjv; - int nitems; - int i; - T* temp; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0) { - $1 = v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - w = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if ((SWIG_ConvertPtr(listobjv[i],(void **) &temp, - $descriptor(T *),0)) != 0) { - char message[] = - "list of " #T " expected"; - Tcl_SetResult(interp, message, TCL_VOLATILE); - return TCL_ERROR; - } - w.push_back(*temp); - } - $1 = &w; - } - } - - %typemap(out) vector< T > { - for (unsigned int i=0; i<$1.size(); i++) { - T* ptr = new T((($1_type &)$1)[i]); - Tcl_ListObjAppendElement(interp, $result, - SWIG_NewInstanceObj(ptr, - $descriptor(T *), - 0)); - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) vector< T > { - Tcl_Obj **listobjv; - int nitems; - T* temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0) { - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if ((SWIG_ConvertPtr(listobjv[0], - (void **) &temp, - $descriptor(T *),0)) != 0) - $1 = 0; - else - $1 = 1; - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) const vector< T >&, - const vector< T >* { - Tcl_Obj **listobjv; - int nitems; - T* temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0){ - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if ((SWIG_ConvertPtr(listobjv[0], - (void **) &temp, - $descriptor(T *),0)) != 0) - $1 = 0; - else - $1 = 1; - } - } - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T& get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && isize()); - if (i<0) i+= size; - if (i>=0 && i class vector< T > { - - %typemap(in) vector< T > (std::vector< T > *v){ - Tcl_Obj **listobjv; - int nitems; - int i; - T temp; - - if(SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0) { - $1 = *v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - $1 = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if (CONVERT_FROM(interp, listobjv[i], &temp) == TCL_ERROR) - return TCL_ERROR; - $1.push_back(temp); - } - } - } - - %typemap(in) const vector< T >& (std::vector< T > *v,std::vector< T > w), - const vector< T >* (std::vector< T > *v,std::vector< T > w) { - Tcl_Obj **listobjv; - int nitems; - int i; - T temp; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0) { - $1 = v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - w = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if (CONVERT_FROM(interp, listobjv[i], &temp) == TCL_ERROR) - return TCL_ERROR; - w.push_back(temp); - } - $1 = &w; - } - } - - %typemap(out) vector< T > { - for (unsigned int i=0; i<$1.size(); i++) { - Tcl_ListObjAppendElement(interp, $result, - CONVERT_TO((($1_type &)$1)[i])); - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) vector< T > { - Tcl_Obj **listobjv; - int nitems; - T temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0){ - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if (CONVERT_FROM(interp, listobjv[0], &temp) == TCL_ERROR) - $1 = 0; - else - $1 = 1; - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) const vector< T >&, - const vector< T >*{ - Tcl_Obj **listobjv; - int nitems; - T temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0){ - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if (CONVERT_FROM(interp, listobjv[0], &temp) == TCL_ERROR) - $1 = 0; - else - $1 = 1; - } - } - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && isize()); - if (i<0) i+= size; - if (i>=0 && i,Tcl_NewIntObj); - specialize_std_vector(int, Tcl_GetIntFromObj,Tcl_NewIntObj); - specialize_std_vector(short, SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(long, SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned char, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned int, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned short, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned long, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(double, Tcl_GetDoubleFromObj, Tcl_NewDoubleObj); - specialize_std_vector(float, SwigDouble_As, Tcl_NewDoubleObj); - specialize_std_vector(std::string, - SwigString_AsString, SwigString_FromString); - -} - - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/std_wstring.i b/linux/bin/swig/share/swig/4.1.0/tcl/std_wstring.i deleted file mode 100755 index f1326149..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/std_wstring.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/stl.i b/linux/bin/swig/share/swig/4.1.0/tcl/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/swigmove.i b/linux/bin/swig/share/swig/4.1.0/tcl/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tcl8.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tcl8.swg deleted file mode 100755 index 5da1bc07..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tcl8.swg +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tcl8.swg - * - * Tcl configuration module. - * ----------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Tcl keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Tcl initialization function - * ------------------------------------------------------------ */ -%include - - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclapi.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclapi.swg deleted file mode 100755 index 2187de52..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclapi.swg +++ /dev/null @@ -1,108 +0,0 @@ -/* ----------------------------------------------------------------------------- - * SWIG API. Portion that goes into the runtime - * ----------------------------------------------------------------------------- */ -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_TCL_POINTER 4 -#define SWIG_TCL_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -typedef int (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); -typedef int (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); -typedef char *(*swig_variable_func)(ClientData, Tcl_Interp *, char *, char *, int); -typedef void (*swig_delete_func)(ClientData); - -typedef struct swig_method { - const char *name; - swig_wrapper method; -} swig_method; - -typedef struct swig_attribute { - const char *name; - swig_wrapper getmethod; - swig_wrapper setmethod; -} swig_attribute; - -typedef struct swig_class { - const char *name; - swig_type_info **type; - swig_wrapper constructor; - void (*destructor)(void *); - swig_method *methods; - swig_attribute *attributes; - struct swig_class **bases; - const char **base_names; - swig_module_info *module; - Tcl_HashTable hashtable; -} swig_class; - -typedef struct swig_instance { - Tcl_Obj *thisptr; - void *thisvalue; - swig_class *classptr; - int destroy; - Tcl_Command cmdtok; -} swig_instance; - -/* Structure for command table */ -typedef struct { - const char *name; - int (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); - ClientData clientdata; -} swig_command_info; - -/* Structure for variable linking table */ -typedef struct { - const char *name; - void *addr; - char * (*get)(ClientData, Tcl_Interp *, char *, char *, int); - char * (*set)(ClientData, Tcl_Interp *, char *, char *, int); -} swig_var_info; - - -/* -----------------------------------------------------------------------------* - * Install a constant object - * -----------------------------------------------------------------------------*/ - -static Tcl_HashTable swigconstTable; -static int swigconstTableinit = 0; - -SWIGINTERN void -SWIG_Tcl_SetConstantObj(Tcl_Interp *interp, const char* name, Tcl_Obj *obj) { - int newobj; - Tcl_ObjSetVar2(interp,Tcl_NewStringObj(name,-1), NULL, obj, TCL_GLOBAL_ONLY); - Tcl_SetHashValue(Tcl_CreateHashEntry(&swigconstTable, name, &newobj), (ClientData) obj); -} - -SWIGINTERN Tcl_Obj * -SWIG_Tcl_GetConstantObj(const char *key) { - Tcl_HashEntry *entryPtr; - if (!swigconstTableinit) return 0; - entryPtr = Tcl_FindHashEntry(&swigconstTable, key); - if (entryPtr) { - return (Tcl_Obj *) Tcl_GetHashValue(entryPtr); - } - return 0; -} - -#ifdef __cplusplus -} -#endif - - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclerrors.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclerrors.swg deleted file mode 100755 index 889d3ad5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclerrors.swg +++ /dev/null @@ -1,76 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGINTERN const char* -SWIG_Tcl_ErrorType(int code) { - const char* type = 0; - switch(code) { - case SWIG_MemoryError: - type = "MemoryError"; - break; - case SWIG_IOError: - type = "IOError"; - break; - case SWIG_RuntimeError: - type = "RuntimeError"; - break; - case SWIG_IndexError: - type = "IndexError"; - break; - case SWIG_TypeError: - type = "TypeError"; - break; - case SWIG_DivisionByZero: - type = "ZeroDivisionError"; - break; - case SWIG_OverflowError: - type = "OverflowError"; - break; - case SWIG_SyntaxError: - type = "SyntaxError"; - break; - case SWIG_ValueError: - type = "ValueError"; - break; - case SWIG_SystemError: - type = "SystemError"; - break; - case SWIG_AttributeError: - type = "AttributeError"; - break; - default: - type = "RuntimeError"; - } - return type; -} - - -SWIGINTERN void -SWIG_Tcl_SetErrorObj(Tcl_Interp *interp, const char *ctype, Tcl_Obj *obj) -{ - Tcl_ResetResult(interp); - Tcl_SetObjResult(interp, obj); - Tcl_SetErrorCode(interp, "SWIG", ctype, NULL); -} - -SWIGINTERN void -SWIG_Tcl_SetErrorMsg(Tcl_Interp *interp, const char *ctype, const char *mesg) -{ - Tcl_ResetResult(interp); - Tcl_SetErrorCode(interp, "SWIG", ctype, NULL); - Tcl_AppendResult(interp, ctype, " ", mesg, NULL); - /* - Tcl_AddErrorInfo(interp, ctype); - Tcl_AddErrorInfo(interp, " "); - Tcl_AddErrorInfo(interp, mesg); - */ -} - -SWIGINTERNINLINE void -SWIG_Tcl_AddErrorMsg(Tcl_Interp *interp, const char* mesg) -{ - Tcl_AddErrorInfo(interp, mesg); -} - - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclfragments.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclfragments.swg deleted file mode 100755 index ba6398c7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclfragments.swg +++ /dev/null @@ -1,22 +0,0 @@ -/* - - Create a file with this name, 'tclfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the ones defined by default by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal_dec(int)(TclObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - -*/ diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclinit.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclinit.swg deleted file mode 100755 index cf14de88..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclinit.swg +++ /dev/null @@ -1,140 +0,0 @@ -/* ------------------------------------------------------------ - * The start of the Tcl initialization function - * ------------------------------------------------------------ */ - -%insert(init) "swiginit.swg" - -/* This initialization code exports the module initialization function */ - -%header %{ - -#ifdef __cplusplus -extern "C" { -#endif -#ifdef MAC_TCL -#pragma export on -#endif -SWIGEXPORT int SWIG_init(Tcl_Interp *); -#ifdef MAC_TCL -#pragma export off -#endif -#ifdef __cplusplus -} -#endif - -/* Compatibility version for TCL stubs */ -#ifndef SWIG_TCL_STUBS_VERSION -#define SWIG_TCL_STUBS_VERSION "8.4" -#endif - -%} - -%init %{ -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - -/* Install Constants */ - -SWIGINTERN void -SWIG_Tcl_InstallConstants(Tcl_Interp *interp, swig_const_info constants[]) { - size_t i; - Tcl_Obj *obj; - - if (!swigconstTableinit) { - Tcl_InitHashTable(&swigconstTable, TCL_STRING_KEYS); - swigconstTableinit = 1; - } - for (i = 0; constants[i].type; i++) { - switch(constants[i].type) { - case SWIG_TCL_POINTER: - obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_TCL_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - SWIG_Tcl_SetConstantObj(interp, constants[i].name, obj); - } - } -} - -/* Create fast method lookup tables */ - -SWIGINTERN void -SWIG_Tcl_InstallMethodLookupTables(void) { - size_t i; - - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = swig_module.type_initial[i]; - if (type->clientdata) { - swig_class* klass = (swig_class*) type->clientdata; - swig_method* meth; - Tcl_InitHashTable(&(klass->hashtable), TCL_STRING_KEYS); - for (meth = klass->methods; meth && meth->name; ++meth) { - int newEntry; - Tcl_HashEntry* hashentry = Tcl_CreateHashEntry(&(klass->hashtable), meth->name, &newEntry); - Tcl_SetHashValue(hashentry, (ClientData)meth->method); - } - } - } -} - -#ifdef __cplusplus -} -#endif - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -SWIGEXPORT int SWIG_init(Tcl_Interp *interp) { - size_t i; - if (interp == 0) return TCL_ERROR; -#ifdef USE_TCL_STUBS - if (Tcl_InitStubs(interp, SWIG_TCL_STUBS_VERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif -#ifdef USE_TK_STUBS - /* (char*) cast is required to avoid compiler warning/error. */ - if (Tk_InitStubs(interp, (char*)SWIG_TCL_STUBS_VERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif - - Tcl_PkgProvide(interp, (char*)SWIG_name, (char*)SWIG_version); - -#ifdef SWIG_namespace - Tcl_Eval(interp, "namespace eval " SWIG_namespace " { }"); -#endif - - SWIG_InitializeModule((void *) interp); - SWIG_PropagateClientData(); - - for (i = 0; swig_commands[i].name; i++) { - Tcl_CreateObjCommand(interp, (char *) swig_commands[i].name, (swig_wrapper_func) swig_commands[i].wrapper, - swig_commands[i].clientdata, NULL); - } - for (i = 0; swig_variables[i].name; i++) { - Tcl_SetVar(interp, (char *) swig_variables[i].name, (char *) "", TCL_GLOBAL_ONLY); - Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_READS | TCL_GLOBAL_ONLY, - (Tcl_VarTraceProc *) swig_variables[i].get, (ClientData) swig_variables[i].addr); - Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_WRITES | TCL_GLOBAL_ONLY, - (Tcl_VarTraceProc *) swig_variables[i].set, (ClientData) swig_variables[i].addr); - } - - SWIG_Tcl_InstallConstants(interp, swig_constants); - SWIG_Tcl_InstallMethodLookupTables(); - -%} - -/* Note: the initialization function is closed after all code is generated */ diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclinterp.i b/linux/bin/swig/share/swig/4.1.0/tcl/tclinterp.i deleted file mode 100755 index 3b45b6d4..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclinterp.i +++ /dev/null @@ -1,17 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclinterp.i - * - * Tcl_Interp *interp - * - * Passes the current Tcl_Interp value directly to a C function. - * This can be used to work with existing wrapper functions or - * if you just need the interp value for some reason. When used, - * the 'interp' parameter becomes hidden in the Tcl interface--that - * is, you don't specify it explicitly. SWIG fills in its value - * automatically. - * ----------------------------------------------------------------------------- */ - -%typemap(in,numinputs=0) Tcl_Interp *interp { - $1 = interp; -} - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclkw.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclkw.swg deleted file mode 100755 index e96e885d..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclkw.swg +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TCL_TCLKW_SWG_ -#define TCL_TCLKW_SWG_ - -// Some special reserved words in classes - -%keywordwarn("cget is a tcl reserved method name") *::cget; -%keywordwarn("configure is a tcl reserved method name") *::configure; - - -#endif //_TCL_TCLKW_SWG_ diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclmacros.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclmacros.swg deleted file mode 100755 index ab7bace5..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclmacros.swg +++ /dev/null @@ -1,4 +0,0 @@ -%include - - - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclopers.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclopers.swg deleted file mode 100755 index f113ccd1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclopers.swg +++ /dev/null @@ -1,43 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclopers.swg - * - * C++ overloaded operators. - * - * These declarations define how SWIG is going to rename C++ - * overloaded operators in Tcl. Since Tcl allows identifiers - * to be essentially any valid string, we'll just use the - * normal operator names. - * ----------------------------------------------------------------------------- */ - - -#ifdef __cplusplus -%rename("+") *::operator+; -//%rename("u+") *::operator+(); // Unary + -//%rename("u+") *::operator+() const; // Unary + -%rename("-") *::operator-; -//%rename("u-") *::operator-(); // Unary - -//%rename("u-") *::operator-() const; // Unary - -%rename("*") *::operator*; -%rename("/") *::operator/; -%rename("<<") *::operator<<; -%rename(">>") *::operator>>; -%rename("&") *::operator&; -%rename("|") *::operator|; -%rename("^") *::operator^; -%rename("%") *::operator%; -%rename("=") *::operator=; - -/* Ignored operators */ -%ignoreoperator(NOTEQUAL) operator!=; -%ignoreoperator(PLUSEQ) operator+=; -%ignoreoperator(MINUSEQ) operator-=; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; - -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclprimtypes.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclprimtypes.swg deleted file mode 100755 index febbffb7..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclprimtypes.swg +++ /dev/null @@ -1,230 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { - %define_as(SWIG_From_dec(bool), Tcl_NewBooleanObj) -} - -%fragment(SWIG_AsVal_frag(bool),"header") { -SWIGINTERN int -SWIG_AsVal_dec(bool)(Tcl_Obj *obj, bool *val) -{ - int v; - if (Tcl_GetBooleanFromObj(0, obj, &v) == TCL_OK) { - if (val) *val = v ? true : false; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header", - fragment="") { -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(long)(long value) -{ - if (((long) INT_MIN <= value) && (value <= (long) INT_MAX)) { - return Tcl_NewIntObj(%numeric_cast(value,int)); - } else { - return Tcl_NewLongObj(value); - } -} -} - -%fragment(SWIG_AsVal_frag(long),"header") { -SWIGINTERN int -SWIG_AsVal_dec(long)(Tcl_Obj *obj, long* val) -{ - long v; - if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) { - if (val) *val = (long) v; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long), - fragment="") { -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(unsigned long)(unsigned long value) -{ - if (value < (unsigned long) LONG_MAX) { - return SWIG_From(long)(%numeric_cast(value, long)); - } else { - char temp[256]; - sprintf(temp, "%lu", value); - return Tcl_NewStringObj(temp,-1); - } -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(Tcl_Obj *obj, unsigned long *val) { - long v; - if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) { - if (v >= 0) { - if (val) *val = (unsigned long) v; - return SWIG_OK; - } - /* If v is negative, then this could be a negative number, or an - unsigned value which doesn't fit in a signed long, so try to - get it as a string so we can distinguish these cases. */ - } - { - int len = 0; - const char *nptr = Tcl_GetStringFromObj(obj, &len); - if (nptr && len > 0) { - char *endptr; - unsigned long v; - if (*nptr == '-') return SWIG_OverflowError; - errno = 0; - v = strtoul(nptr, &endptr,0); - if (nptr[0] == '\0' || *endptr != '\0') - return SWIG_TypeError; - if (v == ULONG_MAX && errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_OK; - } - } - } - } - - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(long long)(long long value) -{ - if (((long long) LONG_MIN <= value) && (value <= (long long) LONG_MAX)) { - return SWIG_From(long)(%numeric_cast(value,long)); - } else { - char temp[256]; - sprintf(temp, "%lld", value); - return Tcl_NewStringObj(temp,-1); - } -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(Tcl_Obj *obj, long long *val) -{ - Tcl_WideInt v; - if (Tcl_GetWideIntFromObj(0, obj, &v) == TCL_OK) { - if (sizeof(v) > sizeof(*val) && (v < LLONG_MIN || v > LLONG_MAX)) { - return SWIG_OverflowError; - } - if (val) *val = v; - return SWIG_OK; - } - return SWIG_TypeError; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment=SWIG_From_frag(long long), - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - if (value < (unsigned long long) LONG_MAX) { - return SWIG_From(long long)(%numeric_cast(value, long long)); - } else { - char temp[256]; - sprintf(temp, "%llu", value); - return Tcl_NewStringObj(temp,-1); - } -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(Tcl_Obj *obj, unsigned long long *val) -{ - long v; - if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) { - if (val) *val = (unsigned long) v; - return SWIG_OK; - } else { - int len = 0; - const char *nptr = Tcl_GetStringFromObj(obj, &len); - if (nptr && len > 0) { - char *endptr; - unsigned long long v; - if (*nptr == '-') return SWIG_OverflowError; - errno = 0; - v = strtoull(nptr, &endptr,0); - if (nptr[0] == '\0' || *endptr != '\0') - return SWIG_TypeError; - if (v == ULLONG_MAX && errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_OK; - } - } - } - } - return SWIG_TypeError; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { - %define_as(SWIG_From(double), Tcl_NewDoubleObj) -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(Tcl_Obj *obj, double *val) -{ - double v; - if (Tcl_GetDoubleFromObj(0, obj, &v) == TCL_OK) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclresult.i b/linux/bin/swig/share/swig/4.1.0/tcl/tclresult.i deleted file mode 100755 index c63b3ee1..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclresult.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclresult.i - * ----------------------------------------------------------------------------- */ - -/* -int Tcl_Result - - Makes the integer return code of a function the return value - of a SWIG generated wrapper function. For example : - - int foo() { - ... do stuff ... - return TCL_OK; - } - - could be wrapped as follows : - - %include typemaps.i - %apply int Tcl_Result { int foo }; - int foo(); -*/ - -// If return code is a Tcl_Result, simply pass it on - -%typemap(out) int Tcl_Result { - return $1; -} diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclrun.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclrun.swg deleted file mode 100755 index e8136051..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclrun.swg +++ /dev/null @@ -1,722 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclrun.swg - * - * This file contains the runtime support for Tcl modules and includes - * code for managing global variables and pointer type checking. - * ----------------------------------------------------------------------------- */ - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_ConvertPtr(oc, ptr, ty, flags) SWIG_Tcl_ConvertPtr(interp, oc, ptr, ty, flags) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Tcl_NewPointerObj(ptr, type, flags) - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Tcl_ConvertPacked(interp, obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Tcl_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_Tcl_ConvertPtr(interp, obj, pptr, type, flags) -#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_Tcl_NewInstanceObj(interp, thisvalue, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Tcl_ConvertPtr(interp, obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Tcl_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Tcl_ConvertPacked(interp,obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Tcl_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Tcl_GetModule((Tcl_Interp *) (clientdata)) -#define SWIG_SetModule(clientdata, pointer) SWIG_Tcl_SetModule((Tcl_Interp *) (clientdata), pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Tcl_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Tcl_SetErrorMsg(interp, SWIG_Tcl_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Tcl-specific SWIG API */ - -#define SWIG_Acquire(ptr) SWIG_Tcl_Acquire(ptr) -#define SWIG_MethodCommand SWIG_Tcl_MethodCommand -#define SWIG_Disown(ptr) SWIG_Tcl_Disown(ptr) -#define SWIG_ConvertPtrFromString(c, ptr, ty, flags) SWIG_Tcl_ConvertPtrFromString(interp, c, ptr, ty, flags) -#define SWIG_MakePtr(c, ptr, ty, flags) SWIG_Tcl_MakePtr(c, ptr, ty, flags) -#define SWIG_PointerTypeFromString(c) SWIG_Tcl_PointerTypeFromString(c) -#define SWIG_GetArgs SWIG_Tcl_GetArgs -#define SWIG_GetConstantObj(key) SWIG_Tcl_GetConstantObj(key) -#define SWIG_ObjectConstructor SWIG_Tcl_ObjectConstructor -#define SWIG_Thisown(ptr) SWIG_Tcl_Thisown(ptr) -#define SWIG_ObjectDelete SWIG_Tcl_ObjectDelete - - -#define SWIG_TCL_DECL_ARGS_2(arg1, arg2) (Tcl_Interp *interp SWIGUNUSED, arg1, arg2) -#define SWIG_TCL_CALL_ARGS_2(arg1, arg2) (interp, arg1, arg2) -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_GetConstant SWIG_GetConstantObj -#define SWIG_Tcl_GetConstant SWIG_Tcl_GetConstantObj - -#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 5) -#define SWIG_TCL_HASHTABLE_INIT {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#else -#define SWIG_TCL_HASHTABLE_INIT {0} -#endif - -#include "assert.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Object support */ - -SWIGRUNTIME Tcl_HashTable* -SWIG_Tcl_ObjectTable(void) { - static Tcl_HashTable swigobjectTable; - static int swigobjectTableinit = 0; - if (!swigobjectTableinit) { - Tcl_InitHashTable(&swigobjectTable, TCL_ONE_WORD_KEYS); - swigobjectTableinit = 1; - } - return &swigobjectTable; -} - -/* Acquire ownership of a pointer */ -SWIGRUNTIME void -SWIG_Tcl_Acquire(void *ptr) { - int newobj; - Tcl_CreateHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr, &newobj); -} - -SWIGRUNTIME int -SWIG_Tcl_Thisown(void *ptr) { - if (Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr)) { - return 1; - } - return 0; -} - -/* Disown a pointer. Returns 1 if we owned it to begin with */ -SWIGRUNTIME int -SWIG_Tcl_Disown(void *ptr) { - Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr); - if (entryPtr) { - Tcl_DeleteHashEntry(entryPtr); - return 1; - } - return 0; -} - -/* Convert a pointer value */ -SWIGRUNTIME int -SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swig_type_info *ty, int flags) { - swig_cast_info *tc; - const char *cmd_name; - /* Pointer values must start with leading underscore */ - while (*c != '_') { - *ptr = (void *) 0; - if (strcmp(c,"NULL") == 0) - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - - /* Empty string: not a pointer */ - if (*c == 0) return SWIG_ERROR; - - /* Hmmm. It could be an object name. */ - - /* Check if this is a command at all. Prevents cget -this */ - /* from being called when c is not a command, firing the unknown proc */ - if (Tcl_VarEval(interp,"info commands ", c, (char *) NULL) == TCL_OK) { - Tcl_Obj *result = Tcl_GetObjResult(interp); - if (*(Tcl_GetStringFromObj(result, NULL)) == 0) { - /* It's not a command, so it can't be a pointer */ - Tcl_ResetResult(interp); - return SWIG_ERROR; - } - } else { - /* This will only fail if the argument is multiple words. */ - /* Multiple words are also not commands. */ - Tcl_ResetResult(interp); - return SWIG_ERROR; - } - - /* Check if this is really a SWIG pointer */ - if (Tcl_VarEval(interp,c," cget -this", (char *) NULL) != TCL_OK) { - Tcl_ResetResult(interp); - return SWIG_ERROR; - } - - c = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), NULL); - } - cmd_name = c; - - c++; - c = SWIG_UnpackData(c,ptr,sizeof(void *)); - - if (ty) { - tc = c ? SWIG_TypeCheck(c,ty) : 0; - if (tc) { - Tcl_CmdInfo info; - if (Tcl_GetCommandInfo(interp, cmd_name, &info)) { - swig_instance *inst = (swig_instance *)info.objClientData; - if (!inst->thisvalue) { - *ptr = 0; - } - assert(inst->thisvalue == *ptr); - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !SWIG_Thisown(inst->thisvalue)) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (flags & SWIG_POINTER_DISOWN) { - SWIG_Disown((void *) *ptr); - } - if (flags & SWIG_POINTER_CLEAR) { - inst->thisvalue = 0; - } - { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,(void *) *ptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } - } - } - } else { - return SWIG_ERROR; - } - } - - return SWIG_OK; -} - -/* Convert a pointer value */ -SWIGRUNTIMEINLINE int -SWIG_Tcl_ConvertPtr(Tcl_Interp *interp, Tcl_Obj *oc, void **ptr, swig_type_info *ty, int flags) { - return SWIG_Tcl_ConvertPtrFromString(interp, Tcl_GetStringFromObj(oc,NULL), ptr, ty, flags); -} - -/* Convert a pointer value */ -SWIGRUNTIME char * -SWIG_Tcl_PointerTypeFromString(char *c) { - char d; - /* Pointer values must start with leading underscore. NULL has no type */ - if (*c != '_') { - return 0; - } - c++; - /* Extract hex value from pointer */ - while ((d = *c)) { - if (!(((d >= '0') && (d <= '9')) || ((d >= 'a') && (d <= 'f')))) break; - c++; - } - return c; -} - -/* Convert a packed pointer value */ -SWIGRUNTIME int -SWIG_Tcl_ConvertPacked(Tcl_Interp *SWIGUNUSEDPARM(interp) , Tcl_Obj *obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c; - - if (!obj) goto type_error; - c = Tcl_GetStringFromObj(obj,NULL); - /* Pointer values must start with leading underscore */ - if (*c != '_') goto type_error; - c++; - c = SWIG_UnpackData(c,ptr,sz); - if (ty) { - tc = SWIG_TypeCheck(c,ty); - if (!tc) goto type_error; - } - return SWIG_OK; - - type_error: - - return SWIG_ERROR; -} - - -/* Take a pointer and convert it to a string */ -SWIGRUNTIME void -SWIG_Tcl_MakePtr(char *c, void *ptr, swig_type_info *ty, int SWIGUNUSEDPARM(flags)) { - if (ptr) { - *(c++) = '_'; - c = SWIG_PackData(c,&ptr,sizeof(void *)); - strcpy(c,ty->name); - } else { - strcpy(c,"NULL"); - } -} - -/* Create a new pointer object */ -SWIGRUNTIMEINLINE Tcl_Obj * -SWIG_Tcl_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - Tcl_Obj *robj; - char result[SWIG_BUFFER_SIZE]; - SWIG_MakePtr(result,ptr,type,flags); - robj = Tcl_NewStringObj(result,-1); - return robj; -} - -SWIGRUNTIME Tcl_Obj * -SWIG_Tcl_NewPackedObj(void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - strcpy(r,type->name); - return Tcl_NewStringObj(result,-1); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -SWIGRUNTIME swig_module_info * -SWIG_Tcl_GetModule(Tcl_Interp *interp) { - const char *data; - swig_module_info *ret = 0; - - /* first check if pointer already created */ - data = Tcl_GetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TCL_GLOBAL_ONLY); - if (data) { - SWIG_UnpackData(data, &ret, sizeof(swig_type_info **)); - } - - return ret; -} - -SWIGRUNTIME void -SWIG_Tcl_SetModule(Tcl_Interp *interp, swig_module_info *module) { - char buf[SWIG_BUFFER_SIZE]; - char *data; - - /* create a new pointer */ - data = SWIG_PackData(buf, &module, sizeof(swig_type_info **)); - *data = 0; - Tcl_SetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, buf, TCL_GLOBAL_ONLY); -} - -/* -----------------------------------------------------------------------------* - * Object auxiliaries - * -----------------------------------------------------------------------------*/ - - -SWIGRUNTIME void -SWIG_Tcl_ObjectDelete(ClientData clientData) { - swig_instance *si = (swig_instance *) clientData; - if (!si) return; - if (si->destroy && SWIG_Disown(si->thisvalue)) { - if (si->classptr->destructor) { - (si->classptr->destructor)(si->thisvalue); - } - } - Tcl_DecrRefCount(si->thisptr); - free(si); -} - -/* Function to invoke object methods given an instance */ -SWIGRUNTIME int -SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST _objv[]) { - char *method, *attrname; - swig_instance *inst = (swig_instance *) clientData; - swig_method *meth; - swig_attribute *attr; - Tcl_Obj *oldarg; - Tcl_Obj **objv; - int rcode; - swig_class *cls; - swig_class *cls_stack[64]; - int cls_stack_bi[64]; - int cls_stack_top = 0; - int numconf = 2; - int bi; - - objv = (Tcl_Obj **) _objv; - if (objc < 2) { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - method = Tcl_GetStringFromObj(objv[1],NULL); - if (strcmp(method,"-acquire") == 0) { - inst->destroy = 1; - SWIG_Acquire(inst->thisvalue); - return TCL_OK; - } - if (strcmp(method,"-disown") == 0) { - if (inst->destroy) { - SWIG_Disown(inst->thisvalue); - } - inst->destroy = 0; - return TCL_OK; - } - if (strcmp(method,"-delete") == 0) { - Tcl_DeleteCommandFromToken(interp,inst->cmdtok); - return TCL_OK; - } - cls_stack[cls_stack_top] = inst->classptr; - cls_stack_bi[cls_stack_top] = -1; - while (1) { - Tcl_HashEntry* hashentry; - bi = cls_stack_bi[cls_stack_top]; - cls = cls_stack[cls_stack_top]; - if (bi != -1) { - if (!cls->bases[bi] && cls->base_names[bi]) { - /* lookup and cache the base class */ - swig_type_info *info = SWIG_TypeQueryModule(cls->module, cls->module, cls->base_names[bi]); - if (info) cls->bases[bi] = (swig_class *) info->clientdata; - } - cls = cls->bases[bi]; - if (cls) { - cls_stack_bi[cls_stack_top]++; - cls_stack_top++; - cls_stack[cls_stack_top] = cls; - cls_stack_bi[cls_stack_top] = -1; - continue; - } - } - if (!cls) { - cls_stack_top--; - if (cls_stack_top < 0) break; - else continue; - } - cls_stack_bi[cls_stack_top]++; - - hashentry = Tcl_FindHashEntry(&(cls->hashtable), method); - if (hashentry) { - ClientData cd = Tcl_GetHashValue(hashentry); - swig_wrapper method_wrapper = (swig_wrapper)cd; - oldarg = objv[1]; - objv[1] = inst->thisptr; - Tcl_IncrRefCount(inst->thisptr); - rcode = (method_wrapper)(clientData,interp,objc,objv); - objv[1] = oldarg; - Tcl_DecrRefCount(inst->thisptr); - return rcode; - } - /* Check class methods for a match */ - if (strcmp(method,"cget") == 0) { - if (objc < 3) { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - attrname = Tcl_GetStringFromObj(objv[2],NULL); - attr = cls->attributes; - while (attr && attr->name) { - if ((strcmp(attr->name, attrname) == 0) && (attr->getmethod)) { - oldarg = objv[1]; - objv[1] = inst->thisptr; - Tcl_IncrRefCount(inst->thisptr); - rcode = (*attr->getmethod)(clientData,interp,2, objv); - objv[1] = oldarg; - Tcl_DecrRefCount(inst->thisptr); - return rcode; - } - attr++; - } - if (strcmp(attrname, "-this") == 0) { - Tcl_SetObjResult(interp, Tcl_DuplicateObj(inst->thisptr)); - return TCL_OK; - } - if (strcmp(attrname, "-thisown") == 0) { - if (SWIG_Thisown(inst->thisvalue)) { - Tcl_SetResult(interp,(char*)"1",TCL_STATIC); - } else { - Tcl_SetResult(interp,(char*)"0",TCL_STATIC); - } - return TCL_OK; - } - } else if (strcmp(method, "configure") == 0) { - int i; - if (objc < 4) { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - i = 2; - while (i < objc) { - attrname = Tcl_GetStringFromObj(objv[i],NULL); - attr = cls->attributes; - while (attr && attr->name) { - if ((strcmp(attr->name, attrname) == 0) && (attr->setmethod)) { - oldarg = objv[i]; - objv[i] = inst->thisptr; - Tcl_IncrRefCount(inst->thisptr); - rcode = (*attr->setmethod)(clientData,interp,3, &objv[i-1]); - objv[i] = oldarg; - Tcl_DecrRefCount(inst->thisptr); - if (rcode != TCL_OK) return rcode; - numconf += 2; - } - attr++; - } - i+=2; - } - } - } - if (strcmp(method,"configure") == 0) { - if (numconf >= objc) { - return TCL_OK; - } else { - Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC); - return TCL_ERROR; - } - } - if (strcmp(method,"cget") == 0) { - Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC); - return TCL_ERROR; - } - Tcl_SetResult(interp, (char *) "Invalid method. Must be one of: configure cget -acquire -disown -delete", TCL_STATIC); - cls = inst->classptr; - bi = 0; - while (cls) { - meth = cls->methods; - while (meth && meth->name) { - char *cr = (char *) Tcl_GetStringResult(interp); - size_t meth_len = strlen(meth->name); - char* where = strchr(cr,':'); - while(where) { - where = strstr(where, meth->name); - if(where) { - if(where[-1] == ' ' && (where[meth_len] == ' ' || where[meth_len]==0)) { - break; - } else { - where++; - } - } - } - - if (!where) - Tcl_AppendElement(interp, (char *) meth->name); - meth++; - } - cls = inst->classptr->bases[bi++]; - } - return TCL_ERROR; -} - -/* This function takes the current result and turns it into an object command */ -SWIGRUNTIME Tcl_Obj * -SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *type, int flags) { - Tcl_Obj *robj = SWIG_NewPointerObj(thisvalue, type,0); - /* Check to see if this pointer belongs to a class or not */ - if (thisvalue && (type->clientdata) && (interp)) { - Tcl_CmdInfo ci; - int has_command; - char *name; - name = Tcl_GetStringFromObj(robj,NULL); - has_command = Tcl_GetCommandInfo(interp, name, &ci); - if (!has_command || flags) { - swig_instance *newinst = (swig_instance *) malloc(sizeof(swig_instance)); - newinst->thisptr = Tcl_DuplicateObj(robj); - Tcl_IncrRefCount(newinst->thisptr); - newinst->thisvalue = thisvalue; - newinst->classptr = (swig_class *) type->clientdata; - newinst->destroy = flags; - newinst->cmdtok = Tcl_CreateObjCommand(interp, Tcl_GetStringFromObj(robj,NULL), (swig_wrapper_func) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); - if (flags) { - SWIG_Acquire(thisvalue); - } - } else { - swig_instance *inst = (swig_instance *)ci.objClientData; - /* Restore thisvalue as SWIG_POINTER_CLEAR may have been used to set it to zero. - Occurs when the C pointer is re-used by the memory allocator and the command has - been created and not destroyed - bug?? - see cpp11_std_unique_ptr_runme.tcl test. */ - if (inst->thisvalue != thisvalue) { - assert(inst->thisvalue == 0); - inst->thisvalue = thisvalue; - } - } - } - return robj; -} - -/* Function to create objects */ -SWIGRUNTIME int -SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - Tcl_Obj *newObj = 0; - void *thisvalue = 0; - swig_instance *newinst = 0; - swig_class *classptr = (swig_class *) clientData; - swig_wrapper cons = 0; - char *name = 0; - int firstarg = 0; - int thisarg = 0; - int destroy = 1; - - if (!classptr) { - Tcl_SetResult(interp, (char *) "swig: internal runtime error. No class object defined.", TCL_STATIC); - return TCL_ERROR; - } - cons = classptr->constructor; - if (objc > 1) { - char *s = Tcl_GetStringFromObj(objv[1],NULL); - if (strcmp(s,"-this") == 0) { - thisarg = 2; - cons = 0; - } else if (strcmp(s,"-args") == 0) { - firstarg = 1; - } else if (objc == 2) { - firstarg = 1; - name = s; - } else if (objc >= 3) { - char *s1; - name = s; - s1 = Tcl_GetStringFromObj(objv[2],NULL); - if (strcmp(s1,"-this") == 0) { - thisarg = 3; - cons = 0; - } else { - firstarg = 1; - } - } - } - if (cons) { - int result; - result = (*cons)(0, interp, objc-firstarg, &objv[firstarg]); - if (result != TCL_OK) { - return result; - } - newObj = Tcl_DuplicateObj(Tcl_GetObjResult(interp)); - if (!name) name = Tcl_GetStringFromObj(newObj,NULL); - } else if (thisarg > 0) { - if (thisarg < objc) { - destroy = 0; - newObj = Tcl_DuplicateObj(objv[thisarg]); - if (!name) name = Tcl_GetStringFromObj(newObj,NULL); - } else { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - } else { - Tcl_SetResult(interp, (char *) "No constructor available.", TCL_STATIC); - return TCL_ERROR; - } - if (SWIG_Tcl_ConvertPtr(interp,newObj, (void **) &thisvalue, *(classptr->type), 0) != SWIG_OK) { - Tcl_DecrRefCount(newObj); - return TCL_ERROR; - } - newinst = (swig_instance *) malloc(sizeof(swig_instance)); - newinst->thisptr = newObj; - Tcl_IncrRefCount(newObj); - newinst->thisvalue = thisvalue; - newinst->classptr = classptr; - newinst->destroy = destroy; - if (destroy) { - SWIG_Acquire(thisvalue); - } - newinst->cmdtok = Tcl_CreateObjCommand(interp,name, (swig_wrapper) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); - return TCL_OK; -} - -/* -----------------------------------------------------------------------------* - * Get arguments - * -----------------------------------------------------------------------------*/ -SWIGRUNTIME int -SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char *fmt, ...) { - int argno = 0, opt = 0; - long tempi; - double tempd; - const char *c; - va_list ap; - void *vptr; - Tcl_Obj *obj = 0; - swig_type_info *ty; - - va_start(ap,fmt); - for (c = fmt; (*c && (*c != ':') && (*c != ';')); c++,argno++) { - if (*c == '|') { - opt = 1; - c++; - } - if (argno >= (objc-1)) { - if (!opt) { - Tcl_SetResult(interp, (char *) "Wrong number of arguments ", TCL_STATIC); - goto argerror; - } else { - va_end(ap); - return TCL_OK; - } - } - - vptr = va_arg(ap,void *); - if (vptr) { - if (isupper(*c)) { - obj = SWIG_Tcl_GetConstantObj(Tcl_GetStringFromObj(objv[argno+1],0)); - if (!obj) obj = objv[argno+1]; - } else { - obj = objv[argno+1]; - } - switch(*c) { - case 'i': case 'I': - case 'l': case 'L': - case 'h': case 'H': - case 'b': case 'B': - if (Tcl_GetLongFromObj(interp,obj,&tempi) != TCL_OK) goto argerror; - if ((*c == 'i') || (*c == 'I')) *((int *)vptr) = (int)tempi; - else if ((*c == 'l') || (*c == 'L')) *((long *)vptr) = (long)tempi; - else if ((*c == 'h') || (*c == 'H')) *((short*)vptr) = (short)tempi; - else if ((*c == 'b') || (*c == 'B')) *((unsigned char *)vptr) = (unsigned char)tempi; - break; - case 'f': case 'F': - case 'd': case 'D': - if (Tcl_GetDoubleFromObj(interp,obj,&tempd) != TCL_OK) goto argerror; - if ((*c == 'f') || (*c == 'F')) *((float *) vptr) = (float)tempd; - else if ((*c == 'd') || (*c == 'D')) *((double*) vptr) = tempd; - break; - case 's': case 'S': - if (*(c+1) == '#') { - int *vlptr = (int *) va_arg(ap, void *); - *((char **) vptr) = Tcl_GetStringFromObj(obj, vlptr); - c++; - } else { - *((char **)vptr) = Tcl_GetStringFromObj(obj,NULL); - } - break; - case 'c': case 'C': - *((char *)vptr) = *(Tcl_GetStringFromObj(obj,NULL)); - break; - case 'p': case 'P': - ty = (swig_type_info *) va_arg(ap, void *); - if (SWIG_Tcl_ConvertPtr(interp, obj, (void **) vptr, ty, 0) != SWIG_OK) goto argerror; - break; - case 'o': case 'O': - *((Tcl_Obj **)vptr) = objv[argno+1]; - break; - default: - break; - } - } - } - - if ((*c != ';') && ((objc-1) > argno)) { - Tcl_SetResult(interp, (char *) "Wrong # args.", TCL_STATIC); - goto argerror; - } - va_end(ap); - return TCL_OK; - - argerror: - { - char temp[32]; - sprintf(temp,"%d", argno+1); - c = strchr(fmt,':'); - if (!c) c = strchr(fmt,';'); - if (!c) c = (char *)""; - Tcl_AppendResult(interp,c," argument ", temp, NULL); - va_end(ap); - return TCL_ERROR; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclruntime.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclruntime.swg deleted file mode 100755 index bb4edd74..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclruntime.swg +++ /dev/null @@ -1,15 +0,0 @@ -/* tcl.h has to appear first */ -%insert(runtime) %{ -#include -#include -#include -#include -#include -#include -%} - -%insert(runtime) "swigrun.swg"; /* Common C API type-checking code */ -%insert(runtime) "swigerrors.swg" /* SWIG errors */ -%insert(runtime) "tclerrors.swg"; /* Tcl Errors */ -%insert(runtime) "tclapi.swg"; /* Tcl API */ -%insert(runtime) "tclrun.swg"; /* Tcl run-time code */ diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclsh.i b/linux/bin/swig/share/swig/4.1.0/tcl/tclsh.i deleted file mode 100755 index 21dc35af..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclsh.i +++ /dev/null @@ -1,57 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclsh.i - * - * SWIG File for building new tclsh program - * ----------------------------------------------------------------------------- */ - -#ifdef AUTODOC -%subsection "tclsh.i" -%text %{ -This module provides the Tcl_AppInit() function needed to build a -new version of the tclsh executable. This file should not be used -when using dynamic loading. To make an interface file work with -both static and dynamic loading, put something like this in your -interface file : - - #ifdef STATIC - %include - #endif -%} -#endif - -%{ - -/* A TCL_AppInit() function that lets you build a new copy - * of tclsh. - * - * The macro SWIG_init contains the name of the initialization - * function in the wrapper file. - */ - -#ifndef SWIG_RcFileName -char *SWIG_RcFileName = "~/.myapprc"; -#endif - - -int Tcl_AppInit(Tcl_Interp *interp){ - - if (Tcl_Init(interp) == TCL_ERROR) - return TCL_ERROR; - - /* Now initialize our functions */ - - if (SWIG_init(interp) == TCL_ERROR) - return TCL_ERROR; - Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY); - - return TCL_OK; -} - -int main(int argc, char **argv) { - Tcl_Main(argc, argv, Tcl_AppInit); - return(0); - -} - -%} - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclstrings.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclstrings.swg deleted file mode 100755 index 540d6270..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclstrings.swg +++ /dev/null @@ -1,31 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsCharPtrAndSize","header") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(Tcl_Obj *obj, char** cptr, size_t* psize, int *alloc) -{ - int len = 0; - char *cstr = Tcl_GetStringFromObj(obj, &len); - if (cstr) { - if (cptr) *cptr = cstr; - if (psize) *psize = len + 1; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - - -%fragment("SWIG_FromCharPtrAndSize","header", - fragment="") { -SWIGINTERNINLINE Tcl_Obj * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - return (size < INT_MAX) ? Tcl_NewStringObj(carray, %numeric_cast(size,int)) : NULL; -} -} - - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tcltypemaps.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tcltypemaps.swg deleted file mode 100755 index 66cce47e..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tcltypemaps.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Tcl - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ - -/* - In Tcl we need to pass the interp value, so we define the decl/call - macros as needed. -*/ - -#define SWIG_AS_DECL_ARGS SWIG_TCL_DECL_ARGS_2 -#define SWIG_AS_CALL_ARGS SWIG_TCL_CALL_ARGS_2 - - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Tcl fragments for primitive types */ -%include - -/* Tcl fragments for char* strings */ -%include - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* No director support in Tcl */ -#ifdef SWIG_DIRECTOR_TYPEMAPS -#undef SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Tcl types */ -#define SWIG_Object Tcl_Obj * - -/* Overload of the output/constant/exception handling */ - -/* output */ -#define %set_output(obj) Tcl_SetObjResult(interp,obj) - -/* append output */ -#define %append_output(obj) Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) SWIG_Tcl_SetConstantObj(interp, name, obj) - -/* raise */ -#define SWIG_Raise(obj,type,desc) SWIG_Tcl_SetErrorObj(interp,type,obj) - - -/* Include the unified typemap library */ -%include - - -/* ------------------------------------------------------------ - * Tcl extra typemaps / typemap overrides - * ------------------------------------------------------------ */ - -#if 1 -// Old 1.3.25 typemaps needed to avoid premature object deletion -%typemap(out,noblock=1) SWIGTYPE *INSTANCE, SWIGTYPE &INSTANCE, SWIGTYPE &&INSTANCE, SWIGTYPE INSTANCE[] { - Tcl_SetObjResult(interp, SWIG_NewInstanceObj( %as_voidptr($1), $1_descriptor,0)); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,%as_voidptrptr(&$1)); - Tcl_SetObjResult(interp,SWIG_NewInstanceObj(%as_voidptr($1), ty,0)); -} - -#endif - -%typemap(out) SWIGTYPE = SWIGTYPE INSTANCE; -%typemap(out) SWIGTYPE * = SWIGTYPE *INSTANCE; -%typemap(out) SWIGTYPE *const = SWIGTYPE *; -%typemap(out) SWIGTYPE & = SWIGTYPE &INSTANCE; -%typemap(out) SWIGTYPE && = SWIGTYPE &&INSTANCE; -%typemap(out) SWIGTYPE [] = SWIGTYPE INSTANCE[]; -%typemap(varout) SWIGTYPE = SWIGTYPE INSTANCE; diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tcluserdir.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tcluserdir.swg deleted file mode 100755 index d5b41fb9..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tcluserdir.swg +++ /dev/null @@ -1,5 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Special user directives - * ----------------------------------------------------------------------------- */ - - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/tclwstrings.swg b/linux/bin/swig/share/swig/4.1.0/tcl/tclwstrings.swg deleted file mode 100755 index 09374c54..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/tclwstrings.swg +++ /dev/null @@ -1,68 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclwstrings.wg - * - * Utility methods for wchar strings - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -%fragment("SWIG_AsWCharPtrAndSize","header") { -SWIGINTERN int -SWIG_AsWCharPtrAndSize(Tcl_Obj *obj, wchar_t** cptr, size_t* psize, int *alloc) -{ - int len = 0; - Tcl_UniChar *ustr = Tcl_GetUnicodeFromObj(obj, &len); - if (ustr) { - if (cptr) { - Tcl_Encoding encoding = NULL; - char *src = (char *) ustr; - int srcLen = (len)*sizeof(Tcl_UniChar); - int dstLen = sizeof(wchar_t)*(len + 1); - char *dst = %new_array(dstLen, char); - int flags = 0; - Tcl_EncodingState *statePtr = 0; - int srcRead = 0; - int dstWrote = 0; - int dstChars = 0; - Tcl_UtfToExternal(0, encoding, src, srcLen, flags, statePtr, dst, - dstLen, &srcRead, &dstWrote, &dstChars); - - *cptr = (wchar_t*)dst; - if (alloc) *alloc = SWIG_NEWOBJ; - } - if (psize) *psize = len + 1; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromWCharPtrAndSize","header") { -SWIGINTERNINLINE Tcl_Obj * -SWIG_FromWCharPtrAndSize(const wchar_t* carray, size_t size) -{ - Tcl_Obj *res = NULL; - if (size < INT_MAX) { - Tcl_Encoding encoding = NULL; - char *src = (char *) carray; - int srcLen = (int)(size*sizeof(wchar_t)); - int dstLen = (int)(size*sizeof(Tcl_UniChar)); - char *dst = %new_array(dstLen, char); - int flags = 0; - Tcl_EncodingState *statePtr = 0; - int srcRead = 0; - int dstWrote = 0; - int dstChars = 0; - - Tcl_ExternalToUtf(0, encoding, src, srcLen, flags, statePtr, dst, - dstLen, &srcRead, &dstWrote, &dstChars); - - res = Tcl_NewUnicodeObj((Tcl_UniChar*)dst, (int)size); - %delete_array(dst); - } - return res; -} -} - diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/typemaps.i b/linux/bin/swig/share/swig/4.1.0/tcl/typemaps.i deleted file mode 100755 index 04a5c78f..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/typemaps.i +++ /dev/null @@ -1,464 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * SWIG typemap library for Tcl8. This file contains various sorts - * of typemaps for modifying SWIG's code generation. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_USE_OLD_TYPEMAPS) -%include -#else - -/* -The SWIG typemap library provides a language independent mechanism for -supporting output arguments, input values, and other C function -calling mechanisms. The primary use of the library is to provide a -better interface to certain C function--especially those involving -pointers. -*/ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -%typemap(in) double *INPUT(double temp), double &INPUT(double temp) -{ - if (Tcl_GetDoubleFromObj(interp,$input,&temp) == TCL_ERROR) { - SWIG_fail; - } - $1 = &temp; -} - -%typemap(in) float *INPUT(double dvalue, float temp), float &INPUT(double dvalue, float temp) -{ - if (Tcl_GetDoubleFromObj(interp,$input,&dvalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (float) dvalue; - $1 = &temp; -} - -%typemap(in) int *INPUT(int temp), int &INPUT(int temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&temp) == TCL_ERROR) { - SWIG_fail; - } - $1 = &temp; -} - -%typemap(in) short *INPUT(int ivalue, short temp), short &INPUT(int ivalue, short temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (short) ivalue; - $1 = &temp; -} - -%typemap(in) long *INPUT(int ivalue, long temp), long &INPUT(int ivalue, long temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (long) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned int *INPUT(int ivalue, unsigned int temp), - unsigned int &INPUT(int ivalue, unsigned int temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned int) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned short *INPUT(int ivalue, unsigned short temp), - unsigned short &INPUT(int ivalue, unsigned short temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned short) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned long *INPUT(int ivalue, unsigned long temp), - unsigned long &INPUT(int ivalue, unsigned long temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned long) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned char *INPUT(int ivalue, unsigned char temp), - unsigned char &INPUT(int ivalue, unsigned char temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned char) ivalue; - $1 = &temp; -} - -%typemap(in) signed char *INPUT(int ivalue, signed char temp), - signed char &INPUT(int ivalue, signed char temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (signed char) ivalue; - $1 = &temp; -} - -%typemap(in) bool *INPUT(int ivalue, bool temp), - bool &INPUT(int ivalue, bool temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = ivalue ? true : false; - $1 = &temp; -} - -%typemap(in) long long *INPUT($*1_ltype temp), - long long &INPUT($*1_ltype temp) -{ - temp = ($*1_ltype) strtoll(Tcl_GetStringFromObj($input,NULL),0,0); - $1 = &temp; -} - -%typemap(in) unsigned long long *INPUT($*1_ltype temp), - unsigned long long &INPUT($*1_ltype temp) -{ - temp = ($*1_ltype) strtoull(Tcl_GetStringFromObj($input,NULL),0,0); - $1 = &temp; -} - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Tcl list. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters).K: - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include typemaps.i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Tcl output of the function would be a list containing both -output values. - -*/ - -%typemap(in,numinputs=0) int *OUTPUT(int temp), - short *OUTPUT(short temp), - long *OUTPUT(long temp), - unsigned int *OUTPUT(unsigned int temp), - unsigned short *OUTPUT(unsigned short temp), - unsigned long *OUTPUT(unsigned long temp), - unsigned char *OUTPUT(unsigned char temp), - signed char *OUTPUT(signed char temp), - bool *OUTPUT(bool temp), - float *OUTPUT(float temp), - double *OUTPUT(double temp), - long long *OUTPUT($*1_ltype temp), - unsigned long long *OUTPUT($*1_ltype temp), - int &OUTPUT(int temp), - short &OUTPUT(short temp), - long &OUTPUT(long temp), - unsigned int &OUTPUT(unsigned int temp), - unsigned short &OUTPUT(unsigned short temp), - unsigned long &OUTPUT(unsigned long temp), - signed char &OUTPUT(signed char temp), - bool &OUTPUT(bool temp), - unsigned char &OUTPUT(unsigned char temp), - float &OUTPUT(float temp), - double &OUTPUT(double temp), - long long &OUTPUT($*1_ltype temp), - unsigned long long &OUTPUT($*1_ltype temp) -"$1 = &temp;"; - -%typemap(argout) int *OUTPUT, int &OUTPUT, - short *OUTPUT, short &OUTPUT, - long *OUTPUT, long &OUTPUT, - unsigned int *OUTPUT, unsigned int &OUTPUT, - unsigned short *OUTPUT, unsigned short &OUTPUT, - unsigned long *OUTPUT, unsigned long &OUTPUT, - unsigned char *OUTPUT, unsigned char &OUTPUT, - signed char *OUTPUT, signed char &OUTPUT, - bool *OUTPUT, bool &OUTPUT -{ - Tcl_Obj *o; - o = Tcl_NewIntObj((int) *($1)); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -%typemap(argout) float *OUTPUT, float &OUTPUT, - double *OUTPUT, double &OUTPUT -{ - Tcl_Obj *o; - o = Tcl_NewDoubleObj((double) *($1)); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -%typemap(argout) long long *OUTPUT, long long &OUTPUT -{ - char temp[256]; - Tcl_Obj *o; - sprintf(temp,"%lld",(long long)*($1)); - o = Tcl_NewStringObj(temp,-1); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -%typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT -{ - char temp[256]; - Tcl_Obj *o; - sprintf(temp,"%llu",(unsigned long long)*($1)); - o = Tcl_NewStringObj(temp,-1); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Tcl list. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - void neg(double *INOUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Tcl). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Tcl variable you might do this : - - set x [neg $x] - -*/ - - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) unsigned int *INOUT = unsigned int *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) unsigned int &INOUT = unsigned int &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) signed char &INOUT = signed char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) unsigned int *INOUT = unsigned int *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) unsigned int &INOUT = unsigned int &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) signed char &INOUT = signed char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; - - -/* Overloading information */ - -%typemap(typecheck) double *INPUT = double; -%typemap(typecheck) bool *INPUT = bool; -%typemap(typecheck) signed char *INPUT = signed char; -%typemap(typecheck) unsigned char *INPUT = unsigned char; -%typemap(typecheck) unsigned long *INPUT = unsigned long; -%typemap(typecheck) unsigned short *INPUT = unsigned short; -%typemap(typecheck) unsigned int *INPUT = unsigned int; -%typemap(typecheck) long *INPUT = long; -%typemap(typecheck) short *INPUT = short; -%typemap(typecheck) int *INPUT = int; -%typemap(typecheck) float *INPUT = float; -%typemap(typecheck) long long *INPUT = long long; -%typemap(typecheck) unsigned long long *INPUT = unsigned long long; - -%typemap(typecheck) double &INPUT = double; -%typemap(typecheck) bool &INPUT = bool; -%typemap(typecheck) signed char &INPUT = signed char; -%typemap(typecheck) unsigned char &INPUT = unsigned char; -%typemap(typecheck) unsigned long &INPUT = unsigned long; -%typemap(typecheck) unsigned short &INPUT = unsigned short; -%typemap(typecheck) unsigned int &INPUT = unsigned int; -%typemap(typecheck) long &INPUT = long; -%typemap(typecheck) short &INPUT = short; -%typemap(typecheck) int &INPUT = int; -%typemap(typecheck) float &INPUT = float; -%typemap(typecheck) long long &INPUT = long long; -%typemap(typecheck) unsigned long long &INPUT = unsigned long long; - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) bool *INOUT = bool; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) float *INOUT = float; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) bool &INOUT = bool; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) float &INOUT = float; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; - -#endif - -// -------------------------------------------------------------------- -// Special types -// -------------------------------------------------------------------- - -%include -%include diff --git a/linux/bin/swig/share/swig/4.1.0/tcl/wish.i b/linux/bin/swig/share/swig/4.1.0/tcl/wish.i deleted file mode 100755 index 42902850..00000000 --- a/linux/bin/swig/share/swig/4.1.0/tcl/wish.i +++ /dev/null @@ -1,113 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wish.i - * - * SWIG File for making wish - * ----------------------------------------------------------------------------- */ - -#ifdef AUTODOC -%subsection "wish.i" -%text %{ -This module provides the Tk_AppInit() function needed to build a -new version of the wish executable. Like tclsh.i, this file should -not be used with dynamic loading. To make an interface file work with -both static and dynamic loading, put something like this in your -interface file : - - #ifdef STATIC - %include - #endif - -A startup file may be specified by defining the symbol SWIG_RcFileName -as follows (this should be included in a code-block) : - - #define SWIG_RcFileName "~/.mywishrc" -%} -#endif - -%{ - - -/* Initialization code for wish */ - -#include - -#ifndef SWIG_RcFileName -char *SWIG_RcFileName = "~/.wishrc"; -#endif - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppInit -- - * - * This procedure performs application-specific initialization. - * Most applications, especially those that incorporate additional - * packages, will have their own version of this procedure. - * - * Results: - * Returns a standard Tcl completion code, and leaves an error - * message in interp->result if an error occurs. - * - * Side effects: - * Depends on the startup script. - * - *---------------------------------------------------------------------- - */ - -int Tcl_AppInit(Tcl_Interp *interp) -{ - Tk_Window main; - main = Tk_MainWindow(interp); - - /* - * Call the init procedures for included packages. Each call should - * look like this: - * - * if (Mod_Init(interp) == TCL_ERROR) { - * return TCL_ERROR; - * } - * - * where "Mod" is the name of the module. - */ - - if (Tcl_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - if (Tk_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - /* - * Call Tcl_CreateCommand for application-specific commands, if - * they weren't already created by the init procedures called above. - */ - - if (SWIG_init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - /* - * Specify a user-specific startup file to invoke if the application - * is run interactively. Typically the startup file is "~/.apprc" - * where "app" is the name of the application. If this line is deleted - * then no user-specific startup file will be run under any conditions. - */ - - Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY); - return TCL_OK; -} - -#if TK_MAJOR_VERSION >= 4 -int main(int argc, char **argv) { - Tk_Main(argc, argv, Tcl_AppInit); - return(0); -} -#else -extern int main(); -#endif - -%} - - - diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/README b/linux/bin/swig/share/swig/4.1.0/typemaps/README old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/attribute.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/attribute.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/carrays.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/carrays.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/cdata.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/cdata.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/cmalloc.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/cmalloc.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/cpointer.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/cpointer.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/cstring.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/cstring.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/cstrings.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/cstrings.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/cwstring.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/cwstring.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/enumint.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/enumint.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/exception.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/exception.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/factory.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/factory.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/fragments.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/fragments.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/implicit.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/implicit.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/inoutlist.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/inoutlist.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/misctypes.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/misctypes.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/primtypes.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/primtypes.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/ptrtypes.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/ptrtypes.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/std_except.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/std_except.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/std_string.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/std_string.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/std_strings.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/std_strings.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/std_wstring.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/std_wstring.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/string.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/string.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/strings.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/strings.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/swigmacros.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/swigmacros.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/swigmove.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/swigmove.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/swigobject.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/swigobject.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/swigtype.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/swigtype.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/swigtypemaps.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/swigtypemaps.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/typemaps.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/typemaps.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/valtypes.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/valtypes.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/void.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/void.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/typemaps/wstring.swg b/linux/bin/swig/share/swig/4.1.0/typemaps/wstring.swg old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/wchar.i b/linux/bin/swig/share/swig/4.1.0/wchar.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/windows.i b/linux/bin/swig/share/swig/4.1.0/windows.i old mode 100755 new mode 100644 diff --git a/linux/bin/swig/share/swig/4.1.0/xml/typemaps.i b/linux/bin/swig/share/swig/4.1.0/xml/typemaps.i deleted file mode 100755 index 29736135..00000000 --- a/linux/bin/swig/share/swig/4.1.0/xml/typemaps.i +++ /dev/null @@ -1,3 +0,0 @@ -// -------------------------------------------------------------------- -// Empty file for %include to work -// -------------------------------------------------------------------- diff --git a/linux/bin/swig/share/swig/4.1.0/xml/xml.swg b/linux/bin/swig/share/swig/4.1.0/xml/xml.swg deleted file mode 100755 index c7bdbad0..00000000 --- a/linux/bin/swig/share/swig/4.1.0/xml/xml.swg +++ /dev/null @@ -1 +0,0 @@ -/* nothing special */ \ No newline at end of file diff --git a/mac/bin/swig/bin/swig b/mac/bin/swig/bin/swig index df3a3968..23c33f68 100755 Binary files a/mac/bin/swig/bin/swig and b/mac/bin/swig/bin/swig differ diff --git a/mac/bin/swig/share/swig/4.1.0/allkw.swg b/mac/bin/swig/share/swig/4.1.0/allkw.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/attribute.i b/mac/bin/swig/share/swig/4.1.0/attribute.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/carrays.i b/mac/bin/swig/share/swig/4.1.0/carrays.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/cdata.i b/mac/bin/swig/share/swig/4.1.0/cdata.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/cmalloc.i b/mac/bin/swig/share/swig/4.1.0/cmalloc.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/constraints.i b/mac/bin/swig/share/swig/4.1.0/constraints.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/cpointer.i b/mac/bin/swig/share/swig/4.1.0/cpointer.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/arrays_csharp.i b/mac/bin/swig/share/swig/4.1.0/csharp/arrays_csharp.i deleted file mode 100755 index 861da838..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/arrays_csharp.i +++ /dev/null @@ -1,179 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_csharp.i - * - * This file contains a two approaches to marshaling arrays. The first uses - * default p/invoke marshaling and the second uses pinning of the arrays. - * - * Default marshaling approach - * ---------------------------- - * Array typemaps using default p/invoke marshaling. The data is copied to a separately - * allocated buffer when passing over the managed-native boundary. - * - * There are separate typemaps for in, out and inout arrays to enable avoiding - * unnecessary copying. - * - * Example usage: - * - * %include "arrays_csharp.i" - * %apply int INPUT[] { int* sourceArray } - * %apply int OUTPUT[] { int* targetArray } - * void myArrayCopy( int* sourceArray, int* targetArray, int nitems ); - * - * %apply int INOUT[] { int* array1, int *array2 } - * void myArraySwap( int* array1, int* array2, int nitems ); - * - * If handling large arrays you should consider using the pinning array typemaps - * described next. - * - * Pinning approach - * ---------------- - * Array typemaps using pinning. These typemaps pin the managed array given - * as parameter and pass a pointer to it to the c/c++ side. This is very - * efficient as no copying is done (unlike in the default array marshaling), - * but it makes garbage collection more difficult. When considering using - * these typemaps, think carefully whether you have callbacks that may cause - * the control to re-enter the managed side from within the call (and produce - * garbage for the gc) or whether other threads may produce enough garbage to - * trigger gc while the call is being executed. In those cases it may be - * wiser to use the default marshaling typemaps. - * - * Please note that when using fixed arrays, you have to mark your corresponding - * module class method unsafe using - * %csmethodmodifiers "public unsafe" - * (the visibility of the method is up to you). - * - * Example usage: - * - * %include "arrays_csharp.i" - * %apply int FIXED[] { int* sourceArray, int *targetArray } - * %csmethodmodifiers myArrayCopy "public unsafe"; - * void myArrayCopy( int *sourceArray, int* targetArray, int nitems ); - * - * ----------------------------------------------------------------------------- */ - -%define CSHARP_ARRAYS( CTYPE, CSTYPE ) - -// input only arrays - -%typemap(ctype) CTYPE INPUT[] "CTYPE*" -%typemap(cstype) CTYPE INPUT[] "CSTYPE[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE INPUT[] "CSTYPE[]" -%typemap(csin) CTYPE INPUT[] "$csinput" - -%typemap(in) CTYPE INPUT[] "$1 = $input;" -%typemap(freearg) CTYPE INPUT[] "" -%typemap(argout) CTYPE INPUT[] "" - -// output only arrays - -%typemap(ctype) CTYPE OUTPUT[] "CTYPE*" -%typemap(cstype) CTYPE OUTPUT[] "CSTYPE[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE OUTPUT[] "CSTYPE[]" -%typemap(csin) CTYPE OUTPUT[] "$csinput" - -%typemap(in) CTYPE OUTPUT[] "$1 = $input;" -%typemap(freearg) CTYPE OUTPUT[] "" -%typemap(argout) CTYPE OUTPUT[] "" - -// inout arrays - -%typemap(ctype) CTYPE INOUT[] "CTYPE*" -%typemap(cstype) CTYPE INOUT[] "CSTYPE[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE INOUT[] "CSTYPE[]" -%typemap(csin) CTYPE INOUT[] "$csinput" - -%typemap(in) CTYPE INOUT[] "$1 = $input;" -%typemap(freearg) CTYPE INOUT[] "" -%typemap(argout) CTYPE INOUT[] "" - -%enddef // CSHARP_ARRAYS - -CSHARP_ARRAYS(signed char, sbyte) -CSHARP_ARRAYS(unsigned char, byte) -CSHARP_ARRAYS(short, short) -CSHARP_ARRAYS(unsigned short, ushort) -CSHARP_ARRAYS(int, int) -CSHARP_ARRAYS(unsigned int, uint) -// FIXME - on Unix 64 bit, long is 8 bytes but is 4 bytes on Windows 64 bit. -// How can this be handled sensibly? -// See e.g. http://www.xml.com/ldd/chapter/book/ch10.html -CSHARP_ARRAYS(long, int) -CSHARP_ARRAYS(unsigned long, uint) -CSHARP_ARRAYS(long long, long) -CSHARP_ARRAYS(unsigned long long, ulong) -CSHARP_ARRAYS(float, float) -CSHARP_ARRAYS(double, double) - -// By default C# will marshal bools as 4 bytes -// UnmanagedType.I1 will change this to 1 byte -// FIXME - When running on mono ArraySubType appears to be ignored and bools will be marshalled as 4-byte -// https://github.com/mono/mono/issues/15592 - -// input only arrays -%typemap(ctype) bool INPUT[] "bool*" -%typemap(cstype) bool INPUT[] "bool[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool INPUT[] "bool[]" -%typemap(csin) bool INPUT[] "$csinput" - -%typemap(in) bool INPUT[] %{ -$1 = $input; -%} -%typemap(freearg) bool INPUT[] "" -%typemap(argout) bool INPUT[] "" - -// output only arrays -%typemap(ctype) bool OUTPUT[] "bool*" -%typemap(cstype) bool OUTPUT[] "bool[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool OUTPUT[] "bool[]" -%typemap(csin) bool OUTPUT[] "$csinput" - -%typemap(in) bool OUTPUT[] %{ -$1 = $input; -%} -%typemap(freearg) bool OUTPUT[] "" -%typemap(argout) bool OUTPUT[] "" - -// inout arrays -%typemap(ctype) bool INOUT[] "bool*" -%typemap(cstype) bool INOUT[] "bool[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool INOUT[] "bool[]" -%typemap(csin) bool INOUT[] "$csinput" - -%typemap(in) bool INOUT[] %{ -$1 = $input; -%} -%typemap(freearg) bool INOUT[] "" -%typemap(argout) bool INOUT[] "" - - -%define CSHARP_ARRAYS_FIXED( CTYPE, CSTYPE ) - -%typemap(ctype) CTYPE FIXED[] "CTYPE*" -%typemap(imtype) CTYPE FIXED[] "global::System.IntPtr" -%typemap(cstype) CTYPE FIXED[] "CSTYPE[]" -%typemap(csin, - pre= " fixed ( CSTYPE* swig_ptrTo_$csinput = $csinput ) {", - terminator=" }") - CTYPE FIXED[] "(global::System.IntPtr)swig_ptrTo_$csinput" - -%typemap(in) CTYPE FIXED[] "$1 = $input;" -%typemap(freearg) CTYPE FIXED[] "" -%typemap(argout) CTYPE FIXED[] "" - - -%enddef // CSHARP_ARRAYS_FIXED - -CSHARP_ARRAYS_FIXED(signed char, sbyte) -CSHARP_ARRAYS_FIXED(unsigned char, byte) -CSHARP_ARRAYS_FIXED(short, short) -CSHARP_ARRAYS_FIXED(unsigned short, ushort) -CSHARP_ARRAYS_FIXED(int, int) -CSHARP_ARRAYS_FIXED(unsigned int, uint) -CSHARP_ARRAYS_FIXED(long, int) -CSHARP_ARRAYS_FIXED(unsigned long, uint) -CSHARP_ARRAYS_FIXED(long long, long) -CSHARP_ARRAYS_FIXED(unsigned long long, ulong) -CSHARP_ARRAYS_FIXED(float, float) -CSHARP_ARRAYS_FIXED(double, double) -CSHARP_ARRAYS_FIXED(bool, bool) - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/boost_intrusive_ptr.i b/mac/bin/swig/share/swig/4.1.0/csharp/boost_intrusive_ptr.i deleted file mode 100755 index 355a910c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/boost_intrusive_ptr.i +++ /dev/null @@ -1,517 +0,0 @@ -// Users can provide their own SWIG_INTRUSIVE_PTR_TYPEMAPS or SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP macros before including this file to change the -// visibility of the constructor and getCPtr method if desired to public if using multiple modules. -#ifndef SWIG_INTRUSIVE_PTR_TYPEMAPS -#define SWIG_INTRUSIVE_PTR_TYPEMAPS(CONST, TYPE...) SWIG_INTRUSIVE_PTR_TYPEMAPS_IMPLEMENTATION(internal, internal, CONST, TYPE) -#endif -#ifndef SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP -#define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(CONST, TYPE...) SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP_IMPLEMENTATION(internal, internal, CONST, TYPE) -#endif - -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - // plain value - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") CONST TYPE %{ - //plain value(out) - $1_ltype* resultp = new $1_ltype($1); - intrusive_ptr_add_ref(resultp); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(resultp, SWIG_intrusive_deleter< CONST TYPE >()); -%} - -%typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain pointer - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE * %{ - //plain pointer(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in, canthrow=1) CONST TYPE & %{ - // plain reference - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if(!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); - return $null; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE & %{ - //plain reference(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) %{ - // plain pointer by reference - temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") TYPE *CONST& %{ - // plain pointer by reference(out) - #if ($owner) - if (*$1) { - intrusive_ptr_add_ref(*$1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_0); - #endif -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by value - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if (smartarg) { - $1 = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ - if ($1) { - intrusive_ptr_add_ref($1.get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1.get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by reference - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - delete &($1); - if ($self) { - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * temp = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); - $1 = *temp; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - if (*$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - delete $1; - if ($self) $1 = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - if ($1 && *$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - if ($owner) delete $1; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& (SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > temp, $*1_ltype tempp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer reference - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if ($input) { - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } - tempp = &temp; - $1 = &tempp; -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if ($self) $1 = *$input; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if (*$1 && **$1) { - intrusive_ptr_add_ref((*$1)->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >((*$1)->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "void *" -%typemap (imtype, out="global::System.IntPtr") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(cstype, TYPE)" -%typemap(csin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(cstype, TYPE).getCPtr($csinput)" - -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ - get { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >& %{ - get { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >* %{ - get { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } %} - - -%typemap(csout, excode=SWIGEXCODE) CONST TYPE { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE & { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -// Base proxy classes -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnBase; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - -// CONST version needed ???? also for C# -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%template() SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; -%enddef - - -///////////////////////////////////////////////////////////////////// - - -%include - -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - - -// plain value -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -// plain pointer -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -// plain reference -%typemap(in, canthrow=1) CONST TYPE & %{ - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "void *" -%typemap (imtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "void *" -%typemap (cstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE)" -%typemap (csin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE).getCPtr($csinput)" -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true); - } - -%typemap(csout, excode=SWIGEXCODE) CONST TYPE { - return new $typemap(cstype, TYPE)($imcall, true); - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE & { - return new $typemap(cstype, TYPE)($imcall, true); - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE * { - global::System.IntPtr cPtr = $imcall; - return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true); - } -%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { - global::System.IntPtr cPtr = $imcall; - return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true); - } - -// Base proxy classes -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnBase; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - - -// CONST version needed ???? also for C# -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/boost_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/csharp/boost_shared_ptr.i deleted file mode 100755 index d47fab55..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/boost_shared_ptr.i +++ /dev/null @@ -1,323 +0,0 @@ -// Users can provide their own SWIG_SHARED_PTR_TYPEMAPS macro before including this file to change the -// visibility of the constructor and getCPtr method if desired to public if using multiple modules. -#ifndef SWIG_SHARED_PTR_TYPEMAPS -#define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(internal, internal, CONST, TYPE) -#endif - -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - argp = ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -%typemap(directorin) CONST TYPE -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (new $1_ltype(SWIG_STD_MOVE($1))); %} - -%typemap(directorout) CONST TYPE -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg->get(); -%} - -// plain pointer -%typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - $result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -%typemap(directorin) CONST TYPE * -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) CONST TYPE * %{ -#error "typemaps for $1_type not available" -%} - -// plain reference -%typemap(in, canthrow=1) CONST TYPE & %{ - $1 = ($1_ltype)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) CONST TYPE & -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (&$1 SWIG_NO_NULL_DELETER_0); %} - -%typemap(directorout) CONST TYPE & %{ -#error "typemaps for $1_type not available" -%} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = (TYPE *)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) TYPE *CONST& -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) TYPE *CONST& %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) $1 = *($&1_ltype)$input; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $result = $1 ? new $1_ltype($1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg; - } -%} - -// shared_ptr by reference -%typemap(in, canthrow=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $result = *$1 ? new $*1_ltype(*$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out, fragment="SWIG_null_deleter") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; - if ($owner) delete $1; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) -%{ temp = $input ? *($1_ltype)&$input : &tempnull; - $1 = &temp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "typemaps for $1_type not available" -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void *" -%typemap (imtype, out="global::System.IntPtr") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(cstype, TYPE)" - -%typemap(csin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(cstype, TYPE).getCPtr($csinput)" - -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - - -%typemap(csout, excode=SWIGEXCODE) CONST TYPE { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE & { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) CONST TYPE & %{ - get { - $csclassname ret = new $csclassname($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) CONST TYPE * %{ - get { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, true);$excode - return ret; - } %} - -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ - get { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ - get { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } %} - -%typemap(csdirectorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE).getCPtr($cscall).Handle" - -%typemap(csdirectorin) CONST TYPE, - CONST TYPE *, - CONST TYPE &, - TYPE *CONST& "($iminput == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)($iminput, true)" - -%typemap(csdirectorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "($iminput == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)($iminput, true)" - - -// Proxy classes (base classes, ie, not derived classes) -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnBase; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/complex.i b/mac/bin/swig/share/swig/4.1.0/csharp/complex.i deleted file mode 100755 index 4a6f91cd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/complex.i +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __cplusplus -%include -#else -#error C# module only supports complex in C++ mode. -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/csharp.swg b/mac/bin/swig/share/swig/4.1.0/csharp/csharp.swg deleted file mode 100755 index 1f80d12a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/csharp.swg +++ /dev/null @@ -1,1120 +0,0 @@ -/* ----------------------------------------------------------------------------- - * csharp.swg - * - * C# typemaps - * ----------------------------------------------------------------------------- */ - -%include - -/* The ctype, imtype and cstype typemaps work together and so there should be one of each. - * The ctype typemap contains the PInvoke type used in the PInvoke (C/C++) code. - * The imtype typemap contains the C# type used in the intermediary class. - * The cstype typemap contains the C# type used in the C# proxy classes, type wrapper classes and module class. */ - -/* SWIG 3 no longer inserts using directives into generated C# code. For backwards compatibility, the SWIG2_CSHARP - macro can be defined to have SWIG 3 generate using directives similar to those generated by SWIG 2. */ -#ifdef SWIG2_CSHARP - -%typemap(csimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "\nusing global::System;\nusing global::System.Runtime.InteropServices;\n" - -%pragma(csharp) moduleimports=%{ -using global::System; -using global::System.Runtime.InteropServices; -%} - -%pragma(csharp) imclassimports=%{ -using global::System; -using global::System.Runtime.InteropServices; -%} - -#endif - - -/* Fragments */ -%fragment("SWIG_PackData", "header") { -/* Pack binary data into a string */ -SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} -} - -%fragment("SWIG_UnPackData", "header") { -/* Unpack binary data from a string */ -SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} -} - -/* Primitive types */ -%typemap(ctype) bool, const bool & "unsigned int" -%typemap(ctype) char, const char & "char" -%typemap(ctype) signed char, const signed char & "signed char" -%typemap(ctype) unsigned char, const unsigned char & "unsigned char" -%typemap(ctype) short, const short & "short" -%typemap(ctype) unsigned short, const unsigned short & "unsigned short" -%typemap(ctype) int, const int & "int" -%typemap(ctype) unsigned int, const unsigned int & "unsigned int" -%typemap(ctype) long, const long & "long" -%typemap(ctype) unsigned long, const unsigned long & "unsigned long" -%typemap(ctype) long long, const long long & "long long" -%typemap(ctype) unsigned long long, const unsigned long long & "unsigned long long" -%typemap(ctype) float, const float & "float" -%typemap(ctype) double, const double & "double" -%typemap(ctype) void "void" - -%typemap(imtype) bool, const bool & "bool" -%typemap(imtype) char, const char & "char" -%typemap(imtype) signed char, const signed char & "sbyte" -%typemap(imtype) unsigned char, const unsigned char & "byte" -%typemap(imtype) short, const short & "short" -%typemap(imtype) unsigned short, const unsigned short & "ushort" -%typemap(imtype) int, const int & "int" -%typemap(imtype) unsigned int, const unsigned int & "uint" -%typemap(imtype) long, const long & "int" -%typemap(imtype) unsigned long, const unsigned long & "uint" -%typemap(imtype) long long, const long long & "long" -%typemap(imtype) unsigned long long, const unsigned long long & "ulong" -%typemap(imtype) float, const float & "float" -%typemap(imtype) double, const double & "double" -%typemap(imtype) void "void" - -%typemap(cstype) bool, const bool & "bool" -%typemap(cstype) char, const char & "char" -%typemap(cstype) signed char, const signed char & "sbyte" -%typemap(cstype) unsigned char, const unsigned char & "byte" -%typemap(cstype) short, const short & "short" -%typemap(cstype) unsigned short, const unsigned short & "ushort" -%typemap(cstype) int, const int & "int" -%typemap(cstype) unsigned int, const unsigned int & "uint" -%typemap(cstype) long, const long & "int" -%typemap(cstype) unsigned long, const unsigned long & "uint" -%typemap(cstype) long long, const long long & "long" -%typemap(cstype) unsigned long long, const unsigned long long & "ulong" -%typemap(cstype) float, const float & "float" -%typemap(cstype) double, const double & "double" -%typemap(cstype) void "void" - -%typemap(ctype) char *, char *&, char[ANY], char[] "char *" -%typemap(imtype) char *, char *&, char[ANY], char[] "string" -%typemap(cstype) char *, char *&, char[ANY], char[] "string" - -/* Non primitive types */ -%typemap(ctype) SWIGTYPE "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE "$&csclassname" - -%typemap(ctype) SWIGTYPE [] "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE [] "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE [] "$csclassname" - -%typemap(ctype) SWIGTYPE * "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE * "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE * "$csclassname" - -%typemap(ctype) SWIGTYPE & "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE & "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE & "$csclassname" - -%typemap(ctype) SWIGTYPE && "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE && "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE && "$csclassname" - -/* pointer to a class member */ -%typemap(ctype) SWIGTYPE (CLASS::*) "char *" -%typemap(imtype) SWIGTYPE (CLASS::*) "string" -%typemap(cstype) SWIGTYPE (CLASS::*) "$csclassname" - -/* The following are the in and out typemaps. These are the PInvoke code generating typemaps for converting from C# to C and visa versa. */ - -/* primitive types */ -%typemap(in) bool -%{ $1 = $input ? true : false; %} - -%typemap(directorout) bool -%{ $result = $input ? true : false; %} - -%typemap(csdirectorin) bool "$iminput" -%typemap(csdirectorout) bool "$cscall" - -%typemap(in) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $1 = ($1_ltype)$input; %} - -%typemap(directorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin) bool "$input = $1;" -%typemap(directorin) char "$input = $1;" -%typemap(directorin) signed char "$input = $1;" -%typemap(directorin) unsigned char "$input = $1;" -%typemap(directorin) short "$input = $1;" -%typemap(directorin) unsigned short "$input = $1;" -%typemap(directorin) int "$input = $1;" -%typemap(directorin) unsigned int "$input = $1;" -%typemap(directorin) long "$input = $1;" -%typemap(directorin) unsigned long "$input = (unsigned long)$1;" -%typemap(directorin) long long "$input = $1;" -%typemap(directorin) unsigned long long "$input = $1;" -%typemap(directorin) float "$input = $1;" -%typemap(directorin) double "$input = $1;" - -%typemap(csdirectorin) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double - "$iminput" - -%typemap(csdirectorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double - "$cscall" - -%typemap(out) bool %{ $result = $1; %} -%typemap(out) char %{ $result = $1; %} -%typemap(out) signed char %{ $result = $1; %} -%typemap(out) unsigned char %{ $result = $1; %} -%typemap(out) short %{ $result = $1; %} -%typemap(out) unsigned short %{ $result = $1; %} -%typemap(out) int %{ $result = $1; %} -%typemap(out) unsigned int %{ $result = $1; %} -%typemap(out) long %{ $result = $1; %} -%typemap(out) unsigned long %{ $result = (unsigned long)$1; %} -%typemap(out) long long %{ $result = $1; %} -%typemap(out) unsigned long long %{ $result = $1; %} -%typemap(out) float %{ $result = $1; %} -%typemap(out) double %{ $result = $1; %} - -/* char * - treat as String */ -%typemap(in) char * %{ $1 = ($1_ltype)$input; %} -%typemap(out) char * %{ $result = SWIG_csharp_string_callback((const char *)$1); %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char * %{ $input = SWIG_csharp_string_callback((const char *)$1); %} -%typemap(csdirectorin) char * "$iminput" -%typemap(csdirectorout) char * "$cscall" - -/* char *& - treat as String */ -%typemap(in) char *& ($*1_ltype temp = 0) %{ - temp = ($*1_ltype)$input; - $1 = &temp; -%} -%typemap(out) char *& %{ if ($1) $result = SWIG_csharp_string_callback((const char *)*$1); %} - -%typemap(out, null="") void "" -%typemap(csdirectorin) void "$iminput" -%typemap(csdirectorout) void "$cscall" -%typemap(directorin) void "" - -/* primitive types by const reference */ -%typemap(in) const bool & ($*1_ltype temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & -%{ static $*1_ltype temp; - temp = $input ? true : false; - $result = &temp; %} - -%typemap(csdirectorin) const bool & "$iminput" -%typemap(csdirectorout) const bool & "$cscall" - -%typemap(in) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ static $*1_ltype temp; - temp = ($*1_ltype)$input; - $result = &temp; %} - -%typemap(directorin) const bool & "$input = $1;" -%typemap(directorin) const char & "$input = $1;" -%typemap(directorin) const signed char & "$input = $1;" -%typemap(directorin) const unsigned char & "$input = $1;" -%typemap(directorin) const short & "$input = $1;" -%typemap(directorin) const unsigned short & "$input = $1;" -%typemap(directorin) const int & "$input = $1;" -%typemap(directorin) const unsigned int & "$input = $1;" -%typemap(directorin) const long & "$input = $1;" -%typemap(directorin) const unsigned long & "$input = $1;" -%typemap(directorin) const long long & "$input = $1;" -%typemap(directorin) const unsigned long long & "$input = $1;" -%typemap(directorin) const float & "$input = $1;" -%typemap(directorin) const double & "$input = $1;" - -%typemap(csdirectorin) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$iminput" - -%typemap(csdirectorout) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$cscall" - - -%typemap(out) const bool & %{ $result = *$1; %} -%typemap(out) const char & %{ $result = *$1; %} -%typemap(out) const signed char & %{ $result = *$1; %} -%typemap(out) const unsigned char & %{ $result = *$1; %} -%typemap(out) const short & %{ $result = *$1; %} -%typemap(out) const unsigned short & %{ $result = *$1; %} -%typemap(out) const int & %{ $result = *$1; %} -%typemap(out) const unsigned int & %{ $result = *$1; %} -%typemap(out) const long & %{ $result = *$1; %} -%typemap(out) const unsigned long & %{ $result = (unsigned long)*$1; %} -%typemap(out) const long long & %{ $result = *$1; %} -%typemap(out) const unsigned long long & %{ $result = *$1; %} -%typemap(out) const float & %{ $result = *$1; %} -%typemap(out) const double & %{ $result = *$1; %} - -/* Default handling. Object passed by value. Convert to a pointer */ -%typemap(in, canthrow=1) SWIGTYPE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; %} - -%typemap(directorout) SWIGTYPE -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); - return $null; - } - $result = *($&1_ltype)$input; %} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ $result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - $result = $1ptr; -} -#endif - -%typemap(directorin) SWIGTYPE -%{ $input = (void *)new $1_ltype(SWIG_STD_MOVE($1)); %} -%typemap(csdirectorin) SWIGTYPE "new $&csclassname($iminput, true)" -%typemap(csdirectorout) SWIGTYPE "$&csclassname.getCPtr($cscall).Handle" - -/* Generic pointers and references */ -%typemap(in) SWIGTYPE * %{ $1 = ($1_ltype)$input; %} -%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) %{ - SWIG_UnpackData($input, (void *)&$1, sizeof($1)); -%} -%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type is null", 0); - return $null; - } %} -%typemap(in, canthrow=1, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type is null", 0); - return $null; - } - rvrdeleter.reset($1); %} -%typemap(out) SWIGTYPE * %{ $result = (void *)$1; %} -%typemap(out, fragment="SWIG_PackData") SWIGTYPE (CLASS::*) %{ - char buf[128]; - char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); - *data = '\0'; - $result = SWIG_csharp_string_callback(buf); -%} -%typemap(out) SWIGTYPE & %{ $result = (void *)$1; %} -%typemap(out) SWIGTYPE && %{ $result = (void *)$1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * -%{ $result = ($1_ltype)$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin) SWIGTYPE * -%{ $input = (void *) $1; %} -%typemap(directorin) SWIGTYPE (CLASS::*) -%{ $input = (void *) $1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); - return $null; - } - $result = ($1_ltype)$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE && -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); - return $null; - } - $result = ($1_ltype)$input; %} -%typemap(directorin) SWIGTYPE & -%{ $input = ($1_ltype) &$1; %} -%typemap(directorin) SWIGTYPE && -%{ $input = ($1_ltype) &$1; %} - -%typemap(csdirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($iminput == global::System.IntPtr.Zero) ? null : new $csclassname($iminput, false)" -%typemap(csdirectorin) SWIGTYPE & "new $csclassname($iminput, false)" -%typemap(csdirectorin) SWIGTYPE && "new $csclassname($iminput, false)" -%typemap(csdirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE &, SWIGTYPE && "$csclassname.getCPtr($cscall).Handle" - -/* Default array handling */ -%typemap(in) SWIGTYPE [] %{ $1 = ($1_ltype)$input; %} -%typemap(out) SWIGTYPE [] %{ $result = $1; %} - -/* char arrays - treat as String */ -%typemap(in) char[ANY], char[] %{ $1 = ($1_ltype)$input; %} -%typemap(out) char[ANY], char[] %{ $result = SWIG_csharp_string_callback((const char *)$1); %} - -%typemap(directorout) char[ANY], char[] %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char[ANY], char[] %{ $input = SWIG_csharp_string_callback((const char *)$1); %} - -%typemap(csdirectorin) char[ANY], char[] "$iminput" -%typemap(csdirectorout) char[ANY], char[] "$cscall" - - -/* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions - * that cannot be overloaded in C# as more than one C++ type maps to a single C# type */ - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_UINT8) - unsigned char, - const unsigned char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) - short, - const short & - "" - -%typecheck(SWIG_TYPECHECK_UINT16) - unsigned short, - const unsigned short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) - int, - long, - const int &, - const long & - "" - -%typecheck(SWIG_TYPECHECK_UINT32) - unsigned int, - unsigned long, - const unsigned int &, - const unsigned long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) - long long, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_UINT64) - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) - char *, - char *&, - char[ANY], - char[] - "" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE *const&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - -/* Exception handling */ - -%typemap(throws, canthrow=1) int, - long, - short, - unsigned int, - unsigned long, - unsigned short -%{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, error_msg); - return $null; %} - -%typemap(throws, canthrow=1) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [ANY] -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(throws, canthrow=1) char * -%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1); - return $null; %} - - -/* Typemaps for code generation in proxy classes and C# type wrapper classes */ - -/* The csin typemap is used for converting function parameter types from the type - * used in the proxy, module or type wrapper class to the type used in the PInvoke class. */ -%typemap(csin) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double & - "$csinput" -%typemap(csin) char *, char *&, char[ANY], char[] "$csinput" -%typemap(csin) SWIGTYPE "$&csclassname.getCPtr($csinput)" -%typemap(csin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$csclassname.getCPtr($csinput)" -%typemap(csin) SWIGTYPE && "$csclassname.swigRelease($csinput)" -%typemap(csin) SWIGTYPE (CLASS::*) "$csclassname.getCMemberPtr($csinput)" - -/* The csout typemap is used for converting function return types from the return type - * used in the PInvoke class to the type returned by the proxy, module or type wrapper class. - * The $excode special variable is replaced by the excode typemap attribute code if the - * method can throw any exceptions from unmanaged code, otherwise replaced by nothing. */ - -// Macro used by the $excode special variable -%define SWIGEXCODE "\n if ($imclassname.SWIGPendingException.Pending) throw $imclassname.SWIGPendingException.Retrieve();" %enddef -%define SWIGEXCODE2 "\n if ($imclassname.SWIGPendingException.Pending) throw $imclassname.SWIGPendingException.Retrieve();" %enddef - -%typemap(csout, excode=SWIGEXCODE) bool, const bool & { - bool ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) char, const char & { - char ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) signed char, const signed char & { - sbyte ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned char, const unsigned char & { - byte ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) short, const short & { - short ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned short, const unsigned short & { - ushort ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) int, const int & { - int ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned int, const unsigned int & { - uint ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) long, const long & { - int ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned long, const unsigned long & { - uint ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) long long, const long long & { - long ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned long long, const unsigned long long & { - ulong ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) float, const float & { - float ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) double, const double & { - double ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) char *, char *&, char[ANY], char[] { - string ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) void { - $imcall;$excode - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE { - $&csclassname ret = new $&csclassname($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE & { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE && { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE *, SWIGTYPE [] { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE (CLASS::*) { - string cMemberPtr = $imcall; - $csclassname ret = (cMemberPtr == null) ? null : new $csclassname(cMemberPtr, $owner);$excode - return ret; - } - - -/* Properties */ -%typemap(csvarin, excode=SWIGEXCODE2) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ - set { - $imcall;$excode - } %} - -%typemap(csvarin, excode=SWIGEXCODE2) char *, char *&, char[ANY], char[] %{ - set { - $imcall;$excode - } %} - -%typemap(csvarout, excode=SWIGEXCODE2) bool, const bool & %{ - get { - bool ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) char, const char & %{ - get { - char ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) signed char, const signed char & %{ - get { - sbyte ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned char, const unsigned char & %{ - get { - byte ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) short, const short & %{ - get { - short ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned short, const unsigned short & %{ - get { - ushort ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) int, const int & %{ - get { - int ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned int, const unsigned int & %{ - get { - uint ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) long, const long & %{ - get { - int ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned long, const unsigned long & %{ - get { - uint ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) long long, const long long & %{ - get { - long ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned long long, const unsigned long long & %{ - get { - ulong ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) float, const float & %{ - get { - float ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) double, const double & %{ - get { - double ret = $imcall;$excode - return ret; - } %} - - -%typemap(csvarout, excode=SWIGEXCODE2) char *, char *&, char[ANY], char[] %{ - get { - string ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) void %{ - get { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE %{ - get { - $&csclassname ret = new $&csclassname($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE & %{ - get { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE && %{ - get { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE *, SWIGTYPE [] %{ - get { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode - return ret; - } %} - -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE (CLASS::*) %{ - get { - string cMemberPtr = $imcall; - $csclassname ret = (cMemberPtr == null) ? null : new $csclassname(cMemberPtr, $owner);$excode - return ret; - } %} - -/* Pointer reference typemaps */ -%typemap(ctype) SWIGTYPE *const& "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE *const& "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE *const& "$*csclassname" -%typemap(csin) SWIGTYPE *const& "$*csclassname.getCPtr($csinput)" -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE *const& { - global::System.IntPtr cPtr = $imcall; - $*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode - return ret; - } -%typemap(csvarout, excode=SWIGEXCODE) SWIGTYPE *const& %{ - get { - global::System.IntPtr cPtr = $imcall; - $*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode - return ret; - } %} - -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)$input; - $1 = ($1_ltype)&temp; %} -%typemap(out) SWIGTYPE *const& -%{ $result = (void *)*$1; %} -%typemap(directorin) SWIGTYPE *const& -%{ $input = (void *) $1; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = ($*1_ltype)$input; - $result = &swig_temp; %} -%typemap(csdirectorin) SWIGTYPE *const& "($iminput == global::System.IntPtr.Zero) ? null : new $*csclassname($iminput, false)" -%typemap(csdirectorout) SWIGTYPE *const& "$*csclassname.getCPtr($cscall).Handle" - -/* Marshal C/C++ pointer to global::System.IntPtr */ -%typemap(ctype) void *VOID_INT_PTR "void *" -%typemap(imtype) void *VOID_INT_PTR "global::System.IntPtr" -%typemap(cstype) void *VOID_INT_PTR "global::System.IntPtr" -%typemap(in) void *VOID_INT_PTR %{ $1 = ($1_ltype)$input; %} -%typemap(out) void *VOID_INT_PTR %{ $result = (void *)$1; %} -%typemap(csin) void *VOID_INT_PTR "$csinput" -%typemap(csout, excode=SWIGEXCODE) void *VOID_INT_PTR { - global::System.IntPtr ret = $imcall;$excode - return ret; - } -%typemap(csvarin, excode=SWIGEXCODE2) void *VOID_INT_PTR %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) void *VOID_INT_PTR %{ - get { - global::System.IntPtr ret = $imcall;$excode - return ret; - } %} -%typemap(csdirectorin) void *VOID_INT_PTR "$iminput" -%typemap(csdirectorout) void *VOID_INT_PTR "$cscall" - -/* Typemaps used for the generation of proxy and type wrapper class code */ -%typemap(csbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class" -%typemap(cscode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csinterfaces) SWIGTYPE "global::System.IDisposable" -%typemap(csinterfaces) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csinterfaces_derived) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csinterfacemodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public interface" - - -// csbody typemaps... these are in macros so that the visibility of the methods can be easily changed by users. - -%define SWIG_CSBODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Proxy classes (base classes, ie, not derived classes) -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef swigRelease($csclassname obj) { - if (obj != null) { - if (!obj.swigCMemOwn) - throw new global::System.ApplicationException("Cannot release ownership as memory is not owned"); - global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.Dispose(); - return ptr; - } else { - return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGUpcast(cPtr), cMemoryOwn) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef swigRelease($csclassname obj) { - if (obj != null) { - if (!obj.swigCMemOwn) - throw new global::System.ApplicationException("Cannot release ownership as memory is not owned"); - global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.Dispose(); - return ptr; - } else { - return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } -%} -%enddef - -%define SWIG_CSBODY_TYPEWRAPPER(PTRCTOR_VISIBILITY, DEFAULTCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Typewrapper classes -%typemap(csbody) TYPE *, TYPE &, TYPE &&, TYPE [] %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool futureUse) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - DEFAULTCTOR_VISIBILITY $csclassname() { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef swigRelease($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csbody) TYPE (CLASS::*) %{ - private string swigCMemberPtr; - - PTRCTOR_VISIBILITY $csclassname(string cMemberPtr, bool futureUse) { - swigCMemberPtr = cMemberPtr; - } - - DEFAULTCTOR_VISIBILITY $csclassname() { - swigCMemberPtr = null; - } - - CPTR_VISIBILITY static string getCMemberPtr($csclassname obj) { - return obj.swigCMemberPtr; - } -%} -%enddef - -/* Set the default csbody typemaps to use internal visibility. - Use the macros to change to public if using multiple modules. */ -SWIG_CSBODY_PROXY(internal, internal, SWIGTYPE) -SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE) - -%typemap(csdispose) SWIGTYPE %{ - ~$csclassname() { - Dispose(false); - } - - public void Dispose() { - Dispose(true); - global::System.GC.SuppressFinalize(this); - } -%} - -%typemap(csdispose_derived) SWIGTYPE "" - -%typemap(csconstruct, excode=SWIGEXCODE,directorconnect="\n SwigDirectorConnect();") SWIGTYPE %{: this($imcall, true) {$excode$directorconnect - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - -%typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{ - protected void $methodname() { - swigCMemOwn = false; - $imcall; - } -%} - -/* C# specific directives */ -#define %csconst(flag) %feature("cs:const","flag") -#define %csconstvalue(value) %feature("cs:constvalue",value) -#define %csenum(wrapapproach) %feature("cs:enum","wrapapproach") -#define %csmethodmodifiers %feature("cs:methodmodifiers") -#define %csnothrowexception %feature("except") -#define %csattributes %feature("cs:attributes") -#define %proxycode %insert("proxycode") - -%pragma(csharp) imclassclassmodifiers="class" -%pragma(csharp) moduleclassmodifiers="public class" - -/* Some ANSI C typemaps */ - -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* csharp keywords */ -%include - -// Default enum handling -%include - -// For vararg handling in macros, from swigmacros.swg -#define %arg(X...) X - -/* -// Alternative char * typemaps. -%pragma(csharp) imclasscode=%{ - public class SWIGStringMarshal : global::System.IDisposable { - public readonly global::System.Runtime.InteropServices.HandleRef swigCPtr; - public SWIGStringMarshal(string str) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, global::System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(str)); - } - public virtual void Dispose() { - global::System.Runtime.InteropServices.Marshal.FreeHGlobal(swigCPtr.Handle); - global::System.GC.SuppressFinalize(this); - } - } -%} - -%typemap(imtype, out="global::System.IntPtr") char *, char[ANY], char[] "global::System.Runtime.InteropServices.HandleRef" -%typemap(out) char *, char[ANY], char[] %{ $result = $1; %} -%typemap(csin) char *, char[ANY], char[] "new $imclassname.SWIGStringMarshal($csinput).swigCPtr" -%typemap(csout, excode=SWIGEXCODE) char *, char[ANY], char[] { - string ret = global::System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode - return ret; - } -%typemap(csvarin, excode=SWIGEXCODE2) char *, char[ANY], char[] %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) char *, char[ANY], char[] %{ - get { - string ret = global::System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode - return ret; - } %} -*/ - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/csharphead.swg b/mac/bin/swig/share/swig/4.1.0/csharp/csharphead.swg deleted file mode 100755 index 56a019bd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/csharphead.swg +++ /dev/null @@ -1,339 +0,0 @@ -/* ----------------------------------------------------------------------------- - * csharphead.swg - * - * Support code for exceptions if the SWIG_CSHARP_NO_EXCEPTION_HELPER is not defined - * Support code for strings if the SWIG_CSHARP_NO_STRING_HELPER is not defined - * ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ -#include -#include -#include -%} - -#if !defined(SWIG_CSHARP_NO_EXCEPTION_HELPER) -%insert(runtime) %{ -/* Support for throwing C# exceptions from C/C++. There are two types: - * Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */ -typedef enum { - SWIG_CSharpApplicationException, - SWIG_CSharpArithmeticException, - SWIG_CSharpDivideByZeroException, - SWIG_CSharpIndexOutOfRangeException, - SWIG_CSharpInvalidCastException, - SWIG_CSharpInvalidOperationException, - SWIG_CSharpIOException, - SWIG_CSharpNullReferenceException, - SWIG_CSharpOutOfMemoryException, - SWIG_CSharpOverflowException, - SWIG_CSharpSystemException -} SWIG_CSharpExceptionCodes; - -typedef enum { - SWIG_CSharpArgumentException, - SWIG_CSharpArgumentNullException, - SWIG_CSharpArgumentOutOfRangeException -} SWIG_CSharpExceptionArgumentCodes; - -typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *); -typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *); - -typedef struct { - SWIG_CSharpExceptionCodes code; - SWIG_CSharpExceptionCallback_t callback; -} SWIG_CSharpException_t; - -typedef struct { - SWIG_CSharpExceptionArgumentCodes code; - SWIG_CSharpExceptionArgumentCallback_t callback; -} SWIG_CSharpExceptionArgument_t; - -static SWIG_CSharpException_t SWIG_csharp_exceptions[] = { - { SWIG_CSharpApplicationException, NULL }, - { SWIG_CSharpArithmeticException, NULL }, - { SWIG_CSharpDivideByZeroException, NULL }, - { SWIG_CSharpIndexOutOfRangeException, NULL }, - { SWIG_CSharpInvalidCastException, NULL }, - { SWIG_CSharpInvalidOperationException, NULL }, - { SWIG_CSharpIOException, NULL }, - { SWIG_CSharpNullReferenceException, NULL }, - { SWIG_CSharpOutOfMemoryException, NULL }, - { SWIG_CSharpOverflowException, NULL }, - { SWIG_CSharpSystemException, NULL } -}; - -static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = { - { SWIG_CSharpArgumentException, NULL }, - { SWIG_CSharpArgumentNullException, NULL }, - { SWIG_CSharpArgumentOutOfRangeException, NULL } -}; - -static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) { - SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback; - if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) { - callback = SWIG_csharp_exceptions[code].callback; - } - callback(msg); -} - -static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { - SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback; - if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) { - callback = SWIG_csharp_exceptions_argument[code].callback; - } - callback(msg, param_name); -} -%} - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_$module( - SWIG_CSharpExceptionCallback_t applicationCallback, - SWIG_CSharpExceptionCallback_t arithmeticCallback, - SWIG_CSharpExceptionCallback_t divideByZeroCallback, - SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback, - SWIG_CSharpExceptionCallback_t invalidCastCallback, - SWIG_CSharpExceptionCallback_t invalidOperationCallback, - SWIG_CSharpExceptionCallback_t ioCallback, - SWIG_CSharpExceptionCallback_t nullReferenceCallback, - SWIG_CSharpExceptionCallback_t outOfMemoryCallback, - SWIG_CSharpExceptionCallback_t overflowCallback, - SWIG_CSharpExceptionCallback_t systemCallback) { - SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback; - SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback; - SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback; - SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback; - SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback; - SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback; - SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback; - SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback; - SWIG_csharp_exceptions[SWIG_CSharpOutOfMemoryException].callback = outOfMemoryCallback; - SWIG_csharp_exceptions[SWIG_CSharpOverflowException].callback = overflowCallback; - SWIG_csharp_exceptions[SWIG_CSharpSystemException].callback = systemCallback; -} - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( - SWIG_CSharpExceptionArgumentCallback_t argumentCallback, - SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback, - SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) { - SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback; - SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback; - SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback; -} -%} - -%pragma(csharp) imclasscode=%{ - protected class SWIGExceptionHelper { - - public delegate void ExceptionDelegate(string message); - public delegate void ExceptionArgumentDelegate(string message, string paramName); - - static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException); - static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException); - static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException); - static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException); - static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException); - static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException); - static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException); - static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException); - static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException); - static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException); - static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException); - - static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException); - static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException); - static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException); - - [global::System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="SWIGRegisterExceptionCallbacks_$module")] - public static extern void SWIGRegisterExceptionCallbacks_$module( - ExceptionDelegate applicationDelegate, - ExceptionDelegate arithmeticDelegate, - ExceptionDelegate divideByZeroDelegate, - ExceptionDelegate indexOutOfRangeDelegate, - ExceptionDelegate invalidCastDelegate, - ExceptionDelegate invalidOperationDelegate, - ExceptionDelegate ioDelegate, - ExceptionDelegate nullReferenceDelegate, - ExceptionDelegate outOfMemoryDelegate, - ExceptionDelegate overflowDelegate, - ExceptionDelegate systemExceptionDelegate); - - [global::System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_$module")] - public static extern void SWIGRegisterExceptionCallbacksArgument_$module( - ExceptionArgumentDelegate argumentDelegate, - ExceptionArgumentDelegate argumentNullDelegate, - ExceptionArgumentDelegate argumentOutOfRangeDelegate); - - static void SetPendingApplicationException(string message) { - SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingArithmeticException(string message) { - SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingDivideByZeroException(string message) { - SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingIndexOutOfRangeException(string message) { - SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingInvalidCastException(string message) { - SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingInvalidOperationException(string message) { - SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingIOException(string message) { - SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingNullReferenceException(string message) { - SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingOutOfMemoryException(string message) { - SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingOverflowException(string message) { - SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingSystemException(string message) { - SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve())); - } - - static void SetPendingArgumentException(string message, string paramName) { - SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve())); - } - static void SetPendingArgumentNullException(string message, string paramName) { - global::System.Exception e = SWIGPendingException.Retrieve(); - if (e != null) message = message + " Inner Exception: " + e.Message; - SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message)); - } - static void SetPendingArgumentOutOfRangeException(string message, string paramName) { - global::System.Exception e = SWIGPendingException.Retrieve(); - if (e != null) message = message + " Inner Exception: " + e.Message; - SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message)); - } - - static SWIGExceptionHelper() { - SWIGRegisterExceptionCallbacks_$module( - applicationDelegate, - arithmeticDelegate, - divideByZeroDelegate, - indexOutOfRangeDelegate, - invalidCastDelegate, - invalidOperationDelegate, - ioDelegate, - nullReferenceDelegate, - outOfMemoryDelegate, - overflowDelegate, - systemDelegate); - - SWIGRegisterExceptionCallbacksArgument_$module( - argumentDelegate, - argumentNullDelegate, - argumentOutOfRangeDelegate); - } - } - - protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper(); - - public class SWIGPendingException { - [global::System.ThreadStatic] - private static global::System.Exception pendingException = null; - private static int numExceptionsPending = 0; - private static global::System.Object exceptionsLock = null; - - public static bool Pending { - get { - bool pending = false; - if (numExceptionsPending > 0) - if (pendingException != null) - pending = true; - return pending; - } - } - - public static void Set(global::System.Exception e) { - if (pendingException != null) - throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); - pendingException = e; - lock(exceptionsLock) { - numExceptionsPending++; - } - } - - public static global::System.Exception Retrieve() { - global::System.Exception e = null; - if (numExceptionsPending > 0) { - if (pendingException != null) { - e = pendingException; - pendingException = null; - lock(exceptionsLock) { - numExceptionsPending--; - } - } - } - return e; - } - - static SWIGPendingException() { - exceptionsLock = new global::System.Object(); - } - } -%} -#endif // SWIG_CSHARP_NO_EXCEPTION_HELPER - -#if !defined(SWIG_CSHARP_NO_STRING_HELPER) -%insert(runtime) %{ -/* Callback for returning strings to C# without leaking memory */ -typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *); -static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL; -%} - -%pragma(csharp) imclasscode=%{ - protected class SWIGStringHelper { - - public delegate string SWIGStringDelegate(string message); - static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString); - - [global::System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="SWIGRegisterStringCallback_$module")] - public static extern void SWIGRegisterStringCallback_$module(SWIGStringDelegate stringDelegate); - - static string CreateString(string cString) { - return cString; - } - - static SWIGStringHelper() { - SWIGRegisterStringCallback_$module(stringDelegate); - } - } - - static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper(); -%} - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_$module(SWIG_CSharpStringHelperCallback callback) { - SWIG_csharp_string_callback = callback; -} -%} -#endif // SWIG_CSHARP_NO_STRING_HELPER - -#if !defined(SWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR) -// Ensure the class is not marked beforefieldinit -%pragma(csharp) imclasscode=%{ - static $imclassname() { - } -%} -#endif - -%insert(runtime) %{ -/* Contract support */ - -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } } while (0) -%} diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/csharpkw.swg b/mac/bin/swig/share/swig/4.1.0/csharp/csharpkw.swg deleted file mode 100755 index 1904fce9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/csharpkw.swg +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef CSHARP_CSHARPKW_SWG_ -#define CSHARP_CSHARPKW_SWG_ - -/* Warnings for C# keywords */ -#define CSHARPKW(x) %keywordwarn("'" `x` "' is a C# keyword",rename="%s_") `x` - -#define CSHARPCLASSKW(x) %keywordwarn("'" `x` "' is a special method name used in the C# wrapper classes",%$isclass,rename="%s_") `x` - -/* - from - http://www.jaggersoft.com/csharp_grammar.html#1.7%20Keywords - -*/ - -CSHARPKW(abstract); -CSHARPKW(as); -CSHARPKW(base); -CSHARPKW(bool); -CSHARPKW(break); -CSHARPKW(byte); -CSHARPKW(case); -CSHARPKW(catch); -CSHARPKW(char); -CSHARPKW(checked); -CSHARPKW(class); -CSHARPKW(const); -CSHARPKW(continue); -CSHARPKW(decimal); -CSHARPKW(default); -CSHARPKW(delegate); -CSHARPKW(do); -CSHARPKW(double); -CSHARPKW(else); -CSHARPKW(enum); -CSHARPKW(event); -CSHARPKW(explicit); -CSHARPKW(extern); -CSHARPKW(false); -CSHARPKW(finally); -CSHARPKW(fixed); -CSHARPKW(float); -CSHARPKW(for); -CSHARPKW(foreach); -CSHARPKW(goto); -CSHARPKW(if); -CSHARPKW(implicit); -CSHARPKW(in); -CSHARPKW(int); -CSHARPKW(interface); -CSHARPKW(internal); -CSHARPKW(is); -CSHARPKW(lock); -CSHARPKW(long); -CSHARPKW(namespace); -CSHARPKW(new); -CSHARPKW(null); -CSHARPKW(object); -CSHARPKW(operator); -CSHARPKW(out); -CSHARPKW(override); -CSHARPKW(params); -CSHARPKW(private); -CSHARPKW(protected); -CSHARPKW(public); -CSHARPKW(readonly); -CSHARPKW(ref); -CSHARPKW(return); -CSHARPKW(sbyte); -CSHARPKW(sealed); -CSHARPKW(short); -CSHARPKW(sizeof); -CSHARPKW(stackalloc); -CSHARPKW(static); -CSHARPKW(struct); -CSHARPKW(string); -CSHARPKW(switch); -CSHARPKW(this); -CSHARPKW(throw); -CSHARPKW(true); -CSHARPKW(try); -CSHARPKW(typeof); -CSHARPKW(uint); -CSHARPKW(ulong); -CSHARPKW(unchecked); -CSHARPKW(unsafe); -CSHARPKW(ushort); -CSHARPKW(using); -CSHARPKW(virtual); -CSHARPKW(void); -CSHARPKW(volatile); -CSHARPKW(while); - -CSHARPCLASSKW(delete); - -#undef CSHARPKW - -#endif //CSHARP_CSHARPKW_SWG_ diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/director.swg b/mac/bin/swig/share/swig/4.1.0/csharp/director.swg deleted file mode 100755 index 5d2ab5d9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/director.swg +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that C# proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#if defined(DEBUG_DIRECTOR_OWNED) -#include -#endif -#include -#include - -namespace Swig { - /* Director base class - not currently used in C# directors */ - class Director { - }; - - /* Base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - - public: - DirectorException(const char *msg) : swig_msg(msg) { - } - - DirectorException(const std::string &msg) : swig_msg(msg) { - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - /* Pure virtual method exception */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; -} - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/enums.swg b/mac/bin/swig/share/swig/4.1.0/csharp/enums.swg deleted file mode 100755 index 5cc26547..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/enums.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enums.swg - * - * Include this file in order for C/C++ enums to be wrapped by proper C# enums. - * Note that the PINVOKE layer handles the enum as an int. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(cstype) const enum SWIGTYPE & "$*csclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(csdirectorin) const enum SWIGTYPE & "($*csclassname)$iminput" -%typemap(csdirectorout) const enum SWIGTYPE & "(int)$cscall" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws, canthrow=1) const enum SWIGTYPE & -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) const enum SWIGTYPE & "(int)$csinput" -%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { - $*csclassname ret = ($*csclassname)$imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ - get { - $*csclassname ret = ($*csclassname)$imcall;$excode - return ret; - } %} - - -// enum SWIGTYPE typemaps -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(cstype) enum SWIGTYPE "$csclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(csdirectorin) enum SWIGTYPE "($csclassname)$iminput" -%typemap(csdirectorout) enum SWIGTYPE "(int)$cscall" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws, canthrow=1) enum SWIGTYPE -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) enum SWIGTYPE "(int)$csinput" -%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { - $csclassname ret = ($csclassname)$imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ - get { - $csclassname ret = ($csclassname)$imcall;$excode - return ret; - } %} - -%typemap(csbase) enum SWIGTYPE "" -%typemap(csclassmodifiers) enum SWIGTYPE "public enum" -%typemap(cscode) enum SWIGTYPE "" -%typemap(csimports) enum SWIGTYPE "" -%typemap(csinterfaces) enum SWIGTYPE "" - -%typemap(csbody) enum SWIGTYPE "" - -%csenum(proper); - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/enumsimple.swg b/mac/bin/swig/share/swig/4.1.0/csharp/enumsimple.swg deleted file mode 100755 index 24e4bcf1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/enumsimple.swg +++ /dev/null @@ -1,88 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumsimple.swg - * - * This file provides backwards compatible enum wrapping. SWIG versions 1.3.21 - * and earlier wrapped global enums with constant integers in the module - * class. Enums declared within a C++ class were wrapped by constant integers - * in the C# proxy class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(cstype) const enum SWIGTYPE & "int" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(csdirectorin) const enum SWIGTYPE & "$iminput" -%typemap(csdirectorout) const enum SWIGTYPE & "$cscall" - -%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" - -%typemap(throws, canthrow=1) const enum SWIGTYPE & -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) const enum SWIGTYPE & "$csinput" -%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { - int ret = $imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ - get { - int ret = $imcall;$excode - return ret; - } %} - - -// enum SWIGTYPE typemaps -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(cstype) enum SWIGTYPE "int" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(csdirectorin) enum SWIGTYPE "$iminput" -%typemap(csdirectorout) enum SWIGTYPE "$cscall" - -%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" - -%typemap(throws, canthrow=1) enum SWIGTYPE -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) enum SWIGTYPE "$csinput" -%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { - int ret = $imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ - get { - int ret = $imcall;$excode - return ret; - } %} - -%typemap(csbase) enum SWIGTYPE "" -%typemap(csclassmodifiers) enum SWIGTYPE "" -%typemap(cscode) enum SWIGTYPE "" -%typemap(csimports) enum SWIGTYPE "" -%typemap(csinterfaces) enum SWIGTYPE "" - -%typemap(csbody) enum SWIGTYPE "" - -%csenum(simple); - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/enumtypesafe.swg b/mac/bin/swig/share/swig/4.1.0/csharp/enumtypesafe.swg deleted file mode 100755 index fd680173..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/enumtypesafe.swg +++ /dev/null @@ -1,130 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumtypesafe.swg - * - * Include this file in order for C/C++ enums to be wrapped by the so called - * typesafe enum pattern. Each enum has an equivalent C# class named after the - * enum and each enum item is a static instance of this class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(cstype) const enum SWIGTYPE & "$*csclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(csdirectorin) const enum SWIGTYPE & "$*csclassname.swigToEnum($iminput)" -%typemap(csdirectorout) const enum SWIGTYPE & "$cscall.swigValue" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws, canthrow=1) const enum SWIGTYPE & -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) const enum SWIGTYPE & "$csinput.swigValue" -%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { - $*csclassname ret = $*csclassname.swigToEnum($imcall);$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ - get { - $*csclassname ret = $*csclassname.swigToEnum($imcall);$excode - return ret; - } %} - - -// enum SWIGTYPE typemaps -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(cstype) enum SWIGTYPE "$csclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(csdirectorin) enum SWIGTYPE "$csclassname.swigToEnum($iminput)" -%typemap(csdirectorout) enum SWIGTYPE "$cscall.swigValue" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws, canthrow=1) enum SWIGTYPE -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) enum SWIGTYPE "$csinput.swigValue" -%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { - $csclassname ret = $csclassname.swigToEnum($imcall);$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ - get { - $csclassname ret = $csclassname.swigToEnum($imcall);$excode - return ret; - } %} - -%typemap(csbase) enum SWIGTYPE "" -%typemap(csclassmodifiers) enum SWIGTYPE "public sealed class" -%typemap(cscode) enum SWIGTYPE "" -%typemap(csimports) enum SWIGTYPE "" -%typemap(csinterfaces) enum SWIGTYPE "" - -/* - * The swigToEnum method is used to find the C# enum from a C++ enum integer value. The default one here takes - * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial - * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be - * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. - * The special variable, $enumvalues, is replaced with a comma separated list of all the enum values. - */ -%typemap(csbody) enum SWIGTYPE %{ - public readonly int swigValue; - - public static $csclassname swigToEnum(int swigValue) { - if (swigValue < swigValues.Length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.Length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new global::System.ArgumentOutOfRangeException("No enum $csclassname with value " + swigValue); - } - - public override string ToString() { - return swigName; - } - - private $csclassname(string swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private $csclassname(string swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private $csclassname(string swigName, $csclassname swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static $csclassname[] swigValues = { $enumvalues }; - private static int swigNext = 0; - private readonly string swigName; -%} - -%csenum(typesafe); - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_array.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_array.i deleted file mode 100755 index 6e7fe9eb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_array.i +++ /dev/null @@ -1,227 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_array.i - * - * SWIG typemaps for std::array - * C# implementation - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.IReadOnlyList<> collection. - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -#include -%} - -%include - - -%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" -%proxycode %{ - public $csclassname(global::System.Collections.ICollection c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - int end = global::System.Math.Min(this.Count, c.Count); - int i = 0; - foreach ($typemap(cstype, T) elem in c) { - if (i >= end) - break; - this[i++] = elem; - } - } - - public int Count { - get { - return (int)size(); - } - } - - public $typemap(cstype, T) this[int index] { - get { - return getitem(index); - } - set { - setitem(index, value); - } - } - - public bool IsEmpty { - get { - return empty(); - } - } - - public void CopyTo($typemap(cstype, T)[] array) - { - CopyTo(0, array, 0, this.Count); - } - - public void CopyTo($typemap(cstype, T)[] array, int arrayIndex) - { - CopyTo(0, array, arrayIndex, this.Count); - } - - public void CopyTo(int index, $typemap(cstype, T)[] array, int arrayIndex, int count) - { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (index < 0) - throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (count < 0) - throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (index+count > this.Count || arrayIndex+count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - for (int i=0; i global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator - , global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> - { - private $csclassname collectionRef; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, T) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, T))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - currentObject = collectionRef[currentIndex]; - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - array(); - array(const array &other); - - size_type size() const; - bool empty() const; - - %rename(Fill) fill; - void fill(const value_type& value); - - %rename(Swap) swap; - void swap(array& other); - - %extend { - T getitemcopy(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - const_reference getitem(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - void setitem(int index, const_reference val) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - (*$self)[index] = val; - else - throw std::out_of_range("index"); - } - void Reverse() { - std::reverse($self->begin(), $self->end()); - } - void Reverse(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - std::reverse($self->begin()+index, $self->begin()+index+count); - } - } -%enddef - - -%csmethodmodifiers std::array::empty "private" -%csmethodmodifiers std::array::getitemcopy "private" -%csmethodmodifiers std::array::getitem "private" -%csmethodmodifiers std::array::setitem "private" -%csmethodmodifiers std::array::size "private" - -namespace std { - template class array { - SWIG_STD_ARRAY_INTERNAL(T, N) - }; -} diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_auto_ptr.i deleted file mode 100755 index da15df3e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_auto_ptr.i +++ /dev/null @@ -1,38 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap (ctype) std::auto_ptr< TYPE > "void *" -%typemap (imtype, out="System.IntPtr") std::auto_ptr< TYPE > "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) std::auto_ptr< TYPE > "$typemap(cstype, TYPE)" - -%typemap(in) std::auto_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(csin) std::auto_ptr< TYPE > "$typemap(cstype, TYPE).swigRelease($csinput)" - -%typemap (out) std::auto_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(csout, excode=SWIGEXCODE) std::auto_ptr< TYPE > { - System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_common.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_complex.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_complex.i deleted file mode 100755 index 6a0cc545..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_complex.i +++ /dev/null @@ -1,95 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_complex.i - * - * Typemaps for handling std::complex and std::complex as a .NET - * System.Numerics.Complex type. Requires .NET 4 minimum. - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -%fragment("SwigSystemNumericsComplex", "header") { -extern "C" { -// Identical to the layout of System.Numerics.Complex, but does assume that it is -// LayoutKind.Sequential on the managed side -struct SwigSystemNumericsComplex { - double real; - double imag; -}; -} - -SWIGINTERN SwigSystemNumericsComplex SwigCreateSystemNumericsComplex(double real, double imag) { - SwigSystemNumericsComplex cpx; - cpx.real = real; - cpx.imag = imag; - return cpx; -} -} - -namespace std { - -%naturalvar complex; - -template -class complex -{ -public: - complex(T re = T(), T im = T()); -}; - -} - -%define SWIG_COMPLEX_TYPEMAPS(T) -%typemap(ctype, fragment="SwigSystemNumericsComplex") std::complex, const std::complex & "SwigSystemNumericsComplex" -%typemap(imtype) std::complex, const std::complex & "System.Numerics.Complex" -%typemap(cstype) std::complex, const std::complex & "System.Numerics.Complex" - -%typemap(in) std::complex -%{$1 = std::complex< double >($input.real, $input.imag);%} - -%typemap(in) const std::complex &($*1_ltype temp) -%{temp = std::complex< T >((T)$input.real, (T)$input.imag); - $1 = &temp;%} - -%typemap(out, null="SwigCreateSystemNumericsComplex(0.0, 0.0)") std::complex -%{$result = SwigCreateSystemNumericsComplex($1.real(), $1.imag());%} - -%typemap(out, null="SwigCreateSystemNumericsComplex(0.0, 0.0)") const std::complex & -%{$result = SwigCreateSystemNumericsComplex($1->real(), $1->imag());%} - -%typemap(cstype) std::complex, const std::complex & "System.Numerics.Complex" - -%typemap(csin) std::complex, const std::complex & "$csinput" - -%typemap(csout, excode=SWIGEXCODE) std::complex, const std::complex & { - System.Numerics.Complex ret = $imcall;$excode - return ret; - } - -%typemap(csvarin, excode=SWIGEXCODE2) const std::complex & %{ - set { - $imcall;$excode - } - %} - -%typemap(csvarout, excode=SWIGEXCODE2) const std::complex & %{ - get { - System.Numerics.Complex ret = $imcall;$excode - return ret; - } - %} - -%template() std::complex; -%enddef - -// By default, typemaps for both std::complex and std::complex -// are defined, but one of them can be disabled by predefining the -// corresponding symbol before including this file. -#ifndef SWIG_NO_STD_COMPLEX_DOUBLE -SWIG_COMPLEX_TYPEMAPS(double) -#endif - -#ifndef SWIG_NO_STD_COMPLEX_FLOAT -SWIG_COMPLEX_TYPEMAPS(float) -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_deque.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_except.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_except.i deleted file mode 100755 index c983bd0f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_except.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. These typemaps are - * used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws, canthrow=1) std::bad_cast "SWIG_CSharpSetPendingException(SWIG_CSharpInvalidCastException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::bad_exception "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::domain_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::exception "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::invalid_argument "SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentException, $1.what(), \"\");\n return $null;" -%typemap(throws, canthrow=1) std::length_error "SWIG_CSharpSetPendingException(SWIG_CSharpIndexOutOfRangeException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::logic_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::out_of_range "SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::overflow_error "SWIG_CSharpSetPendingException(SWIG_CSharpOverflowException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::range_error "SWIG_CSharpSetPendingException(SWIG_CSharpIndexOutOfRangeException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::runtime_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::underflow_error "SWIG_CSharpSetPendingException(SWIG_CSharpOverflowException, $1.what());\n return $null;" - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_list.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_list.i deleted file mode 100755 index cf6f2023..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_list.i +++ /dev/null @@ -1,519 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list - * C# implementation - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.LinkedList<> collection. - * - * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with - * C++ std::list wrappers. The ICollection<> interface is also implemented to provide enhanced functionality - * whenever we are confident that the required C++ operator== is available. This is the case for when - * T is a primitive type or a pointer. If T does define an operator==, then use the SWIG_STD_LIST_ENHANCED - * macro to obtain this enhanced functionality, for example: - * - * SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass) - * %template(ListKlass) std::list; - * ----------------------------------------------------------------------------- */ - -%include - -// MACRO for use within the std::list class body -%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" - -%apply void *VOID_INT_PTR { std::list< CTYPE >::iterator * }; - -%proxycode %{ - public $csclassname(global::System.Collections.IEnumerable c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - foreach ($typemap(cstype, CTYPE) element in c) { - this.AddLast(element); - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public int Count { - get { - return (int)size(); - } - } - - public $csclassnameNode First { - get { - if (Count == 0) - return null; - return new $csclassnameNode(getFirstIter(), this); - } - } - - public $csclassnameNode Last { - get { - if (Count == 0) - return null; - return new $csclassnameNode(getLastIter(), this); - } - } - - public $csclassnameNode AddFirst($typemap(cstype, CTYPE) value) { - push_front(value); - return new $csclassnameNode(getFirstIter(), this); - } - - public void AddFirst($csclassnameNode newNode) { - ValidateNewNode(newNode); - if (!newNode.inlist) { - push_front(newNode.csharpvalue); - newNode.iter = getFirstIter(); - newNode.inlist = true; - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public $csclassnameNode AddLast($typemap(cstype, CTYPE) value) { - push_back(value); - return new $csclassnameNode(getLastIter(), this); - } - - public void AddLast($csclassnameNode newNode) { - ValidateNewNode(newNode); - if (!newNode.inlist) { - push_back(newNode.csharpvalue); - newNode.iter = getLastIter(); - newNode.inlist = true; - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public $csclassnameNode AddBefore($csclassnameNode node, $typemap(cstype, CTYPE) value) { - return new $csclassnameNode(insertNode(node.iter, value), this); - } - - public void AddBefore($csclassnameNode node, $csclassnameNode newNode) { - ValidateNode(node); - ValidateNewNode(newNode); - if (!newNode.inlist) { - newNode.iter = insertNode(node.iter, newNode.csharpvalue); - newNode.inlist = true; - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public $csclassnameNode AddAfter($csclassnameNode node, $typemap(cstype, CTYPE) value) { - node = node.Next; - return new $csclassnameNode(insertNode(node.iter, value), this); - } - - public void AddAfter($csclassnameNode node, $csclassnameNode newNode) { - ValidateNode(node); - ValidateNewNode(newNode); - if (!newNode.inlist) { - if (node == this.Last) - AddLast(newNode); - else - { - node = node.Next; - newNode.iter = insertNode(node.iter, newNode.csharpvalue); - newNode.inlist = true; - } - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public void Add($typemap(cstype, CTYPE) value) { - AddLast(value); - } - - public void Remove($csclassnameNode node) { - ValidateNode(node); - eraseIter(node.iter); - } - - public void CopyTo($typemap(cstype, CTYPE)[] array, int index) { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (index < 0 || index > array.Length) - throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - $csclassnameNode node = this.First; - if (node != null) { - do { - array[index++] = node.Value; - node = node.Next; - } while (node != null); - } - } - - internal void ValidateNode($csclassnameNode node) { - if (node == null) { - throw new System.ArgumentNullException("node"); - } - if (!node.inlist || node.list != this) { - throw new System.InvalidOperationException("node"); - } - } - - internal void ValidateNewNode($csclassnameNode node) { - if (node == null) { - throw new System.ArgumentNullException("node"); - } - } - - global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, - global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> - { - private $csclassname collectionRef; - private $csclassnameNode currentNode; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - currentNode = collection.First; - currentIndex = 0; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, CTYPE) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, CTYPE))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - if (currentNode == null) { - currentIndex = collectionRef.Count + 1; - return false; - } - ++currentIndex; - currentObject = currentNode.Value; - currentNode = currentNode.Next; - return true; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } - - public sealed class $csclassnameNode { - internal $csclassname list; - internal System.IntPtr iter; - internal $typemap(cstype, CTYPE) csharpvalue; - internal bool inlist; - - public $csclassnameNode($typemap(cstype, CTYPE) value) { - csharpvalue = value; - inlist = false; - } - - internal $csclassnameNode(System.IntPtr iter, $csclassname list) { - this.list = list; - this.iter = iter; - inlist = true; - } - - public $csclassname List { - get { - return this.list; - } - } - - public $csclassnameNode Next { - get { - if (list.getNextIter(iter) == System.IntPtr.Zero) - return null; - return new $csclassnameNode(list.getNextIter(iter), list); - } - } - - public $csclassnameNode Previous { - get { - if (list.getPrevIter(iter) == System.IntPtr.Zero) - return null; - return new $csclassnameNode(list.getPrevIter(iter), list); - } - } - - public $typemap(cstype, CTYPE) Value { - get { - return list.getItem(this.iter); - } - set { - list.setItem(this.iter, value); - } - } - - public static bool operator==($csclassnameNode node1, $csclassnameNode node2) { - if (object.ReferenceEquals(node1, null) && object.ReferenceEquals(node2, null)) - return true; - if (object.ReferenceEquals(node1, null) || object.ReferenceEquals(node2, null)) - return false; - return node1.Equals(node2); - } - - public static bool operator!=($csclassnameNode node1, $csclassnameNode node2) { - if (node1 == null && node2 == null) - return false; - if (node1 == null || node2 == null) - return true; - return !node1.Equals(node2); - } - - public bool Equals($csclassnameNode node) { - if (node == null) - return false; - if (!node.inlist || !this.inlist) - return object.ReferenceEquals(this, node); - return list.equals(this.iter, node.iter); - } - - public override bool Equals(object node) { - return Equals(($csclassnameNode)node); - } - - public override int GetHashCode() { - int hash = 13; - if (inlist) { - hash = (hash * 7) + this.list.GetHashCode(); - hash = (hash * 7) + this.Value.GetHashCode(); - hash = (hash * 7) + this.list.getNextIter(this.iter).GetHashCode(); - hash = (hash * 7) + this.list.getPrevIter(this.iter).GetHashCode(); - } else { - hash = (hash * 7) + this.csharpvalue.GetHashCode(); - } - return hash; - } - - public void Dispose() { - list.deleteIter(this.iter); - } - } -%} - -public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - class iterator; - - void push_front(CTYPE const& x); - void push_back(CTYPE const& x); - %rename(RemoveFirst) pop_front; - void pop_front(); - %rename(RemoveLast) pop_back; - void pop_back(); - size_type size() const; - %rename(Clear) clear; - void clear(); - %extend { - const_reference getItem(iterator *iter) { - return **iter; - } - - void setItem(iterator *iter, CTYPE const& val) { - *(*iter) = val; - } - - iterator *getFirstIter() { - if ($self->size() == 0) - return NULL; - return new std::list< CTYPE >::iterator($self->begin()); - } - - iterator *getLastIter() { - if ($self->size() == 0) - return NULL; - return new std::list< CTYPE >::iterator(--$self->end()); - } - - iterator *getNextIter(iterator *iter) { - std::list< CTYPE >::iterator it = *iter; - if (std::distance(it, --$self->end()) != 0) { - std::list< CTYPE >::iterator* itnext = new std::list< CTYPE >::iterator(++it); - return itnext; - } - return NULL; - } - - iterator *getPrevIter(iterator *iter) { - std::list< CTYPE >::iterator it = *iter; - if (std::distance($self->begin(), it) != 0) { - std::list< CTYPE >::iterator* itprev = new std::list< CTYPE >::iterator(--it); - return itprev; - } - return NULL; - } - - iterator *insertNode(iterator *iter, CTYPE const& value) { - std::list< CTYPE >::iterator it = $self->insert(*iter, value); - return new std::list< CTYPE >::iterator(it); - } - - void eraseIter(iterator *iter) { - std::list< CTYPE >::iterator it = *iter; - $self->erase(it); - } - - void deleteIter(iterator *iter) { - delete iter; - } - - bool equals(iterator *iter1, iterator *iter2) { - if (iter1 == NULL && iter2 == NULL) - return true; - std::list< CTYPE >::iterator it1 = *iter1; - std::list< CTYPE >::iterator it2 = *iter2; - return it1 == it2; - } - } -%enddef - -// Extra methods added to the collection class if operator== is defined for the class being wrapped -// The class will then implement ICollection<>, which adds extra functionality -%define SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE...) - %extend { - bool Contains(CTYPE const& value) { - return std::find($self->begin(), $self->end(), value) != $self->end(); - } - - bool Remove(CTYPE const& value) { - std::list< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); - if (it != $self->end()) { - $self->erase(it); - return true; - } - return false; - } - - iterator *find(CTYPE const& value) { - if (std::find($self->begin(), $self->end(), value) != $self->end()) { - return new std::list< CTYPE >::iterator(std::find($self->begin(), $self->end(), value)); - } - return NULL; - } - } -%proxycode %{ - public $csclassnameNode Find($typemap(cstype, CTYPE) value) { - System.IntPtr tmp = find(value); - if (tmp != System.IntPtr.Zero) { - return new $csclassnameNode(tmp, this); - } - return null; - } -%} -%enddef - -// Macros for std::list class specializations/enhancements -%define SWIG_STD_LIST_ENHANCED(CTYPE...) -namespace std { - template<> class list< CTYPE > { - SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, %arg(CTYPE)); - SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE) - }; -} -%enddef - - -%{ -#include -#include -#include -%} - -%csmethodmodifiers std::list::size "private" -%csmethodmodifiers std::list::getItem "private" -%csmethodmodifiers std::list::setItem "private" -%csmethodmodifiers std::list::push_front "private" -%csmethodmodifiers std::list::push_back "private" -%csmethodmodifiers std::list::getFirstIter "private" -%csmethodmodifiers std::list::getNextIter "private" -%csmethodmodifiers std::list::getPrevIter "private" -%csmethodmodifiers std::list::getLastIter "private" -%csmethodmodifiers std::list::find "private" -%csmethodmodifiers std::list::deleteIter "private" - -namespace std { - // primary (unspecialized) class template for std::list - // does not require operator== to be defined - template - class list { - SWIG_STD_LIST_MINIMUM_INTERNAL(IEnumerable, T) - }; - // specialization for pointers - template - class list { - SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, T *) - SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(T *) - }; -} - -// template specializations for std::list -// these provide extra collections methods as operator== is defined -SWIG_STD_LIST_ENHANCED(char) -SWIG_STD_LIST_ENHANCED(signed char) -SWIG_STD_LIST_ENHANCED(unsigned char) -SWIG_STD_LIST_ENHANCED(short) -SWIG_STD_LIST_ENHANCED(unsigned short) -SWIG_STD_LIST_ENHANCED(int) -SWIG_STD_LIST_ENHANCED(unsigned int) -SWIG_STD_LIST_ENHANCED(long) -SWIG_STD_LIST_ENHANCED(unsigned long) -SWIG_STD_LIST_ENHANCED(long long) -SWIG_STD_LIST_ENHANCED(unsigned long long) -SWIG_STD_LIST_ENHANCED(float) -SWIG_STD_LIST_ENHANCED(double) -SWIG_STD_LIST_ENHANCED(std::string) // also requires a %include -SWIG_STD_LIST_ENHANCED(std::wstring) // also requires a %include diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_map.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_map.i deleted file mode 100755 index 7a118569..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_map.i +++ /dev/null @@ -1,312 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map< K, T, C > - * - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.IDictionary<>. - * - * Using this wrapper is fairly simple. For example, to create a map from integers to doubles use: - * - * %include - * %template(MapIntDouble) std::map - * - * Notes: - * 1) IEnumerable<> is implemented in the proxy class which is useful for using LINQ with - * C++ std::map wrappers. - * - * Warning: heavy macro usage in this file. Use swig -E to get a sane view on the real file contents! - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -#include -%} - -/* K is the C++ key type, T is the C++ value type */ -%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" -%proxycode %{ - - public $typemap(cstype, T) this[$typemap(cstype, K) key] { - get { - return getitem(key); - } - - set { - setitem(key, value); - } - } - - public bool TryGetValue($typemap(cstype, K) key, out $typemap(cstype, T) value) { - if (this.ContainsKey(key)) { - value = this[key]; - return true; - } - value = default($typemap(cstype, T)); - return false; - } - - public int Count { - get { - return (int)size(); - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public global::System.Collections.Generic.ICollection<$typemap(cstype, K)> Keys { - get { - global::System.Collections.Generic.ICollection<$typemap(cstype, K)> keys = new global::System.Collections.Generic.List<$typemap(cstype, K)>(); - int size = this.Count; - if (size > 0) { - global::System.IntPtr iter = create_iterator_begin(); - for (int i = 0; i < size; i++) { - keys.Add(get_next_key(iter)); - } - destroy_iterator(iter); - } - return keys; - } - } - - public global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Values { - get { - global::System.Collections.Generic.ICollection<$typemap(cstype, T)> vals = new global::System.Collections.Generic.List<$typemap(cstype, T)>(); - foreach (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> pair in this) { - vals.Add(pair.Value); - } - return vals; - } - } - - public void Add(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { - Add(item.Key, item.Value); - } - - public bool Remove(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { - if (Contains(item)) { - return Remove(item.Key); - } else { - return false; - } - } - - public bool Contains(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { - if (this[item.Key] == item.Value) { - return true; - } else { - return false; - } - } - - public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array) { - CopyTo(array, 0); - } - - public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array, int arrayIndex) { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (arrayIndex+this.Count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - - global::System.Collections.Generic.IList<$typemap(cstype, K)> keyList = new global::System.Collections.Generic.List<$typemap(cstype, K)>(this.Keys); - for (int i = 0; i < keyList.Count; i++) { - $typemap(cstype, K) currentKey = keyList[i]; - array.SetValue(new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, this[currentKey]), arrayIndex+i); - } - } - - global::System.Collections.Generic.IEnumerator> global::System.Collections.Generic.IEnumerable>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, - global::System.Collections.Generic.IEnumerator> - { - private $csclassname collectionRef; - private global::System.Collections.Generic.IList<$typemap(cstype, K)> keyCollection; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - keyCollection = new global::System.Collections.Generic.List<$typemap(cstype, K)>(collection.Keys); - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>)currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - $typemap(cstype, K) currentKey = keyCollection[currentIndex]; - currentObject = new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, collectionRef[currentKey]); - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } - -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - size_type size() const; - bool empty() const; - %rename(Clear) clear; - void clear(); - %extend { - const mapped_type& getitem(const key_type& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator iter = $self->find(key); - if (iter != $self->end()) - return iter->second; - else - throw std::out_of_range("key not found"); - } - - void setitem(const key_type& key, const mapped_type& x) { - (*$self)[key] = x; - } - - bool ContainsKey(const key_type& key) { - std::map< K, T, C >::iterator iter = $self->find(key); - return iter != $self->end(); - } - - void Add(const key_type& key, const mapped_type& value) throw (std::out_of_range) { - std::map< K, T, C >::iterator iter = $self->find(key); - if (iter != $self->end()) - throw std::out_of_range("key already exists"); - $self->insert(std::pair< K, T >(key, value)); - } - - bool Remove(const key_type& key) { - std::map< K, T, C >::iterator iter = $self->find(key); - if (iter != $self->end()) { - $self->erase(iter); - return true; - } - return false; - } - - // create_iterator_begin(), get_next_key() and destroy_iterator work together to provide a collection of keys to C# - %apply void *VOID_INT_PTR { std::map< K, T, C >::iterator *create_iterator_begin } - %apply void *VOID_INT_PTR { std::map< K, T, C >::iterator *swigiterator } - - std::map< K, T, C >::iterator *create_iterator_begin() { - return new std::map< K, T, C >::iterator($self->begin()); - } - - const key_type& get_next_key(std::map< K, T, C >::iterator *swigiterator) { - std::map< K, T, C >::iterator iter = *swigiterator; - (*swigiterator)++; - return (*iter).first; - } - - void destroy_iterator(std::map< K, T, C >::iterator *swigiterator) { - delete swigiterator; - } - } - - -%enddef - -%csmethodmodifiers std::map::size "private" -%csmethodmodifiers std::map::getitem "private" -%csmethodmodifiers std::map::setitem "private" -%csmethodmodifiers std::map::create_iterator_begin "private" -%csmethodmodifiers std::map::get_next_key "private" -%csmethodmodifiers std::map::destroy_iterator "private" - -// Default implementation -namespace std { - template > class map { - SWIG_STD_MAP_INTERNAL(K, T, C) - }; -} - - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_pair.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_set.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_set.i deleted file mode 100755 index 01215226..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_set.i +++ /dev/null @@ -1,311 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_set.i - * - * SWIG typemaps for std::set. - * - * Note that ISet<> used here requires .NET 4 or later. - * - * The C# wrapper implements ISet<> interface and shares performance - * characteristics of C# System.Collections.Generic.SortedSet<> class, but - * doesn't provide quite all of its methods. - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -#include -%} - -%csmethodmodifiers std::set::size "private" -%csmethodmodifiers std::set::getitem "private" -%csmethodmodifiers std::set::create_iterator_begin "private" -%csmethodmodifiers std::set::get_next "private" -%csmethodmodifiers std::set::destroy_iterator "private" - -namespace std { - -// TODO: Add support for comparator and allocator template parameters. -template -class set { - -%typemap(csinterfaces) std::set "global::System.IDisposable, global::System.Collections.Generic.ISet<$typemap(cstype, T)>\n" -%proxycode %{ - 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); - } - - public bool TryGetValue($typemap(cstype, T) equalValue, out $typemap(cstype, T) actualValue) { - try { - actualValue = getitem(equalValue); - return true; - } catch { - actualValue = default($typemap(cstype, T)); - return false; - } - } - - public int Count { - get { - return (int)size(); - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public void CopyTo($typemap(cstype, T)[] array) { - CopyTo(array, 0); - } - - public void CopyTo($typemap(cstype, T)[] array, int arrayIndex) { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (arrayIndex+this.Count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - - foreach ($typemap(cstype, T) item in this) { - array.SetValue(item, arrayIndex++); - } - } - - public void ExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - Remove(item); - } - } - - public void IntersectWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - $csclassname old = new $csclassname(this); - - Clear(); - foreach ($typemap(cstype, T) item in other) { - if (old.Contains(item)) - Add(item); - } - } - - private static int count_enum(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - int count = 0; - foreach ($typemap(cstype, T) item in other) { - count++; - } - - return count; - } - - public bool IsProperSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - return IsSubsetOf(other) && Count < count_enum(other); - } - - public bool IsProperSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - return IsSupersetOf(other) && Count > count_enum(other); - } - - public bool IsSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - int countContained = 0; - - foreach ($typemap(cstype, T) item in other) { - if (Contains(item)) - countContained++; - } - - return countContained == Count; - } - - public bool IsSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - if (!Contains(item)) - return false; - } - - return true; - } - - public bool Overlaps(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - if (Contains(item)) - return true; - } - - return false; - } - - public bool SetEquals(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - return IsSupersetOf(other) && Count == count_enum(other); - } - - public void SymmetricExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - if (!Remove(item)) - Add(item); - } - } - - public void UnionWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - Add(item); - } - } - - private global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Items { - get { - global::System.Collections.Generic.ICollection<$typemap(cstype, T)> items = new global::System.Collections.Generic.List<$typemap(cstype, T)>(); - int size = this.Count; - if (size > 0) { - global::System.IntPtr iter = create_iterator_begin(); - for (int i = 0; i < size; i++) { - items.Add(get_next(iter)); - } - destroy_iterator(iter); - } - return items; - } - } - - global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, - global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> - { - private $csclassname collectionRef; - private global::System.Collections.Generic.IList<$typemap(cstype, T)> ItemsCollection; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - ItemsCollection = new global::System.Collections.Generic.List<$typemap(cstype, T)>(collection.Items); - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, T) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, T))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - currentObject = ItemsCollection[currentIndex]; - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } - -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T key_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - set(); - set(const set& other); - size_type size() const; - bool empty() const; - %rename(Clear) clear; - void clear(); - %extend { - bool Add(const value_type& item) { - return $self->insert(item).second; - } - - bool Contains(const value_type& item) { - return $self->count(item) != 0; - } - - bool Remove(const value_type& item) { - return $self->erase(item) != 0; - } - - const value_type& getitem(const value_type& item) throw (std::out_of_range) { - std::set::iterator iter = $self->find(item); - if (iter == $self->end()) - throw std::out_of_range("item not found"); - - return *iter; - } - - // create_iterator_begin(), get_next() and destroy_iterator work together to provide a collection of items to C# - %apply void *VOID_INT_PTR { std::set::iterator *create_iterator_begin } - %apply void *VOID_INT_PTR { std::set::iterator *swigiterator } - - std::set::iterator *create_iterator_begin() { - return new std::set::iterator($self->begin()); - } - - const key_type& get_next(std::set::iterator *swigiterator) { - std::set::iterator iter = *swigiterator; - (*swigiterator)++; - return *iter; - } - - void destroy_iterator(std::set::iterator *swigiterator) { - delete swigiterator; - } - } -}; - -} diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_string.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_string.i deleted file mode 100755 index c8920c09..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_string.i +++ /dev/null @@ -1,111 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a C# String and are passed around by value. - * - * To use non-const std::string references use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -// string -%typemap(ctype) string "const char *" -%typemap(imtype) string "string" -%typemap(cstype) string "string" - -%typemap(csdirectorin) string "$iminput" -%typemap(csdirectorout) string "$cscall" - -%typemap(in, canthrow=1) string -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - $1.assign($input); %} -%typemap(out) string %{ $result = SWIG_csharp_string_callback($1.c_str()); %} - -%typemap(directorout, canthrow=1) string -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - $result.assign($input); %} - -%typemap(directorin) string %{ $input = $1.c_str(); %} - -%typemap(csin) string "$csinput" -%typemap(csout, excode=SWIGEXCODE) string { - string ret = $imcall;$excode - return ret; - } - -%typemap(typecheck) string = char *; - -%typemap(throws, canthrow=1) string -%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str()); - return $null; %} - -// const string & -%typemap(ctype) const string & "const char *" -%typemap(imtype) const string & "string" -%typemap(cstype) const string & "string" - -%typemap(csdirectorin) const string & "$iminput" -%typemap(csdirectorout) const string & "$cscall" - -%typemap(in, canthrow=1) const string & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - $*1_ltype $1_str($input); - $1 = &$1_str; %} -%typemap(out) const string & %{ $result = SWIG_csharp_string_callback($1->c_str()); %} - -%typemap(csin) const string & "$csinput" -%typemap(csout, excode=SWIGEXCODE) const string & { - string ret = $imcall;$excode - return ret; - } - -%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - /* possible thread/reentrant code problem */ - static $*1_ltype $1_str; - $1_str = $input; - $result = &$1_str; %} - -%typemap(directorin) const string & %{ $input = $1.c_str(); %} - -%typemap(csvarin, excode=SWIGEXCODE2) const string & %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) const string & %{ - get { - string ret = $imcall;$excode - return ret; - } %} - -%typemap(typecheck) const string & = char *; - -%typemap(throws, canthrow=1) const string & -%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str()); - return $null; %} - -} - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_unique_ptr.i deleted file mode 100755 index 0a4caafb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_unique_ptr.i +++ /dev/null @@ -1,38 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap (ctype) std::unique_ptr< TYPE > "void *" -%typemap (imtype, out="System.IntPtr") std::unique_ptr< TYPE > "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) std::unique_ptr< TYPE > "$typemap(cstype, TYPE)" - -%typemap(in) std::unique_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(csin) std::unique_ptr< TYPE > "$typemap(cstype, TYPE).swigRelease($csinput)" - -%typemap (out) std::unique_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(csout, excode=SWIGEXCODE) std::unique_ptr< TYPE > { - System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_vector.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_vector.i deleted file mode 100755 index a2add584..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_vector.i +++ /dev/null @@ -1,418 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector - * C# implementation - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.List<> collection. - * - * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with - * C++ std::vector wrappers. The IList<> interface is also implemented to provide enhanced functionality - * whenever we are confident that the required C++ operator== is available. This is the case for when - * T is a primitive type or a pointer. If T does define an operator==, then use the SWIG_STD_VECTOR_ENHANCED - * macro to obtain this enhanced functionality, for example: - * - * SWIG_STD_VECTOR_ENHANCED(SomeNamespace::Klass) - * %template(VectKlass) std::vector; - * ----------------------------------------------------------------------------- */ - -%include - -// MACRO for use within the std::vector class body -%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" -%proxycode %{ - public $csclassname(global::System.Collections.IEnumerable c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - foreach ($typemap(cstype, CTYPE) element in c) { - this.Add(element); - } - } - - public $csclassname(global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)> c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - foreach ($typemap(cstype, CTYPE) element in c) { - this.Add(element); - } - } - - public bool IsFixedSize { - get { - return false; - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public $typemap(cstype, CTYPE) this[int index] { - get { - return getitem(index); - } - set { - setitem(index, value); - } - } - - public int Capacity { - get { - return (int)capacity(); - } - set { - if (value < 0 || ($typemap(cstype, size_t))value < size()) - throw new global::System.ArgumentOutOfRangeException("Capacity"); - reserve(($typemap(cstype, size_t))value); - } - } - - public int Count { - get { - return (int)size(); - } - } - - public bool IsSynchronized { - get { - return false; - } - } - - public void CopyTo($typemap(cstype, CTYPE)[] array) - { - CopyTo(0, array, 0, this.Count); - } - - public void CopyTo($typemap(cstype, CTYPE)[] array, int arrayIndex) - { - CopyTo(0, array, arrayIndex, this.Count); - } - - public void CopyTo(int index, $typemap(cstype, CTYPE)[] array, int arrayIndex, int count) - { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (index < 0) - throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (count < 0) - throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (index+count > this.Count || arrayIndex+count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - for (int i=0; i global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator - , global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> - { - private $csclassname collectionRef; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, CTYPE) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, CTYPE))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - currentObject = collectionRef[currentIndex]; - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - %rename(Clear) clear; - void clear(); - %rename(Add) push_back; - void push_back(CTYPE const& x); - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %newobject GetRange(int index, int count); - %newobject Repeat(CTYPE const& value, int count); - - vector(); - vector(const vector &other); - - %extend { - vector(int capacity) throw (std::out_of_range) { - std::vector< CTYPE >* pv = 0; - if (capacity >= 0) { - pv = new std::vector< CTYPE >(); - pv->reserve(capacity); - } else { - throw std::out_of_range("capacity"); - } - return pv; - } - CTYPE getitemcopy(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - CONST_REFERENCE getitem(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - void setitem(int index, CTYPE const& val) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - (*$self)[index] = val; - else - throw std::out_of_range("index"); - } - // Takes a deep copy of the elements unlike ArrayList.AddRange - void AddRange(const std::vector< CTYPE >& values) { - $self->insert($self->end(), values.begin(), values.end()); - } - // Takes a deep copy of the elements unlike ArrayList.GetRange - std::vector< CTYPE > *GetRange(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - return new std::vector< CTYPE >($self->begin()+index, $self->begin()+index+count); - } - void Insert(int index, CTYPE const& x) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()+1) - $self->insert($self->begin()+index, x); - else - throw std::out_of_range("index"); - } - // Takes a deep copy of the elements unlike ArrayList.InsertRange - void InsertRange(int index, const std::vector< CTYPE >& values) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()+1) - $self->insert($self->begin()+index, values.begin(), values.end()); - else - throw std::out_of_range("index"); - } - void RemoveAt(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - $self->erase($self->begin() + index); - else - throw std::out_of_range("index"); - } - void RemoveRange(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - $self->erase($self->begin()+index, $self->begin()+index+count); - } - static std::vector< CTYPE > *Repeat(CTYPE const& value, int count) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("count"); - return new std::vector< CTYPE >(count, value); - } - void Reverse() { - std::reverse($self->begin(), $self->end()); - } - void Reverse(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - std::reverse($self->begin()+index, $self->begin()+index+count); - } - // Takes a deep copy of the elements unlike ArrayList.SetRange - void SetRange(int index, const std::vector< CTYPE >& values) throw (std::out_of_range) { - if (index < 0) - throw std::out_of_range("index"); - if (index+values.size() > $self->size()) - throw std::out_of_range("index"); - std::copy(values.begin(), values.end(), $self->begin()+index); - } - } -%enddef - -// Extra methods added to the collection class if operator== is defined for the class being wrapped -// The class will then implement IList<>, which adds extra functionality -%define SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE...) - %extend { - bool Contains(CTYPE const& value) { - return std::find($self->begin(), $self->end(), value) != $self->end(); - } - int IndexOf(CTYPE const& value) { - int index = -1; - std::vector< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); - if (it != $self->end()) - index = (int)(it - $self->begin()); - return index; - } - int LastIndexOf(CTYPE const& value) { - int index = -1; - std::vector< CTYPE >::reverse_iterator rit = std::find($self->rbegin(), $self->rend(), value); - if (rit != $self->rend()) - index = (int)($self->rend() - 1 - rit); - return index; - } - bool Remove(CTYPE const& value) { - std::vector< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); - if (it != $self->end()) { - $self->erase(it); - return true; - } - return false; - } - } -%enddef - -// Macros for std::vector class specializations/enhancements -%define SWIG_STD_VECTOR_ENHANCED(CTYPE...) -namespace std { - template<> class vector< CTYPE > { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, %arg(CTYPE)) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE) - }; -} -%enddef - -// Legacy macros -%define SWIG_STD_VECTOR_SPECIALIZE(CSTYPE, CTYPE...) -#warning SWIG_STD_VECTOR_SPECIALIZE macro deprecated, please see csharp/std_vector.i and switch to SWIG_STD_VECTOR_ENHANCED -SWIG_STD_VECTOR_ENHANCED(CTYPE) -%enddef - -%define SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(CSTYPE, CTYPE...) -#warning SWIG_STD_VECTOR_SPECIALIZE_MINIMUM macro deprecated, it is no longer required -%enddef - -%{ -#include -#include -#include -%} - -%csmethodmodifiers std::vector::getitemcopy "private" -%csmethodmodifiers std::vector::getitem "private" -%csmethodmodifiers std::vector::setitem "private" -%csmethodmodifiers std::vector::size "private" -%csmethodmodifiers std::vector::capacity "private" -%csmethodmodifiers std::vector::reserve "private" - -namespace std { - // primary (unspecialized) class template for std::vector - // does not require operator== to be defined - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IEnumerable, const value_type&, T) - }; - // specialization for pointers - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, T *) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *) - }; - // bool is specialized in the C++ standard - const_reference in particular - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, bool, bool) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(bool) - }; -} - -// template specializations for std::vector -// these provide extra collections methods as operator== is defined -SWIG_STD_VECTOR_ENHANCED(char) -SWIG_STD_VECTOR_ENHANCED(signed char) -SWIG_STD_VECTOR_ENHANCED(unsigned char) -SWIG_STD_VECTOR_ENHANCED(short) -SWIG_STD_VECTOR_ENHANCED(unsigned short) -SWIG_STD_VECTOR_ENHANCED(int) -SWIG_STD_VECTOR_ENHANCED(unsigned int) -SWIG_STD_VECTOR_ENHANCED(long) -SWIG_STD_VECTOR_ENHANCED(unsigned long) -SWIG_STD_VECTOR_ENHANCED(long long) -SWIG_STD_VECTOR_ENHANCED(unsigned long long) -SWIG_STD_VECTOR_ENHANCED(float) -SWIG_STD_VECTOR_ENHANCED(double) -SWIG_STD_VECTOR_ENHANCED(std::string) // also requires a %include -SWIG_STD_VECTOR_ENHANCED(std::wstring) // also requires a %include - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/std_wstring.i b/mac/bin/swig/share/swig/4.1.0/csharp/std_wstring.i deleted file mode 100755 index 1d10ca80..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/std_wstring.i +++ /dev/null @@ -1,146 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_wstring.i - * - * Typemaps for std::wstring and const std::wstring& - * std::wstring is mapped to a C# Unicode string (UTF16) and is passed around by value. - * std::wstring support includes wchar_t as a 2 byte type (Windows) and a 4 byte type - * (most Unix systems). - * - * To use non-const std::wstring references use the following %apply. Note - * that they are passed by value. - * %apply const std::wstring & {std::wstring &}; - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -%} - -%fragment("Swig_csharp_UTF16ToWString", "header") %{ -/* For converting from .NET UTF16 (2 byte unicode) strings. wchar_t is 2 bytes on Windows, 4 bytes on Linux. */ -static std::wstring Swig_csharp_UTF16ToWString(const unsigned short *str) { - if (sizeof(wchar_t) == 2) { - return std::wstring((wchar_t *)str); - } else { - const unsigned short *pBegin(str); - const unsigned short *ptr(pBegin); - - while (*ptr != 0) - ++ptr; - - std::wstring result; - result.reserve(ptr - pBegin); - while(pBegin != ptr) - result.push_back(*pBegin++); - - return result; - } -} -%} - -namespace std { - -%naturalvar wstring; - -class wstring; - -// wstring -%typemap(ctype, out="void *") wstring "unsigned short *" -%typemap(imtype, - inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directorinattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directoroutattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]" - ) wstring "string" -%typemap(cstype) wstring "string" -%typemap(csdirectorin) wstring "$iminput" -%typemap(csdirectorout) wstring "$cscall" - -%typemap(in, canthrow=1, fragment="Swig_csharp_UTF16ToWString") wstring -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - $1 = Swig_csharp_UTF16ToWString($input); %} -%typemap(out) wstring %{ $result = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} - -%typemap(directorout, canthrow=1) wstring -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - $result = Swig_csharp_UTF16ToWString($input); %} - -%typemap(directorin) wstring %{ $input = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} - -%typemap(csin) wstring "$csinput" -%typemap(csout, excode=SWIGEXCODE) wstring { - string ret = $imcall;$excode - return ret; - } - -%typemap(typecheck) wstring = wchar_t *; - -%typemap(throws, canthrow=1) wstring -%{ SWIG_csharp_ApplicationException_callback($1.c_str(), (int)$1.size()); - return $null; %} - -// const wstring & -%typemap(ctype, out="void *") const wstring & "unsigned short *" -%typemap(imtype, - inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directorinattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directoroutattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]" - ) const wstring & "string" -%typemap(cstype) const wstring & "string" - -%typemap(csdirectorin) const wstring & "$iminput" -%typemap(csdirectorout) const wstring & "$cscall" - -%typemap(in, canthrow=1, fragment="Swig_csharp_UTF16ToWString") const wstring & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - std::wstring $1_str(Swig_csharp_UTF16ToWString($input)); - $1 = &$1_str; %} -%typemap(out) const wstring & %{ $result = SWIG_csharp_wstring_with_length_callback($1->c_str(), (int)$1->size()); %} - -%typemap(csin) const wstring & "$csinput" -%typemap(csout, excode=SWIGEXCODE) const wstring & { - string ret = $imcall;$excode - return ret; - } - -%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - /* possible thread/reentrant code problem */ - static std::wstring $1_str; - $1_str = Swig_csharp_UTF16ToWString($input); - $result = &$1_str; %} - -%typemap(directorin) const wstring & %{ $input = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} - -%typemap(csvarin, excode=SWIGEXCODE2) const wstring & %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) const wstring & %{ - get { - string ret = $imcall;$excode - return ret; - } %} - -%typemap(typecheck) const wstring & = wchar_t *; - -%typemap(throws, canthrow=1) const wstring & -%{ SWIG_csharp_ApplicationException_callback($1.c_str(), (int)$1.size()); - return $null; %} - -} - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/stl.i b/mac/bin/swig/share/swig/4.1.0/csharp/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/swiginterface.i b/mac/bin/swig/share/swig/4.1.0/csharp/swiginterface.i deleted file mode 100755 index e5bfd23a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/swiginterface.i +++ /dev/null @@ -1,63 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swiginterface.i - * - * SWIG interface feature and typemaps implementation providing: - * %interface - * %interface_impl - * %interface_custom - * ----------------------------------------------------------------------------- */ - -%define INTERFACE_TYPEMAPS(CTYPE...) -%typemap(cstype) CTYPE "$&csinterfacename" -%typemap(cstype) CTYPE *, CTYPE [], CTYPE & "$csinterfacename" -%typemap(cstype) CTYPE *const& "$*csinterfacename" -%typemap(csin) CTYPE, CTYPE & "$csinput.GetInterfaceCPtr()" -%typemap(csin) CTYPE *, CTYPE *const&, CTYPE [] "$csinput == null ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : $csinput.GetInterfaceCPtr()" -%typemap(csout, excode=SWIGEXCODE) CTYPE { - $&csclassname ret = new $&csclassname($imcall, true);$excode - return ($&csinterfacename)ret; - } -%typemap(csout, excode=SWIGEXCODE) CTYPE & { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ($csinterfacename)ret; - } -%typemap(csout, excode=SWIGEXCODE) CTYPE *, CTYPE [] { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode - return ($csinterfacename)ret; - } -%typemap(csout, excode=SWIGEXCODE) CTYPE *const& { - global::System.IntPtr cPtr = $imcall; - $*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode - return ($*csinterfacename)ret; - } -%typemap(csdirectorin) CTYPE "($&csinterfacename)new $&csclassname($iminput, true)" -%typemap(csdirectorin) CTYPE & "($csinterfacename)new $csclassname($iminput, false)" -%typemap(csdirectorin) CTYPE *, CTYPE [] "($iminput == global::System.IntPtr.Zero) ? null : ($csinterfacename)new $csclassname($iminput, false)" -%typemap(csdirectorin) CTYPE *const& "($iminput == global::System.IntPtr.Zero) ? null : ($*csinterfacename)new $*csclassname($iminput, false)" -%typemap(csdirectorout) CTYPE, CTYPE *, CTYPE *const&, CTYPE [], CTYPE & "$cscall.GetInterfaceCPtr()" -%typemap(csinterfacecode, declaration=" [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n global::System.Runtime.InteropServices.HandleRef GetInterfaceCPtr();\n", cptrmethod="$interfacename_GetInterfaceCPtr") CTYPE %{ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - global::System.Runtime.InteropServices.HandleRef $interfacename.GetInterfaceCPtr() { - return new global::System.Runtime.InteropServices.HandleRef(this, $imclassname.$csclazzname$interfacename_GetInterfaceCPtr(swigCPtr.Handle)); - } -%} -%enddef - -%define %interface(CTYPE...) -%feature("interface", name="%sSwigInterface") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_impl(CTYPE...) -%rename("%sSwigImpl") CTYPE; -%feature("interface", name="%(rstrip:[SwigImpl])s") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_custom(PROXY, INTERFACE, CTYPE...) -%rename(PROXY) CTYPE; -%feature("interface", name=INTERFACE) CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/swigmove.i b/mac/bin/swig/share/swig/4.1.0/csharp/swigmove.i deleted file mode 100755 index 2f21bd6f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/swigmove.i +++ /dev/null @@ -1,16 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, canthrow=1, fragment="") SWIGTYPE MOVE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - SwigValueWrapper< $1_ltype >::reset($1, argp); %} - -%typemap(csin) SWIGTYPE MOVE "$&csclassname.swigRelease($csinput)" diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/swigtype_inout.i b/mac/bin/swig/share/swig/4.1.0/csharp/swigtype_inout.i deleted file mode 100755 index e7312e8f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/swigtype_inout.i +++ /dev/null @@ -1,34 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigtype_inout.i - * - * Pointer pointer and pointer reference handling typemap library for non-primitive types - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointer references and pointer to pointers. - * - * These are named typemaps (OUTPUT) and can be used like any named typemap. - * Alternatively they can be made the default by using %apply: - * %apply SWIGTYPE *& OUTPUT { SWIGTYPE *& } - * ----------------------------------------------------------------------------- */ - -/* - * OUTPUT typemaps. Example usage wrapping: - * - * void f(XXX *& x) { x = new XXX(111); } - * - * would be: - * - * XXX x = null; - * f(out x); - * // use x - * x.Dispose(); // manually clear memory or otherwise leave out and leave it to the garbage collector - */ -%typemap(ctype) SWIGTYPE *& OUTPUT "void **" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE *& OUTPUT "out global::System.IntPtr" -%typemap(cstype) SWIGTYPE *& OUTPUT "out $*csclassname" -%typemap(csin, - pre=" global::System.IntPtr cPtr_$csinput = global::System.IntPtr.Zero;", - post=" $csinput = (cPtr_$csinput == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr_$csinput, true);", - cshin="out $csinput") SWIGTYPE *& OUTPUT "out cPtr_$csinput" -%typemap(in) SWIGTYPE *& OUTPUT %{ $1 = ($1_ltype)$input; %} -%typemap(freearg) SWIGTYPE *& OUTPUT "" diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/typemaps.i b/mac/bin/swig/share/swig/4.1.0/csharp/typemaps.i deleted file mode 100755 index b6f9bddb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/typemaps.i +++ /dev/null @@ -1,253 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps are used for pointer/reference parameters that are input only -and are mapped to a C# input parameter. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In C# you could then use it like this: - double answer = modulename.fadd(10.0, 20.0); -*/ - -%define INPUT_TYPEMAP(TYPE, CTYPE, CSTYPE) -%typemap(ctype, out="void *") TYPE *INPUT, TYPE &INPUT "CTYPE" -%typemap(imtype, out="global::System.IntPtr") TYPE *INPUT, TYPE &INPUT "CSTYPE" -%typemap(cstype, out="$csclassname") TYPE *INPUT, TYPE &INPUT "CSTYPE" -%typemap(csin) TYPE *INPUT, TYPE &INPUT "$csinput" - -%typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(typecheck) TYPE *INPUT = TYPE; -%typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, unsigned int, bool) -//INPUT_TYPEMAP(char, char, char) -INPUT_TYPEMAP(signed char, signed char, sbyte) -INPUT_TYPEMAP(unsigned char, unsigned char, byte) -INPUT_TYPEMAP(short, short, short) -INPUT_TYPEMAP(unsigned short, unsigned short, ushort) -INPUT_TYPEMAP(int, int, int) -INPUT_TYPEMAP(unsigned int, unsigned int, uint) -INPUT_TYPEMAP(long, long, int) -INPUT_TYPEMAP(unsigned long, unsigned long, uint) -INPUT_TYPEMAP(long long, long long, long) -INPUT_TYPEMAP(unsigned long long, unsigned long long, ulong) -INPUT_TYPEMAP(float, float, float) -INPUT_TYPEMAP(double, double, double) - -#undef INPUT_TYPEMAP - -/* -OUTPUT typemaps ---------------- - -These typemaps are used for pointer/reference parameters that are output only and -are mapped to a C# output parameter. - -The following typemaps can be applied to turn a pointer or reference into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In C#, the 'out' keyword is -used when passing the parameter to a function that takes an output parameter. - - bool *OUTPUT, bool &OUTPUT - signed char *OUTPUT, signed char &OUTPUT - unsigned char *OUTPUT, unsigned char &OUTPUT - short *OUTPUT, short &OUTPUT - unsigned short *OUTPUT, unsigned short &OUTPUT - int *OUTPUT, int &OUTPUT - unsigned int *OUTPUT, unsigned int &OUTPUT - long *OUTPUT, long &OUTPUT - unsigned long *OUTPUT, unsigned long &OUTPUT - long long *OUTPUT, long long &OUTPUT - unsigned long long *OUTPUT, unsigned long long &OUTPUT - float *OUTPUT, float &OUTPUT - double *OUTPUT, double &OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters): - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The C# output of the function would be the function return value and the -value returned in the second output parameter. In C# you would use it like this: - - double dptr; - double fraction = modulename.modf(5, out dptr); -*/ - -%define OUTPUT_TYPEMAP(TYPE, CTYPE, CSTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *OUTPUT, TYPE &OUTPUT "CTYPE *" -%typemap(imtype, out="global::System.IntPtr") TYPE *OUTPUT, TYPE &OUTPUT "out CSTYPE" -%typemap(cstype, out="$csclassname") TYPE *OUTPUT, TYPE &OUTPUT "out CSTYPE" -%typemap(csin) TYPE *OUTPUT, TYPE &OUTPUT "out $csinput" - -%typemap(in) TYPE *OUTPUT, TYPE &OUTPUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *OUTPUT, TYPE &OUTPUT "" -%enddef - -OUTPUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//OUTPUT_TYPEMAP(char, char, char, CHAR_PTR) -OUTPUT_TYPEMAP(signed char, signed char, sbyte, INT8_PTR) -OUTPUT_TYPEMAP(unsigned char, unsigned char, byte, UINT8_PTR) -OUTPUT_TYPEMAP(short, short, short, INT16_PTR) -OUTPUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -OUTPUT_TYPEMAP(int, int, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long, long, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long long, long long, long, INT64_PTR) -OUTPUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -OUTPUT_TYPEMAP(float, float, float, FLOAT_PTR) -OUTPUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -#undef OUTPUT_TYPEMAP - -%typemap(in) bool *OUTPUT, bool &OUTPUT -%{ *$input = 0; - $1 = ($1_ltype)$input; %} - - -/* -INOUT typemaps --------------- - -These typemaps are for pointer/reference parameters that are both input and -output and are mapped to a C# reference parameter. - -The following typemaps can be applied to turn a pointer or reference into a -reference parameters, that is the parameter is both an input and an output. -In C#, the 'ref' keyword is used for reference parameters. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -The C# output of the function would be the new value returned by the -reference parameter. In C# you would use it like this: - - - double x = 5.0; - neg(ref x); - -The implementation of the OUTPUT and INOUT typemaps is different to the scripting -languages in that the scripting languages will return the output value as part -of the function return value. - -*/ - -%define INOUT_TYPEMAP(TYPE, CTYPE, CSTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *INOUT, TYPE &INOUT "CTYPE *" -%typemap(imtype, out="global::System.IntPtr") TYPE *INOUT, TYPE &INOUT "ref CSTYPE" -%typemap(cstype, out="$csclassname") TYPE *INOUT, TYPE &INOUT "ref CSTYPE" -%typemap(csin) TYPE *INOUT, TYPE &INOUT "ref $csinput" - -%typemap(in) TYPE *INOUT, TYPE &INOUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *INOUT, TYPE &INOUT "" -%enddef - -INOUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//INOUT_TYPEMAP(char, char, char, CHAR_PTR) -INOUT_TYPEMAP(signed char, signed char, sbyte, INT8_PTR) -INOUT_TYPEMAP(unsigned char, unsigned char, byte, UINT8_PTR) -INOUT_TYPEMAP(short, short, short, INT16_PTR) -INOUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -INOUT_TYPEMAP(int, int, int, INT32_PTR) -INOUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -INOUT_TYPEMAP(long, long, int, INT32_PTR) -INOUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) -INOUT_TYPEMAP(long long, long long, long, INT64_PTR) -INOUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -INOUT_TYPEMAP(float, float, float, FLOAT_PTR) -INOUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -#undef INOUT_TYPEMAP - diff --git a/mac/bin/swig/share/swig/4.1.0/csharp/wchar.i b/mac/bin/swig/share/swig/4.1.0/csharp/wchar.i deleted file mode 100755 index f1e0d5a2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/csharp/wchar.i +++ /dev/null @@ -1,335 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wchar.i - * - * Typemaps for the wchar_t type - * wchar_t * is mapped to a C# Unicode string (UTF16) and is passed around by value. - * wchar_t * support includes wchar_t as a 2 byte type (Windows) and a 4 byte type - * (most Unix systems). - * - * Support code for wide strings can be turned off by defining SWIG_CSHARP_NO_WSTRING_HELPER - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_CSHARP_NO_WSTRING_HELPER) -#if !defined(SWIG_CSHARP_WSTRING_HELPER_) -#define SWIG_CSHARP_WSTRING_HELPER_ - -%fragment(""); // TODO: %fragment("") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) (new wchar_t[wcslen((const wchar_t *)$input)+1]); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,fragment="") wchar_t * { - delete [] $1; - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) (new wchar_t[wcslen((const wchar_t *)$input)+1]); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,warning=SWIGWARN_TYPEMAP_WCHARLEAK_MSG,fragment="") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) (new wchar_t[wcslen((const wchar_t *)$input)+1]); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -#else -%typemap(memberin,fragment="") wchar_t * { - free($1); - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(memberin,warning=SWIGWARN_TYPEMAP_WCHARLEAK_MSG,fragment="") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,fragment="") wchar_t * { - free($1); - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,warning=SWIGWARN_TYPEMAP_WCHARLEAK_MSG,fragment="") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/cstring.i b/mac/bin/swig/share/swig/4.1.0/cstring.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/cwstring.i b/mac/bin/swig/share/swig/4.1.0/cwstring.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/d/boost_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/d/boost_shared_ptr.i deleted file mode 100755 index 6d85c5ae..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/boost_shared_ptr.i +++ /dev/null @@ -1,293 +0,0 @@ -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ((*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\"))) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - argp = ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0; - if (!argp) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -%typemap(directorin) CONST TYPE -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (new $1_ltype(SWIG_STD_MOVE($1))); %} - -%typemap(directorout) CONST TYPE -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg->get(); -%} - -// plain pointer -%typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - $result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -%typemap(directorin) CONST TYPE * -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) CONST TYPE * %{ -#error "typemaps for $1_type not available" -%} - -// plain reference -%typemap(in, canthrow=1) CONST TYPE & %{ - $1 = ($1_ltype)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - if (!$1) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "$1_type reference is null"); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) CONST TYPE & -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (&$1 SWIG_NO_NULL_DELETER_0); %} - -%typemap(directorout) CONST TYPE & %{ -#error "typemaps for $1_type not available" -%} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = (TYPE *)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) TYPE *CONST& -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) TYPE *CONST& %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) $1 = *($&1_ltype)$input; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $result = $1 ? new $1_ltype($1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg; - } -%} - -// shared_ptr by reference -%typemap(in, canthrow=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $result = *$1 ? new $*1_ltype(*$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out, fragment="SWIG_null_deleter") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; - if ($owner) delete $1; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) -%{ temp = $input ? *($1_ltype)&$input : &tempnull; - $1 = &temp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "typemaps for $1_type not available" -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void *" -%typemap (imtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void*" -%typemap (dtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(dtype, TYPE)" - -%typemap(din) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(dtype, TYPE).swigGetCPtr($dinput)" - -%typemap(ddirectorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(dtype, TYPE).swigGetCPtr($dcall)" - -%typemap(ddirectorin) CONST TYPE, - CONST TYPE *, - CONST TYPE &, - TYPE *CONST& "($winput is null) ? null : new $typemap(dtype, TYPE)($winput, true)" - -%typemap(ddirectorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "($winput is null) ? null : new $typemap(dtype, TYPE)($winput, true)" - - -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - - -%typemap(dout, excode=SWIGEXCODE) CONST TYPE { - auto ret = new $typemap(dtype, TYPE)($imcall, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) CONST TYPE & { - auto ret = new $typemap(dtype, TYPE)($imcall, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) CONST TYPE * { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) TYPE *CONST& { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - -// Proxy classes (base classes, ie, not derived classes) -%typemap(dbody) SWIGTYPE %{ -private void* swigCPtr; -private bool swigCMemOwn; - -public this(void* cObject, bool ownCObject) { - swigCPtr = cObject; - swigCMemOwn = ownCObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} -%} - -// Derived proxy classes -%typemap(dbody_derived) SWIGTYPE %{ -private void* swigCPtr; -private bool swigCMemOwn; - -public this(void* cObject, bool ownCObject) { - super($imdmodule.$dclazznameSmartPtrUpcast(cObject), ownCObject); - swigCPtr = cObject; - swigCMemOwn = ownCObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} -%} - -%typemap(ddispose, methodname="dispose", methodmodifiers="public") TYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - } - } -} - -%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public") TYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - super.dispose(); - } - } -} - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/d/carrays.i b/mac/bin/swig/share/swig/4.1.0/d/carrays.i deleted file mode 100755 index f2803ea4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/carrays.i +++ /dev/null @@ -1,111 +0,0 @@ -/* ----------------------------------------------------------------------------- - * carrays.i - * - * D-specific version of ../carrays.i. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * %array_functions(TYPE,NAME) - * - * Generates functions for creating and accessing elements of a C array - * (as pointers). Creates the following functions: - * - * TYPE *new_NAME(int nelements) - * void delete_NAME(TYPE *); - * TYPE NAME_getitem(TYPE *, int index); - * void NAME_setitem(TYPE *, int index, TYPE value); - * - * ----------------------------------------------------------------------------- */ - -%define %array_functions(TYPE,NAME) -%{ -static TYPE *new_##NAME(int nelements) { %} -#ifdef __cplusplus -%{ return new TYPE[nelements](); %} -#else -%{ return (TYPE *) calloc(nelements,sizeof(TYPE)); %} -#endif -%{} - -static void delete_##NAME(TYPE *ary) { %} -#ifdef __cplusplus -%{ delete [] ary; %} -#else -%{ free(ary); %} -#endif -%{} - -static TYPE NAME##_getitem(TYPE *ary, int index) { - return ary[index]; -} -static void NAME##_setitem(TYPE *ary, int index, TYPE value) { - ary[index] = value; -} -%} - -TYPE *new_##NAME(int nelements); -void delete_##NAME(TYPE *ary); -TYPE NAME##_getitem(TYPE *ary, int index); -void NAME##_setitem(TYPE *ary, int index, TYPE value); - -%enddef - - -/* ----------------------------------------------------------------------------- - * %array_class(TYPE,NAME) - * - * Generates a class wrapper around a C array. The class has the following - * interface: - * - * struct NAME { - * NAME(int nelements); - * ~NAME(); - * TYPE getitem(int index); - * void setitem(int index, TYPE value); - * TYPE * ptr(); - * static NAME *frompointer(TYPE *t); - * } - * - * ----------------------------------------------------------------------------- */ - -%define %array_class(TYPE,NAME) -%{ -typedef TYPE NAME; -%} - -typedef struct {} NAME; - -%extend NAME { -#ifdef __cplusplus - NAME(int nelements) { - return new TYPE[nelements](); - } - ~NAME() { - delete [] self; - } -#else - NAME(int nelements) { - return (TYPE *) calloc(nelements,sizeof(TYPE)); - } - ~NAME() { - free(self); - } -#endif - - TYPE getitem(int index) { - return self[index]; - } - void setitem(int index, TYPE value) { - self[index] = value; - } - TYPE * ptr() { - return self; - } - static NAME *frompointer(TYPE *t) { - return (NAME *) t; - } -}; - -%types(NAME = TYPE); - -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/d/cpointer.i b/mac/bin/swig/share/swig/4.1.0/d/cpointer.i deleted file mode 100755 index da3084b7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/cpointer.i +++ /dev/null @@ -1,171 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cpointer.i - * - * D-specific version of ../cpointer.i. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * %pointer_class(type,name) - * - * Places a simple proxy around a simple type like 'int', 'float', or whatever. - * The proxy provides this interface: - * - * class type { - * public: - * type(); - * ~type(); - * type value(); - * void assign(type value); - * }; - * - * Example: - * - * %pointer_class(int, intp); - * - * int add(int *x, int *y) { return *x + *y; } - * - * In python (with proxies) - * - * >>> a = intp() - * >>> a.assign(10) - * >>> a.value() - * 10 - * >>> b = intp() - * >>> b.assign(20) - * >>> print add(a,b) - * 30 - * - * As a general rule, this macro should not be used on class/structures that - * are already defined in the interface. - * ----------------------------------------------------------------------------- */ - - -%define %pointer_class(TYPE, NAME) -%{ -typedef TYPE NAME; -%} - -typedef struct { -} NAME; - -%extend NAME { -#ifdef __cplusplus -NAME() { - return new TYPE(); -} -~NAME() { - delete self; -} -#else -NAME() { - return (TYPE *) calloc(1,sizeof(TYPE)); -} -~NAME() { - free(self); -} -#endif -} - -%extend NAME { - -void assign(TYPE value) { - *self = value; -} -TYPE value() { - return *self; -} -TYPE * ptr() { - return self; -} -static NAME * frompointer(TYPE *t) { - return (NAME *) t; -} - -} - -%types(NAME = TYPE); - -%enddef - -/* ----------------------------------------------------------------------------- - * %pointer_functions(type,name) - * - * Create functions for allocating/deallocating pointers. This can be used - * if you don't want to create a proxy class or if the pointer is complex. - * - * %pointer_functions(int, intp) - * - * int add(int *x, int *y) { return *x + *y; } - * - * In python (with proxies) - * - * >>> a = copy_intp(10) - * >>> intp_value(a) - * 10 - * >>> b = new_intp() - * >>> intp_assign(b,20) - * >>> print add(a,b) - * 30 - * >>> delete_intp(a) - * >>> delete_intp(b) - * - * ----------------------------------------------------------------------------- */ - -%define %pointer_functions(TYPE,NAME) -%{ -static TYPE *new_##NAME() { %} -#ifdef __cplusplus -%{ return new TYPE(); %} -#else -%{ return (TYPE *) calloc(1,sizeof(TYPE)); %} -#endif -%{} - -static TYPE *copy_##NAME(TYPE value) { %} -#ifdef __cplusplus -%{ return new TYPE(value); %} -#else -%{ TYPE *self = (TYPE *) calloc(1,sizeof(TYPE)); - *self = value; - return self; %} -#endif -%{} - -static void delete_##NAME(TYPE *self) { %} -#ifdef __cplusplus -%{ delete self; %} -#else -%{ free(self); %} -#endif -%{} - -static void NAME ##_assign(TYPE *self, TYPE value) { - *self = value; -} - -static TYPE NAME ##_value(TYPE *self) { - return *self; -} -%} - -TYPE *new_##NAME(); -TYPE *copy_##NAME(TYPE value); -void delete_##NAME(TYPE *self); -void NAME##_assign(TYPE *self, TYPE value); -TYPE NAME##_value(TYPE *self); - -%enddef - -/* ----------------------------------------------------------------------------- - * %pointer_cast(type1,type2,name) - * - * Generates a pointer casting function. - * ----------------------------------------------------------------------------- */ - -%define %pointer_cast(TYPE1,TYPE2,NAME) -%inline %{ -TYPE2 NAME(TYPE1 x) { - return (TYPE2) x; -} -%} -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/d/d.swg b/mac/bin/swig/share/swig/4.1.0/d/d.swg deleted file mode 100755 index f5bb4596..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/d.swg +++ /dev/null @@ -1,46 +0,0 @@ -/* ----------------------------------------------------------------------------- - * d.swg - * - * Main library file for the D language module. See the D chapter in the SWIG - * manual for explanation on the typemaps, pragmas, etc. used. - * ----------------------------------------------------------------------------- */ - -// Typemaps for exception handling. -%include - -// Typemaps for primitive types. -%include - -// Typemaps for non-primitive types (C/C++ classes and structs). -%include - -// Typemaps for enumeration types. -%include - -// Typemaps for member function pointers. -%include - -// Typemaps for wrapping pointers to/arrays of C chars as D strings. -%include - -// Typemaps for handling void function return types and empty parameter lists. -%include - -// Typemaps containing D code used when generating D proxy classes. -%include - -// Mapping of C++ operator overloading methods to D. -%include - -// Helper code string and exception handling. -%include - -// Wrapper loader code for dynamically linking the C wrapper library from the D -// wrapper module. -%include - -// List of all reserved D keywords. -%include - -// D-specific directives. -%include diff --git a/mac/bin/swig/share/swig/4.1.0/d/dclassgen.swg b/mac/bin/swig/share/swig/4.1.0/d/dclassgen.swg deleted file mode 100755 index e4ff8d5f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/dclassgen.swg +++ /dev/null @@ -1,172 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dclassgen.swg - * - * Typemaps containing D code used when generating D proxy classes. - * ----------------------------------------------------------------------------- */ - -%typemap(dbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "class" -%typemap(dcode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dinterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dinterfaces_derived) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" - -// See . -%typemap(dclassmodifiers) enum SWIGTYPE "enum" -%typemap(dcode) enum SWIGTYPE "" - - -/* - * Proxy classes. - */ - -%typemap(dconstructor, excode=SWIGEXCODE,directorconnect="\n swigDirectorConnect();") SWIGTYPE { - this($imcall, true);$excode$directorconnect -} - -%typemap(ddestructor) SWIGTYPE %{ -~this() { - dispose(); -} -%} - -// We do not use »override« attribute for generated dispose() methods to stay -// somewhat compatible to Phobos and older Tango versions where Object.dispose() -// does not exist. -%typemap(ddispose, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - } - } -} - -%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - super.dispose(); - } - } -} - - -// Unfortunately, the »package« visibility attribute does not work in D when the -// module in question is in the root package (happens if no -package is specified -// at the SWIG command line), so we are stuck with public visibility for -// swigGetCPtr(). -%typemap(dbody) SWIGTYPE %{ -private void* swigCPtr; -protected bool swigCMemOwn; - -public this(void* cObject, bool ownCObject) { - swigCPtr = cObject; - swigCMemOwn = ownCObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -public static void* swigRelease(typeof(this) obj) { - if (obj !is null) { - if (!obj.swigCMemOwn) - throw new Exception("Cannot release ownership as memory is not owned"); - void* ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.dispose(); - return ptr; - } else { - return null; - } -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} - - -%typemap(dbody_derived) SWIGTYPE %{ -private void* swigCPtr; - -public this(void* cObject, bool ownCObject) { - super($imdmodule.$dclazznameUpcast(cObject), ownCObject); - swigCPtr = cObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -public static void* swigRelease(typeof(this) obj) { - if (obj !is null) { - if (!obj.swigCMemOwn) - throw new Exception("Cannot release ownership as memory is not owned"); - void* ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.dispose(); - return ptr; - } else { - return null; - } -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} - - -/* - * Type wrapper classes. - */ - -%typemap(dbody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] %{ -private void* swigCPtr; - -public this(void* cObject, bool futureUse) { - swigCPtr = cObject; -} - -protected this() { - swigCPtr = null; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -public static void* swigRelease(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} - - -/* - * Member function pointer wrapper classes (see ). - */ - -%typemap(dbody) SWIGTYPE (CLASS::*) %{ -private char* swigCPtr; - -public this(char* cMemberPtr, bool futureUse) { - swigCPtr = cMemberPtr; -} - -protected this() { - swigCPtr = null; -} - -package static char* swigGetCMemberPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} diff --git a/mac/bin/swig/share/swig/4.1.0/d/ddirectives.swg b/mac/bin/swig/share/swig/4.1.0/d/ddirectives.swg deleted file mode 100755 index 145cf01f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/ddirectives.swg +++ /dev/null @@ -1,11 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ddirectives.swg - * - * D-specifiv directives. - * ----------------------------------------------------------------------------- */ - -#define %dmanifestconst %feature("d:manifestconst") -#define %dconstvalue(value) %feature("d:constvalue",value) -#define %dmethodmodifiers %feature("d:methodmodifiers") -#define %dnothrowexception %feature("except") -#define %proxycode %insert("proxycode") diff --git a/mac/bin/swig/share/swig/4.1.0/d/denums.swg b/mac/bin/swig/share/swig/4.1.0/d/denums.swg deleted file mode 100755 index 3f812466..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/denums.swg +++ /dev/null @@ -1,60 +0,0 @@ -/* ----------------------------------------------------------------------------- - * denums.swg - * - * Typemaps for enumerations. - * ----------------------------------------------------------------------------- */ - - -/* - * Typemaps for enumeration types. - */ - -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(dtype, cprimitive="1") enum SWIGTYPE "$dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(ddirectorin) enum SWIGTYPE "cast($dclassname)$winput" -%typemap(ddirectorout) enum SWIGTYPE "cast(int)$dcall" - -%typemap(din) enum SWIGTYPE "cast(int)$dinput" -%typemap(dout, excode=SWIGEXCODE) enum SWIGTYPE { - $dclassname ret = cast($dclassname)$imcall;$excode - return ret; -} - - -/* - * Typemaps for (const) references to enumeration types. - */ - -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(dtype) const enum SWIGTYPE & "$*dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} - -%typemap(ddirectorin) const enum SWIGTYPE & "cast($*dclassname)$winput" -%typemap(ddirectorout) const enum SWIGTYPE & "cast(int)$dcall" - -%typemap(din) const enum SWIGTYPE & "cast(int)$dinput" -%typemap(dout, excode=SWIGEXCODE) const enum SWIGTYPE & { - $*dclassname ret = cast($*dclassname)$imcall;$excode - return ret; -} diff --git a/mac/bin/swig/share/swig/4.1.0/d/dexception.swg b/mac/bin/swig/share/swig/4.1.0/d/dexception.swg deleted file mode 100755 index 1aadbaad..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/dexception.swg +++ /dev/null @@ -1,30 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dexception.swg - * - * Typemaps used for propagating C++ exceptions to D. - * ----------------------------------------------------------------------------- */ - -// Code which is inserted into the dout typemaps and class constructors via -// excode if exceptions can be thrown. -%define SWIGEXCODE "\n if ($imdmodule.SwigPendingException.isPending) throw $imdmodule.SwigPendingException.retrieve();" %enddef - -%typemap(throws, canthrow=1) int, - long, - short, - unsigned int, - unsigned long, - unsigned short -%{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_DSetPendingException(SWIG_DException, error_msg); - return $null; %} - -%typemap(throws, canthrow=1) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [ANY], - enum SWIGTYPE, const enum SWIGTYPE & -%{ (void)$1; - SWIG_DSetPendingException(SWIG_DException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(throws, canthrow=1) char * -%{ SWIG_DSetPendingException(SWIG_DException, $1); - return $null; %} diff --git a/mac/bin/swig/share/swig/4.1.0/d/dhead.swg b/mac/bin/swig/share/swig/4.1.0/d/dhead.swg deleted file mode 100755 index 1ef1e416..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/dhead.swg +++ /dev/null @@ -1,298 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dhead.swg - * - * Support code for exceptions if the SWIG_D_NO_EXCEPTION_HELPER is not defined - * Support code for strings if the SWIG_D_NO_STRING_HELPER is not defined - * - * Support code for function pointers. ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ -#include -#include -#include - -/* Contract support. */ -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_DSetPendingException(SWIG_DException, msg); return nullreturn; } } while (0) -%} - - -/* - * Exception support code. - */ - -#if !defined(SWIG_D_NO_EXCEPTION_HELPER) -%insert(runtime) %{ -// Support for throwing D exceptions from C/C++. -typedef enum { - SWIG_DException = 0, - SWIG_DIllegalArgumentException, - SWIG_DIllegalElementException, - SWIG_DIOException, - SWIG_DNoSuchElementException -} SWIG_DExceptionCodes; - -typedef void (* SWIG_DExceptionCallback_t)(const char *); - -typedef struct { - SWIG_DExceptionCodes code; - SWIG_DExceptionCallback_t callback; -} SWIG_DException_t; - -static SWIG_DException_t SWIG_d_exceptions[] = { - { SWIG_DException, NULL }, - { SWIG_DIllegalArgumentException, NULL }, - { SWIG_DIllegalElementException, NULL }, - { SWIG_DIOException, NULL }, - { SWIG_DNoSuchElementException, NULL } -}; - -static void SWIGUNUSED SWIG_DSetPendingException(SWIG_DExceptionCodes code, const char *msg) { - if ((size_t)code < sizeof(SWIG_d_exceptions)/sizeof(SWIG_DException_t)) { - SWIG_d_exceptions[code].callback(msg); - } else { - SWIG_d_exceptions[SWIG_DException].callback(msg); - } -} - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGRegisterExceptionCallbacks_$module( - SWIG_DExceptionCallback_t exceptionCallback, - SWIG_DExceptionCallback_t illegalArgumentCallback, - SWIG_DExceptionCallback_t illegalElementCallback, - SWIG_DExceptionCallback_t ioCallback, - SWIG_DExceptionCallback_t noSuchElementCallback) { - SWIG_d_exceptions[SWIG_DException].callback = exceptionCallback; - SWIG_d_exceptions[SWIG_DIllegalArgumentException].callback = illegalArgumentCallback; - SWIG_d_exceptions[SWIG_DIllegalElementException].callback = illegalElementCallback; - SWIG_d_exceptions[SWIG_DIOException].callback = ioCallback; - SWIG_d_exceptions[SWIG_DNoSuchElementException].callback = noSuchElementCallback; -} -%} - -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports=%{ -// Exception throwing support currently requires Tango, but there is no reason -// why it could not support Phobos. -static import tango.core.Exception; -static import tango.core.Thread; -static import tango.stdc.stringz; -%} - -%pragma(d) imdmodulecode=%{ -private class SwigExceptionHelper { - static this() { - swigRegisterExceptionCallbacks$module( - &setException, - &setIllegalArgumentException, - &setIllegalElementException, - &setIOException, - &setNoSuchElementException); - } - - static void setException(char* message) { - auto exception = new object.Exception(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIllegalArgumentException(char* message) { - auto exception = new tango.core.Exception.IllegalArgumentException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIllegalElementException(char* message) { - auto exception = new tango.core.Exception.IllegalElementException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIOException(char* message) { - auto exception = new tango.core.Exception.IOException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setNoSuchElementException(char* message) { - auto exception = new tango.core.Exception.NoSuchElementException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } -} - -package class SwigPendingException { -public: - static this() { - m_sPendingException = new ThreadLocalData(null); - } - - static bool isPending() { - return m_sPendingException.val !is null; - } - - static void set(object.Exception e) { - auto pending = m_sPendingException.val; - if (pending !is null) { - e.next = pending; - throw new object.Exception("FATAL: An earlier pending exception from C/C++ " ~ - "code was missed and thus not thrown (" ~ pending.classinfo.name ~ ": " ~ - pending.msg ~ ")!", e); - } - m_sPendingException.val = e; - } - - static object.Exception retrieve() { - auto e = m_sPendingException.val; - m_sPendingException.val = null; - return e; - } - -private: - // The reference to the pending exception (if any) is stored thread-local. - alias tango.core.Thread.ThreadLocal!(object.Exception) ThreadLocalData; - static ThreadLocalData m_sPendingException; -} -alias void function(char* message) SwigExceptionCallback; -%} -#else -%pragma(d) imdmoduleimports=%{ -static import std.conv; -%} - -%pragma(d) imdmodulecode=%{ -private class SwigExceptionHelper { - static this() { - // The D1/Tango version maps C++ exceptions to multiple exception types. - swigRegisterExceptionCallbacks$module( - &setException, - &setException, - &setException, - &setException, - &setException - ); - } - - static void setException(const char* message) { - auto exception = new object.Exception(std.conv.to!string(message)); - SwigPendingException.set(exception); - } -} - -package struct SwigPendingException { -public: - static this() { - m_sPendingException = null; - } - - static bool isPending() { - return m_sPendingException !is null; - } - - static void set(object.Exception e) { - if (m_sPendingException !is null) { - e.next = m_sPendingException; - throw new object.Exception("FATAL: An earlier pending exception from C/C++ code " ~ - "was missed and thus not thrown (" ~ m_sPendingException.classinfo.name ~ - ": " ~ m_sPendingException.msg ~ ")!", e); - } - - m_sPendingException = e; - } - - static object.Exception retrieve() { - auto e = m_sPendingException; - m_sPendingException = null; - return e; - } - -private: - // The reference to the pending exception (if any) is stored thread-local. - static object.Exception m_sPendingException; -} -alias void function(const char* message) SwigExceptionCallback; -%} -#endif -// Callback registering function in wrapperloader.swg. -#endif // SWIG_D_NO_EXCEPTION_HELPER - - -/* - * String support code. - */ - -#if !defined(SWIG_D_NO_STRING_HELPER) -%insert(runtime) %{ -// Callback for returning strings to D without leaking memory. -typedef char * (* SWIG_DStringHelperCallback)(const char *); -static SWIG_DStringHelperCallback SWIG_d_string_callback = NULL; - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGRegisterStringCallback_$module(SWIG_DStringHelperCallback callback) { - SWIG_d_string_callback = callback; -} -%} - -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports = "static import tango.stdc.stringz;"; - -%pragma(d) imdmodulecode = %{ -private class SwigStringHelper { - static this() { - swigRegisterStringCallback$module(&createString); - } - - static char* createString(char* cString) { - // We are effectively dup'ing the string here. - return tango.stdc.stringz.toStringz(tango.stdc.stringz.fromStringz(cString)); - } -} -alias char* function(char* cString) SwigStringCallback; -%} -#else -%pragma(d) imdmoduleimports = %{ -static import std.conv; -static import std.string; -%} - -%pragma(d) imdmodulecode = %{ -private class SwigStringHelper { - static this() { - swigRegisterStringCallback$module(&createString); - } - - static const(char)* createString(const(char*) cString) { - // We are effectively dup'ing the string here. - // TODO: Is this also correct for D2/Phobos? - return std.string.toStringz(std.conv.to!string(cString)); - } -} -alias const(char)* function(const(char*) cString) SwigStringCallback; -%} -#endif -// Callback registering function in wrapperloader.swg. -#endif // SWIG_D_NO_STRING_HELPER - - -/* - * Function pointer support code. - */ -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmodulecode = %{ -template SwigExternC(T) { - static if (is(typeof(*(T.init)) R == return)) { - static if (is(typeof(*(T.init)) P == function)) { - alias extern(C) R function(P) SwigExternC; - } - } -} -%} -#else -%pragma(d) imdmodulecode = %{ -template SwigExternC(T) if (is(typeof(*(T.init)) P == function)) { - static if (is(typeof(*(T.init)) R == return)) { - static if (is(typeof(*(T.init)) P == function)) { - alias extern(C) R function(P) SwigExternC; - } - } -} -%} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/d/director.swg b/mac/bin/swig/share/swig/4.1.0/d/director.swg deleted file mode 100755 index 02da0e0a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/director.swg +++ /dev/null @@ -1,49 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that D proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#if defined(DEBUG_DIRECTOR_OWNED) -#include -#endif -#include -#include - -namespace Swig { - - // Director base class – not used in D directors. - class Director { - }; - - // Base class for director exceptions. - class DirectorException : public std::exception { - protected: - std::string swig_msg; - - public: - DirectorException(const std::string &msg) : swig_msg(msg) { - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - // Exception which is thrown when attempting to call a pure virtual method - // from D code through the director layer. - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg) : DirectorException(std::string("Attempted to invoke pure virtual method ") + msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; -} - diff --git a/mac/bin/swig/share/swig/4.1.0/d/dkw.swg b/mac/bin/swig/share/swig/4.1.0/d/dkw.swg deleted file mode 100755 index 2a189ed6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/dkw.swg +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef D_DKW_SWG_ -#define D_DKW_SWG_ - -/* Warnings for D keywords */ -#define DKEYWORD(x) %keywordwarn("'" `x` "' is a D keyword",rename="_%s") `x` - -// Source: http://www.digitalmars.com/d/{1.0,2.0}/lex.html and -DKEYWORD(Error); -DKEYWORD(Exception); -DKEYWORD(Object); -DKEYWORD(__FILE__); -DKEYWORD(__LINE__); -DKEYWORD(__gshared); -DKEYWORD(__thread); -DKEYWORD(__traits); -DKEYWORD(abstract); -DKEYWORD(alias); -DKEYWORD(align); -DKEYWORD(asm); -DKEYWORD(assert); -DKEYWORD(auto); -DKEYWORD(body); -DKEYWORD(bool); -DKEYWORD(break); -DKEYWORD(byte); -DKEYWORD(case); -DKEYWORD(cast); -DKEYWORD(catch); -DKEYWORD(cdouble); -DKEYWORD(cent); -DKEYWORD(cfloat); -DKEYWORD(char); -DKEYWORD(class); -DKEYWORD(const); -DKEYWORD(continue); -DKEYWORD(creal); -DKEYWORD(dchar); -DKEYWORD(debug); -DKEYWORD(default); -DKEYWORD(delegate); -DKEYWORD(delete); -DKEYWORD(deprecated); -DKEYWORD(do); -DKEYWORD(double); -DKEYWORD(dstring); -DKEYWORD(else); -DKEYWORD(enum); -DKEYWORD(export); -DKEYWORD(extern); -DKEYWORD(false); -DKEYWORD(final); -DKEYWORD(finally); -DKEYWORD(float); -DKEYWORD(for); -DKEYWORD(foreach); -DKEYWORD(foreach_reverse); -DKEYWORD(function); -DKEYWORD(goto); -DKEYWORD(idouble); -DKEYWORD(if); -DKEYWORD(ifloat); -DKEYWORD(immutable); -DKEYWORD(import); -DKEYWORD(in); -DKEYWORD(inout); -DKEYWORD(int); -DKEYWORD(interface); -DKEYWORD(invariant); -DKEYWORD(ireal); -DKEYWORD(is); -DKEYWORD(lazy); -DKEYWORD(long); -DKEYWORD(macro); -DKEYWORD(mixin); -DKEYWORD(module); -DKEYWORD(new); -DKEYWORD(nothrow); -DKEYWORD(null); -DKEYWORD(out); -DKEYWORD(override); -DKEYWORD(package); -DKEYWORD(pragma); -DKEYWORD(private); -DKEYWORD(protected); -DKEYWORD(public); -DKEYWORD(pure); -DKEYWORD(real); -DKEYWORD(ref); -DKEYWORD(return); -DKEYWORD(scope); -DKEYWORD(shared); -DKEYWORD(short); -DKEYWORD(static); -DKEYWORD(string); -DKEYWORD(struct); -DKEYWORD(super); -DKEYWORD(switch); -DKEYWORD(synchronized); -DKEYWORD(template); -DKEYWORD(this); -DKEYWORD(throw); -DKEYWORD(true); -DKEYWORD(try); -DKEYWORD(typedef); -DKEYWORD(typeid); -DKEYWORD(typeof); -DKEYWORD(ubyte); -DKEYWORD(ucent); -DKEYWORD(uint); -DKEYWORD(ulong); -DKEYWORD(union); -DKEYWORD(unittest); -DKEYWORD(ushort); -DKEYWORD(version); -DKEYWORD(void); -DKEYWORD(volatile); -DKEYWORD(wchar); -DKEYWORD(while); -DKEYWORD(with); -DKEYWORD(wstring); - -// Not really a keyword, but dispose() methods are generated in proxy classes -// and it's a special method name for D1/Tango. -DKEYWORD(dispose); - -#undef DKEYWORD - -#endif //D_DKW_SWG_ diff --git a/mac/bin/swig/share/swig/4.1.0/d/dmemberfunctionpointers.swg b/mac/bin/swig/share/swig/4.1.0/d/dmemberfunctionpointers.swg deleted file mode 100755 index a07d0a5d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/dmemberfunctionpointers.swg +++ /dev/null @@ -1,94 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dmemberfunctionpointers.swg - * - * Typemaps for member function pointers. - * ----------------------------------------------------------------------------- */ - - -%typemap(ctype) SWIGTYPE (CLASS::*) "char *" -%typemap(imtype) SWIGTYPE (CLASS::*) "char*" -%typemap(dtype) SWIGTYPE (CLASS::*) "$dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE (CLASS::*) - "" - - -/* - * Conversion generation typemaps. - */ - -%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) %{ - SWIG_UnpackData($input, (void *)&$1, sizeof($1)); -%} -%typemap(out, fragment="SWIG_PackData") SWIGTYPE (CLASS::*) %{ - char buf[128]; - char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); - *data = '\0'; - $result = SWIG_d_string_callback(buf); -%} - -%typemap(directorin) SWIGTYPE (CLASS::*) "$input = (void *) $1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) - "$result = ($1_ltype)$input;" - -%typemap(ddirectorin) SWIGTYPE (CLASS::*) - "($winput is null) ? null : new $dclassname($winput, false)" -%typemap(ddirectorout) SWIGTYPE (CLASS::*) "$dclassname.swigGetCPtr($dcall)" - -%typemap(din) SWIGTYPE (CLASS::*) "$dclassname.swigGetCMemberPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE (CLASS::*) { - char* cMemberPtr = $imcall; - $dclassname ret = (cMemberPtr is null) ? null : new $dclassname(cMemberPtr, $owner);$excode - return ret; -} - -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* - * Helper functions to pack/unpack arbitrary binary data (member function - * pointers in this case) into a string. - */ - -%fragment("SWIG_PackData", "header") { -/* Pack binary data into a string */ -SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} -} - -%fragment("SWIG_UnPackData", "header") { -/* Unpack binary data from a string */ -SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/d/doperators.swg b/mac/bin/swig/share/swig/4.1.0/d/doperators.swg deleted file mode 100755 index 0a82a6cb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/doperators.swg +++ /dev/null @@ -1,259 +0,0 @@ -/* ----------------------------------------------------------------------------- - * doperators.swg - * - * Mapping of C++ operator overloading methods to D. - * ----------------------------------------------------------------------------- */ - -#if (SWIG_D_VERSION == 1) - -%pragma(d) imdmodulecode=%{ -template SwigOperatorDefinitions() { - public override int opEquals(Object o) { - if (auto rhs = cast(typeof(this))o) { - if (swigCPtr == rhs.swigCPtr) return 1; - static if (is(typeof(swigOpEquals(rhs)))) { - return swigOpEquals(rhs) ? 1 : 0; - } else { - return 0; - } - } - return super.opEquals(o); - } -%} -// opEquals is emitted in pure C mode as well to define two proxy classes -// pointing to the same struct as equal. - -#ifdef __cplusplus -%rename(opPos) *::operator+(); -%rename(opPos) *::operator+() const; -%rename(opNeg) *::operator-(); -%rename(opNeg) *::operator-() const; -%rename(opCom) *::operator~(); -%rename(opCom) *::operator~() const; - -%rename(opAdd) *::operator+; -%rename(opAddAssign) *::operator+=; -%rename(opSub) *::operator-; -%rename(opSubAssign) *::operator-=; -%rename(opMul) *::operator*; -%rename(opMulAssign) *::operator*=; -%rename(opDiv) *::operator/; -%rename(opDivAssign) *::operator/=; -%rename(opMod) *::operator%; -%rename(opModAssign) *::operator%=; -%rename(opAnd) *::operator&; -%rename(opAndAssign) *::operator&=; -%rename(opOr) *::operator|; -%rename(opOrAssign) *::operator|=; -%rename(opXor) *::operator^; -%rename(opXorAssign) *::operator^=; -%rename(opShl) *::operator<<; -%rename(opShlAssign) *::operator<<=; -%rename(opShr) *::operator>>; -%rename(opShrAssign) *::operator>>=; - -%rename(opIndex) *::operator[](unsigned) const; -// opIndexAssign is not currently generated, it needs more extensive support -// mechanisms. - -%rename(opCall) *::operator(); - -// !a is not overridable in D1. -%ignoreoperator(LNOT) operator!; - -// opCmp is used in D. -%rename(swigOpEquals) *::operator==; -%rename(swigOpLt) *::operator<; -%rename(swigOpLtEquals) *::operator<=; -%rename(swigOpGt) *::operator>; -%rename(swigOpGtEquals) *::operator>=; - -// a != b is rewritten as !a.opEquals(b) in D. -%ignoreoperator(NOTEQUAL) operator!=; - -// The logic operators are not overridable in D. -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; - -// ++/--a is rewritten as a +/-= 1 in D1,so ignore the prefix operators. -%ignoreoperator(PLUSPLUS) *::operator++(); -%ignoreoperator(MINUSMINUS) *::operator--(); -%rename(swigOpInc) *::operator++(int); -%rename(swigOpDec) *::operator--(int); - -// The C++ assignment operator does not translate well to D where the proxy -// classes have reference semantics. -%ignoreoperator(EQ) operator=; - -%pragma(d) imdmodulecode=%{ - public override int opCmp(Object o) { - static if (is(typeof(swigOpLt(typeof(this).init) && - swigOpEquals(typeof(this).init)))) { - if (auto rhs = cast(typeof(this))o) { - if (swigOpLt(rhs)) { - return -1; - } else if (swigOpEquals(rhs)) { - return 0; - } else { - return 1; - } - } - } - return super.opCmp(o); - } - - public typeof(this) opPostInc(T = int)(T unused = 0) { - static assert( - is(typeof(swigOpInc(int.init))), - "opPostInc called on " ~ typeof(this).stringof ~ ", but no postfix " ~ - "increment operator exists in the corresponding C++ class." - ); - return swigOpInc(int.init); - } - - public typeof(this) opPostDec(T = int)(T unused = 0) { - static assert( - is(typeof(swigOpDec(int.init))), - "opPostInc called on " ~ typeof(this).stringof ~ ", but no postfix " ~ - "decrement operator exists in the corresponding C++ class." - ); - return swigOpDec(int.init); - } -%} -#endif - -%pragma(d) imdmodulecode=%{ -} -%} - -#else -%pragma(d) imdmodulecode=%{ -mixin template SwigOperatorDefinitions() { - public override bool opEquals(Object o) { - if (auto rhs = cast(typeof(this))o) { - if (swigCPtr == rhs.swigCPtr) return true; - static if (is(typeof(swigOpEquals(rhs)))) { - return swigOpEquals(rhs); - } else { - return false; - } - } - return super.opEquals(o); - } -%} -// opEquals is emitted in pure C mode as well to define two proxy classes -// pointing to the same struct as equal. - -#ifdef __cplusplus -%rename(swigOpPos) *::operator+(); -%rename(swigOpPos) *::operator+() const; -%rename(swigOpNeg) *::operator-(); -%rename(swigOpNeg) *::operator-() const; -%rename(swigOpCom) *::operator~(); -%rename(swigOpCom) *::operator~() const; -%rename(swigOpInc) *::operator++(); -%rename(swigOpDec) *::operator--(); -%ignoreoperator(PLUSPLUS) *::operator++(int); -%ignoreoperator(MINUSMINUS) *::operator--(int); -// The postfix increment/decrement operators are ignored because they are -// rewritten to (auto t = e, ++e, t) in D2. The unary * operator (used for -// pointer dereferencing in C/C++) isn't mapped to opUnary("*") by default, -// despite this would be possible in D2 – the difference in member access -// semantics would only lead to confusion in most cases. - -%rename(swigOpAdd) *::operator+; -%rename(swigOpSub) *::operator-; -%rename(swigOpMul) *::operator*; -%rename(swigOpDiv) *::operator/; -%rename(swigOpMod) *::operator%; -%rename(swigOpAnd) *::operator&; -%rename(swigOpOr) *::operator|; -%rename(swigOpXor) *::operator^; -%rename(swigOpShl) *::operator<<; -%rename(swigOpShr) *::operator>>; - -%rename(swigOpAddAssign) *::operator+=; -%rename(swigOpSubAssign) *::operator-=; -%rename(swigOpMulAssign) *::operator*=; -%rename(swigOpDivAssign) *::operator/=; -%rename(swigOpModAssign) *::operator%=; -%rename(swigOpAndAssign) *::operator&=; -%rename(swigOpOrAssign) *::operator|=; -%rename(swigOpXorAssign) *::operator^=; -%rename(swigOpShlAssign) *::operator<<=; -%rename(swigOpShrAssign) *::operator>>=; - -%rename(opIndex) *::operator[]; -// opIndexAssign is not currently generated, it needs more extensive support -// mechanisms. - -%rename(opCall) *::operator(); - -%rename(swigOpEquals) *::operator==; -%rename(swigOpLt) *::operator<; -%rename(swigOpLtEquals) *::operator<=; -%rename(swigOpGt) *::operator>; -%rename(swigOpGtEquals) *::operator>=; - -// a != b is rewritten as !a.opEquals(b) in D. -%ignoreoperator(NOTEQUAL) operator!=; - -// The logic operators are not overridable in D. -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; - -// The C++ assignment operator does not translate well to D where the proxy -// classes have reference semantics. -%ignoreoperator(EQ) operator=; - -%pragma(d) imdmodulecode=%{ - public override int opCmp(Object o) { - static if (__traits(compiles, swigOpLt(typeof(this).init) && - swigOpEquals(typeof(this).init))) { - if (auto rhs = cast(typeof(this))o) { - if (swigOpLt(rhs)) { - return -1; - } else if (swigOpEquals(rhs)) { - return 0; - } else { - return 1; - } - } - } - return super.opCmp(o); - } - - private template swigOpBinary(string operator, string name) { - enum swigOpBinary = `public void opOpAssign(string op, T)(T rhs) if (op == "` ~ operator ~ - `" && __traits(compiles, swigOp` ~ name ~ `Assign(rhs))) { swigOp` ~ name ~ `Assign(rhs);}` ~ - `public auto opBinary(string op, T)(T rhs) if (op == "` ~ operator ~ - `" && __traits(compiles, swigOp` ~ name ~ `(rhs))) { return swigOp` ~ name ~ `(rhs);}`; - } - mixin(swigOpBinary!("+", "Add")); - mixin(swigOpBinary!("-", "Sub")); - mixin(swigOpBinary!("*", "Mul")); - mixin(swigOpBinary!("/", "Div")); - mixin(swigOpBinary!("%", "Mod")); - mixin(swigOpBinary!("&", "And")); - mixin(swigOpBinary!("|", "Or")); - mixin(swigOpBinary!("^", "Xor")); - mixin(swigOpBinary!("<<", "Shl")); - mixin(swigOpBinary!(">>", "Shr")); - - private template swigOpUnary(string operator, string name) { - enum swigOpUnary = `public auto opUnary(string op)() if (op == "` ~ operator ~ - `" && __traits(compiles, swigOp` ~ name ~ `())) { return swigOp` ~ name ~ `();}`; - } - mixin(swigOpUnary!("+", "Pos")); - mixin(swigOpUnary!("-", "Neg")); - mixin(swigOpUnary!("~", "Com")); - mixin(swigOpUnary!("++", "Inc")); - mixin(swigOpUnary!("--", "Dec")); -%} -#endif - -%pragma(d) imdmodulecode=%{ -} -%} - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/d/dprimitives.swg b/mac/bin/swig/share/swig/4.1.0/d/dprimitives.swg deleted file mode 100755 index eaee816d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/dprimitives.swg +++ /dev/null @@ -1,171 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dprimitves.swg - * - * Typemaps for primitive types. - * ----------------------------------------------------------------------------- */ - -// C long/ulong width depends on the target arch, use stdlib aliases for them. -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports = "static import tango.stdc.config;" -%pragma(d) globalproxyimports = "static import tango.stdc.config;" -#define SWIG_LONG_DTYPE tango.stdc.config.c_long -#define SWIG_ULONG_DTYPE tango.stdc.config.c_ulong -#else -%pragma(d) imdmoduleimports = "static import core.stdc.config;" -%pragma(d) globalproxyimports = "static import core.stdc.config;" -#define SWIG_LONG_DTYPE core.stdc.config.c_long -#define SWIG_ULONG_DTYPE core.stdc.config.c_ulong -#endif - -/* - * The SWIG_D_PRIMITIVE macro is used to define the typemaps for the primitive - * types, because are more or less the same for all of them. The few special - * cases are handled below. - */ -%define SWIG_D_PRIMITIVE(TYPE, DTYPE) -%typemap(ctype) TYPE, const TYPE & "TYPE" -%typemap(imtype) TYPE, const TYPE & "DTYPE" -%typemap(dtype, cprimitive="1") TYPE, const TYPE & "DTYPE" - -%typemap(in) TYPE "$1 = ($1_ltype)$input;" -%typemap(out) TYPE "$result = $1;" -%typemap(directorin) TYPE "$input = $1;" -%typemap(directorout) TYPE "$result = ($1_ltype)$input;" -%typemap(ddirectorin) TYPE "$winput" -%typemap(ddirectorout) TYPE "$dcall" - -%typemap(in) const TYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const TYPE & "$result = *$1;" -%typemap(directorin) const TYPE & "$input = $1;" -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const TYPE & -%{ static $*1_ltype temp; - temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(ddirectorin) const TYPE & "$winput" -%typemap(ddirectorout) const TYPE & "$dcall" - -%typemap(din) TYPE, const TYPE & "$dinput" -%typemap(dout, excode=SWIGEXCODE) TYPE, const TYPE & { - auto ret = $imcall;$excode - return ret; -} -%enddef - - -SWIG_D_PRIMITIVE(bool, bool) -SWIG_D_PRIMITIVE(char, char) -SWIG_D_PRIMITIVE(signed char, byte) -SWIG_D_PRIMITIVE(unsigned char, ubyte) -SWIG_D_PRIMITIVE(short, short) -SWIG_D_PRIMITIVE(unsigned short, ushort) -SWIG_D_PRIMITIVE(int, int) -SWIG_D_PRIMITIVE(unsigned int, uint) -SWIG_D_PRIMITIVE(long, SWIG_LONG_DTYPE) -SWIG_D_PRIMITIVE(unsigned long, SWIG_ULONG_DTYPE) -SWIG_D_PRIMITIVE(size_t, size_t) -SWIG_D_PRIMITIVE(long long, long) -SWIG_D_PRIMITIVE(unsigned long long, ulong) -SWIG_D_PRIMITIVE(float, float) -SWIG_D_PRIMITIVE(double, double) - - -// The C++ boolean type needs some special casing since it is not part of the -// C standard and is thus represented as unsigned int in the C wrapper layer. -%typemap(ctype) bool, const bool & "unsigned int" -%typemap(imtype) bool, const bool & "uint" - -%typemap(in) bool "$1 = $input ? true : false;" -%typemap(in) const bool & ($*1_ltype temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(directorout) bool - "$result = $input ? true : false;" -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & -%{ static $*1_ltype temp; - temp = $input ? true : false; - $result = &temp; %} - -%typemap(ddirectorin) bool "($winput ? true : false)" - -%typemap(dout, excode=SWIGEXCODE) bool, const bool & { - bool ret = $imcall ? true : false;$excode - return ret; -} - - -// Judging from the history of the C# module, the explicit casts are needed for -// certain versions of VC++. -%typemap(out) unsigned long "$result = (unsigned long)$1;" -%typemap(out) const unsigned long & "$result = (unsigned long)*$1;" - - -/* - * Typecheck typemaps. - */ - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_UINT8) - unsigned char, - const unsigned char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) - short, - const short & - "" - -%typecheck(SWIG_TYPECHECK_UINT16) - unsigned short, - const unsigned short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) - int, - long, - const int &, - const long & - "" - -%typecheck(SWIG_TYPECHECK_UINT32) - unsigned int, - unsigned long, - const unsigned int &, - const unsigned long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) - long long, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_UINT64) - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) - double, - const double & - "" diff --git a/mac/bin/swig/share/swig/4.1.0/d/dstrings.swg b/mac/bin/swig/share/swig/4.1.0/d/dstrings.swg deleted file mode 100755 index 02895c15..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/dstrings.swg +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dstrings.swg - * - * Typemaps for wrapping pointers to/arrays of C chars as D strings. - * ----------------------------------------------------------------------------- */ - -%define SWIGD_STRING_TYPEMAPS(DW_STRING_TYPE, DP_STRING_TYPE, FROM_STRINGZ, TO_STRINGZ) -%typemap(ctype) char *, char *&, char[ANY], char[] "char *" -%typemap(imtype) char *, char *&, char[ANY], char[] #DW_STRING_TYPE -%typemap(dtype) char *, char *&, char[ANY], char[] #DP_STRING_TYPE - - -/* - * char* typemaps. - */ - -%typemap(in) char * %{ $1 = ($1_ltype)$input; %} -%typemap(out) char * %{ $result = SWIG_d_string_callback((const char *)$1); %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char * %{ $input = SWIG_d_string_callback((const char *)$1); %} -%typemap(ddirectorin) char * "FROM_STRINGZ($winput)" -%typemap(ddirectorout) char * "TO_STRINGZ($dcall)" - - -/* - * char*& typemaps. - */ - -%typemap(in) char *& ($*1_ltype temp = 0) %{ - temp = ($*1_ltype)$input; - $1 = &temp; -%} -%typemap(out) char *& %{ if ($1) $result = SWIG_d_string_callback((const char *)*$1); %} - - -/* - * char array typemaps. - */ - -%typemap(in) char[ANY], char[] %{ $1 = ($1_ltype)$input; %} -%typemap(out) char[ANY], char[] %{ $result = SWIG_d_string_callback((const char *)$1); %} - -%typemap(directorout) char[ANY], char[] %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char[ANY], char[] %{ $input = SWIG_d_string_callback((const char *)$1); %} - -%typemap(ddirectorin) char[ANY], char[] "$winput" -%typemap(ddirectorout) char[ANY], char[] "$dcall" - - -%typemap(din) char *, char *&, char[ANY], char[] "($dinput ? TO_STRINGZ($dinput) : null)" -%typemap(dout, excode=SWIGEXCODE) char *, char *&, char[ANY], char[] { - DP_STRING_TYPE ret = FROM_STRINGZ ## ($imcall);$excode - return ret; -} - -%typecheck(SWIG_TYPECHECK_STRING) - char *, - char *&, - char[ANY], - char[] - "" -%enddef - - -// We need to have the \0-terminated string conversion functions available in -// the D proxy modules. -#if (SWIG_D_VERSION == 1) -// Could be easily extended to support Phobos as well. -SWIGD_STRING_TYPEMAPS(char*, char[], tango.stdc.stringz.fromStringz, tango.stdc.stringz.toStringz) - -%pragma(d) globalproxyimports = "static import tango.stdc.stringz;"; -#else -SWIGD_STRING_TYPEMAPS(const(char)*, string, std.conv.to!string, std.string.toStringz) - -%pragma(d) globalproxyimports = %{ -static import std.conv; -static import std.string; -%} -#endif -#undef SWIGD_STRING_TYPEMAPS diff --git a/mac/bin/swig/share/swig/4.1.0/d/dswigtype.swg b/mac/bin/swig/share/swig/4.1.0/d/dswigtype.swg deleted file mode 100755 index c227519e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/dswigtype.swg +++ /dev/null @@ -1,241 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dswigtype.swg - * - * Typemaps for non-primitive types (C/C++ classes and structs). - * ----------------------------------------------------------------------------- */ - -%typemap(ctype) SWIGTYPE "void *" -%typemap(imtype) SWIGTYPE "void*" -%typemap(dtype) SWIGTYPE "$&dclassname" - -%typemap(ctype) SWIGTYPE [] "void *" -%typemap(imtype) SWIGTYPE [] "void*" -%typemap(dtype) SWIGTYPE [] "$dclassname" - -%typemap(ctype) SWIGTYPE * "void *" -%typemap(imtype) SWIGTYPE * "void*" -%typemap(dtype, nativepointer="$dtype") SWIGTYPE * "$dclassname" - -%typemap(ctype) SWIGTYPE & "void *" -%typemap(imtype) SWIGTYPE & "void*" -%typemap(dtype, nativepointer="$dtype") SWIGTYPE & "$dclassname" - -%typemap(ctype) SWIGTYPE && "void *" -%typemap(imtype) SWIGTYPE && "void*" -%typemap(dtype, nativepointer="$dtype") SWIGTYPE && "$dclassname" - -%typemap(ctype) SWIGTYPE *const& "void *" -%typemap(imtype) SWIGTYPE *const& "void*" -%typemap(dtype) SWIGTYPE *const& "$*dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [], - SWIGTYPE *const& - "" - - -/* - * By-value conversion typemaps (parameter is converted to a pointer). - */ - -%typemap(in, canthrow=1) SWIGTYPE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ $result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - $result = $1ptr; -} -#endif - -%typemap(directorin) SWIGTYPE - "$input = (void *)new $1_ltype(SWIG_STD_MOVE($1));" -%typemap(directorout) SWIGTYPE -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *($&1_ltype)$input; %} - -%typemap(ddirectorin) SWIGTYPE "new $&dclassname($winput, true)" -%typemap(ddirectorout) SWIGTYPE "$&dclassname.swigGetCPtr($dcall)" - -%typemap(din) SWIGTYPE "$&dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE { - $&dclassname ret = new $&dclassname($imcall, true);$excode - return ret; -} - - -/* - * Pointer conversion typemaps. - */ - -%typemap(in) SWIGTYPE * "$1 = ($1_ltype)$input;" -%typemap(out) SWIGTYPE * "$result = (void *)$1;" - -%typemap(directorin) SWIGTYPE * - "$input = (void *) $1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * - "$result = ($1_ltype)$input;" - -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE * "($winput is null) ? null : new $dclassname($winput, false)" - -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE * "$dclassname.swigGetCPtr($dcall)" - -%typemap(din, - nativepointer="cast(void*)$dinput" -) SWIGTYPE * "$dclassname.swigGetCPtr($dinput)" - -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}" -) SWIGTYPE * { - void* cPtr = $imcall; - $dclassname ret = (cPtr is null) ? null : new $dclassname(cPtr, $owner);$excode - return ret; -} - -// Use the same typemaps for const pointers. -%apply SWIGTYPE * { SWIGTYPE *const } - - -/* - * Reference conversion typemaps. - */ - -%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "$1_type is null"); - return $null; - } %} -%typemap(out) SWIGTYPE & "$result = (void *)$1;" - -%typemap(directorin) SWIGTYPE & - "$input = ($1_ltype) &$1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Unexpected null return for type $1_type"); - return $null; - } - $result = ($1_ltype)$input; %} - -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE & "new $dclassname($winput, false)" -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE & "$dclassname.swigGetCPtr($dcall)" - -%typemap(din, - nativepointer="cast(void*)$dinput" -) SWIGTYPE & "$dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}") SWIGTYPE & { - $dclassname ret = new $dclassname($imcall, $owner);$excode - return ret; -} - - -/* - * Rvalue reference conversion typemaps. - */ - -%typemap(in, canthrow=1, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "$1_type is null"); - return $null; - } - rvrdeleter.reset($1); %} -%typemap(out) SWIGTYPE && "$result = (void *)$1;" - -%typemap(directorin) SWIGTYPE && - "$input = ($1_ltype) &$1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE && -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Unexpected null return for type $1_type"); - return $null; - } - $result = ($1_ltype)$input; %} - -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE && "new $dclassname($winput, false)" -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE && "$dclassname.swigGetCPtr($dcall)" - -%typemap(din, - nativepointer="cast(void*)$dinput" -) SWIGTYPE && "$dclassname.swigRelease($dinput)" -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}") SWIGTYPE && { - $dclassname ret = new $dclassname($imcall, $owner);$excode - return ret; -} - - -/* - * Array conversion typemaps. - */ - -%typemap(in) SWIGTYPE [] %{ $1 = ($1_ltype)$input; %} -%typemap(out) SWIGTYPE [] %{ $result = $1; %} - -%typemap(din) SWIGTYPE [] "$dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE [] { - void* cPtr = $imcall; - $dclassname ret = (cPtr is null) ? null : new $dclassname(cPtr, $owner);$excode - return ret; -} - -// Treat references to arrays like references to a single element. -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - - -/* - * Pointer reference conversion typemaps. - */ - -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)$input; - $1 = ($1_ltype)&temp; %} -%typemap(out) SWIGTYPE *const& -%{ $result = (void *)*$1; %} - -%typemap(din) SWIGTYPE *const& "$*dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE *const& { - void* cPtr = $imcall; - $*dclassname ret = (cPtr is null) ? null : new $*dclassname(cPtr, $owner);$excode - return ret; -} -%typemap(directorin) SWIGTYPE *const& - "$input = (void *) $1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = ($*1_ltype)$input; - $result = &swig_temp; %} -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE *const& "($winput is null) ? null : new $*dclassname($winput, false)" -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE *const& "$*dclassname.swigGetCPtr($dcall)" - diff --git a/mac/bin/swig/share/swig/4.1.0/d/dvoid.swg b/mac/bin/swig/share/swig/4.1.0/d/dvoid.swg deleted file mode 100755 index 805f1e71..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/dvoid.swg +++ /dev/null @@ -1,18 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dvoid.swg - * - * Typemaps for handling void function return types and empty parameter lists. - * ----------------------------------------------------------------------------- */ - -%typemap(ctype) void "void" -%typemap(imtype) void "void" -%typemap(dtype, cprimitive="1") void "void" - -%typemap(out, null="") void "" -%typemap(ddirectorin) void "$winput" -%typemap(ddirectorout) void "$dcall" -%typemap(directorin) void "" - -%typemap(dout, excode=SWIGEXCODE) void { - $imcall;$excode -} diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/d/std_auto_ptr.i deleted file mode 100755 index 500b6115..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_auto_ptr.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap (ctype) std::auto_ptr< TYPE > "void *" -%typemap (imtype) std::auto_ptr< TYPE > "void*" -%typemap (dtype) std::auto_ptr< TYPE > "$typemap(dtype, TYPE)" - -%typemap(in) std::auto_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(din, - nativepointer="cast(void*)$dinput" -) std::auto_ptr< TYPE > "$typemap(dtype, TYPE).swigRelease($dinput)" - -%typemap (out) std::auto_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}" -) std::auto_ptr< TYPE > { - void* cPtr = $imcall; - $typemap(dtype, TYPE) ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_common.i b/mac/bin/swig/share/swig/4.1.0/d/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_deque.i b/mac/bin/swig/share/swig/4.1.0/d/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_except.i b/mac/bin/swig/share/swig/4.1.0/d/std_except.i deleted file mode 100755 index fbfd6c33..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_except.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. These typemaps are - * used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws, canthrow=1) std::bad_cast "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::bad_exception "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::domain_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::exception "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::invalid_argument "SWIG_DSetPendingException(SWIG_DIllegalArgumentException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::length_error "SWIG_DSetPendingException(SWIG_DNoSuchElementException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::logic_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::out_of_range "SWIG_DSetPendingException(SWIG_DNoSuchElementException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::overflow_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::range_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::runtime_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::underflow_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" - diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_map.i b/mac/bin/swig/share/swig/4.1.0/d/std_map.i deleted file mode 100755 index c5e03d06..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_map.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -namespace std { - template > class map { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; -} diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_pair.i b/mac/bin/swig/share/swig/4.1.0/d/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/d/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_string.i b/mac/bin/swig/share/swig/4.1.0/d/std_string.i deleted file mode 100755 index 8d75d23e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_string.i +++ /dev/null @@ -1,98 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a D char[] and are passed around by value. - * - * To use non-const std::string references, use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -%define SWIGD_STD_STRING_TYPEMAPS(DW_STRING_TYPE, DP_STRING_TYPE, FROM_STRINGZ, TO_STRINGZ) -// string -%typemap(ctype) string, const string & "char *" -%typemap(imtype) string, const string & #DW_STRING_TYPE -%typemap(dtype) string, const string & #DP_STRING_TYPE - -%typemap(in, canthrow=1) string, const string & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - $1.assign($input); %} -%typemap(in, canthrow=1) const string & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - $*1_ltype $1_str($input); - $1 = &$1_str; %} - -%typemap(out) string %{ $result = SWIG_d_string_callback($1.c_str()); %} -%typemap(out) const string & %{ $result = SWIG_d_string_callback($1->c_str()); %} - -%typemap(din) string, const string & "($dinput ? TO_STRINGZ($dinput) : null)" -%typemap(dout, excode=SWIGEXCODE) string, const string & { - DP_STRING_TYPE ret = FROM_STRINGZ($imcall);$excode - return ret; -} - -%typemap(directorin) string, const string & %{ $input = SWIG_d_string_callback($1.c_str()); %} - -%typemap(directorout, canthrow=1) string -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - $result.assign($input); %} - -%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - /* possible thread/reentrant code problem */ - static $*1_ltype $1_str; - $1_str = $input; - $result = &$1_str; %} - -%typemap(ddirectorin) string, const string & "FROM_STRINGZ($winput)" -%typemap(ddirectorout) string, const string & "TO_STRINGZ($dcall)" - -%typemap(throws, canthrow=1) string, const string & -%{ SWIG_DSetPendingException(SWIG_DException, $1.c_str()); - return $null; %} - -%typemap(typecheck) string, const string & = char *; -%enddef - -// We need to have the \0-terminated string conversion functions available in -// the D proxy modules. -#if (SWIG_D_VERSION == 1) -// Could be easily extended to support Phobos as well. -SWIGD_STD_STRING_TYPEMAPS(char*, char[], tango.stdc.stringz.fromStringz, tango.stdc.stringz.toStringz) - -%pragma(d) globalproxyimports = "static import tango.stdc.stringz;"; -#else -SWIGD_STD_STRING_TYPEMAPS(const(char)*, string, std.conv.to!string, std.string.toStringz) - -%pragma(d) globalproxyimports = %{ -static import std.conv; -static import std.string; -%} -#endif - -#undef SWIGD_STD_STRING_TYPEMAPS - -} // namespace std diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/d/std_unique_ptr.i deleted file mode 100755 index 9317a7e0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_unique_ptr.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap (ctype) std::unique_ptr< TYPE > "void *" -%typemap (imtype) std::unique_ptr< TYPE > "void*" -%typemap (dtype) std::unique_ptr< TYPE > "$typemap(dtype, TYPE)" - -%typemap(in) std::unique_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(din, - nativepointer="cast(void*)$dinput" -) std::unique_ptr< TYPE > "$typemap(dtype, TYPE).swigRelease($dinput)" - -%typemap (out) std::unique_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}" -) std::unique_ptr< TYPE > { - void* cPtr = $imcall; - $typemap(dtype, TYPE) ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/d/std_vector.i b/mac/bin/swig/share/swig/4.1.0/d/std_vector.i deleted file mode 100755 index fb8f7d2e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/std_vector.i +++ /dev/null @@ -1,605 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector, D implementation. - * - * The D wrapper is made to loosely resemble a tango.util.container.more.Vector - * and to provide built-in array-like access. - * - * If T does define an operator==, then use the SWIG_STD_VECTOR_ENHANCED - * macro to obtain enhanced functionality (none yet), for example: - * - * SWIG_STD_VECTOR_ENHANCED(SomeNamespace::Klass) - * %template(VectKlass) std::vector; - * - * Warning: heavy macro usage in this file. Use swig -E to get a sane view on - * the real file contents! - * ----------------------------------------------------------------------------- */ - -// Warning: Use the typemaps here in the expectation that the macros they are in will change name. - -%include - -// MACRO for use within the std::vector class body -%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CONST_REFERENCE, CTYPE...) -#if (SWIG_D_VERSION == 1) -%typemap(dimports) std::vector< CTYPE > "static import tango.core.Exception;" -%proxycode %{ -public this($typemap(dtype, CTYPE)[] values) { - this(); - append(values); -} - -alias push_back add; -alias push_back push; -alias push_back opCatAssign; -alias size length; -alias opSlice slice; - -public $typemap(dtype, CTYPE) opIndexAssign($typemap(dtype, CTYPE) value, size_t index) { - if (index >= size()) { - throw new tango.core.Exception.NoSuchElementException("Tried to assign to element out of vector bounds."); - } - setElement(index, value); - return value; -} - -public $typemap(dtype, CTYPE) opIndex(size_t index) { - if (index >= size()) { - throw new tango.core.Exception.NoSuchElementException("Tried to read from element out of vector bounds."); - } - return getElement(index); -} - -public void append($typemap(dtype, CTYPE)[] value...) { - foreach (v; value) { - add(v); - } -} - -public $typemap(dtype, CTYPE)[] opSlice() { - $typemap(dtype, CTYPE)[] array = new $typemap(dtype, CTYPE)[size()]; - foreach (i, ref value; array) { - value = getElement(i); - } - return array; -} - -public int opApply(int delegate(ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - result = dg(value); - setElement(i, value); - } - return result; -} - -public int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - - // Workaround for http://d.puremagic.com/issues/show_bug.cgi?id=2443. - auto index = i; - - result = dg(index, value); - setElement(i, value); - } - return result; -} - -public void capacity(size_t value) { - if (value < size()) { - throw new tango.core.Exception.IllegalArgumentException("Tried to make the capacity of a vector smaller than its size."); - } - - reserve(value); -} -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - void clear(); - void push_back(CTYPE const& x); - size_type size() const; - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - - vector(); - vector(const vector &other); - - %extend { - vector(size_type capacity) throw (std::length_error) { - std::vector< CTYPE >* pv = 0; - pv = new std::vector< CTYPE >(); - - // Might throw std::length_error. - pv->reserve(capacity); - - return pv; - } - - size_type unused() const { - return $self->capacity() - $self->size(); - } - - const_reference remove() throw (std::out_of_range) { - if ($self->empty()) { - throw std::out_of_range("Tried to remove last element from empty vector."); - } - - std::vector< CTYPE >::const_reference value = $self->back(); - $self->pop_back(); - return value; - } - - const_reference remove(size_type index) throw (std::out_of_range) { - if (index >= $self->size()) { - throw std::out_of_range("Tried to remove element with invalid index."); - } - - std::vector< CTYPE >::iterator it = $self->begin() + index; - std::vector< CTYPE >::const_reference value = *it; - $self->erase(it); - return value; - } - } - - // Wrappers for setting/getting items with the possibly thrown exception - // specified (important for SWIG wrapper generation). - %extend { - const_reference getElement(size_type index) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to get value of element with invalid index."); - } - return (*$self)[index]; - } - } - - // Use CTYPE const& instead of const_reference to work around SWIG code - // generation issue when using const pointers as vector elements (like - // std::vector< const int* >). - %extend { - void setElement(size_type index, CTYPE const& val) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to set value of element with invalid index."); - } - (*$self)[index] = val; - } - } - -%dmethodmodifiers std::vector::getElement "private" -%dmethodmodifiers std::vector::setElement "private" -%dmethodmodifiers std::vector::reserve "private" - -#else - -%typemap(dimports) std::vector< CTYPE > %{ -static import std.algorithm; -static import std.exception; -static import std.range; -static import std.traits; -%} -%proxycode %{ -alias size_t KeyType; -alias $typemap(dtype, CTYPE) ValueType; - -this(ValueType[] values...) { - this(); - reserve(values.length); - foreach (e; values) { - this ~= e; - } -} - -struct Range { - private $typemap(dtype, std::vector< CTYPE >) _outer; - private size_t _a, _b; - - this($typemap(dtype, std::vector< CTYPE >) data, size_t a, size_t b) { - _outer = data; - _a = a; - _b = b; - } - - @property bool empty() const { - assert((cast($typemap(dtype, std::vector< CTYPE >))_outer).length >= _b); - return _a >= _b; - } - - @property Range save() { - return this; - } - - @property ValueType front() { - std.exception.enforce(!empty); - return _outer[_a]; - } - - @property void front(ValueType value) { - std.exception.enforce(!empty); - _outer[_a] = std.algorithm.move(value); - } - - void popFront() { - std.exception.enforce(!empty); - ++_a; - } - - void opIndexAssign(ValueType value, size_t i) { - i += _a; - std.exception.enforce(i < _b && _b <= _outer.length); - _outer[i] = value; - } - - void opIndexOpAssign(string op)(ValueType value, size_t i) { - std.exception.enforce(_outer && _a + i < _b && _b <= _outer.length); - auto element = _outer[i]; - mixin("element "~op~"= value;"); - _outer[i] = element; - } -} - -// TODO: dup? - -Range opSlice() { - return Range(this, 0, length); -} - -Range opSlice(size_t a, size_t b) { - std.exception.enforce(a <= b && b <= length); - return Range(this, a, b); -} - -size_t opDollar() const { - return length; -} - -@property ValueType front() { - std.exception.enforce(!empty); - return getElement(0); -} - -@property void front(ValueType value) { - std.exception.enforce(!empty); - setElement(0, value); -} - -@property ValueType back() { - std.exception.enforce(!empty); - return getElement(length - 1); -} - -@property void back(ValueType value) { - std.exception.enforce(!empty); - setElement(length - 1, value); -} - -ValueType opIndex(size_t i) { - return getElement(i); -} - -void opIndexAssign(ValueType value, size_t i) { - setElement(i, value); -} - -void opIndexOpAssign(string op)(ValueType value, size_t i) { - auto element = this[i]; - mixin("element "~op~"= value;"); - this[i] = element; -} - -ValueType[] opBinary(string op, Stuff)(Stuff stuff) if (op == "~") { - ValueType[] result; - result ~= this[]; - assert(result.length == length); - result ~= stuff[]; - return result; -} - -void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~") { - static if (is(typeof(insertBack(stuff)))) { - insertBack(stuff); - } else if (is(typeof(insertBack(stuff[])))) { - insertBack(stuff[]); - } else { - static assert(false, "Cannot append " ~ Stuff.stringof ~ " to " ~ typeof(this).stringof); - } -} - -alias size length; - -alias remove removeAny; -alias removeAny stableRemoveAny; - -size_t insertBack(Stuff)(Stuff stuff) -if (std.traits.isImplicitlyConvertible!(Stuff, ValueType)){ - push_back(stuff); - return 1; -} -size_t insertBack(Stuff)(Stuff stuff) -if (std.range.isInputRange!Stuff && - std.traits.isImplicitlyConvertible!(std.range.ElementType!Stuff, ValueType)) { - size_t itemCount; - foreach(item; stuff) { - insertBack(item); - ++itemCount; - } - return itemCount; -} -alias insertBack insert; - -alias pop_back removeBack; -alias pop_back stableRemoveBack; - -size_t insertBefore(Stuff)(Range r, Stuff stuff) -if (std.traits.isImplicitlyConvertible!(Stuff, ValueType)) { - std.exception.enforce(r._outer.swigCPtr == swigCPtr && r._a < length); - insertAt(r._a, stuff); - return 1; -} - -size_t insertBefore(Stuff)(Range r, Stuff stuff) -if (std.range.isInputRange!Stuff && std.traits.isImplicitlyConvertible!(ElementType!Stuff, ValueType)) { - std.exception.enforce(r._outer.swigCPtr == swigCPtr && r._a <= length); - - size_t insertCount; - foreach(i, item; stuff) { - insertAt(r._a + i, item); - ++insertCount; - } - - return insertCount; -} - -size_t insertAfter(Stuff)(Range r, Stuff stuff) { - // TODO: optimize - immutable offset = r._a + r.length; - std.exception.enforce(offset <= length); - auto result = insertBack(stuff); - std.algorithm.bringToFront(this[offset .. length - result], - this[length - result .. length]); - return result; -} - -size_t replace(Stuff)(Range r, Stuff stuff) -if (std.range.isInputRange!Stuff && - std.traits.isImplicitlyConvertible!(ElementType!Stuff, ValueType)) { - immutable offset = r._a; - std.exception.enforce(offset <= length); - size_t result; - for (; !stuff.empty; stuff.popFront()) { - if (r.empty) { - // append the rest - return result + insertBack(stuff); - } - r.front = stuff.front; - r.popFront(); - ++result; - } - // Remove remaining stuff in r - remove(r); - return result; -} - -size_t replace(Stuff)(Range r, Stuff stuff) -if (std.traits.isImplicitlyConvertible!(Stuff, ValueType)) -{ - if (r.empty) - { - insertBefore(r, stuff); - } - else - { - r.front = stuff; - r.popFront(); - remove(r); - } - return 1; -} - -Range linearRemove(Range r) { - std.exception.enforce(r._a <= r._b && r._b <= length); - immutable tailLength = length - r._b; - linearRemove(r._a, r._b); - return this[length - tailLength .. length]; -} -alias remove stableLinearRemove; - -int opApply(int delegate(ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - result = dg(value); - setElement(i, value); - } - return result; -} - -int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - - // Workaround for http://d.puremagic.com/issues/show_bug.cgi?id=2443. - auto index = i; - - result = dg(index, value); - setElement(i, value); - } - return result; -} -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - bool empty() const; - void clear(); - void push_back(CTYPE const& x); - void pop_back(); - size_type size() const; - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - - vector(); - vector(const vector &other); - - %extend { - vector(size_type capacity) throw (std::length_error) { - std::vector< CTYPE >* pv = 0; - pv = new std::vector< CTYPE >(); - - // Might throw std::length_error. - pv->reserve(capacity); - - return pv; - } - - const_reference remove() throw (std::out_of_range) { - if ($self->empty()) { - throw std::out_of_range("Tried to remove last element from empty vector."); - } - - std::vector< CTYPE >::const_reference value = $self->back(); - $self->pop_back(); - return value; - } - - const_reference remove(size_type index) throw (std::out_of_range) { - if (index >= $self->size()) { - throw std::out_of_range("Tried to remove element with invalid index."); - } - - std::vector< CTYPE >::iterator it = $self->begin() + index; - std::vector< CTYPE >::const_reference value = *it; - $self->erase(it); - return value; - } - - void removeBack(size_type how_many) throw (std::out_of_range) { - std::vector< CTYPE >::iterator end = $self->end(); - std::vector< CTYPE >::iterator start = end - how_many; - $self->erase(start, end); - } - - void linearRemove(size_type start_index, size_type end_index) throw (std::out_of_range) { - std::vector< CTYPE >::iterator start = $self->begin() + start_index; - std::vector< CTYPE >::iterator end = $self->begin() + end_index; - $self->erase(start, end); - } - - void insertAt(size_type index, CTYPE const& x) throw (std::out_of_range) { - std::vector< CTYPE >::iterator it = $self->begin() + index; - $self->insert(it, x); - } - } - - // Wrappers for setting/getting items with the possibly thrown exception - // specified (important for SWIG wrapper generation). - %extend { - const_reference getElement(size_type index) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to get value of element with invalid index."); - } - return (*$self)[index]; - } - } - // Use CTYPE const& instead of const_reference to work around SWIG code - // generation issue when using const pointers as vector elements (like - // std::vector< const int* >). - %extend { - void setElement(size_type index, CTYPE const& val) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to set value of element with invalid index."); - } - (*$self)[index] = val; - } - } - -%dmethodmodifiers std::vector::getElement "private" -%dmethodmodifiers std::vector::setElement "private" -#endif -%enddef - -// Extra methods added to the collection class if operator== is defined for the class being wrapped -// The class will then implement IList<>, which adds extra functionality -%define SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE...) - %extend { - } -%enddef - -// For vararg handling in macros, from swigmacros.swg -#define %arg(X...) X - -// Macros for std::vector class specializations/enhancements -%define SWIG_STD_VECTOR_ENHANCED(CTYPE...) -namespace std { - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, %arg(CTYPE)) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE) - }; -} -%enddef - -%{ -#include -#include -%} - -namespace std { - // primary (unspecialized) class template for std::vector - // does not require operator== to be defined - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T) - }; - // specializations for pointers - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T *) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *) - }; - // bool is a bit different in the C++ standard - const_reference in particular - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(bool, bool) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(bool) - }; -} - -// template specializations for std::vector -// these provide extra collections methods as operator== is defined -SWIG_STD_VECTOR_ENHANCED(char) -SWIG_STD_VECTOR_ENHANCED(signed char) -SWIG_STD_VECTOR_ENHANCED(unsigned char) -SWIG_STD_VECTOR_ENHANCED(short) -SWIG_STD_VECTOR_ENHANCED(unsigned short) -SWIG_STD_VECTOR_ENHANCED(int) -SWIG_STD_VECTOR_ENHANCED(unsigned int) -SWIG_STD_VECTOR_ENHANCED(long) -SWIG_STD_VECTOR_ENHANCED(unsigned long) -SWIG_STD_VECTOR_ENHANCED(long long) -SWIG_STD_VECTOR_ENHANCED(unsigned long long) -SWIG_STD_VECTOR_ENHANCED(float) -SWIG_STD_VECTOR_ENHANCED(double) -SWIG_STD_VECTOR_ENHANCED(std::string) // also requires a %include diff --git a/mac/bin/swig/share/swig/4.1.0/d/stl.i b/mac/bin/swig/share/swig/4.1.0/d/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/d/swigmove.i b/mac/bin/swig/share/swig/4.1.0/d/swigmove.i deleted file mode 100755 index e2eb8340..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/swigmove.i +++ /dev/null @@ -1,16 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, canthrow=1) SWIGTYPE MOVE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - SwigValueWrapper< $1_ltype >::reset($1, argp); %} - -%typemap(din) SWIGTYPE MOVE "$dclassname.swigRelease($dinput)" diff --git a/mac/bin/swig/share/swig/4.1.0/d/typemaps.i b/mac/bin/swig/share/swig/4.1.0/d/typemaps.i deleted file mode 100755 index 4f1b5997..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/typemaps.i +++ /dev/null @@ -1,261 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps are used for pointer/reference parameters that are input only -and are mapped to a D input parameter. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In D you could then use it like this: - double answer = fadd(10.0, 20.0); -*/ - -%define INPUT_TYPEMAP(TYPE, CTYPE, DTYPE) -%typemap(ctype, out="void *") TYPE *INPUT, TYPE &INPUT "CTYPE" -%typemap(imtype, out="void*") TYPE *INPUT, TYPE &INPUT "DTYPE" -%typemap(dtype, out="DTYPE*") TYPE *INPUT, TYPE &INPUT "DTYPE" -%typemap(din) TYPE *INPUT, TYPE &INPUT "$dinput" - -%typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(typecheck) TYPE *INPUT = TYPE; -%typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, unsigned int, bool) -//INPUT_TYPEMAP(char, char, char) // Why was this commented out? -INPUT_TYPEMAP(signed char, signed char, byte) -INPUT_TYPEMAP(unsigned char, unsigned char, ubyte) -INPUT_TYPEMAP(short, short, short) -INPUT_TYPEMAP(unsigned short, unsigned short, ushort) -INPUT_TYPEMAP(int, int, int) -INPUT_TYPEMAP(unsigned int, unsigned int, uint) -INPUT_TYPEMAP(long, long, SWIG_LONG_DTYPE) -INPUT_TYPEMAP(unsigned long, unsigned long, SWIG_ULONG_DTYPE) -INPUT_TYPEMAP(long long, long long, long) -INPUT_TYPEMAP(unsigned long long, unsigned long long, ulong) -INPUT_TYPEMAP(float, float, float) -INPUT_TYPEMAP(double, double, double) - -INPUT_TYPEMAP(enum SWIGTYPE, unsigned int, int) -%typemap(dtype) enum SWIGTYPE *INPUT, enum SWIGTYPE &INPUT "$*dclassname" - -#undef INPUT_TYPEMAP - - -/* -OUTPUT typemaps ---------------- - -These typemaps are used for pointer/reference parameters that are output only and -are mapped to a D output parameter. - -The following typemaps can be applied to turn a pointer or reference into an -"output" value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In D, the 'out' keyword is -used when passing the parameter to a function that takes an output parameter. - - bool *OUTPUT, bool &OUTPUT - signed char *OUTPUT, signed char &OUTPUT - unsigned char *OUTPUT, unsigned char &OUTPUT - short *OUTPUT, short &OUTPUT - unsigned short *OUTPUT, unsigned short &OUTPUT - int *OUTPUT, int &OUTPUT - unsigned int *OUTPUT, unsigned int &OUTPUT - long *OUTPUT, long &OUTPUT - unsigned long *OUTPUT, unsigned long &OUTPUT - long long *OUTPUT, long long &OUTPUT - unsigned long long *OUTPUT, unsigned long long &OUTPUT - float *OUTPUT, float &OUTPUT - double *OUTPUT, double &OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters): - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The D output of the function would be the function return value and the -value returned in the second output parameter. In D you would use it like this: - - double dptr; - double fraction = modf(5, dptr); -*/ - -%define OUTPUT_TYPEMAP(TYPE, CTYPE, DTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *OUTPUT, TYPE &OUTPUT "CTYPE *" -%typemap(imtype, out="void*") TYPE *OUTPUT, TYPE &OUTPUT "out DTYPE" -%typemap(dtype, out="DTYPE*") TYPE *OUTPUT, TYPE &OUTPUT "out DTYPE" -%typemap(din) TYPE *OUTPUT, TYPE &OUTPUT "$dinput" - -%typemap(in) TYPE *OUTPUT, TYPE &OUTPUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *OUTPUT, TYPE &OUTPUT "" -%enddef - -OUTPUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//OUTPUT_TYPEMAP(char, char, char, CHAR_PTR) // Why was this commented out? -OUTPUT_TYPEMAP(signed char, signed char, byte, INT8_PTR) -OUTPUT_TYPEMAP(unsigned char, unsigned char, ubyte, UINT8_PTR) -OUTPUT_TYPEMAP(short, short, short, INT16_PTR) -OUTPUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -OUTPUT_TYPEMAP(int, int, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long, long, SWIG_LONG_DTYPE,INT32_PTR) -OUTPUT_TYPEMAP(unsigned long, unsigned long, SWIG_ULONG_DTYPE,UINT32_PTR) -OUTPUT_TYPEMAP(long long, long long, long, INT64_PTR) -OUTPUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -OUTPUT_TYPEMAP(float, float, float, FLOAT_PTR) -OUTPUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -OUTPUT_TYPEMAP(enum SWIGTYPE, unsigned int, int, INT32_PTR) -%typemap(dtype) enum SWIGTYPE *OUTPUT, enum SWIGTYPE &OUTPUT "out $*dclassname" - -#undef OUTPUT_TYPEMAP - -%typemap(in) bool *OUTPUT, bool &OUTPUT -%{ *$input = 0; - $1 = ($1_ltype)$input; %} - - -/* -INOUT typemaps --------------- - -These typemaps are for pointer/reference parameters that are both input and -output and are mapped to a D reference parameter. - -The following typemaps can be applied to turn a pointer or reference into a -reference parameters, that is the parameter is both an input and an output. -In D, the 'ref' keyword is used for reference parameters. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -The D output of the function would be the new value returned by the -reference parameter. In D you would use it like this: - - - double x = 5.0; - neg(x); - -The implementation of the OUTPUT and INOUT typemaps is different to the scripting -languages in that the scripting languages will return the output value as part -of the function return value. -*/ - -%define INOUT_TYPEMAP(TYPE, CTYPE, DTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *INOUT, TYPE &INOUT "CTYPE *" -%typemap(imtype, out="void*") TYPE *INOUT, TYPE &INOUT "ref DTYPE" -%typemap(dtype, out="DTYPE*") TYPE *INOUT, TYPE &INOUT "ref DTYPE" -%typemap(din) TYPE *INOUT, TYPE &INOUT "$dinput" - -%typemap(in) TYPE *INOUT, TYPE &INOUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *INOUT, TYPE &INOUT "" -%enddef - -INOUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//INOUT_TYPEMAP(char, char, char, CHAR_PTR) -INOUT_TYPEMAP(signed char, signed char, byte, INT8_PTR) -INOUT_TYPEMAP(unsigned char, unsigned char, ubyte, UINT8_PTR) -INOUT_TYPEMAP(short, short, short, INT16_PTR) -INOUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -INOUT_TYPEMAP(int, int, int, INT32_PTR) -INOUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -INOUT_TYPEMAP(long, long, SWIG_LONG_DTYPE,INT32_PTR) -INOUT_TYPEMAP(unsigned long, unsigned long, SWIG_ULONG_DTYPE,UINT32_PTR) -INOUT_TYPEMAP(long long, long long, long, INT64_PTR) -INOUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -INOUT_TYPEMAP(float, float, float, FLOAT_PTR) -INOUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -INOUT_TYPEMAP(enum SWIGTYPE, unsigned int, int, INT32_PTR) -%typemap(dtype) enum SWIGTYPE *INOUT, enum SWIGTYPE &INOUT "ref $*dclassname" - -#undef INOUT_TYPEMAP diff --git a/mac/bin/swig/share/swig/4.1.0/d/wrapperloader.swg b/mac/bin/swig/share/swig/4.1.0/d/wrapperloader.swg deleted file mode 100755 index 67e03bfc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/d/wrapperloader.swg +++ /dev/null @@ -1,309 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wrapperloader.swg - * - * Support code for dynamically linking the C wrapper library from the D - * wrapper module. - * - * The loading code was adapted from the Derelict project and is used with - * permission from Michael Parker, the original author. - * ----------------------------------------------------------------------------- */ - -%pragma(d) wrapperloadercode = %{ -private { - version(linux) { - version = Nix; - } else version(darwin) { - version = Nix; - } else version(OSX) { - version = Nix; - } else version(FreeBSD) { - version = Nix; - version = freebsd; - } else version(freebsd) { - version = Nix; - } else version(Unix) { - version = Nix; - } else version(Posix) { - version = Nix; - } - - version(Tango) { - static import tango.stdc.string; - static import tango.stdc.stringz; - - version (PhobosCompatibility) { - } else { - alias char[] string; - alias wchar[] wstring; - alias dchar[] dstring; - } - } else { - version(D_Version2) { - static import std.conv; - } else { - static import std.c.string; - } - static import std.string; - } - - version(D_Version2) { - mixin("alias const(char)* CCPTR;"); - } else { - alias char* CCPTR; - } - - CCPTR swigToCString(string str) { - version(Tango) { - return tango.stdc.stringz.toStringz(str); - } else { - return std.string.toStringz(str); - } - } - - string swigToDString(CCPTR cstr) { - version(Tango) { - return tango.stdc.stringz.fromStringz(cstr); - } else { - version(D_Version2) { - mixin("return std.conv.to!string(cstr);"); - } else { - return std.c.string.toString(cstr); - } - } - } -} - -class SwigSwigSharedLibLoadException : Exception { - this(in string[] libNames, in string[] reasons) { - string msg = "Failed to load one or more shared libraries:"; - foreach(i, n; libNames) { - msg ~= "\n\t" ~ n ~ " - "; - if(i < reasons.length) - msg ~= reasons[i]; - else - msg ~= "Unknown"; - } - super(msg); - } -} - -class SwigSymbolLoadException : Exception { - this(string SwigSharedLibName, string symbolName) { - super("Failed to load symbol " ~ symbolName ~ " from shared library " ~ SwigSharedLibName); - _symbolName = symbolName; - } - - string symbolName() { - return _symbolName; - } - -private: - string _symbolName; -} - -private { - version(Nix) { - version(freebsd) { - // the dl* functions are in libc on FreeBSD - } - else { - pragma(lib, "dl"); - } - - version(Tango) { - import tango.sys.Common; - } else version(linux) { - import core.sys.posix.dlfcn; - } else { - extern(C) { - const RTLD_NOW = 2; - - void *dlopen(CCPTR file, int mode); - int dlclose(void* handle); - void *dlsym(void* handle, CCPTR name); - CCPTR dlerror(); - } - } - - alias void* SwigSharedLibHandle; - - SwigSharedLibHandle swigLoadSharedLib(string libName) { - return dlopen(swigToCString(libName), RTLD_NOW); - } - - void swigUnloadSharedLib(SwigSharedLibHandle hlib) { - dlclose(hlib); - } - - void* swigGetSymbol(SwigSharedLibHandle hlib, string symbolName) { - return dlsym(hlib, swigToCString(symbolName)); - } - - string swigGetErrorStr() { - CCPTR err = dlerror(); - if (err is null) { - return "Unknown Error"; - } - return swigToDString(err); - } - } else version(Windows) { - alias ushort WORD; - alias uint DWORD; - alias CCPTR LPCSTR; - alias void* HMODULE; - alias void* HLOCAL; - alias int function() FARPROC; - struct VA_LIST {} - - extern (Windows) { - HMODULE LoadLibraryA(LPCSTR); - FARPROC GetProcAddress(HMODULE, LPCSTR); - void FreeLibrary(HMODULE); - DWORD GetLastError(); - DWORD FormatMessageA(DWORD, in void*, DWORD, DWORD, LPCSTR, DWORD, VA_LIST*); - HLOCAL LocalFree(HLOCAL); - } - - DWORD MAKELANGID(WORD p, WORD s) { - return (((cast(WORD)s) << 10) | cast(WORD)p); - } - - enum { - LANG_NEUTRAL = 0, - SUBLANG_DEFAULT = 1, - FORMAT_MESSAGE_ALLOCATE_BUFFER = 256, - FORMAT_MESSAGE_IGNORE_INSERTS = 512, - FORMAT_MESSAGE_FROM_SYSTEM = 4096 - } - - alias HMODULE SwigSharedLibHandle; - - SwigSharedLibHandle swigLoadSharedLib(string libName) { - return LoadLibraryA(swigToCString(libName)); - } - - void swigUnloadSharedLib(SwigSharedLibHandle hlib) { - FreeLibrary(hlib); - } - - void* swigGetSymbol(SwigSharedLibHandle hlib, string symbolName) { - return GetProcAddress(hlib, swigToCString(symbolName)); - } - - string swigGetErrorStr() { - DWORD errcode = GetLastError(); - - LPCSTR msgBuf; - DWORD i = FormatMessageA( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - null, - errcode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - cast(LPCSTR)&msgBuf, - 0, - null); - - string text = swigToDString(msgBuf); - LocalFree(cast(HLOCAL)msgBuf); - - if (i >= 2) { - i -= 2; - } - return text[0 .. i]; - } - } else { - static assert(0, "Operating system not supported by the wrapper loading code."); - } - - final class SwigSharedLib { - void load(string[] names) { - if (_hlib !is null) return; - - string[] failedLibs; - string[] reasons; - - foreach(n; names) { - _hlib = swigLoadSharedLib(n); - if (_hlib is null) { - failedLibs ~= n; - reasons ~= swigGetErrorStr(); - continue; - } - _name = n; - break; - } - - if (_hlib is null) { - throw new SwigSwigSharedLibLoadException(failedLibs, reasons); - } - } - - void* loadSymbol(string symbolName, bool doThrow = true) { - void* sym = swigGetSymbol(_hlib, symbolName); - if(doThrow && (sym is null)) { - throw new SwigSymbolLoadException(_name, symbolName); - } - return sym; - } - - void unload() { - if(_hlib !is null) { - swigUnloadSharedLib(_hlib); - _hlib = null; - } - } - - private: - string _name; - SwigSharedLibHandle _hlib; - } -} - -static this() { - string[] possibleFileNames; - version (Posix) { - version (OSX) { - possibleFileNames ~= ["lib$wraplibrary.dylib", "lib$wraplibrary.bundle"]; - } - possibleFileNames ~= ["lib$wraplibrary.so"]; - } else version (Windows) { - possibleFileNames ~= ["$wraplibrary.dll", "lib$wraplibrary.so"]; - } else { - static assert(false, "Operating system not supported by the wrapper loading code."); - } - - auto library = new SwigSharedLib; - library.load(possibleFileNames); - - string bindCode(string functionPointer, string symbol) { - return functionPointer ~ " = cast(typeof(" ~ functionPointer ~ - "))library.loadSymbol(`" ~ symbol ~ "`);"; - } - - //#if !defined(SWIG_D_NO_EXCEPTION_HELPER) - mixin(bindCode("swigRegisterExceptionCallbacks$module", "SWIGRegisterExceptionCallbacks_$module")); - //#endif // SWIG_D_NO_EXCEPTION_HELPER - //#if !defined(SWIG_D_NO_STRING_HELPER) - mixin(bindCode("swigRegisterStringCallback$module", "SWIGRegisterStringCallback_$module")); - //#endif // SWIG_D_NO_STRING_HELPER - $wrapperloaderbindcode -} - -//#if !defined(SWIG_D_NO_EXCEPTION_HELPER) -extern(C) void function( - SwigExceptionCallback exceptionCallback, - SwigExceptionCallback illegalArgumentCallback, - SwigExceptionCallback illegalElementCallback, - SwigExceptionCallback ioCallback, - SwigExceptionCallback noSuchElementCallback) swigRegisterExceptionCallbacks$module; -//#endif // SWIG_D_NO_EXCEPTION_HELPER - -//#if !defined(SWIG_D_NO_STRING_HELPER) -extern(C) void function(SwigStringCallback callback) swigRegisterStringCallback$module; -//#endif // SWIG_D_NO_STRING_HELPER -%} - -%pragma(d) wrapperloaderbindcommand = %{ - mixin(bindCode("$function", "$symbol"));%} diff --git a/mac/bin/swig/share/swig/4.1.0/director_common.swg b/mac/bin/swig/share/swig/4.1.0/director_common.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/exception.i b/mac/bin/swig/share/swig/4.1.0/exception.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/go/cdata.i b/mac/bin/swig/share/swig/4.1.0/go/cdata.i deleted file mode 100755 index b4411af9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/cdata.i +++ /dev/null @@ -1,97 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cdata.i - * - * SWIG library file containing macros for manipulating raw C data as strings. - * ----------------------------------------------------------------------------- */ - -%{ -typedef struct SWIGCDATA { - char *data; - intgo len; -} SWIGCDATA; -%} - -%fragment("cdata", "header") %{ -struct swigcdata { - intgo size; - void *data; -}; -%} - -%typemap(gotype) SWIGCDATA "[]byte" - -%typemap(imtype) SWIGCDATA "uint64" - -%typemap(out, fragment="cdata") SWIGCDATA(struct swigcdata *swig_out) %{ - swig_out = (struct swigcdata *)malloc(sizeof(*swig_out)); - if (swig_out) { - swig_out->size = $1.len; - swig_out->data = malloc(swig_out->size); - if (swig_out->data) { - memcpy(swig_out->data, $1.data, swig_out->size); - } - } - $result = *(long long *)(void **)&swig_out; -%} - -%typemap(goout) SWIGCDATA %{ - { - type swigcdata struct { size int; data uintptr } - p := (*swigcdata)(unsafe.Pointer(uintptr($1))) - if p == nil || p.data == 0 { - $result = nil - } else { - b := make([]byte, p.size) - a := (*[0x7fffffff]byte)(unsafe.Pointer(p.data))[:p.size] - copy(b, a) - Swig_free(p.data) - Swig_free(uintptr(unsafe.Pointer(p))) - $result = b - } - } -%} - -/* ----------------------------------------------------------------------------- - * %cdata(TYPE [, NAME]) - * - * Convert raw C data to a binary string. - * ----------------------------------------------------------------------------- */ - -%define %cdata(TYPE,NAME...) - -%insert("header") { -#if #NAME == "" -static SWIGCDATA cdata_##TYPE(TYPE *ptr, int nelements) { -#else -static SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements) { -#endif - SWIGCDATA d; - d.data = (char *) ptr; -#if #TYPE != "void" - d.len = nelements*sizeof(TYPE); -#else - d.len = nelements; -#endif - return d; -} -} - -%typemap(default) int nelements "$1 = 1;" - -#if #NAME == "" -SWIGCDATA cdata_##TYPE(TYPE *ptr, int nelements); -#else -SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements); -#endif -%enddef - -%typemap(default) int nelements; - -%rename(cdata) ::cdata_void(void *ptr, int nelements); - -%cdata(void); - -/* Memory move function. Due to multi-argument typemaps this appears - to be wrapped as - void memmove(void *data, const char *s); */ -void memmove(void *data, char *indata, int inlen); diff --git a/mac/bin/swig/share/swig/4.1.0/go/director.swg b/mac/bin/swig/share/swig/4.1.0/go/director.swg deleted file mode 100755 index 103ba22a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/director.swg +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Go proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#include -#include - -namespace Swig { - - class DirectorException : public std::exception { - }; -} - -/* Handle memory management for directors. */ - -namespace { - struct GCItem { - virtual ~GCItem() {} - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem* operator->() { - return _item; - } - - private: - GCItem *_item; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; -} - -class Swig_memory { -public: - template - void swig_acquire_pointer(Type* vptr) { - if (vptr) { - swig_owner[vptr] = new GCItem_T(vptr); - } - } -private: - typedef std::map swig_ownership_map; - swig_ownership_map swig_owner; -}; - -template -static void swig_acquire_pointer(Swig_memory** pmem, Type* ptr) { - if (!pmem) { - *pmem = new Swig_memory; - } - (*pmem)->swig_acquire_pointer(ptr); -} diff --git a/mac/bin/swig/share/swig/4.1.0/go/exception.i b/mac/bin/swig/share/swig/4.1.0/go/exception.i deleted file mode 100755 index 5abd306a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/exception.i +++ /dev/null @@ -1,7 +0,0 @@ -%typemap(throws,noblock=1) (...) { - SWIG_exception(SWIG_RuntimeError,"unknown exception"); -} - -%insert("runtime") %{ -#define SWIG_exception(code, msg) _swig_gopanic(msg) -%} diff --git a/mac/bin/swig/share/swig/4.1.0/go/go.swg b/mac/bin/swig/share/swig/4.1.0/go/go.swg deleted file mode 100755 index 348ae5f0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/go.swg +++ /dev/null @@ -1,744 +0,0 @@ -/* ------------------------------------------------------------ - * go.swg - * - * Go configuration module. - * ------------------------------------------------------------ */ - -%include - -/* Code insertion directives */ -#define %go_import(...) %insert(go_imports) %{__VA_ARGS__%} - -/* Basic types */ - -%typemap(gotype) bool, const bool & "bool" -%typemap(gotype) char, const char & "byte" -%typemap(gotype) signed char, const signed char & "int8" -%typemap(gotype) unsigned char, const unsigned char & "byte" -%typemap(gotype) short, const short & "int16" -%typemap(gotype) unsigned short, const unsigned short & "uint16" -%typemap(gotype) int, const int & "int" -%typemap(gotype) unsigned int, const unsigned int & "uint" -%typemap(gotype) long, const long & "int64" -%typemap(gotype) unsigned long, const unsigned long & "uint64" -%typemap(gotype) long long, const long long & "int64" -%typemap(gotype) unsigned long long, const unsigned long long & "uint64" -%typemap(gotype) float, const float & "float32" -%typemap(gotype) double, const double & "float64" - -%typemap(in) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $1 = ($1_ltype)$input; %} - -%typemap(in) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ $1 = ($1_ltype)&$input; %} - -%typemap(in) const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = ($1_ltype)&temp; %} - -%typemap(out) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $result = $1; %} - -%typemap(goout) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -"" - -%typemap(out) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ $result = ($*1_ltype)*$1; %} - -%typemap(goout) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -"" - -%typemap(out) void "" - -%typemap(goout) void "" - -%typemap(directorin) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $input = ($1_ltype)$1; %} - -%typemap(godirectorin) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -"" - -%typemap(directorin) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ $input = ($*1_ltype)$1; %} - -%typemap(godirectorin) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -"" - -%typemap(directorout) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $result = ($1_ltype)$input; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ - $result = new $*1_ltype($input); - swig_acquire_pointer(&swig_mem, $result); -%} - -/* The size_t type. */ - -%typemap(gotype) size_t, const size_t & %{int64%} - -%typemap(in) size_t -%{ $1 = (size_t)$input; %} - -%typemap(in) const size_t & -%{ $1 = ($1_ltype)&$input; %} - -%typemap(out) size_t -%{ $result = $1; %} - -%typemap(goout) size_t "" - -%typemap(out) const size_t & -%{ $result = ($*1_ltype)*$1; %} - -%typemap(goout) const size_t & "" - -%typemap(directorin) size_t -%{ $input = (size_t)$1; %} - -%typemap(godirectorin) size_t "" - -%typemap(directorin) const size_t & -%{ $input = ($*1_ltype)$1; %} - -%typemap(godirectorin) const size_t & "" - -%typemap(directorout) size_t -%{ $result = ($1_ltype)$input; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) const size_t & -%{ - $result = new $*1_ltype($input); - swig_acquire_pointer(&swig_mem, $result); -%} - -/* Member pointers. */ - -%typemap(gotype) SWIGTYPE (CLASS::*) -%{$gotypename%} - -%typemap(in) SWIGTYPE (CLASS::*) -%{ $1 = *($&1_ltype)$input; %} - -%typemap(out) SWIGTYPE (CLASS::*) -%{ - struct swig_out_type { intgo size; void* val; } *swig_out; - swig_out = (struct swig_out_type*)malloc(sizeof(*swig_out)); - if (swig_out) { - swig_out->size = sizeof($1_ltype); - swig_out->val = malloc(swig_out->size); - if (swig_out->val) { - *($&1_ltype)(swig_out->val) = $1; - } - } - $result = swig_out; -%} - -%typemap(goout) SWIGTYPE (CLASS::*) -%{ - { - type swig_out_type struct { size int; val uintptr } - p := (*swig_out_type)(unsafe.Pointer($1)) - if p == nil || p.val == 0 { - $result = nil - } else { - m := make([]byte, p.size) - a := (*[1024]byte)(unsafe.Pointer(p.val))[:p.size] - copy(m, a) - Swig_free(p.val) - Swig_free(uintptr(unsafe.Pointer(p))) - $result = &m[0] - } - } -%} - -%typemap(directorin) SWIGTYPE (CLASS::*) -%{ $input = *($&1_ltype)$1; %} - -%typemap(godirectorin) SWIGTYPE (CLASS::*) "" - -%typemap(directorout) SWIGTYPE (CLASS::*) -%{ - $result = new $1_ltype($input); - swig_acquire_pointer(&swig_mem, $result); -%} - -/* Pointers. */ - -/* We can't translate pointers using a typemap, so that is handled in - the C++ code. */ -%typemap(gotype) SWIGTYPE * -%{$gotypename%} - -%typemap(in) SWIGTYPE * -%{ $1 = *($&1_ltype)&$input; %} - -%typemap(out) SWIGTYPE * -%{ *($&1_ltype)&$result = ($1_ltype)$1; %} - -%typemap(goout) SWIGTYPE * "" - -%typemap(directorin) SWIGTYPE * -%{ *($&1_ltype)&$input = ($1_ltype)$1; %} - -%typemap(godirectorin) SWIGTYPE * "" - -%typemap(directorout) SWIGTYPE * -%{ $result = *($&1_ltype)&$input; %} - -/* Pointer references. */ - -%typemap(gotype) SWIGTYPE *const& -%{$gotypename%} - -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ - temp = *($1_ltype)&$input; - $1 = ($1_ltype)&temp; -%} - -%typemap(out) SWIGTYPE *const& -%{ *($1_ltype)&$result = *$1; %} - -%typemap(goout) SWIGTYPE *const& "" - -/* References. */ - -/* Converting a C++ reference to Go has to be handled in the C++ - code. */ -%typemap(gotype) SWIGTYPE & -%{$gotypename%} - -%typemap(in) SWIGTYPE & -%{ $1 = *($&1_ltype)&$input; %} - -%typemap(out) SWIGTYPE & -%{ *($&1_ltype)&$result = $1; %} - -%typemap(goout) SWIGTYPE & "" - -%typemap(directorin) SWIGTYPE & -%{ $input = ($1_ltype)&$1; %} - -%typemap(godirectorin) SWIGTYPE & "" - -%typemap(directorout) SWIGTYPE & -%{ *($&1_ltype)&$result = $input; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = *($1_ltype)&$input; - $result = &swig_temp; %} - -%typemap(gotype) SWIGTYPE && -%{$gotypename%} - -%typemap(in, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) -%{ $1 = *($&1_ltype)&$input; -rvrdeleter.reset($1); %} - -%typemap(out) SWIGTYPE && -%{ *($&1_ltype)&$result = $1; %} - -%typemap(goout) SWIGTYPE && "" - -%typemap(directorin) SWIGTYPE && -%{ $input = ($1_ltype)&$1_name; %} - -%typemap(godirectorin) SWIGTYPE && "" - -%typemap(directorout) SWIGTYPE && -%{ *($&1_ltype)&$result = $input; %} - -/* C arrays turn into Go pointers. If we know the length we can use a - slice. */ - -%typemap(gotype) SWIGTYPE [] -%{$gotypename%} - -%typemap(in) SWIGTYPE [] -%{ $1 = *($&1_ltype)&$input; %} - -%typemap(out) SWIGTYPE [] -%{ *($&1_ltype)&$result = $1; %} - -%typemap(goout) SWIGTYPE [] "" - -%typemap(directorin) SWIGTYPE [] -%{ $input = *($1_ltype)&$1; %} - -%typemap(godirectorin) SWIGTYPE [] "" - -%typemap(directorout) SWIGTYPE [] -%{ *($&1_ltype)&$result = $input; %} - -/* Strings. */ - -%typemap(gotype) - char *, char *&, char[ANY], char[] "string" - -/* Needed to avoid confusion with the way the go module handles - references. */ -%typemap(gotype) char&, unsigned char& "*byte" -%typemap(gotype) signed char& "*int8" - -%typemap(in) - char *, char[ANY], char[] -%{ - $1 = ($1_ltype)malloc($input.n + 1); - memcpy($1, $input.p, $input.n); - $1[$input.n] = '\0'; -%} - -%typemap(in) char *& (char *temp) -%{ - temp = (char *)malloc($input.n + 1); - memcpy(temp, $input.p, $input.n); - temp[$input.n] = '\0'; - $1 = ($1_ltype)&temp; -%} - -%typemap(freearg) - char *, char[ANY], char[] -%{ free($1); %} - -%typemap(freearg) char *& -%{ free(temp$argnum); %} - -%typemap(out,fragment="AllocateString") - char *, char *&, char[ANY], char[] -%{ $result = Swig_AllocateString((char*)$1, $1 ? strlen((char*)$1) : 0); %} - -%typemap(goout,fragment="CopyString") - char *, char *&, char[ANY], char[] -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") - char *, char *&, char[ANY], char[] -%{ - $input = Swig_AllocateString((char*)$1, $1 ? strlen((char*)$1) : 0); -%} - -%typemap(godirectorin,fragment="CopyString") - char *, char *&, char[ANY], char[] -%{ - $result = swigCopyString($input) -%} - -%typemap(godirectorout) - char *, char *&, char[ANY], char[] -%{ - { - p := Swig_malloc(len($input) + 1) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len($input) + 1] - copy(s, $input) - s[len($input)] = 0 - $result = *(*string)(unsafe.Pointer(&s)) - } -%} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) - char *, char *&, char[ANY], char[] -%{ $result = ($1_ltype)$input.p; %} - -/* String & length */ - -%typemap(gotype) (char *STRING, size_t LENGTH) "string" - -%typemap(in) (char *STRING, size_t LENGTH) -%{ - $1 = ($1_ltype)$input.p; - $2 = ($2_ltype)$input.n; -%} - -%typemap(out,fragment="AllocateString") (char *STRING, size_t LENGTH) -%{ $result = Swig_AllocateString((char*)$1, (size_t)$2); %} - -%typemap(goout,fragment="CopyString") (char *STRING, size_t LENGTH) -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") (char *STRING, size_t LENGTH) -%{ $input = Swig_AllocateString((char*)$1, $2); %} - -%typemap(godirectorin,fragment="CopyString") (char *STRING, size_t LENGTH) -%{ $result = swigCopyString($input) %} - -%typemap(directorout) (char *STRING, size_t LENGTH) -%{ - $1 = ($1_ltype)$input.p; - $2 = ($2_ltype)$input.n; -%} - -/* The int & type needs to convert to intgo. */ - -%typemap(gotype) int & "*int" - -%typemap(in) int & (int e) -%{ - e = (int)*$input; - $1 = &e; -%} - -%typemap(out) int & -%{ $result = new intgo(*$1); %} - -%typemap(argout) int & -%{ *$input = (intgo)e$argnum; %} - -%typemap(goout) int & "" - -%typemap(directorin) int & (intgo e) -%{ - e = (intgo)$1; - $input = &e; -%} - -%typemap(godirectorin) int & "" - -%typemap(directorout) int & -%{ - $*1_ltype f = ($*1_ltype)*$input; - $result = ($1_ltype)&f; -%} - -%typemap(directorargout) int & -%{ $1 = (int)*$input; %} - -%typemap(argout) const int & "" -%typemap(directorargout) const int & "" - -/* Enums. We can't do the right thing for enums in typemap(gotype) so - we deliberately don't define them. The right thing would be to - capitalize the name. This is instead done in go.cxx. */ - -%typemap(gotype) enum SWIGTYPE -%{$gotypename%} - -%typemap(in) enum SWIGTYPE -%{ $1 = ($1_ltype)$input; %} - -%typemap(out) enum SWIGTYPE -%{ $result = (intgo)$1; %} - -%typemap(goout) enum SWIGTYPE "" - -%typemap(directorin) enum SWIGTYPE -%{ $input = (intgo)$1; %} - -%typemap(godirectorin) enum SWIGTYPE "" - -%typemap(directorout) enum SWIGTYPE -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin) enum SWIGTYPE & (intgo e) -%{ - e = (intgo)$1; - $input = ($1_ltype)&e; -%} - -%typemap(godirectorin) enum SWIGTYPE & "" - -%typemap(directorout) enum SWIGTYPE & -%{ $result = $input; %} - -/* Arbitrary type. This is a type passed by value in the C/C++ code. - We convert it to a pointer for the Go code. Note that all basic - types are explicitly handled above. */ - -%typemap(gotype) SWIGTYPE -%{$gotypename%} - -%typemap(in) SWIGTYPE ($&1_type argp) -%{ - argp = ($&1_ltype)$input; - if (argp == NULL) { - _swig_gopanic("Attempt to dereference null $1_type"); - } - $1 = ($1_ltype)*argp; -%} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ *($&1_ltype*)&$result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype)malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - *($&1_ltype*)&$result = $1ptr; -} -#endif - -%typemap(goout) SWIGTYPE "" - -%typemap(directorin) SWIGTYPE -%{ $input = new $1_ltype(SWIG_STD_MOVE($1)); %} - -%typemap(godirectorin) SWIGTYPE "" - -%typemap(directorout) SWIGTYPE -%{ $result = *($&1_ltype)$input; %} - -/* Exception handling */ - -%typemap(throws) char * -%{ _swig_gopanic($1); %} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] -%{ - (void)$1; - _swig_gopanic("C++ $1_type exception thrown"); -%} - -/* Typecheck typemaps. The purpose of these is merely to issue a - warning for overloaded C++ functions that cannot be overloaded in - Go as more than one C++ type maps to a single Go type. */ - -%typecheck(SWIG_TYPECHECK_BOOL) /* Go bool */ - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) /* Go byte */ - char, - const char &, - unsigned char, - const unsigned char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) /* Go int8 */ - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Go int16 */ - short, - const short & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Go uint16 */ - unsigned short, - const unsigned short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Go int */ - int, - const int & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Go uint */ - unsigned int, - const unsigned int & - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Go int64 */ - long, - const long &, - long long, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Go uint64 */ - unsigned long, - const unsigned long &, - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) /* Go float32 */ - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) /* Go float64 */ - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) /* Go string */ - char *, - char *&, - char[ANY], - char [], - signed char *, - signed char *&, - signed char[ANY], - signed char [], - unsigned char *, - unsigned char *&, - unsigned char[ANY], - unsigned char [] - "" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE *const&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* Go keywords. */ -%include - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/go/gokw.swg b/mac/bin/swig/share/swig/4.1.0/go/gokw.swg deleted file mode 100755 index 35428300..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/gokw.swg +++ /dev/null @@ -1,33 +0,0 @@ -/* Rename keywords. */ - -#define GOKW(x) %keywordwarn("'" `x` "' is a Go keyword",rename="X%s") `x` -#define GOBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in Go") "::"`x` - -GOKW(break); -GOKW(case); -GOKW(chan); -GOKW(const); -GOKW(continue); -GOKW(default); -GOKW(defer); -GOKW(else); -GOKW(fallthrough); -GOKW(for); -GOKW(func); -GOKW(go); -GOKW(goto); -GOKW(if); -GOKW(import); -GOKW(interface); -GOKW(package); -GOKW(range); -GOKW(return); -GOKW(select); -GOKW(struct); -GOKW(switch); -GOKW(type); -GOKW(var); - -GOBN(map); - -#undef GOKW diff --git a/mac/bin/swig/share/swig/4.1.0/go/goruntime.swg b/mac/bin/swig/share/swig/4.1.0/go/goruntime.swg deleted file mode 100755 index 7bf083bd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/goruntime.swg +++ /dev/null @@ -1,217 +0,0 @@ -/* ------------------------------------------------------------ - * goruntime.swg - * - * Go runtime code for the various generated files. - * ------------------------------------------------------------ */ - -%inline %{ -static void Swig_free(void* p) { - free(p); -} - -static void* Swig_malloc(int c) { - return malloc(c); -} -%} - -%insert(runtime) %{ -#include -#include -#include -#include -#include - -%} - -%insert(cgo_comment_typedefs) %{ -#include -#include -%} - -#if SWIGGO_INTGO_SIZE == 32 -%insert(runtime) %{ -typedef int intgo; -typedef unsigned int uintgo; -%} -%insert(cgo_comment_typedefs) %{ -typedef int intgo; -typedef unsigned int uintgo; -%} -#elif SWIGGO_INTGO_SIZE == 64 -%insert(runtime) %{ -typedef long long intgo; -typedef unsigned long long uintgo; -%} -%insert(cgo_comment_typedefs) %{ -typedef long long intgo; -typedef unsigned long long uintgo; -%} -#else -%insert(runtime) %{ -typedef ptrdiff_t intgo; -typedef size_t uintgo; -%} -%insert(cgo_comment_typedefs) %{ -typedef ptrdiff_t intgo; -typedef size_t uintgo; -%} -#endif - -#ifndef SWIGGO_GCCGO -// Set the host compiler struct attribute that will be -// used to match gc's struct layout. For example, on 386 Windows, -// gcc wants to 8-align int64s, but gc does not. -// Use __gcc_struct__ to work around http://gcc.gnu.org/PR52991 on x86, -// and https://golang.org/issue/5603. -// See: https://github.com/golang/go/blob/fcbf04f9b93b4cd8addd05c2ed784118eb50a46c/src/cmd/cgo/out.go#L663 -%insert(runtime) %{ -# if !defined(__clang__) && (defined(__i386__) || defined(__x86_64__)) -# define SWIGSTRUCTPACKED __attribute__((__packed__, __gcc_struct__)) -# else -# define SWIGSTRUCTPACKED __attribute__((__packed__)) -# endif -%} -#else -# define SWIGSTRUCTPACKED -#endif - -%insert(runtime) %{ - -typedef struct { char *p; intgo n; } _gostring_; -typedef struct { void* array; intgo len; intgo cap; } _goslice_; - -%} - -%insert(cgo_comment_typedefs) %{ - -typedef struct { char *p; intgo n; } _gostring_; -typedef struct { void* array; intgo len; intgo cap; } _goslice_; - -%} - -#ifdef SWIGGO_GCCGO - -/* Boilerplate for C/C++ code when using gccgo. */ -%insert(runtime) %{ -#define SWIGGO_GCCGO - -#ifdef __cplusplus -extern "C" { -#endif -extern void *_cgo_allocate(size_t); -extern void _cgo_panic(const char *); -#ifdef __cplusplus -} -#endif - -#define _swig_goallocate _cgo_allocate -#define _swig_gopanic _cgo_panic -%} - -#endif - -#ifndef SWIGGO_GCCGO - -%go_import("unsafe", _ "runtime/cgo") - -#else - -%go_import("syscall", "unsafe") - -%insert(go_header) %{ - -type _ syscall.Sockaddr - -%} - -#endif - -%insert(go_header) %{ - -type _ unsafe.Pointer - -%} - -/* Swig_always_false is used to conditionally assign parameters to - Swig_escape_val so that the compiler thinks that they escape. We - only assign them if Swig_always_false is true, which it never is. - We export the variable so that the compiler doesn't realize that it - is never set. */ -%insert(go_header) %{ -var Swig_escape_always_false bool -var Swig_escape_val interface{} -%} - -/* Function pointers are translated by the code in go.cxx into - _swig_fnptr. Member pointers are translated to _swig_memberptr. */ - -%insert(go_header) %{ -type _swig_fnptr *byte -type _swig_memberptr *byte -%} - -/* Convert a Go interface value into a C++ pointer. */ - -%insert(go_header) %{ -func getSwigcptr(v interface { Swigcptr() uintptr }) uintptr { - if v == nil { - return 0 - } - return v.Swigcptr() -} -%} - -/* For directors we need C++ to track a Go pointer. Since we can't - pass a Go pointer into C++, we use a map to track the pointers on - the Go side. */ - -%go_import("sync") - -%insert(go_header) %{ -type _ sync.Mutex -%} - -%insert(go_director) %{ - -var swigDirectorTrack struct { - sync.Mutex - m map[int]interface{} - c int -} - -func swigDirectorAdd(v interface{}) int { - swigDirectorTrack.Lock() - defer swigDirectorTrack.Unlock() - if swigDirectorTrack.m == nil { - swigDirectorTrack.m = make(map[int]interface{}) - } - swigDirectorTrack.c++ - ret := swigDirectorTrack.c - swigDirectorTrack.m[ret] = v - return ret -} - -func swigDirectorLookup(c int) interface{} { - swigDirectorTrack.Lock() - defer swigDirectorTrack.Unlock() - ret := swigDirectorTrack.m[c] - if ret == nil { - panic("C++ director pointer not found (possible use-after-free)") - } - return ret -} - -func swigDirectorDelete(c int) { - swigDirectorTrack.Lock() - defer swigDirectorTrack.Unlock() - if swigDirectorTrack.m[c] == nil { - if c > swigDirectorTrack.c { - panic("C++ director pointer invalid (possible memory corruption") - } else { - panic("C++ director pointer not found (possible use-after-free)") - } - } - delete(swigDirectorTrack.m, c) -} - -%} diff --git a/mac/bin/swig/share/swig/4.1.0/go/gostring.swg b/mac/bin/swig/share/swig/4.1.0/go/gostring.swg deleted file mode 100755 index 44cbbb8e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/gostring.swg +++ /dev/null @@ -1,29 +0,0 @@ -/* ------------------------------------------------------------ - * gostring.swg - * - * Support for returning strings from C to Go. - * ------------------------------------------------------------ */ - -// C/C++ code to convert a memory buffer into a Go string allocated in -// C/C++ memory. -%fragment("AllocateString", "runtime") %{ -static _gostring_ Swig_AllocateString(const char *p, size_t l) { - _gostring_ ret; - ret.p = (char*)malloc(l); - memcpy(ret.p, p, l); - ret.n = l; - return ret; -} -%} - -// Go code to convert a string allocated in C++ memory to one -// allocated in Go memory. -%fragment("CopyString", "go_runtime") %{ -type swig_gostring struct { p uintptr; n int } -func swigCopyString(s string) string { - p := *(*swig_gostring)(unsafe.Pointer(&s)) - r := string((*[0x7fffffff]byte)(unsafe.Pointer(p.p))[:p.n]) - Swig_free(p.p) - return r -} -%} diff --git a/mac/bin/swig/share/swig/4.1.0/go/std_array.i b/mac/bin/swig/share/swig/4.1.0/go/std_array.i deleted file mode 100755 index 36c790e3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/std_array.i +++ /dev/null @@ -1,43 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_array.i - * ----------------------------------------------------------------------------- */ - -%include - -namespace std { - - template class array { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - array(); - array(const array& other); - - size_type size() const; - %rename(isEmpty) empty; - bool empty() const; - void fill(const T& u); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; diff --git a/mac/bin/swig/share/swig/4.1.0/go/std_deque.i b/mac/bin/swig/share/swig/4.1.0/go/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/go/std_except.i b/mac/bin/swig/share/swig/4.1.0/go/std_except.i deleted file mode 100755 index 4f021a12..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/std_except.i +++ /dev/null @@ -1,31 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. - * These typemaps are used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws) std::bad_cast %{_swig_gopanic($1.what());%} -%typemap(throws) std::bad_exception %{_swig_gopanic($1.what());%} -%typemap(throws) std::domain_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::exception %{_swig_gopanic($1.what());%} -%typemap(throws) std::invalid_argument %{_swig_gopanic($1.what());%} -%typemap(throws) std::length_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::logic_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::out_of_range %{_swig_gopanic($1.what());%} -%typemap(throws) std::overflow_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::range_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::runtime_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::underflow_error %{_swig_gopanic($1.what());%} diff --git a/mac/bin/swig/share/swig/4.1.0/go/std_list.i b/mac/bin/swig/share/swig/4.1.0/go/std_list.i deleted file mode 100755 index ff6f7001..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/std_list.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std { - - template - class list { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - list(); - list(const list& other); - - size_type size() const; - bool empty() const; - %rename(isEmpty) empty; - void clear(); - void push_front(const value_type& x); - void pop_front(); - void push_back(const value_type& x); - void pop_back(); - void remove(value_type x); - void reverse(); - void unique(); - void sort(); - void merge(list& x); - }; - -} diff --git a/mac/bin/swig/share/swig/4.1.0/go/std_map.i b/mac/bin/swig/share/swig/4.1.0/go/std_map.i deleted file mode 100755 index 773b6d0c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/std_map.i +++ /dev/null @@ -1,66 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; -} diff --git a/mac/bin/swig/share/swig/4.1.0/go/std_pair.i b/mac/bin/swig/share/swig/4.1.0/go/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/go/std_string.i b/mac/bin/swig/share/swig/4.1.0/go/std_string.i deleted file mode 100755 index 35b4a5e4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/std_string.i +++ /dev/null @@ -1,162 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a Go string and are passed around by value. - * - * To use non-const std::string references use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -%typemap(gotype) string, const string & "string" - -%typemap(in) string -%{ $1.assign($input.p, $input.n); %} - -%typemap(godirectorout) string -%{ - { - p := Swig_malloc(len($input)) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len($input)] - copy(s, $input) - $result = *(*string)(unsafe.Pointer(&s)) - } -%} - -%typemap(directorout) string -%{ - $result.assign($input.p, $input.n); - free($input.p); -%} - -%typemap(out,fragment="AllocateString") string -%{ $result = Swig_AllocateString($1.data(), $1.length()); %} - -%typemap(goout,fragment="CopyString") string -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") string -%{ $input = Swig_AllocateString($1.data(), $1.length()); %} - -%typemap(godirectorin,fragment="CopyString") string -%{ $result = swigCopyString($input) %} - -%typemap(throws) string -%{ _swig_gopanic($1.c_str()); %} - -%typemap(in) const string & -%{ - $*1_ltype $1_str($input.p, $input.n); - $1 = &$1_str; -%} - -%typemap(godirectorout) const string & -%{ - { - p := Swig_malloc(len($input)) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len($input)] - copy(s, $input) - $result = *(*string)(unsafe.Pointer(&s)) - } -%} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ - static $*1_ltype $1_str; - $1_str.assign($input.p, $input.n); - free($input.p); - $result = &$1_str; -%} - -%typemap(out,fragment="AllocateString") const string & -%{ $result = Swig_AllocateString((*$1).data(), (*$1).length()); %} - -%typemap(goout,fragment="CopyString") const string & -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") const string & -%{ $input = Swig_AllocateString($1.data(), $1.length()); %} - -%typemap(godirectorin,fragment="CopyString") const string & -%{ $result = swigCopyString($input) %} - -%typemap(throws) const string & -%{ _swig_gopanic($1.c_str()); %} - - -%typemap(gotype) string * "*string" - -%typemap(in) string * (string temp) -%{ - if ($input) { - temp.assign($input->p, $input->n); - $1 = &temp; - } else - $1 = 0; -%} - -%typemap(godirectorout) string * -%{ - if $input != nil { - p := Swig_malloc(len(*$input)) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len(*$input)] - copy(s, *$input) - $result = (*string)(unsafe.Pointer(&s)) - } else { - $result = nil - } -%} - -%typemap(directorout) string * (string temp) -%{ - temp.assign($input->p, $input->n); - $result = &temp; - free($input.p); -%} - -%typemap(out,fragment="AllocateString") string * (_gostring_ temp) -%{ - temp = Swig_AllocateString($1->data(), $1->length()); - $result = &temp; -%} - -%typemap(goout,fragment="CopyString") string * -%{ *$result = swigCopyString(*$1) %} - -%typemap(directorin,fragment="AllocateString") string * (_gostring_ temp) -%{ - if ($1) { - temp = Swig_AllocateString($1->data(), $1->length()); - $input = &temp; - } else - $input = 0; -%} - -%typemap(godirectorin,fragment="CopyString") string * -%{ *$result = swigCopyString(*$input); %} - -%typemap(argout,fragment="AllocateString") string * -%{ - if ($1) - *$input = Swig_AllocateString($1->data(), $1->length()); -%} - -%typemap(goargout,fragment="CopyString") string * -%{ - if $input != nil { - *$1 = swigCopyString(*$input) - } -%} - -} diff --git a/mac/bin/swig/share/swig/4.1.0/go/std_vector.i b/mac/bin/swig/share/swig/4.1.0/go/std_vector.i deleted file mode 100755 index 679c7075..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/std_vector.i +++ /dev/null @@ -1,92 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/go/swigmove.i b/mac/bin/swig/share/swig/4.1.0/go/swigmove.i deleted file mode 100755 index e1984b6e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/swigmove.i +++ /dev/null @@ -1,15 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in) SWIGTYPE MOVE ($&1_type argp) -%{ - argp = ($&1_ltype)$input; - if (argp == NULL) { - _swig_gopanic("Attempt to dereference null $1_type"); - } - SwigValueWrapper< $1_ltype >::reset($1, argp); -%} diff --git a/mac/bin/swig/share/swig/4.1.0/go/typemaps.i b/mac/bin/swig/share/swig/4.1.0/go/typemaps.i deleted file mode 100755 index d2e60d37..00000000 --- a/mac/bin/swig/share/swig/4.1.0/go/typemaps.i +++ /dev/null @@ -1,298 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps remap a C pointer or C++ reference to be an "INPUT" value which is -passed by value instead of reference. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In Go you could then use it like this: - answer := modulename.Fadd(10.0, 20.0) - -There are no char *INPUT typemaps, however you can apply the signed -char * typemaps instead: - %include - %apply signed char *INPUT {char *input}; - void f(char *input); -*/ - -%define INPUT_TYPEMAP(TYPE, GOTYPE) -%typemap(gotype) TYPE *INPUT, TYPE &INPUT "GOTYPE" - - %typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(out) TYPE *INPUT, TYPE &INPUT "" - -%typemap(goout) TYPE *INPUT, TYPE &INPUT "" - -%typemap(freearg) TYPE *INPUT, TYPE &INPUT "" - -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" - -// %typemap(typecheck) TYPE *INPUT = TYPE; -// %typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, bool); -INPUT_TYPEMAP(signed char, int8); -INPUT_TYPEMAP(char, byte); -INPUT_TYPEMAP(unsigned char, byte); -INPUT_TYPEMAP(short, int16); -INPUT_TYPEMAP(unsigned short, uint16); -INPUT_TYPEMAP(int, int); -INPUT_TYPEMAP(unsigned int, uint); -INPUT_TYPEMAP(long, int64); -INPUT_TYPEMAP(unsigned long, uint64); -INPUT_TYPEMAP(long long, int64); -INPUT_TYPEMAP(unsigned long long, uint64); -INPUT_TYPEMAP(float, float32); -INPUT_TYPEMAP(double, float64); - -#undef INPUT_TYPEMAP - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. An array replaces the c pointer or reference parameter. -// The output value is returned in this array passed in. - -/* -OUTPUT typemaps ---------------- - -The following typemaps can be applied to turn a pointer or reference -into an "output" value. When calling a function, no input value would -be given for a parameter, but an output value would be returned. This -works by a Go slice being passed as a parameter where a c pointer or -reference is required. As with any Go function, the array is passed -by reference so that any modifications to the array will be picked up -in the calling function. Note that the array passed in MUST have at -least one element, but as the c function does not require any input, -the value can be set to anything. - - bool *OUTPUT, bool &OUTPUT - signed char *OUTPUT, signed char &OUTPUT - unsigned char *OUTPUT, unsigned char &OUTPUT - short *OUTPUT, short &OUTPUT - unsigned short *OUTPUT, unsigned short &OUTPUT - int *OUTPUT, int &OUTPUT - unsigned int *OUTPUT, unsigned int &OUTPUT - long *OUTPUT, long &OUTPUT - unsigned long *OUTPUT, unsigned long &OUTPUT - long long *OUTPUT, long long &OUTPUT - unsigned long long *OUTPUT, unsigned long long &OUTPUT - float *OUTPUT, float &OUTPUT - double *OUTPUT, double &OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters): - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Go output of the function would be the function return value and the -value in the single element array. In Go you would use it like this: - - ptr := []float64{0.0} - fraction := modulename.Modf(5.0,ptr) - -There are no char *OUTPUT typemaps, however you can apply the signed -char * typemaps instead: - %include - %apply signed char *OUTPUT {char *output}; - void f(char *output); -*/ - -%define OUTPUT_TYPEMAP(TYPE, GOTYPE) -%typemap(gotype) TYPE *OUTPUT, TYPE &OUTPUT %{[]GOTYPE%} - -%typemap(in) TYPE *OUTPUT($*1_ltype temp), TYPE &OUTPUT($*1_ltype temp) -{ - if ($input.len == 0) { - _swig_gopanic("array must contain at least 1 element"); - } - $1 = &temp; -} - -%typemap(out) TYPE *OUTPUT, TYPE &OUTPUT "" - -%typemap(goout) TYPE *INPUT, TYPE &INPUT "" - -%typemap(freearg) TYPE *OUTPUT, TYPE &OUTPUT "" - -%typemap(argout) TYPE *OUTPUT, TYPE &OUTPUT -{ - TYPE* a = (TYPE *) $input.array; - a[0] = temp$argnum; -} - -%enddef - -OUTPUT_TYPEMAP(bool, bool); -OUTPUT_TYPEMAP(signed char, int8); -OUTPUT_TYPEMAP(char, byte); -OUTPUT_TYPEMAP(unsigned char, byte); -OUTPUT_TYPEMAP(short, int16); -OUTPUT_TYPEMAP(unsigned short, uint16); -OUTPUT_TYPEMAP(int, int); -OUTPUT_TYPEMAP(unsigned int, uint); -OUTPUT_TYPEMAP(long, int64); -OUTPUT_TYPEMAP(unsigned long, uint64); -OUTPUT_TYPEMAP(long long, int64); -OUTPUT_TYPEMAP(unsigned long long, uint64); -OUTPUT_TYPEMAP(float, float32); -OUTPUT_TYPEMAP(double, float64); - -#undef OUTPUT_TYPEMAP - -/* -INOUT typemaps --------------- - -Mappings for a parameter that is both an input and an output parameter - -The following typemaps can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" typemaps described earlier. Output values are -returned as an element in a Go slice. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -This works similarly to C in that the mapping directly modifies the -input value - the input must be an array with a minimum of one element. -The element in the array is the input and the output is the element in -the array. - - x := []float64{5.0} - Neg(x); - -The implementation of the OUTPUT and INOUT typemaps is different to -other languages in that other languages will return the output value -as part of the function return value. This difference is due to Go -being a typed language. - -There are no char *INOUT typemaps, however you can apply the signed -char * typemaps instead: - %include - %apply signed char *INOUT {char *inout}; - void f(char *inout); -*/ - -%define INOUT_TYPEMAP(TYPE, GOTYPE) -%typemap(gotype) TYPE *INOUT, TYPE &INOUT %{[]GOTYPE%} - -%typemap(in) TYPE *INOUT, TYPE &INOUT { - if ($input.len == 0) { - _swig_gopanic("array must contain at least 1 element"); - } - $1 = ($1_ltype) $input.array; -} - -%typemap(out) TYPE *INOUT, TYPE &INOUT "" - -%typemap(goout) TYPE *INOUT, TYPE &INOUT "" - -%typemap(freearg) TYPE *INOUT, TYPE &INOUT "" - -%typemap(argout) TYPE *INOUT, TYPE &INOUT "" - -%enddef - -INOUT_TYPEMAP(bool, bool); -INOUT_TYPEMAP(signed char, int8); -INOUT_TYPEMAP(char, byte); -INOUT_TYPEMAP(unsigned char, byte); -INOUT_TYPEMAP(short, int16); -INOUT_TYPEMAP(unsigned short, uint16); -INOUT_TYPEMAP(int, int); -INOUT_TYPEMAP(unsigned int, uint); -INOUT_TYPEMAP(long, int64); -INOUT_TYPEMAP(unsigned long, uint64); -INOUT_TYPEMAP(long long, int64); -INOUT_TYPEMAP(unsigned long long, uint64); -INOUT_TYPEMAP(float, float32); -INOUT_TYPEMAP(double, float64); - -#undef INOUT_TYPEMAP diff --git a/mac/bin/swig/share/swig/4.1.0/guile/Makefile b/mac/bin/swig/share/swig/4.1.0/guile/Makefile deleted file mode 100755 index fba7fd5d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/Makefile +++ /dev/null @@ -1,3 +0,0 @@ - -co: - co RCS/*.i* RCS/*.swg* diff --git a/mac/bin/swig/share/swig/4.1.0/guile/common.scm b/mac/bin/swig/share/swig/4.1.0/guile/common.scm deleted file mode 100755 index 17c9ab58..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/common.scm +++ /dev/null @@ -1,70 +0,0 @@ -;;;************************************************************************ -;;;*common.scm -;;;* -;;;* This file contains generic SWIG GOOPS classes for generated -;;;* GOOPS file support -;;;************************************************************************ - -(define-module (Swig swigrun)) - -(define-module (Swig common) - #:use-module (oop goops) - #:use-module (Swig swigrun)) - -(define-class () - (new-function #:init-value #f)) - -(define-method (initialize (class ) initargs) - (slot-set! class 'new-function (get-keyword #:new-function initargs #f)) - (next-method)) - -(define-class () - (swig-smob #:init-value #f) - #:metaclass -) - -(define-method (initialize (obj ) initargs) - (next-method) - (slot-set! obj 'swig-smob - (let ((arg (get-keyword #:init-smob initargs #f))) - (if arg - arg - (let ((ret (apply (slot-ref (class-of obj) 'new-function) (get-keyword #:args initargs '())))) - ;; if the class is registered with runtime environment, - ;; new-Function will return a goops class. In that case, extract the smob - ;; from that goops class and set it as the current smob. - (if (slot-exists? ret 'swig-smob) - (slot-ref ret 'swig-smob) - ret)))))) - -(define (display-address o file) - (display (number->string (object-address o) 16) file)) - -(define (display-pointer-address o file) - ;; Don't fail if the function SWIG-PointerAddress is not present. - (let ((address (false-if-exception (SWIG-PointerAddress o)))) - (if address - (begin - (display " @ " file) - (display (number->string address 16) file))))) - -(define-method (write (o ) file) - ;; We display _two_ addresses to show the object's identity: - ;; * first the address of the GOOPS proxy object, - ;; * second the pointer address. - ;; The reason is that proxy objects are created and discarded on the - ;; fly, so different proxy objects for the same C object will appear. - (let ((class (class-of o))) - (if (slot-bound? class 'name) - (begin - (display "#<" file) - (display (class-name class) file) - (display #\space file) - (display-address o file) - (display-pointer-address o file) - (display ">" file)) - (next-method)))) - -(export ) - -;;; common.scm ends here diff --git a/mac/bin/swig/share/swig/4.1.0/guile/cplusplus.i b/mac/bin/swig/share/swig/4.1.0/guile/cplusplus.i deleted file mode 100755 index d5d65efa..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/cplusplus.i +++ /dev/null @@ -1,22 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cplusplus.i - * - * SWIG typemaps for C++ - * ----------------------------------------------------------------------------- */ - -%typemap(guile,out) string, std::string { - $result = SWIG_str02scm(const_cast($1.c_str())); -} -%typemap(guile,in) string, std::string { - $1 = SWIG_scm2str($input); -} - -%typemap(guile,out) complex, complex, std::complex { - $result = scm_make_rectangular( scm_from_double ($1.real ()), - scm_from_double ($1.imag ()) ); -} -%typemap(guile,in) complex, complex, std::complex { - $1 = std::complex( scm_to_double (scm_real_part ($input)), - scm_to_double (scm_imag_part ($input)) ); -} - diff --git a/mac/bin/swig/share/swig/4.1.0/guile/extra-install.list b/mac/bin/swig/share/swig/4.1.0/guile/extra-install.list deleted file mode 100755 index 05d2c0c4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/extra-install.list +++ /dev/null @@ -1,2 +0,0 @@ -# see top-level Makefile.in -common.scm diff --git a/mac/bin/swig/share/swig/4.1.0/guile/guile.i b/mac/bin/swig/share/swig/4.1.0/guile/guile.i deleted file mode 100755 index ef270d74..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/guile.i +++ /dev/null @@ -1,33 +0,0 @@ -/* ----------------------------------------------------------------------------- - * guile.i - * - * SWIG Configuration File for Guile. - * ----------------------------------------------------------------------------- */ - -/* Macro for inserting Scheme code into the stub */ -#define %scheme %insert("scheme") -#define %goops %insert("goops") - -/* Return-styles */ -%pragma(guile) return_nothing_doc = "Returns unspecified." -%pragma(guile) return_one_doc = "Returns $values." - -%define %values_as_list - %pragma(guile) beforereturn = "" - %pragma(guile) return_multi_doc = "Returns a list of $num_values values: $values." -%enddef -%values_as_list /* the default style */ - -%define %values_as_vector - %pragma(guile) beforereturn = "GUILE_MAYBE_VECTOR" - %pragma(guile) return_multi_doc = "Returns a vector of $num_values values: $values." -%enddef - -%define %multiple_values - %pragma(guile) beforereturn = "GUILE_MAYBE_VALUES" - %pragma(guile) return_multi_doc = "Returns $num_values values: $values." -%enddef - -#define GUILE_APPEND_RESULT SWIG_APPEND_VALUE - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/guile/guile_scm.swg b/mac/bin/swig/share/swig/4.1.0/guile/guile_scm.swg deleted file mode 100755 index 16dc8aa9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/guile_scm.swg +++ /dev/null @@ -1,46 +0,0 @@ -/* ----------------------------------------------------------------------------- - * guile_scm.swg - * - * This SWIG interface file is processed if the Guile module is run - * with SCM_ flavor. - * ----------------------------------------------------------------------------- */ - -#define SWIGGUILE_SCM - -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors - -%runtime "guile_scm_run.swg" -%include - -%runtime %{ - -#define GUILE_MAYBE_VALUES \ - if (gswig_list_p) gswig_result = scm_values(gswig_result); - -#define GUILE_MAYBE_VECTOR \ - if (gswig_list_p) gswig_result = scm_vector(gswig_result); - -#define SWIG_APPEND_VALUE(object) \ - if (gswig_result == SCM_UNSPECIFIED) \ - gswig_result = object; \ - else { \ - if (!gswig_list_p) { \ - gswig_list_p = 1; \ - gswig_result = scm_list_n(gswig_result, object, SCM_UNDEFINED); \ - } \ - else \ - gswig_result = scm_append(scm_list_n(gswig_result, scm_list_n(object, SCM_UNDEFINED), SCM_UNDEFINED)); \ - } - -%} - -%insert(init) "swiginit.swg" - -%init %{ -SWIG_GUILE_INIT_STATIC void -SWIG_init(void) -{ - SWIG_InitializeModule(0); - SWIG_PropagateClientData(); -%} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/guile_scm_run.swg b/mac/bin/swig/share/swig/4.1.0/guile/guile_scm_run.swg deleted file mode 100755 index 689a1060..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/guile_scm_run.swg +++ /dev/null @@ -1,532 +0,0 @@ -/* ----------------------------------------------------------------------------- - * guile_scm_run.swg - * ----------------------------------------------------------------------------- */ - -#if __GNUC__ >= 10 -#if defined(__cplusplus) -#pragma GCC diagnostic ignored "-Wvolatile" /* For 'volatile SCM *' in at least Guile 3.0 and earlier */ -#endif -#endif - -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/* In the code below, use guile 2.0 compatible functions where possible. - Functions that don't exist in older versions will be mapped to - a deprecated equivalent for those versions only */ -#if defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION < 2) - -static SCM -scm_module_variable (SCM module, SCM sym) -{ - return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F); -} - -#define scm_to_utf8_string scm_to_locale_string -#define scm_from_utf8_string scm_from_locale_string -#endif - -#if SCM_MAJOR_VERSION >= 2 -/* scm_c_define_gsubr takes a different parameter type depending on the guile version */ - -typedef scm_t_subr swig_guile_proc; -#else -typedef SCM (*swig_guile_proc)(); -#endif -typedef SCM (*guile_destructor)(SCM); - -typedef struct swig_guile_clientdata { - guile_destructor destroy; - SCM goops_class; -} swig_guile_clientdata; - -#define SWIG_scm2str(s) \ - SWIG_Guile_scm2newstr(s, NULL) -#define SWIG_str02scm(str) \ - str ? scm_from_utf8_string(str) : SCM_BOOL_F -# define SWIG_malloc(size) \ - scm_malloc(size) -# define SWIG_free(mem) \ - free(mem) -#define SWIG_ConvertPtr(s, result, type, flags) \ - SWIG_Guile_ConvertPtr(s, result, type, flags) -#define SWIG_MustGetPtr(s, type, argnum, flags) \ - SWIG_Guile_MustGetPtr(s, type, argnum, flags, FUNC_NAME) -#define SWIG_NewPointerObj(ptr, type, owner) \ - SWIG_Guile_NewPointerObj((void*)ptr, type, owner) -#define SWIG_PointerAddress(object) \ - SWIG_Guile_PointerAddress(object) -#define SWIG_PointerType(object) \ - SWIG_Guile_PointerType(object) -#define SWIG_IsPointerOfType(object, type) \ - SWIG_Guile_IsPointerOfType(object, type) -#define SWIG_IsPointer(object) \ - SWIG_Guile_IsPointer(object) -#define SWIG_contract_assert(expr, msg) \ - do { \ - if (!(expr)) \ - scm_error(scm_from_locale_symbol("swig-contract-assertion-failed"), \ - (char *) FUNC_NAME, (char *) msg, \ - SCM_EOL, SCM_BOOL_F); \ - } while (0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) \ - SWIG_Guile_ConvertMember(obj, ptr, sz, ty, FUNC_NAME) -#define SWIG_NewMemberObj(ptr, sz, type) \ - SWIG_Guile_NewMemberObj(ptr, sz, type, FUNC_NAME) - -/* Runtime API */ -static swig_module_info *SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata)); -#define SWIG_GetModule(clientdata) SWIG_Guile_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer) - -SWIGINTERN char * -SWIG_Guile_scm2newstr(SCM str, size_t *len) { -#define FUNC_NAME "SWIG_Guile_scm2newstr" - char *ret; - - SCM_ASSERT (scm_is_string(str), str, 1, FUNC_NAME); - - ret = scm_to_utf8_string(str); - if (!ret) return NULL; - - if (len) *len = strlen(ret) - 1; - return ret; -#undef FUNC_NAME -} - -static int swig_initialized = 0; -static scm_t_bits swig_tag = 0; -static scm_t_bits swig_collectable_tag = 0; -static scm_t_bits swig_finalized_tag = 0; -static scm_t_bits swig_destroyed_tag = 0; -static scm_t_bits swig_member_function_tag = 0; -static SCM swig_make_func = SCM_EOL; -static SCM swig_keyword = SCM_EOL; -static SCM swig_symbol = SCM_EOL; - -#define SWIG_Guile_GetSmob(x) \ - ( !scm_is_null(x) && SCM_INSTANCEP(x) && scm_is_true(scm_slot_exists_p(x, swig_symbol)) \ - ? scm_slot_ref(x, swig_symbol) : (x) ) - -SWIGINTERN void SWIG_Guile_MarkPointerNoncollectable(SCM s); - -SWIGINTERN SCM -SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner) -{ - if (ptr == NULL) - return SCM_EOL; - else { - SCM smob; - swig_guile_clientdata *cdata = (swig_guile_clientdata *) type->clientdata; - if (owner) - SCM_NEWSMOB2(smob, swig_collectable_tag, ptr, (void *) type); - else - SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); - - if (!cdata || scm_is_null(cdata->goops_class) || swig_make_func == SCM_EOL ) { - return smob; - } else { - /* the scm_make() C function only handles the creation of gf, - methods and classes (no instances) the (make ...) function is - later redefined in goops.scm. So we need to call that - Scheme function. */ - return scm_apply(swig_make_func, - scm_list_3(cdata->goops_class, - swig_keyword, - smob), - SCM_EOL); - } - } -} - -SWIGINTERN unsigned long -SWIG_Guile_PointerAddress(SCM object) -{ - SCM smob = SWIG_Guile_GetSmob(object); - if (scm_is_null(smob)) return 0; - else if (SCM_SMOB_PREDICATE(swig_tag, smob) - || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) - || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { - return (unsigned long) (void *) SCM_CELL_WORD_1(smob); - } - else scm_wrong_type_arg("SWIG-Guile-PointerAddress", 1, object); -} - -SWIGINTERN swig_type_info * -SWIG_Guile_PointerType(SCM object) -{ - SCM smob = SWIG_Guile_GetSmob(object); - if (scm_is_null(smob)) return NULL; - else if (SCM_SMOB_PREDICATE(swig_tag, smob) - || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) - || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { - return (swig_type_info *) SCM_CELL_WORD_2(smob); - } - else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object); -} - -SWIGINTERN int -SWIG_Guile_IsValidSmob(SCM smob) -{ - /* We do not accept smobs representing destroyed pointers, but we have to - allow finalized smobs because Guile >= 2.0.12 sets all smob instances - to the 'finalized' type before calling their 'free' function. This change - was introduced to Guile in commit 8dff3af087c6eaa83ae0d72aa8b22aef5c65d65d */ - return SCM_SMOB_PREDICATE(swig_tag, smob) - || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) - || SCM_SMOB_PREDICATE(swig_finalized_tag, smob); -} - -SWIGINTERN int -SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags) -{ - swig_cast_info *cast; - swig_type_info *from; - SCM smob = SWIG_Guile_GetSmob(s); - int ret = SWIG_ERROR; - - if (scm_is_null(smob)) { - *result = NULL; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; -#if SCM_MAJOR_VERSION >= 2 - } else if (SCM_POINTER_P(s)) { - *result = SCM_POINTER_VALUE(s); - return SWIG_OK; -#endif /* if SCM_MAJOR_VERSION >= 2 */ - } else if (SWIG_Guile_IsValidSmob(smob)) { - from = (swig_type_info *) SCM_CELL_WORD_2(smob); - if (!from) return SWIG_ERROR; - - if ((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) { - if ((SCM_CELL_TYPE(smob) == swig_collectable_tag && SCM_CELL_WORD_1(smob) == 0) || SCM_CELL_TYPE(smob) == swig_tag) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - } - - if (type) { - cast = SWIG_TypeCheckStruct(from, type); - if (cast) { - int newmemory = 0; - *result = SWIG_TypeCast(cast, (void *) SCM_CELL_WORD_1(smob), &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - ret = SWIG_OK; - } else { - return SWIG_ERROR; - } - } else { - *result = (void *) SCM_CELL_WORD_1(smob); - ret = SWIG_OK; - } - - if (flags & SWIG_POINTER_DISOWN) { - SWIG_Guile_MarkPointerNoncollectable(smob); - } - if (flags & SWIG_POINTER_CLEAR) { - SCM_SET_CELL_WORD_1(smob, 0); - } - } - return ret; -} - -SWIGINTERNINLINE void * -SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type, - int argnum, int flags, const char *func_name) -{ - void *result; - int res = SWIG_Guile_ConvertPtr(s, &result, type, flags); - if (!SWIG_IsOK(res)) { - /* type mismatch */ - scm_wrong_type_arg((char *) func_name, argnum, s); - } - return result; -} - -SWIGINTERNINLINE int -SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type) -{ - void *result; - if (SWIG_Guile_ConvertPtr(s, &result, type, 0)) { - /* type mismatch */ - return 0; - } - else return 1; -} - -SWIGINTERNINLINE int -SWIG_Guile_IsPointer (SCM s) -{ - /* module might not be initialized yet, so initialize it */ - SWIG_GetModule(0); - return SWIG_Guile_IsPointerOfType (s, NULL); -} - -/* Mark a pointer object non-collectable */ -SWIGINTERN void -SWIG_Guile_MarkPointerNoncollectable(SCM s) -{ - SCM smob = SWIG_Guile_GetSmob(s); - if (!scm_is_null(smob)) { - if (SWIG_Guile_IsValidSmob(smob)) { - SCM_SET_CELL_TYPE(smob, swig_tag); - } - else scm_wrong_type_arg(NULL, 0, s); - } -} - -/* Mark a pointer object destroyed */ -SWIGINTERN void -SWIG_Guile_MarkPointerDestroyed(SCM s) -{ - SCM smob = SWIG_Guile_GetSmob(s); - if (!scm_is_null(smob)) { - if (SWIG_Guile_IsValidSmob(smob)) { - SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); - } - else scm_wrong_type_arg(NULL, 0, s); - } -} - -/* Member functions */ - -SWIGINTERN SCM -SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type, - const char *func_name) -{ - SCM smob; - void *copy = malloc(sz); - memcpy(copy, ptr, sz); - SCM_NEWSMOB2(smob, swig_member_function_tag, copy, (void *) type); - return smob; -} - -SWIGINTERN int -SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type, - const char *func_name) -{ - swig_cast_info *cast; - swig_type_info *from; - - if (SCM_SMOB_PREDICATE(swig_member_function_tag, smob)) { - from = (swig_type_info *) SCM_CELL_WORD_2(smob); - if (!from) return SWIG_ERROR; - if (type) { - cast = SWIG_TypeCheckStruct(from, type); - if (!cast) return SWIG_ERROR; - } - memcpy(ptr, (void *) SCM_CELL_WORD_1(smob), sz); - return SWIG_OK; - } - return SWIG_ERROR; -} - - -/* Init */ - -SWIGINTERN int -print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate, - const char *attribute) -{ - swig_type_info *type; - - type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); - if (type) { - scm_puts((char *) "#<", port); - scm_puts((char *) attribute, port); - scm_puts((char *) "swig-pointer ", port); - scm_puts((char *) SWIG_TypePrettyName(type), port); - scm_puts((char *) " ", port); - scm_intprint((long) SCM_CELL_WORD_1(swig_smob), 16, port); - scm_puts((char *) ">", port); - /* non-zero means success */ - return 1; - } else { - return 0; - } -} - - -SWIGINTERN int -print_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - return print_swig_aux(swig_smob, port, pstate, ""); -} - -SWIGINTERN int -print_collectable_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - return print_swig_aux(swig_smob, port, pstate, "collectable-"); -} - -SWIGINTERN int -print_destroyed_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - return print_swig_aux(swig_smob, port, pstate, "destroyed-"); -} - -SWIGINTERN int -print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - swig_type_info *type; - type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); - if (type) { - scm_puts((char *) "#<", port); - scm_puts((char *) "swig-member-function-pointer ", port); - scm_puts((char *) SWIG_TypePrettyName(type), port); - scm_puts((char *) " >", port); - /* non-zero means success */ - return 1; - } else { - return 0; - } -} - -SWIGINTERN SCM -equalp_swig (SCM A, SCM B) -{ - if (SCM_CELL_WORD_0(A) == SCM_CELL_WORD_0(B) && SCM_CELL_WORD_1(A) == SCM_CELL_WORD_1(B) - && SCM_CELL_WORD_2(A) == SCM_CELL_WORD_2(B)) - return SCM_BOOL_T; - else return SCM_BOOL_F; -} - -SWIGINTERN size_t -free_swig(SCM A) -{ - swig_type_info *type = (swig_type_info *) SCM_CELL_WORD_2(A); - if (type) { - if (type->clientdata && ((swig_guile_clientdata *)type->clientdata)->destroy) - ((swig_guile_clientdata *)type->clientdata)->destroy(A); - } - return 0; -} - -SWIGINTERN size_t -free_swig_member_function(SCM A) -{ - free((swig_type_info *) SCM_CELL_WORD_1(A)); - return 0; -} - -SWIGINTERN int -ensure_smob_tag(SCM swig_module, - scm_t_bits *tag_variable, - const char *smob_name, - const char *scheme_variable_name) -{ - SCM variable = scm_module_variable(swig_module, - scm_from_locale_symbol(scheme_variable_name)); - if (scm_is_false(variable)) { - *tag_variable = scm_make_smob_type((char*)scheme_variable_name, 0); - scm_c_module_define(swig_module, scheme_variable_name, - scm_from_ulong(*tag_variable)); - return 1; - } - else { - *tag_variable = scm_to_ulong(SCM_VARIABLE_REF(variable)); - return 0; - } -} - -SWIGINTERN SCM -SWIG_Guile_Init () -{ - static SCM swig_module; - - if (swig_initialized) return swig_module; - swig_initialized = 1; - - swig_module = scm_c_resolve_module("Swig swigrun"); - if (ensure_smob_tag(swig_module, &swig_tag, - "swig-pointer", "swig-pointer-tag")) { - scm_set_smob_print(swig_tag, print_swig); - scm_set_smob_equalp(swig_tag, equalp_swig); - } - if (ensure_smob_tag(swig_module, &swig_collectable_tag, - "collectable-swig-pointer", "collectable-swig-pointer-tag")) { - scm_set_smob_print(swig_collectable_tag, print_collectable_swig); - scm_set_smob_equalp(swig_collectable_tag, equalp_swig); - scm_set_smob_free(swig_collectable_tag, free_swig); - /* For Guile >= 2.0.12. See libguile/smob.c:clear_smobnum */ - swig_finalized_tag = swig_collectable_tag & ~0xff00; - } - if (ensure_smob_tag(swig_module, &swig_destroyed_tag, - "destroyed-swig-pointer", "destroyed-swig-pointer-tag")) { - scm_set_smob_print(swig_destroyed_tag, print_destroyed_swig); - scm_set_smob_equalp(swig_destroyed_tag, equalp_swig); - } - if (ensure_smob_tag(swig_module, &swig_member_function_tag, - "swig-member-function-pointer", "swig-member-function-pointer-tag")) { - scm_set_smob_print(swig_member_function_tag, print_member_function_swig); - scm_set_smob_free(swig_member_function_tag, free_swig_member_function); - } - swig_make_func = scm_permanent_object( - scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make"))); - swig_keyword = scm_permanent_object(scm_from_locale_keyword((char*) "init-smob")); - swig_symbol = scm_permanent_object(scm_from_locale_symbol("swig-smob")); -#ifdef SWIG_INIT_RUNTIME_MODULE - SWIG_INIT_RUNTIME_MODULE -#endif - - return swig_module; -} - -SWIGINTERN swig_module_info * -SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata)) -{ - SCM module = SWIG_Guile_Init(); - SCM variable = scm_module_variable(module, scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME)); - if (scm_is_false(variable)) { - return NULL; - } else { - return (swig_module_info *) scm_to_ulong(SCM_VARIABLE_REF(variable)); - } -} - -SWIGINTERN void -SWIG_Guile_SetModule(swig_module_info *swig_module) -{ - SCM module = SWIG_Guile_Init(); - scm_module_define(module, - scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME), - scm_from_ulong((unsigned long) swig_module)); -} - -SWIGINTERN int -SWIG_Guile_GetArgs (SCM *dest, SCM rest, - int reqargs, int optargs, - const char *procname) -{ - int i; - int num_args_passed = 0; - for (i = 0; i - -#ifdef __cplusplus -extern "C" { -#endif - -static void -inner_main(void *closure, int argc, char **argv) -{ -#ifdef SWIGINIT - SWIGINIT -#else - SWIG_init(); /* SWIG init function */ -#endif - scm_shell(argc, argv); /* scheme interpreter */ - /* never reached: scm_shell will perform an exit */ -} - -#ifdef __cplusplus -} -#endif - -int -main(int argc, char **argv) -{ - /* put any default initialisation code here: e.g. exit handlers */ - scm_boot_guile(argc, argv, inner_main, 0); /* make a stack entry for the - garbage collector */ - return 0; /* never reached, but avoids a warning */ -} -%} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/interpreter.i b/mac/bin/swig/share/swig/4.1.0/guile/interpreter.i deleted file mode 100755 index 524e0694..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/interpreter.i +++ /dev/null @@ -1,59 +0,0 @@ -/* ----------------------------------------------------------------------------- - * interpreter.i - * - * SWIG file for a simple Guile interpreter - * ----------------------------------------------------------------------------- */ - -%{ - -#include -GSCM_status guile_init(); - -int main(int argc, char **argv) { - GSCM_status status; - GSCM_top_level toplev; - char *eval_answer; - char input_str[16384]; - int done; - - /* start a scheme interpreter */ - status = gscm_run_scm(argc, argv, 0, stdout, stderr, guile_init, 0, "#t"); - if (status != GSCM_OK) { - fputs(gscm_error_msg(status), stderr); - fputc('\n', stderr); - printf("Error in startup.\n"); - exit(1); - } - - /* create the top level environment */ - status = gscm_create_top_level(&toplev); - if (status != GSCM_OK) { - fputs(gscm_error_msg(status), stderr); - fputc('\n', stderr); - exit(1); - } - - /* now sit in a scheme eval loop: I input the expressions, have guile - * evaluate them, and then get another expression. - */ - done = 0; - fprintf(stdout,"Guile > "); - while (!done) { - if (fgets(input_str,16384,stdin) == NULL) { - exit(1); - } else { - if (strncmp(input_str,"quit",4) == 0) exit(1); - status = gscm_eval_str(&eval_answer, toplev, input_str); - fprintf(stdout,"%s\n", eval_answer); - fprintf(stdout,"Guile > "); - } - } - - /* now clean up and quit */ - gscm_destroy_top_level(toplev); -} - -%} - - - diff --git a/mac/bin/swig/share/swig/4.1.0/guile/list-vector.i b/mac/bin/swig/share/swig/4.1.0/guile/list-vector.i deleted file mode 100755 index 82405259..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/list-vector.i +++ /dev/null @@ -1,488 +0,0 @@ -/* ----------------------------------------------------------------------------- - * list_vector.i - * - * Guile typemaps for converting between arrays and Scheme lists or vectors - * ----------------------------------------------------------------------------- */ - -/* Here is a macro that will define typemaps for converting between C - arrays and Scheme lists or vectors when passing arguments to the C - function. - - TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - - Supported calling conventions: - - func(int VECTORLENINPUT, [const] C_TYPE *VECTORINPUT) - - Scheme wrapper will take one argument, a vector. A temporary C - array of elements of type C_TYPE will be allocated and filled - with the elements of the vectors, converted to C with the - SCM_TO_C function. Length and address of the array are passed - to the C function. - - SCM_TYPE is used to describe the Scheme type of the elements in - the Guile procedure documentation. - - func(int LISTLENINPUT, [const] C_TYPE *LISTINPUT) - - Likewise, but the Scheme wrapper will take one argument, a list. - - func(int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - - Scheme wrapper will take no arguments. Addresses of an integer - and a C_TYPE * variable will be passed to the C function. The - C function is expected to return address and length of a - freshly allocated array of elements of type C_TYPE through - these pointers. The elements of this array are converted to - Scheme with the C_TO_SCM function and returned as a Scheme - vector. - - If the function has a void return value, the vector constructed - by this typemap becomes the return value of the Scheme wrapper. - Otherwise, the function returns multiple values. (See - the documentation on how to deal with multiple values.) - - func(int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - - Likewise, but the Scheme wrapper will return a list instead of - a vector. - - It is also allowed to use "size_t LISTLENINPUT" rather than "int - LISTLENINPUT". */ - -%define TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - - /* input */ - - /* We make use of the new multi-dispatch typemaps here. */ - - %typemap(in, doc="$NAME is a vector of " #SCM_TYPE " values") - (int VECTORLENINPUT, C_TYPE *VECTORINPUT), - (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT) - { - SCM_VALIDATE_VECTOR($argnum, $input); - $1 = scm_c_vector_length($input); - if ($1 > 0) { - $1_ltype i; - $2 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * $1); - for (i = 0; i<$1; i++) { - SCM swig_scm_value = scm_vector_ref($input, scm_from_long(i)); - $2[i] = SCM_TO_C_EXPR; - } - } - else $2 = NULL; - } - - %typemap(in, doc="$NAME is a list of " #SCM_TYPE " values") - (int LISTLENINPUT, C_TYPE *LISTINPUT), - (size_t LISTLENINPUT, C_TYPE *LISTINPUT) - { - SCM_VALIDATE_LIST($argnum, $input); - $1 = scm_to_ulong(scm_length($input)); - if ($1 > 0) { - $1_ltype i; - SCM rest; - $2 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * $1); - for (i = 0, rest = $input; - i<$1; - i++, rest = SCM_CDR(rest)) { - SCM swig_scm_value = SCM_CAR(rest); - $2[i] = SCM_TO_C_EXPR; - } - } - else $2 = NULL; - } - - /* Do not check for NULL pointers (override checks). */ - - %typemap(check) (int VECTORLENINPUT, C_TYPE *VECTORINPUT), - (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT), - (int LISTLENINPUT, C_TYPE *LISTINPUT), - (size_t LISTLENINPUT, C_TYPE *LISTINPUT) - "/* no check for NULL pointer */"; - - /* Discard the temporary array after the call. */ - - %typemap(freearg) (int VECTORLENINPUT, C_TYPE *VECTORINPUT), - (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT), - (int LISTLENINPUT, C_TYPE *LISTINPUT), - (size_t LISTLENINPUT, C_TYPE *LISTINPUT) - {SWIG_free($2);} - -%enddef - - /* output */ - -%define TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) - - /* First we make temporary variables ARRAYLENTEMP and ARRAYTEMP, - whose addresses we pass to the C function. We ignore both - arguments for Scheme. */ - - %typemap(in,numinputs=0) (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - (int arraylentemp, C_TYPE *arraytemp), - (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - (int arraylentemp, C_TYPE *arraytemp), - (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - (size_t arraylentemp, C_TYPE *arraytemp), - (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - (size_t arraylentemp, C_TYPE *arraytemp) - %{ - $1 = &arraylentemp; - $2 = &arraytemp; - %} - - /* In the ARGOUT typemaps, we convert the array into a vector or - a list and append it to the results. */ - - %typemap(argout, doc="$NAME (a vector of " #SCM_TYPE " values)") - (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - { - $*1_ltype i; - SCM res = scm_make_vector(scm_from_long(*$1), - SCM_BOOL_F); - for (i = 0; i<*$1; i++) { - C_TYPE swig_c_value = (*$2)[i]; - SCM elt = C_TO_SCM_EXPR; - scm_vector_set_x(res, scm_from_long(i), elt); - } - SWIG_APPEND_VALUE(res); - } - - %typemap(argout, doc="$NAME (a list of " #SCM_TYPE " values)") - (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT), - (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - { - int i; - SCM res = SCM_EOL; - for (i = ((int)(*$1)) - 1; i>=0; i--) { - C_TYPE swig_c_value = (*$2)[i]; - SCM elt = C_TO_SCM_EXPR; - res = scm_cons(elt, res); - } - SWIG_APPEND_VALUE(res); - } - - /* In the FREEARG typemaps, get rid of the C vector. - (This can be overridden if you want to keep the C vector.) */ - - %typemap(freearg) - (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), - (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT), - (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - { - free(*$2); - } - -%enddef - -%define TYPEMAP_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_TYPE) - TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) -%enddef - -%define TYPEMAP_LIST_VECTOR_INPUT(C_TYPE, SCM_TO_C, SCM_TYPE) - TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), SCM_TYPE) -%enddef - -%define TYPEMAP_LIST_VECTOR_OUTPUT(C_TYPE, C_TO_SCM, SCM_TYPE) - TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR - (C_TYPE, C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -%define TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - TYPEMAP_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -/* We use the macro to define typemaps for some standard types. */ - -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(bool, scm_is_true, scm_from_bool, boolean); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(int, scm_to_int, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(short, scm_to_int, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(long, scm_to_long, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(ptrdiff_t, scm_to_long, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned int, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned short, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned long, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(size_t, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(float, scm_to_double, scm_from_double, real); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(double, scm_to_double, scm_from_double, real); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(char *, SWIG_scm2str, SWIG_str02scm, string); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(const char *, SWIG_scm2str, SWIG_str02scm, string); - -/* For the char *, free all strings after converting */ - - %typemap(freearg) - (int *VECTORLENOUTPUT, char ***VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, char ***VECTOROUTPUT), - (int *LISTLENOUTPUT, char ***LISTOUTPUT), - (size_t *LISTLENOUTPUT, char ***LISTOUTPUT), - (int *VECTORLENOUTPUT, const char ***VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, const char ***VECTOROUTPUT), - (int *LISTLENOUTPUT, const char ***LISTOUTPUT), - (size_t *LISTLENOUTPUT, const char ***LISTOUTPUT) - { - if ((*$2)!=NULL) { - int i; - for (i = 0; i < *$1; i++) { - free((*$2)[i]); - } - free(*$2); - } - } - -%typemap(freearg) (int VECTORLENINPUT, char **VECTORINPUT), - (size_t VECTORLENINPUT, char **VECTORINPUT), - (int LISTLENINPUT, char **LISTINPUT), - (size_t LISTLENINPUT, char **LISTINPUT), - (int VECTORLENINPUT, const char **VECTORINPUT), - (size_t VECTORLENINPUT, const char **VECTORINPUT), - (int LISTLENINPUT, const char **LISTINPUT), - (size_t LISTLENINPUT, const char **LISTINPUT) -{ - if (($2)!=NULL) { - int i; - for (i = 0; i< $1; i++) - free(($2)[i]); - free($2); - } -} - - -/* Following is a macro that emits typemaps that are much more - flexible. (They are also messier.) It supports multiple parallel - lists and vectors (sharing one length argument each). - - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - - Supported calling conventions: - - func(int PARALLEL_VECTORLENINPUT, [const] C_TYPE *PARALLEL_VECTORINPUT, ...) or - func([const] C_TYPE *PARALLEL_VECTORINPUT, ..., int PARALLEL_VECTORLENINPUT) - - func(int PARALLEL_LISTLENINPUT, [const] C_TYPE *PARALLEL_LISTINPUT, ...) or - func([const] C_TYPE *PARALLEL_LISTINPUT, ..., int PARALLEL_LISTLENINPUT) - - func(int *PARALLEL_VECTORLENOUTPUT, C_TYPE **PARALLEL_VECTOROUTPUT, ...) or - func(C_TYPE **PARALLEL_VECTOROUTPUT, int *PARALLEL_VECTORLENOUTPUT, ...) - - func(int *PARALLEL_LISTLENOUTPUT, C_TYPE **PARALLEL_LISTOUTPUT) or - func(C_TYPE **PARALLEL_LISTOUTPUT, int *PARALLEL_LISTLENOUTPUT) - - It is also allowed to use "size_t PARALLEL_LISTLENINPUT" rather than "int - PARALLEL_LISTLENINPUT". */ - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - - /* input */ - - /* Passing data is a little complicated here; just remember: - IGNORE typemaps come first, then IN, then CHECK. But if - IGNORE is given, IN won't be used for this type. - - We need to "ignore" one of the parameters because there shall - be only one argument on the Scheme side. Here we only - initialize the array length to 0 but save its address for a - later change. */ - - %typemap(in,numinputs=0) int PARALLEL_VECTORLENINPUT (int *_global_vector_length), - size_t PARALLEL_VECTORLENINPUT (size_t *_global_vector_length) - { - $1 = 0; - _global_vector_length = &$1; - } - - %typemap(in,numinputs=0) int PARALLEL_LISTLENINPUT (int *_global_list_length), - size_t PARALLEL_LISTLENINPUT (size_t *_global_list_length) - { - $1 = 0; - _global_list_length = &$1; - } - - /* All the work is done in IN. */ - - %typemap(in, doc="$NAME is a vector of " #SCM_TYPE " values") - C_TYPE *PARALLEL_VECTORINPUT, - const C_TYPE *PARALLEL_VECTORINPUT - { - SCM_VALIDATE_VECTOR($argnum, $input); - *_global_vector_length = scm_c_vector_length($input); - if (*_global_vector_length > 0) { - int i; - $1 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) - * (*_global_vector_length)); - for (i = 0; i<*_global_vector_length; i++) { - SCM swig_scm_value = scm_vector_ref($input, scm_from_long(i)); - $1[i] = SCM_TO_C_EXPR; - } - } - else $1 = NULL; - } - - %typemap(in, doc="$NAME is a list of " #SCM_TYPE " values") - C_TYPE *PARALLEL_LISTINPUT, - const C_TYPE *PARALLEL_LISTINPUT - { - SCM_VALIDATE_LIST($argnum, $input); - *_global_list_length = scm_to_ulong(scm_length($input)); - if (*_global_list_length > 0) { - int i; - SCM rest; - $1 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) - * (*_global_list_length)); - for (i = 0, rest = $input; - i<*_global_list_length; - i++, rest = SCM_CDR(rest)) { - SCM swig_scm_value = SCM_CAR(rest); - $1[i] = SCM_TO_C_EXPR; - } - } - else $1 = NULL; - } - - /* Don't check for NULL pointers (override checks). */ - - %typemap(check) C_TYPE *PARALLEL_VECTORINPUT, - const C_TYPE *PARALLEL_VECTORINPUT, - C_TYPE *PARALLEL_LISTINPUT, - const C_TYPE *PARALLEL_LISTINPUT - "/* no check for NULL pointer */"; - - /* Discard the temporary array after the call. */ - - %typemap(freearg) C_TYPE *PARALLEL_VECTORINPUT, - const C_TYPE *PARALLEL_VECTORINPUT, - C_TYPE *PARALLEL_LISTINPUT, - const C_TYPE *PARALLEL_LISTINPUT - {SWIG_free($1);} - -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) - - /* output */ - - /* First we make a temporary variable ARRAYLENTEMP, use its - address as the ...LENOUTPUT argument for the C function and - "ignore" the ...LENOUTPUT argument for Scheme. */ - - %typemap(in,numinputs=0) int *PARALLEL_VECTORLENOUTPUT (int _global_arraylentemp), - size_t *PARALLEL_VECTORLENOUTPUT (size_t _global_arraylentemp), - int *PARALLEL_LISTLENOUTPUT (int _global_arraylentemp), - size_t *PARALLEL_LISTLENOUTPUT (size_t _global_arraylentemp) - "$1 = &_global_arraylentemp;"; - - /* We also need to ignore the ...OUTPUT argument. */ - - %typemap(in,numinputs=0) C_TYPE **PARALLEL_VECTOROUTPUT (C_TYPE *arraytemp), - C_TYPE **PARALLEL_LISTOUTPUT (C_TYPE *arraytemp) - "$1 = &arraytemp;"; - - /* In the ARGOUT typemaps, we convert the array into a vector or - a list and append it to the results. */ - - %typemap(argout, doc="$NAME (a vector of " #SCM_TYPE " values)") - C_TYPE **PARALLEL_VECTOROUTPUT - { - int i; - SCM res = scm_make_vector(scm_from_long(_global_arraylentemp), - SCM_BOOL_F); - for (i = 0; i<_global_arraylentemp; i++) { - C_TYPE swig_c_value = (*$1)[i]; - SCM elt = C_TO_SCM_EXPR; - scm_vector_set_x(res, scm_from_long(i), elt); - } - SWIG_APPEND_VALUE(res); - } - - %typemap(argout, doc="$NAME (a list of " #SCM_TYPE " values)") - C_TYPE **PARALLEL_LISTOUTPUT - { - int i; - SCM res = SCM_EOL; - if (_global_arraylentemp > 0) { - for (i = _global_arraylentemp - 1; i>=0; i--) { - C_TYPE swig_c_value = (*$1)[i]; - SCM elt = C_TO_SCM_EXPR; - res = scm_cons(elt, res); - } - } - SWIG_APPEND_VALUE(res); - } - - /* In the FREEARG typemaps, get rid of the C vector. - (This can be overridden if you want to keep the C vector.) */ - - %typemap(freearg) C_TYPE **PARALLEL_VECTOROUTPUT, - C_TYPE **PARALLEL_LISTOUTPUT - { - free(*$1); - } - -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT(C_TYPE, SCM_TO_C, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), SCM_TYPE) -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT(C_TYPE, C_TO_SCM, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR - (C_TYPE, C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -/* We use the macro to define typemaps for some standard types. */ - -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(bool, scm_is_true, scm_from_bool, boolean); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(int, scm_to_int, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(short, scm_to_int, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(long, scm_to_long, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(ptrdiff_t, scm_to_long, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned int, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned short, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned long, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(size_t, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(float, scm_to_double, scm_from_double, real); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(double, scm_to_double, scm_from_double, real); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(char *, SWIG_scm2str, SWIG_str02scm, string); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(const char *, SWIG_scm2str, SWIG_str02scm, string); - -%typemap(freearg) char **PARALLEL_LISTINPUT, char **PARALLEL_VECTORINPUT, - const char **PARALLEL_LISTINPUT, const char **PARALLEL_VECTORINPUT -{ - if (($1)!=NULL) { - int i; - for (i = 0; i<*_global_list_length; i++) - SWIG_free(($1)[i]); - SWIG_free($1); - } -} - -%typemap(freearg) char ***PARALLEL_LISTOUTPUT, char ***PARALLEL_VECTOROUTPUT, - const char ***PARALLEL_LISTOUTPUT, const char ***PARALLEL_VECTOROUTPUT -{ - if ((*$1)!=NULL) { - int i; - for (i = 0; i<_global_arraylentemp; i++) - free((*$1)[i]); - free(*$1); - } -} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/pointer-in-out.i b/mac/bin/swig/share/swig/4.1.0/guile/pointer-in-out.i deleted file mode 100755 index d8a631ca..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/pointer-in-out.i +++ /dev/null @@ -1,102 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pointer-in-out.i - * - * Guile typemaps for passing pointers indirectly - * ----------------------------------------------------------------------------- */ - -/* Here is a macro that will define typemaps for passing C pointers indirectly. - - TYPEMAP_POINTER_INPUT_OUTPUT(PTRTYPE, SCM_TYPE) - - Supported calling conventions (in this example, PTRTYPE is int *): - - func(int **INPUT) - - Scheme wrapper will take one argument, a wrapped C pointer. - The address of a variable containing this pointer will be - passed to the function. - - func(int **INPUT_CONSUMED) - - Likewise, but mark the pointer object as not garbage - collectable. - - func(int **INPUT_DESTROYED) - - Likewise, but mark the pointer object as destroyed. - - func(int **OUTPUT) - - Scheme wrapper will take no arguments. The address of an int * - variable will be passed to the function. The function is - expected to modify the variable; its value is wrapped and - becomes an extra return value. (See the documentation on how - to deal with multiple values.) - - func(int **OUTPUT_NONCOLLECTABLE) - - Likewise, but make the pointer object not garbage collectable. - - func(int **BOTH) - func(int **INOUT) - - This annotation combines INPUT and OUTPUT. - -*/ - -%define TYPEMAP_POINTER_INPUT_OUTPUT(PTRTYPE, SCM_TYPE) - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE ">") PTRTYPE *INPUT(PTRTYPE temp) -{ - if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); - } - $1 = &temp; -} - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE "> and is consumed by the function") PTRTYPE *INPUT_CONSUMED(PTRTYPE temp) -{ - if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); - } - SWIG_Guile_MarkPointerNoncollectable($input); - $1 = &temp; -} - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE "> and is consumed by the function") PTRTYPE *INPUT_DESTROYED(PTRTYPE temp) -{ - if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); - } - SWIG_Guile_MarkPointerDestroyed($input); - $1 = &temp; -} - -%typemap(in, numinputs=0) PTRTYPE *OUTPUT(PTRTYPE temp), - PTRTYPE *OUTPUT_NONCOLLECTABLE(PTRTYPE temp) - "$1 = &temp;"; - -%typemap(argout, doc="<" #SCM_TYPE ">") PTRTYPE *OUTPUT - "SWIG_APPEND_VALUE(SWIG_NewPointerObj(*$1, $*descriptor, 1));"; - -%typemap(argout, doc="<" #SCM_TYPE ">") PTRTYPE *OUTPUT_NONCOLLECTABLE - "SWIG_APPEND_VALUE(SWIG_NewPointerObj(*$1, $*descriptor, 0));"; - -%typemap(in) PTRTYPE *BOTH = PTRTYPE *INPUT; -%typemap(argout) PTRTYPE *BOTH = PTRTYPE *OUTPUT; -%typemap(in) PTRTYPE *INOUT = PTRTYPE *INPUT; -%typemap(argout) PTRTYPE *INOUT = PTRTYPE *OUTPUT; - -/* As a special convenience measure, also attach docs involving - SCM_TYPE to the standard pointer typemaps */ - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE ">") PTRTYPE { - if (SWIG_ConvertPtr($input, (void **) &$1, $descriptor, 0)) - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); -} - -%typemap(out, doc="<" #SCM_TYPE ">") PTRTYPE { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/guile/ports.i b/mac/bin/swig/share/swig/4.1.0/guile/ports.i deleted file mode 100755 index 7691d3e3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/ports.i +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ports.i - * - * Guile typemaps for handling ports - * ----------------------------------------------------------------------------- */ - -%{ - #ifndef _POSIX_SOURCE - /* This is needed on Solaris for fdopen(). */ - # define _POSIX_SOURCE 199506L - #endif - #include - #include - #include -%} - -/* This typemap for FILE * accepts - (1) FILE * pointer objects, - (2) Scheme file ports. In this case, it creates a temporary C stream - which reads or writes from a dup'ed file descriptor. - */ - -%typemap(in, doc="$NAME is a file port or a FILE * pointer") FILE * -{ - if (SWIG_ConvertPtr($input, (void**) &($1), $1_descriptor, 0) != 0) { - if (!(SCM_FPORTP($input))) { - scm_wrong_type_arg("$symname", $argnum, $input); - } else { - int fd; - if (SCM_OUTPUT_PORT_P($input)) { - scm_force_output($input); - } - fd=dup(SCM_FPORT_FDES($input)); - if (fd==-1) { - scm_misc_error("$symname", strerror(errno), SCM_EOL); - } - $1=fdopen(fd, SCM_OUTPUT_PORT_P($input) ? (SCM_INPUT_PORT_P($input) ? "r+" : "w") : "r"); - if ($1==NULL) { - scm_misc_error("$symname", strerror(errno), SCM_EOL); - } - } - } -} - -%typemap(freearg) FILE* { - if ($1) { - fclose($1); - } -} - diff --git a/mac/bin/swig/share/swig/4.1.0/guile/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/guile/std_auto_ptr.i deleted file mode 100755 index 59d5c0ed..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scm_misc_error(FUNC_NAME, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'", SCM_EOL); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/std_common.i b/mac/bin/swig/share/swig/4.1.0/guile/std_common.i deleted file mode 100755 index 97974497..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/std_common.i +++ /dev/null @@ -1,25 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; - -#define SWIG_bool2scm(b) scm_from_bool(b ? 1 : 0) -#define SWIG_string2scm(s) SWIG_str02scm(s.c_str()) - -%{ -#include - -SWIGINTERNINLINE -std::string SWIG_scm2string(SCM x) { - char* temp; - temp = SWIG_scm2str(x); - std::string s(temp); - SWIG_free(temp); - return s; -} -%} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/std_deque.i b/mac/bin/swig/share/swig/4.1.0/guile/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/guile/std_except.i b/mac/bin/swig/share/swig/4.1.0/guile/std_except.i deleted file mode 100755 index 6c30a319..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/std_except.i +++ /dev/null @@ -1,13 +0,0 @@ -// TODO: STL exception handling -// Note that the generic std_except.i file did not work -%{ -#include -#include -%} - -namespace std { - %ignore exception; - struct exception { - }; -} - diff --git a/mac/bin/swig/share/swig/4.1.0/guile/std_map.i b/mac/bin/swig/share/swig/4.1.0/guile/std_map.i deleted file mode 100755 index f84e78bc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/std_map.i +++ /dev/null @@ -1,1370 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// -// The aim of all that follows would be to integrate std::map with -// Guile as much as possible, namely, to allow the user to pass and -// be returned Scheme association lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::map), f(const std::map&), f(const std::map*): -// the parameter being read-only, either a Scheme alist or a -// previously wrapped std::map can be passed. -// -- f(std::map&), f(std::map*): -// the parameter must be modified; therefore, only a wrapped std::map -// can be passed. -// -- std::map f(): -// the map is returned by copy; therefore, a Scheme alist -// is returned which is most easily used in other Scheme functions -// -- std::map& f(), std::map* f(), const std::map& f(), -// const std::map* f(): -// the map is returned by reference; therefore, a wrapped std::map -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[*k] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[*k] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - K* key = new K(i->first); - T* val = new T(i->second); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - /* native sequence? */ - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - K* k; - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - /* native sequence? */ - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - K* k; - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, const T& x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scm_cons(k,result); - } - return result; - } - } - }; - - - // specializations for built-ins - - %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) - - template class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[CONVERT_FROM(key)] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[CONVERT_FROM(key)] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - T* val = new T(i->second); - SCM k = CONVERT_TO(i->first); - SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, const T& x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - SCM k = CONVERT_TO(i->first); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) - template class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[*k] = CONVERT_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[*k] = CONVERT_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - SCM x = CONVERT_TO(i->second); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - K* k; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - K* k; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, T x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, - T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) - template<> class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[CONVERT_K_FROM(key)] = - CONVERT_T_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - SCM k = CONVERT_K_TO(i->first); - SCM x = CONVERT_T_TO(i->second); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, T x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - SCM k = CONVERT_K_TO(i->first); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - - specialize_std_map_on_key(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_key(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_key(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_key(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_map_on_value(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_value(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_value(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_value(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); -} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/std_pair.i b/mac/bin/swig/share/swig/4.1.0/guile/std_pair.i deleted file mode 100755 index 050d4880..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/std_pair.i +++ /dev/null @@ -1,867 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// -// See std_vector.i for the rationale of typemap application -// ------------------------------------------------------------------------ - -%{ -#include -%} - -// exported class - -namespace std { - - template struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(*x,*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = new std::pair< T, U >(*x,*y); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - T* x = new T($1.first); - U* y = new U($1.second); - SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scm_cons(first,second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - - // specializations for built-ins - - %define specialize_std_pair_on_first(T,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(CONVERT_FROM(first),*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = new std::pair< T, U >(CONVERT_FROM(first),*y); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - U* y = new U($1.second); - SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scm_cons(CONVERT_TO($1.first),second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_second(U,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - T* x; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = std::make_pair(*x,CONVERT_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - T* x; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = new std::pair< T, U >(*x,CONVERT_FROM(second)); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - T* x = new T($1.first); - SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - $result = scm_cons(first,CONVERT_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_both(T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO, - U,CHECK_U,CONVERT_U_FROM,CONVERT_U_TO) - template<> struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = std::make_pair(CONVERT_T_FROM(first), - CONVERT_U_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = new std::pair< T, U >(CONVERT_T_FROM(first), CONVERT_U_FROM(second)); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - $result = scm_cons(CONVERT_T_TO($1.first), - CONVERT_U_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - - specialize_std_pair_on_first(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_first(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_first(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_first(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_first(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_first(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_first(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_first(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_first(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_first(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_pair_on_second(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_second(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_second(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_second(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_second(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_second(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_second(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_second(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_second(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_second(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); -} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/std_string.i b/mac/bin/swig/share/swig/4.1.0/guile/std_string.i deleted file mode 100755 index c49bfcb0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/std_string.i +++ /dev/null @@ -1,95 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - %typemap(typecheck) string = char *; - %typemap(typecheck) const string & = char *; - - %typemap(in) string (char * tempptr) { - if (scm_is_string($input)) { - tempptr = SWIG_scm2str($input); - $1.assign(tempptr); - SWIG_free(tempptr); - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(in) const string & ($*1_ltype temp, char *tempptr) { - if (scm_is_string($input)) { - tempptr = SWIG_scm2str($input); - temp.assign(tempptr); - SWIG_free(tempptr); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(in) string * (char *tempptr) { - if (scm_is_string($input)) { - tempptr = SWIG_scm2str($input); - $1 = new $*1_ltype(tempptr); - SWIG_free(tempptr); - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(out) string { - $result = SWIG_str02scm($1.c_str()); - } - - %typemap(out) const string & { - $result = SWIG_str02scm($1->c_str()); - } - - %typemap(out) string * { - $result = SWIG_str02scm($1->c_str()); - } - - %typemap(varin) string { - if (scm_is_string($input)) { - char *tempptr = SWIG_scm2str($input); - $1.assign(tempptr); - SWIG_free(tempptr); - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(varout) string { - $result = SWIG_str02scm($1.c_str()); - } - - %typemap(throws) string { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); - } - - %typemap(throws) const string & { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); - } -} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/guile/std_unique_ptr.i deleted file mode 100755 index 6f907e90..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scm_misc_error(FUNC_NAME, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'", SCM_EOL); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/std_vector.i b/mac/bin/swig/share/swig/4.1.0/guile/std_vector.i deleted file mode 100755 index 42bad849..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/std_vector.i +++ /dev/null @@ -1,424 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Guile as much as possible, namely, to allow the user to pass and -// be returned Guile vectors or lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a Guile sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a Guile vector of T:s -// is returned which is most easily used in other Guile functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - $1 = std::vector< T >(size); - for (unsigned long i=0; i(); - } else if (scm_is_pair($input)) { - SCM head, tail; - $1 = std::vector< T >(); - tail = $input; - while (!scm_is_null(tail)) { - head = SCM_CAR(tail); - tail = SCM_CDR(tail); - $1.push_back(*((T*)SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const vector& (std::vector temp), - const vector* (std::vector temp) { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - temp = std::vector< T >(size); - $1 = &temp; - for (unsigned long i=0; i(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::vector< T >(); - $1 = &temp; - SCM head, tail; - tail = $input; - while (!scm_is_null(tail)) { - head = SCM_CAR(tail); - tail = SCM_CDR(tail); - temp.push_back(*((T*) SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) vector { - $result = scm_make_vector(scm_from_long($1.size()),SCM_UNSPECIFIED); - for (unsigned int i=0; i<$1.size(); i++) { - T* x = new T((($1_type &)$1)[i]); - scm_vector_set_x($result,scm_from_long(i), - SWIG_NewPointerObj(x, $descriptor(T *), 1)); - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - T* x; - if (SWIG_ConvertPtr(o,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - T* x; - SCM head = SCM_CAR($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - if (SWIG_ConvertPtr(o,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - T* x; - SCM head = SCM_CAR($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - const T& ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - $1 = std::vector< T >(size); - for (unsigned long i=0; i(); - } else if (scm_is_pair($input)) { - SCM v = scm_vector($input); - unsigned long size = scm_c_vector_length(v); - $1 = std::vector< T >(size); - for (unsigned long i=0; i& (std::vector temp), - const vector* (std::vector temp) { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - temp = std::vector< T >(size); - $1 = &temp; - for (unsigned long i=0; i(); - $1 = &temp; - } else if (scm_is_pair($input)) { - SCM v = scm_vector($input); - unsigned long size = scm_c_vector_length(v); - temp = std::vector< T >(size); - $1 = &temp; - for (unsigned long i=0; i { - $result = scm_make_vector(scm_from_long($1.size()),SCM_UNSPECIFIED); - for (unsigned int i=0; i<$1.size(); i++) { - SCM x = CONVERT_TO((($1_type &)$1)[i]); - scm_vector_set_x($result,scm_from_long(i),x); - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - $1 = CHECK(o) ? 1 : 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - SCM head = SCM_CAR($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) ? 1 : 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - $1 = CHECK(o) ? 1 : 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - SCM head = SCM_CAR($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) ? 1 : 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/guile/swigmove.i b/mac/bin/swig/share/swig/4.1.0/guile/swigmove.i deleted file mode 100755 index 87ab91ea..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/swigmove.i +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "$1_type", $symname, $argnum); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/mac/bin/swig/share/swig/4.1.0/guile/swigrun.i b/mac/bin/swig/share/swig/4.1.0/guile/swigrun.i deleted file mode 100755 index e4573eb3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/swigrun.i +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- mode: c -*- */ - -%module swigrun - -#ifdef SWIGGUILE_SCM - -%runtime %{ -/* Hook the runtime module initialization - into the shared initialization function SWIG_Guile_Init. */ -#include -#ifdef __cplusplus -extern "C" -#endif -SCM scm_init_Swig_swigrun_module (void); -#define SWIG_INIT_RUNTIME_MODULE scm_init_Swig_swigrun_module(); -%} - -/* The runtime type system from common.swg */ - -typedef struct swig_type_info swig_type_info; - -const char * -SWIG_TypeName(const swig_type_info *type); - -const char * -SWIG_TypePrettyName(const swig_type_info *type); - -swig_type_info * -SWIG_TypeQuery(const char *); - -/* Language-specific stuff */ - -%apply bool { int }; - -int -SWIG_IsPointer(SCM object); - -int -SWIG_IsPointerOfType(SCM object, swig_type_info *type); - -unsigned long -SWIG_PointerAddress(SCM object); - -swig_type_info * -SWIG_PointerType(SCM object); - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/guile/typemaps.i b/mac/bin/swig/share/swig/4.1.0/guile/typemaps.i deleted file mode 100755 index 45a2208f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/guile/typemaps.i +++ /dev/null @@ -1,501 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Guile-specific typemaps - * ----------------------------------------------------------------------------- */ - -/* These are defined with a view to eventually merging with those defined for other target languages in swigtypemaps.swg and exception.swg */ -#define %set_output(obj) $result = obj -#define %set_varoutput(obj) $result = obj -#define %argument_fail(_code, _type, _name, _argn) scm_wrong_type_arg((char *) FUNC_NAME, _argn, $input) -#define %as_voidptr(ptr) (void*)(ptr) -#define %argument_nullref(_type, _name, _argn) scm_misc_error(FUNC_NAME, "invalid null reference for argument " #_argn " of type '" _type "'", SCM_EOL) -#define %releasenotowned_fail(_code, _type, _name, _argn) scm_misc_error(FUNC_NAME, "cannot release ownership as memory is not owned for argument " #_argn " of type '" _type "'", SCM_EOL) - -/* Pointers */ - -%typemap(in) SWIGTYPE *, SWIGTYPE [] { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} -%typemap(in) SWIGTYPE & ($1_ltype argp) { - argp = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - $1 = argp; -} -%typemap(in, noblock=1, fragment="") SWIGTYPE && (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) { - res = SWIG_ConvertPtr($input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "$1_type", $symname, $argnum); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -} -%typemap(freearg) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] "" - -%typemap(in) void * { - $1 = ($1_ltype)SWIG_MustGetPtr($input, NULL, $argnum, 0); -} -%typemap(freearg) void * "" - -%typemap(varin) SWIGTYPE * { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0); -} - -%typemap(varin) SWIGTYPE & { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE && { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE [] { - scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); -} - -%typemap(varin) SWIGTYPE [ANY] { - void *temp; - int ii; - $1_basetype *b = 0; - temp = SWIG_MustGetPtr($input, $1_descriptor, 1, 0); - b = ($1_basetype *) $1; - for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii); -} - -%typemap(varin) void * { - $1 = SWIG_MustGetPtr($input, NULL, 1, 0); -} - -%typemap(out) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj ($1, ty, $owner); -} - -%typemap(varout) SWIGTYPE *, SWIGTYPE [] { - $result = SWIG_NewPointerObj ($1, $descriptor, 0); -} - -%typemap(varout) SWIGTYPE & { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -%typemap(varout) SWIGTYPE && { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -%typemap(throws) SWIGTYPE { - $<ype temp = new $ltype($1); - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj(temp, $&descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE & { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj(&$1, $descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE && { - scm_throw(gh_symbol2scm((char *) "swig-exception"), - gh_list(SWIG_NewPointerObj(&$1, $descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE * { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj($1, $descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE [] { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj($1, $descriptor, 1), - SCM_UNDEFINED)); -} - -/* Change of object ownership, and interaction of destructor-like functions and the - garbage-collector */ - -%typemap(in, doc="$NAME is of type <$type> and gets destroyed by the function") SWIGTYPE *DESTROYED { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} - -%typemap(freearg) SWIGTYPE *DESTROYED { - SWIG_Guile_MarkPointerDestroyed($input); -} - -%typemap(in, doc="$NAME is of type <$type> and is consumed by the function") SWIGTYPE *CONSUMED { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); - SWIG_Guile_MarkPointerNoncollectable($input); -} - -/* Pass-by-value */ - -%typemap(in) SWIGTYPE ($&1_ltype argp) { - argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0); - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - $1 = *argp; -} - -%typemap(varin) SWIGTYPE { - $&1_ltype argp; - argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, 1, 0); - $1 = *argp; -} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype($1); - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 1); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1); -} -#endif - -%typemap(varout) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr = ($&1_ltype)&$1; - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 0); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0); -} -#endif - -/* Enums */ - -%typemap(in) enum SWIGTYPE { $1 = ($1_type) scm_to_int($input); } -/* The complicated construction below needed to deal with anonymous - enums, which cannot be cast to. */ -%typemap(varin) enum SWIGTYPE { - if (sizeof(int) != sizeof($1)) { - scm_error(scm_from_locale_symbol("swig-error"), - (char *) FUNC_NAME, - (char *) "enum variable '$name' cannot be set", - SCM_EOL, SCM_BOOL_F); - } - * (int *) &($1) = scm_to_int($input); -} -%typemap(out) enum SWIGTYPE { $result = scm_from_long((int)$1); } -%typemap(varout) enum SWIGTYPE { $result = scm_from_long((int)$1); } -%typemap(throws) enum SWIGTYPE { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(scm_from_long((int)$1), SCM_UNDEFINED)); -} - -/* The SIMPLE_MAP_WITH_EXPR macro below defines the whole set of - typemaps needed for simple types. - -- SCM_TO_C_EXPR is a C expression that translates the Scheme value - "swig_scm_value" to a C value. - -- C_TO_SCM_EXPR is a C expression that translates the C value - "swig_c_value" to a Scheme value. */ - -%define SIMPLE_MAP_WITH_EXPR(C_NAME, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_NAME) - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">") C_NAME - { SCM swig_scm_value = $input; - $1 = SCM_TO_C_EXPR; } - %typemap (varin, doc="NEW-VALUE is of type <" #SCM_NAME ">") C_NAME - { SCM swig_scm_value = $input; - $1 = SCM_TO_C_EXPR; } - %typemap (out, doc="<" #SCM_NAME ">") C_NAME - { C_NAME swig_c_value = $1; - $result = C_TO_SCM_EXPR; } - %typemap (varout, doc="<" #SCM_NAME ">") C_NAME - { C_NAME swig_c_value = $1; - $result = C_TO_SCM_EXPR; } - /* INPUT and OUTPUT */ - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">)") - C_NAME *INPUT(C_NAME temp) { - SCM swig_scm_value = $input; - temp = (C_NAME) SCM_TO_C_EXPR; $1 = &temp; } - %typemap (in,numinputs=0) C_NAME *OUTPUT (C_NAME temp) - {$1 = &temp;} - %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT - { C_NAME swig_c_value = *$1; - SWIG_APPEND_VALUE(C_TO_SCM_EXPR); } - %typemap (in) C_NAME *BOTH = C_NAME *INPUT; - %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; - %typemap (in) C_NAME *INOUT = C_NAME *INPUT; - %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; - /* Const primitive references. Passed by value */ - %typemap(in, doc="$NAME is of type <" #SCM_NAME ">") const C_NAME & (C_NAME temp) - { SCM swig_scm_value = $input; - temp = SCM_TO_C_EXPR; - $1 = &temp; } - %typemap(out, doc="<" #SCM_NAME ">") const C_NAME & - { C_NAME swig_c_value = *$1; - $result = C_TO_SCM_EXPR; } - /* Throw typemap */ - %typemap(throws) C_NAME { - C_NAME swig_c_value = $1; - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(C_TO_SCM_EXPR, SCM_UNDEFINED)); - } -%enddef - -/* The SIMPLE_MAP macro below defines the whole set of typemaps needed - for simple types. It generates slightly simpler code than the - macro above, but it is only suitable for very simple conversion - expressions. */ - -%define SIMPLE_MAP(C_NAME, SCM_TO_C, C_TO_SCM, SCM_NAME) - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">") - C_NAME {$1 = ($1_ltype) SCM_TO_C($input);} - %typemap (varin, doc="NEW-VALUE is of type <" #SCM_NAME ">") - C_NAME {$1 = ($1_ltype) SCM_TO_C($input);} - %typemap (out, doc="<" #SCM_NAME ">") - C_NAME {$result = C_TO_SCM($1);} - %typemap (varout, doc="<" #SCM_NAME ">") - C_NAME {$result = C_TO_SCM($1);} - /* INPUT and OUTPUT */ - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">)") - C_NAME *INPUT(C_NAME temp), C_NAME &INPUT(C_NAME temp) { - temp = (C_NAME) SCM_TO_C($input); $1 = &temp; - } - %typemap (in,numinputs=0) C_NAME *OUTPUT (C_NAME temp), C_NAME &OUTPUT(C_NAME temp) - {$1 = &temp;} - %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT, C_NAME &OUTPUT - {SWIG_APPEND_VALUE(C_TO_SCM(*$1));} - %typemap (in) C_NAME *BOTH = C_NAME *INPUT; - %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; - %typemap (in) C_NAME *INOUT = C_NAME *INPUT; - %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; - %typemap (in) C_NAME &INOUT = C_NAME &INPUT; - %typemap (argout) C_NAME &INOUT = C_NAME &OUTPUT; - /* Const primitive references. Passed by value */ - %typemap(in, doc="$NAME is of type <" #SCM_NAME ">") const C_NAME & (C_NAME temp) { - temp = SCM_TO_C($input); - $1 = ($1_ltype) &temp; - } - %typemap(out, doc="<" #SCM_NAME ">") const C_NAME & { - $result = C_TO_SCM(*$1); - } - /* Throw typemap */ - %typemap(throws) C_NAME { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(C_TO_SCM($1), SCM_UNDEFINED)); - } -%enddef - - SIMPLE_MAP(bool, scm_is_true, scm_from_bool, boolean); - SIMPLE_MAP(char, SCM_CHAR, SCM_MAKE_CHAR, char); - SIMPLE_MAP(unsigned char, SCM_CHAR, SCM_MAKE_CHAR, char); - SIMPLE_MAP(signed char, SCM_CHAR, SCM_MAKE_CHAR, char); - SIMPLE_MAP(int, scm_to_int, scm_from_long, integer); - SIMPLE_MAP(short, scm_to_short, scm_from_long, integer); - SIMPLE_MAP(long, scm_to_long, scm_from_long, integer); - SIMPLE_MAP(ptrdiff_t, scm_to_long, scm_from_long, integer); - SIMPLE_MAP(unsigned int, scm_to_uint, scm_from_ulong, integer); - SIMPLE_MAP(unsigned short, scm_to_ushort, scm_from_ulong, integer); - SIMPLE_MAP(unsigned long, scm_to_ulong, scm_from_ulong, integer); - SIMPLE_MAP(size_t, scm_to_ulong, scm_from_ulong, integer); - SIMPLE_MAP(float, scm_to_double, scm_from_double, real); - SIMPLE_MAP(double, scm_to_double, scm_from_double, real); -// SIMPLE_MAP(char *, SWIG_scm2str, SWIG_str02scm, string); -// SIMPLE_MAP(const char *, SWIG_scm2str, SWIG_str02scm, string); - -/* Define long long typemaps -- uses functions that are only defined - in recent versions of Guile, availability also depends on Guile's - configuration. */ - -SIMPLE_MAP(long long, scm_to_long_long, scm_from_long_long, integer); -SIMPLE_MAP(unsigned long long, scm_to_ulong_long, scm_from_ulong_long, integer); - -/* Strings */ - - %typemap (in, doc="$NAME is a string") char *(int must_free = 0) { - $1 = ($1_ltype)SWIG_scm2str($input); - must_free = 1; - } - %typemap (varin, doc="NEW-VALUE is a string") char * {$1 = ($1_ltype)SWIG_scm2str($input);} - %typemap (out, doc="") char * {$result = SWIG_str02scm((const char *)$1);} - %typemap (varout, doc="") char * {$result = SWIG_str02scm($1);} - %typemap (in, doc="$NAME is a string") char **INPUT(char * temp, int must_free = 0) { - temp = (char *) SWIG_scm2str($input); $1 = &temp; - must_free = 1; - } - %typemap (in,numinputs=0) char **OUTPUT (char * temp) - {$1 = &temp;} - %typemap (argout,doc="$NAME (a string)") char **OUTPUT - {SWIG_APPEND_VALUE(SWIG_str02scm(*$1));} - %typemap (in) char **BOTH = char **INPUT; - %typemap (argout) char **BOTH = char **OUTPUT; - %typemap (in) char **INOUT = char **INPUT; - %typemap (argout) char **INOUT = char **OUTPUT; - -/* SWIG_scm2str makes a malloc'ed copy of the string, so get rid of it after - the function call. */ - -%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 **OUTPUT "SWIG_free(*$1);" - -/* But this shall not apply if we try to pass a single char by - reference. */ - -%typemap (freearg) char *OUTPUT, char *BOTH "" - -/* If we set a string variable, delete the old result first, unless const. */ - -%typemap (varin) char * { - free($1); - $1 = ($1_ltype) SWIG_scm2str($input); -} - -%typemap (varin) const char * { - $1 = ($1_ltype) SWIG_scm2str($input); -} - -%typemap(throws) char * { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_str02scm($1), SCM_UNDEFINED)); -} - -/* Void */ - -%typemap (out,doc="") void "gswig_result = SCM_UNSPECIFIED;" - -/* SCM is passed through */ - -typedef unsigned long SCM; -%typemap (in) SCM "$1=$input;" -%typemap (out) SCM "$result=$1;" -%typecheck(SWIG_TYPECHECK_POINTER) SCM "$1=1;"; - -/* ------------------------------------------------------------ - * String & length - * ------------------------------------------------------------ */ - -%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) { - size_t temp; - $1 = ($1_ltype) SWIG_Guile_scm2newstr($input, &temp); - $2 = ($2_ltype) temp; -} - -/* ------------------------------------------------------------ - * CLASS::* (member function pointer) typemaps - * taken from typemaps/swigtype.swg - * ------------------------------------------------------------ */ - -%typemap(in) SWIGTYPE (CLASS::*) { - int res = SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($1), $descriptor); - if (!SWIG_IsOK(res)) { - %argument_fail(res,"$type",$symname, $argnum); - } -} - -%typemap(out,noblock=1) SWIGTYPE (CLASS::*) { - %set_output(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($1), $descriptor)); -} - -%typemap(varin) SWIGTYPE (CLASS::*) { - int res = SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($1), $descriptor); - if (!SWIG_IsOK(res)) { - scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); - } -} - -%typemap(varout,noblock=1) SWIGTYPE (CLASS::*) { - %set_varoutput(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($1), $descriptor)); -} - -/* ------------------------------------------------------------ - * Typechecking rules - * ------------------------------------------------------------ */ - -/* adapted from python.swg */ - -%typecheck(SWIG_TYPECHECK_INTEGER) - int, short, long, - unsigned int, unsigned short, unsigned long, - signed char, unsigned char, - long long, unsigned long long, - size_t, ptrdiff_t, - std::size_t, std::ptrdiff_t, - const int &, const short &, const long &, - const unsigned int &, const unsigned short &, const unsigned long &, - const long long &, const unsigned long long &, - const size_t &, const ptrdiff_t &, - const std::size_t &, const std::ptrdiff_t &, - enum SWIGTYPE -{ - $1 = scm_is_true(scm_integer_p($input)) && scm_is_true(scm_exact_p($input))? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, bool&, const bool& -{ - $1 = scm_is_bool($input) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) - float, double, - const float &, const double & -{ - $1 = scm_is_true(scm_real_p($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_CHAR) char { - $1 = SCM_CHARP($input) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - $1 = scm_is_string($input) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $1_descriptor, 0); - $1 = SWIG_CheckState(res); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE &, SWIGTYPE && { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $1_descriptor, SWIG_POINTER_NO_NULL); - $1 = SWIG_CheckState(res); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $&descriptor, SWIG_POINTER_NO_NULL); - $1 = SWIG_CheckState(res); -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, 0, 0); - $1 = SWIG_CheckState(res); -} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* typemaps.i ends here */ diff --git a/mac/bin/swig/share/swig/4.1.0/intrusive_ptr.i b/mac/bin/swig/share/swig/4.1.0/intrusive_ptr.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/inttypes.i b/mac/bin/swig/share/swig/4.1.0/inttypes.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/java/arrays_java.i b/mac/bin/swig/share/swig/4.1.0/java/arrays_java.i deleted file mode 100755 index a57da64b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/arrays_java.i +++ /dev/null @@ -1,392 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_java.i - * - * These typemaps give more natural support for arrays. The typemaps are not efficient - * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from Java and vice versa. The Java array is expected to be the same size as the C array. - * An exception is thrown if they are not. - * - * Example usage: - * Wrapping: - * - * %include - * %inline %{ - * short FiddleSticks[3]; - * %} - * - * Use from Java like this: - * - * short[] fs = new short[] {10, 11, 12}; - * example.setFiddleSticks(fs); - * fs = example.getFiddleSticks(); - * ----------------------------------------------------------------------------- */ - -/* Primitive array support is a combination of SWIG macros and functions in order to reduce - * code bloat and aid maintainability. The SWIG preprocessor expands the macros into functions - * for inclusion in the generated code. */ - -/* Array support functions declarations macro */ -%define JAVA_ARRAYS_DECL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) -%{ -static int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input); -static void SWIG_JavaArrayArgout##JFUNCNAME (JNIEnv *jenv, JNITYPE *jarr, CTYPE *carr, JNITYPE##Array input); -static JNITYPE##Array SWIG_JavaArrayOut##JFUNCNAME (JNIEnv *jenv, CTYPE *result, jsize sz); -%} -%enddef - -/* Array support functions macro */ -%define JAVA_ARRAYS_IMPL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) -%{ -/* CTYPE[] support */ -static int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = JCALL1(GetArrayLength, jenv, input); - *jarr = JCALL2(Get##JAVATYPE##ArrayElements, jenv, input, 0); - if (!*jarr) - return 0; %} -#ifdef __cplusplus -%{ *carr = new CTYPE[sz]; %} -#else -%{ *carr = (CTYPE*) malloc(sz * sizeof(CTYPE)); %} -#endif -%{ if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; i - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -%typemap(in) CONST TYPE ($&1_type argp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain value - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") CONST TYPE %{ - //plain value(out) - $1_ltype* resultp = new $1_ltype($1); - intrusive_ptr_add_ref(resultp); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(resultp, SWIG_intrusive_deleter< CONST TYPE >()); -%} - -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain pointer - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE * %{ - //plain pointer(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in) CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain reference - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if(!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - return $null; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE & %{ - //plain reference(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain pointer by reference - temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") TYPE *CONST& %{ - // plain pointer by reference(out) - #if ($owner) - if (*$1) { - intrusive_ptr_add_ref(*$1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_0); - #endif -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > ($&1_type argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by value - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if (smartarg) { - $1 = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ - if ($1) { - intrusive_ptr_add_ref(result.get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(result.get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by reference - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - delete &($1); - if ($self) { - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * temp = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); - $1 = *temp; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - if (*$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - delete $1; - if ($self) $1 = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - if ($1 && *$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - if ($owner) delete $1; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& (SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > temp, $*1_ltype tempp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer reference - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if ($input) { - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } - tempp = &temp; - $1 = &tempp; -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if ($self) $1 = *$input; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if (*$1 && **$1) { - intrusive_ptr_add_ref((*$1)->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >((*$1)->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (jni) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "jlong" -%typemap (jtype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "long" -%typemap (jstype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(jstype, TYPE)" -%typemap(javain) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(jstype, TYPE).getCPtr($javainput)" - -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - - -%typemap(javaout) CONST TYPE { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE & { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) TYPE *CONST& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnBase; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { - if(swigCPtr != 0 && swigCMemOwnBase) { - swigCMemOwnBase = false; - $jnicall; - } - swigCPtr = 0; - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { - if(swigCPtr != 0 && swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $jnicall; - } - swigCPtr = 0; - super.delete(); - } - -// CONST version needed ???? also for C# -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "long" -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "long" - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%template() SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; -%enddef - - -///////////////////////////////////////////////////////////////////// - - -%include - -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - - -// plain value -%typemap(in) CONST TYPE ($&1_type argp = 0) %{ - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -// plain pointer -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -// plain reference -%typemap(in) CONST TYPE & %{ - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (jni) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "jlong" -%typemap (jtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "long" -%typemap (jstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE)" -%typemap (javain) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE).getCPtr($javainput)" -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(javaout) CONST TYPE { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE & { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) TYPE *CONST& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnBase; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $jnicall; - } - swigCPtr = 0; - } - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $jnicall; - } - swigCPtr = 0; - } - super.delete(); - } - -// CONST version needed ???? also for C# -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "long" -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "long" - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef - diff --git a/mac/bin/swig/share/swig/4.1.0/java/boost_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/java/boost_shared_ptr.i deleted file mode 100755 index ce00162d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/boost_shared_ptr.i +++ /dev/null @@ -1,337 +0,0 @@ -// Users can provide their own SWIG_SHARED_PTR_TYPEMAPS macro before including this file to change the -// visibility of the constructor and getCPtr method if desired to public if using multiple modules. -#ifndef SWIG_SHARED_PTR_TYPEMAPS -#define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(protected, protected, CONST, TYPE) -#endif - -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE ($&1_type argp = 0) %{ - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -%typemap(directorin,descriptor="L$packagepath/$&javaclassname;") CONST TYPE -%{ $input = 0; - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (new $1_ltype(SWIG_STD_MOVE($1))); %} - -%typemap(directorout) CONST TYPE -%{ if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $result = *smartarg->get(); - %} - -// plain pointer -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") CONST TYPE * -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($1 SWIG_NO_NULL_DELETER_0); - } %} - -%typemap(directorout) CONST TYPE * %{ -#error "typemaps for $1_type not available" -%} - -// plain reference -%typemap(in) CONST TYPE & %{ - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") CONST TYPE & -%{ $input = 0; - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (&$1 SWIG_NO_NULL_DELETER_0); %} - -%typemap(directorout) CONST TYPE & %{ -#error "typemaps for $1_type not available" -%} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = (TYPE *)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin,descriptor="L$packagepath/$*javaclassname;") TYPE *CONST& -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($1 SWIG_NO_NULL_DELETER_0); - } %} - -%typemap(directorout) TYPE *CONST& %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (argp) $1 = *argp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) { - $&1_type smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $result = *smartarg; - } %} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) -%{ $1 = $input ? *($&1_ltype)&$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ *($&1_ltype)&$result = *$1 ? new $*1_ltype(*$1) : 0; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) -%{ $1 = $input ? *($&1_ltype)&$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ *($&1_ltype)&$result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; - if ($owner) delete $1; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $input = 0; - if ($1 && *$1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) -%{ temp = $input ? *($1_ltype)&$input : &tempnull; - $1 = &temp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ $input = 0; - if ($1 && *$1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "typemaps for $1_type not available" -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (jni) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "jlong" -%typemap (jtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "long" -%typemap (jstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(jstype, TYPE)" - -%typemap(javain) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(jstype, TYPE).getCPtr($javainput)" - -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - - -%typemap(javaout) CONST TYPE { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE & { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) TYPE *CONST& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(javadirectorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE).getCPtr($javacall)" - -%typemap(javadirectorin) CONST TYPE, - CONST TYPE *, - CONST TYPE &, - TYPE *CONST& "($jniinput == 0) ? null : new $typemap(jstype, TYPE)($jniinput, true)" - -%typemap(javadirectorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "($jniinput == 0) ? null : new $typemap(jstype, TYPE)($jniinput, true)" - -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwn; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY void swigSetCMemOwn(boolean own) { - swigCMemOwn = own; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY void swigSetCMemOwn(boolean own) { - swigCMemOwnDerived = own; - super.swigSetCMemOwn(own); - } -%} - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - $jnicall; - } - swigCPtr = 0; - } - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $jnicall; - } - swigCPtr = 0; - } - super.delete(); - } - -%typemap(directordisconnect, methodname="swigDirectorDisconnect") TYPE %{ - protected void $methodname() { - swigSetCMemOwn(false); - $jnicall; - } -%} - -%typemap(directorowner_release, methodname="swigReleaseOwnership") TYPE %{ - public void $methodname() { - swigSetCMemOwn(false); - $jnicall; - } -%} - -%typemap(directorowner_take, methodname="swigTakeOwnership") TYPE %{ - public void $methodname() { - swigSetCMemOwn(true); - $jnicall; - } -%} - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef - diff --git a/mac/bin/swig/share/swig/4.1.0/java/director.swg b/mac/bin/swig/share/swig/4.1.0/java/director.swg deleted file mode 100755 index 53651355..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/director.swg +++ /dev/null @@ -1,541 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Java proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#if defined(DEBUG_DIRECTOR_OWNED) || defined(DEBUG_DIRECTOR_EXCEPTION) || defined(DEBUG_DIRECTOR_THREAD_NAME) -#include -#endif - -#include - -#if defined(SWIG_JAVA_USE_THREAD_NAME) - -#if !defined(SWIG_JAVA_GET_THREAD_NAME) -namespace Swig { - SWIGINTERN int GetThreadName(char *name, size_t len); -} - -#if defined(__linux__) - -#include -SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { - (void)len; -#if defined(PR_GET_NAME) - return prctl(PR_GET_NAME, (unsigned long)name, 0, 0, 0); -#else - (void)name; - return 1; -#endif -} - -#elif defined(__unix__) || defined(__APPLE__) - -#include -SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { - return pthread_getname_np(pthread_self(), name, len); -} - -#else - -SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { - (void)len; - (void)name; - return 1; -} -#endif - -#endif - -#endif - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) -#include -#endif - -namespace Swig { - - /* Java object wrapper */ - class JObjectWrapper { - public: - JObjectWrapper() : jthis_(NULL), weak_global_(true) { - } - - ~JObjectWrapper() { - jthis_ = NULL; - weak_global_ = true; - } - - bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) { - if (!jthis_) { - weak_global_ = weak_global || !mem_own; // hold as weak global if explicitly requested or not owned - if (jobj) - jthis_ = weak_global_ ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj); -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl; -#endif - return true; - } else { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl; -#endif - return false; - } - } - - jobject get(JNIEnv *jenv) const { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::get("; - if (jthis_) - std::cout << jthis_; - else - std::cout << "null"; - std::cout << ") -> return new local ref" << std::endl; -#endif - return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_); - } - - void release(JNIEnv *jenv) { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl; -#endif - if (jthis_) { - if (weak_global_) { - if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE) - jenv->DeleteWeakGlobalRef((jweak)jthis_); - } else - jenv->DeleteGlobalRef(jthis_); - } - - jthis_ = NULL; - weak_global_ = true; - } - - /* Only call peek if you know what you are doing wrt to weak/global references */ - jobject peek() { - return jthis_; - } - - /* Java proxy releases ownership of C++ object, C++ object is now - responsible for destruction (creates NewGlobalRef to pin Java proxy) */ - void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { - if (take_or_release) { /* Java takes ownership of C++ object's lifetime. */ - if (!weak_global_) { - jenv->DeleteGlobalRef(jthis_); - jthis_ = jenv->NewWeakGlobalRef(jself); - weak_global_ = true; - } - } else { - /* Java releases ownership of C++ object's lifetime */ - if (weak_global_) { - jenv->DeleteWeakGlobalRef((jweak)jthis_); - jthis_ = jenv->NewGlobalRef(jself); - weak_global_ = false; - } - } - } - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) - static void detach(void *jvm) { - static_cast(jvm)->DetachCurrentThread(); - } - - static void make_detach_key() { - pthread_key_create(&detach_key_, detach); - } - - /* thread-local key to register a destructor */ - static pthread_key_t detach_key_; -#endif - - private: - /* pointer to Java object */ - jobject jthis_; - /* Local or global reference flag */ - bool weak_global_; - }; - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) - pthread_key_t JObjectWrapper::detach_key_; -#endif - - /* Local JNI reference deleter */ - class LocalRefGuard { - JNIEnv *jenv_; - jobject jobj_; - - // non-copyable - LocalRefGuard(const LocalRefGuard &); - LocalRefGuard &operator=(const LocalRefGuard &); - public: - LocalRefGuard(JNIEnv *jenv, jobject jobj): jenv_(jenv), jobj_(jobj) {} - ~LocalRefGuard() { - if (jobj_) - jenv_->DeleteLocalRef(jobj_); - } - }; - - /* director base class */ - class Director { - /* pointer to Java virtual machine */ - JavaVM *swig_jvm_; - - protected: -#if defined (_MSC_VER) && (_MSC_VER<1300) - class JNIEnvWrapper; - friend class JNIEnvWrapper; -#endif - /* Utility class for managing the JNI environment */ - class JNIEnvWrapper { - const Director *director_; - JNIEnv *jenv_; - int env_status; - public: - JNIEnvWrapper(const Director *director) : director_(director), jenv_(0), env_status(0) { -#if defined(__ANDROID__) - JNIEnv **jenv = &jenv_; -#else - void **jenv = (void **)&jenv_; -#endif - env_status = director_->swig_jvm_->GetEnv((void **)&jenv_, JNI_VERSION_1_2); - JavaVMAttachArgs args; - args.version = JNI_VERSION_1_2; - args.group = NULL; - args.name = NULL; -#if defined(SWIG_JAVA_USE_THREAD_NAME) - char thread_name[64]; // MAX_TASK_COMM_LEN=16 is hard-coded in the Linux kernel and MacOS has MAXTHREADNAMESIZE=64. - if (Swig::GetThreadName(thread_name, sizeof(thread_name)) == 0) { - args.name = thread_name; -#if defined(DEBUG_DIRECTOR_THREAD_NAME) - std::cout << "JNIEnvWrapper: thread name: " << thread_name << std::endl; - } else { - std::cout << "JNIEnvWrapper: Couldn't set Java thread name" << std::endl; -#endif - } -#endif -#if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON) - // Attach a daemon thread to the JVM. Useful when the JVM should not wait for - // the thread to exit upon shutdown. Only for jdk-1.4 and later. - director_->swig_jvm_->AttachCurrentThreadAsDaemon(jenv, &args); -#else - director_->swig_jvm_->AttachCurrentThread(jenv, &args); -#endif - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) - // At least on Android 6, detaching after every call causes a memory leak. - // Instead, register a thread desructor and detach only when the thread ends. - // See https://developer.android.com/training/articles/perf-jni#threads - static pthread_once_t once = PTHREAD_ONCE_INIT; - - pthread_once(&once, JObjectWrapper::make_detach_key); - pthread_setspecific(JObjectWrapper::detach_key_, director->swig_jvm_); -#endif - } - ~JNIEnvWrapper() { -#if !defined(SWIG_JAVA_DETACH_ON_THREAD_END) && !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD) - // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call. - // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak. - if (env_status == JNI_EDETACHED) - director_->swig_jvm_->DetachCurrentThread(); -#endif - } - JNIEnv *getJNIEnv() const { - return jenv_; - } - }; - - struct SwigDirectorMethod { - const char *name; - const char *desc; - jmethodID methid; - SwigDirectorMethod(JNIEnv *jenv, jclass baseclass, const char *name, const char *desc) : name(name), desc(desc) { - methid = jenv->GetMethodID(baseclass, name, desc); - } - }; - - /* Java object wrapper */ - JObjectWrapper swig_self_; - - /* Disconnect director from Java object */ - void swig_disconnect_director_self(const char *disconn_method) { - JNIEnvWrapper jnienv(this) ; - JNIEnv *jenv = jnienv.getJNIEnv() ; - jobject jobj = swig_self_.get(jenv); - LocalRefGuard ref_deleter(jenv, jobj); -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl; -#endif - if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) { - jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V"); - if (disconn_meth) { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl; -#endif - jenv->CallVoidMethod(jobj, disconn_meth); - } - } - } - - jclass swig_new_global_ref(JNIEnv *jenv, const char *classname) { - jclass clz = jenv->FindClass(classname); - return clz ? (jclass)jenv->NewGlobalRef(clz) : 0; - } - - public: - Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() { - /* Acquire the Java VM pointer */ - jenv->GetJavaVM(&swig_jvm_); - } - - virtual ~Director() { - JNIEnvWrapper jnienv(this) ; - JNIEnv *jenv = jnienv.getJNIEnv() ; - swig_self_.release(jenv); - } - - bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global) { - return swig_self_.set(jenv, jself, mem_own, weak_global); - } - - jobject swig_get_self(JNIEnv *jenv) const { - return swig_self_.get(jenv); - } - - // Change C++ object's ownership, relative to Java - void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { - swig_self_.java_change_ownership(jenv, jself, take_or_release); - } - }; - - // Zero initialized bool array - template class BoolArray { - bool array_[N]; - public: - BoolArray() { - memset(array_, 0, sizeof(array_)); - } - bool& operator[](size_t n) { - return array_[n]; - } - bool operator[](size_t n) const { - return array_[n]; - } - }; - - // Utility classes and functions for exception handling. - - // Simple holder for a Java string during exception handling, providing access to a c-style string - class JavaString { - public: - JavaString(JNIEnv *jenv, jstring jstr) : jenv_(jenv), jstr_(jstr), cstr_(0) { - if (jenv_ && jstr_) - cstr_ = (const char *) jenv_->GetStringUTFChars(jstr_, NULL); - } - - ~JavaString() { - if (jenv_ && jstr_ && cstr_) - jenv_->ReleaseStringUTFChars(jstr_, cstr_); - } - - const char *c_str(const char *null_string = "null JavaString") const { - return cstr_ ? cstr_ : null_string; - } - - private: - // non-copyable - JavaString(const JavaString &); - JavaString &operator=(const JavaString &); - - JNIEnv *jenv_; - jstring jstr_; - const char *cstr_; - }; - - // Helper class to extract the exception message from a Java throwable - class JavaExceptionMessage { - public: - JavaExceptionMessage(JNIEnv *jenv, jthrowable throwable) : message_(jenv, exceptionMessageFromThrowable(jenv, throwable)) { - } - - // Return a C string of the exception message in the jthrowable passed in the constructor - // If no message is available, null_string is return instead - const char *message(const char *null_string = "Could not get exception message in JavaExceptionMessage") const { - return message_.c_str(null_string); - } - - private: - // non-copyable - JavaExceptionMessage(const JavaExceptionMessage &); - JavaExceptionMessage &operator=(const JavaExceptionMessage &); - - // Get exception message by calling Java method Throwable.getMessage() - static jstring exceptionMessageFromThrowable(JNIEnv *jenv, jthrowable throwable) { - jstring jmsg = NULL; - if (jenv && throwable) { - jenv->ExceptionClear(); // Cannot invoke methods with any pending exceptions - jclass throwclz = jenv->GetObjectClass(throwable); - if (throwclz) { - // All Throwable classes have a getMessage() method, so call it to extract the exception message - jmethodID getMessageMethodID = jenv->GetMethodID(throwclz, "getMessage", "()Ljava/lang/String;"); - if (getMessageMethodID) - jmsg = (jstring)jenv->CallObjectMethod(throwable, getMessageMethodID); - } - if (jmsg == NULL && jenv->ExceptionCheck()) - jenv->ExceptionClear(); - } - return jmsg; - } - - JavaString message_; - }; - - // C++ Exception class for handling Java exceptions thrown during a director method Java upcall - class DirectorException : public std::exception { - public: - - // Construct exception from a Java throwable - DirectorException(JNIEnv *jenv, jthrowable throwable) : jenv_(jenv), throwable_(throwable), classname_(0), msg_(0) { - - // Call Java method Object.getClass().getName() to obtain the throwable's class name (delimited by '/') - if (jenv && throwable) { - jenv->ExceptionClear(); // Cannot invoke methods with any pending exceptions - jclass throwclz = jenv->GetObjectClass(throwable); - if (throwclz) { - jclass clzclz = jenv->GetObjectClass(throwclz); - if (clzclz) { - jmethodID getNameMethodID = jenv->GetMethodID(clzclz, "getName", "()Ljava/lang/String;"); - if (getNameMethodID) { - jstring jstr_classname = (jstring)(jenv->CallObjectMethod(throwclz, getNameMethodID)); - // Copy strings, since there is no guarantee that jenv will be active when handled - if (jstr_classname) { - JavaString jsclassname(jenv, jstr_classname); - const char *classname = jsclassname.c_str(0); - if (classname) - classname_ = copypath(classname); - } - } - } - } - } - - JavaExceptionMessage exceptionmsg(jenv, throwable); - msg_ = copystr(exceptionmsg.message(0)); - } - - // More general constructor for handling as a java.lang.RuntimeException - DirectorException(const char *msg) : jenv_(0), throwable_(0), classname_(0), msg_(msg ? copystr(msg) : 0) { - } - - ~DirectorException() throw() { - delete[] classname_; - delete[] msg_; - } - - const char *what() const throw() { - return msg_ ? msg_ : "Unspecified DirectorException message"; - } - - // Reconstruct and raise/throw the Java Exception that caused the DirectorException - // Note that any error in the JNI exception handling results in a Java RuntimeException - void throwException(JNIEnv *jenv) const { - if (jenv) { - if (jenv == jenv_ && throwable_) { - // Throw original exception if not already pending - jthrowable throwable = jenv->ExceptionOccurred(); - if (throwable && jenv->IsSameObject(throwable, throwable_) == JNI_FALSE) { - jenv->ExceptionClear(); - throwable = 0; - } - if (!throwable) - jenv->Throw(throwable_); - } else { - // Try and reconstruct original exception, but original stacktrace is not reconstructed - jenv->ExceptionClear(); - - jmethodID ctorMethodID = 0; - jclass throwableclass = 0; - if (classname_) { - throwableclass = jenv->FindClass(classname_); - if (throwableclass) - ctorMethodID = jenv->GetMethodID(throwableclass, "", "(Ljava/lang/String;)V"); - } - - if (ctorMethodID) { - jenv->ThrowNew(throwableclass, what()); - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, what()); - } - } - } - } - - // Deprecated - use throwException - void raiseJavaException(JNIEnv *jenv) const { - throwException(jenv); - } - - // Create and throw the DirectorException - static void raise(JNIEnv *jenv, jthrowable throwable) { - throw DirectorException(jenv, throwable); - } - - private: - static char *copypath(const char *srcmsg) { - char *target = copystr(srcmsg); - for (char *c=target; *c; ++c) { - if ('.' == *c) - *c = '/'; - } - return target; - } - - static char *copystr(const char *srcmsg) { - char *target = 0; - if (srcmsg) { - size_t msglen = strlen(srcmsg) + 1; - target = new char[msglen]; - strncpy(target, srcmsg, msglen); - } - return target; - } - - JNIEnv *jenv_; - jthrowable throwable_; - const char *classname_; - const char *msg_; - }; - - // Helper method to determine if a Java throwable matches a particular Java class type - // Note side effect of clearing any pending exceptions - SWIGINTERN bool ExceptionMatches(JNIEnv *jenv, jthrowable throwable, const char *classname) { - bool matches = false; - - if (throwable && jenv && classname) { - // Exceptions need to be cleared for correct behavior. - // The caller of ExceptionMatches should restore pending exceptions if desired - - // the caller already has the throwable. - jenv->ExceptionClear(); - - jclass clz = jenv->FindClass(classname); - if (clz) { - jclass classclz = jenv->GetObjectClass(clz); - jmethodID isInstanceMethodID = jenv->GetMethodID(classclz, "isInstance", "(Ljava/lang/Object;)Z"); - if (isInstanceMethodID) { - matches = jenv->CallBooleanMethod(clz, isInstanceMethodID, throwable) != 0; - } - } - -#if defined(DEBUG_DIRECTOR_EXCEPTION) - if (jenv->ExceptionCheck()) { - // Typically occurs when an invalid classname argument is passed resulting in a ClassNotFoundException - JavaExceptionMessage exc(jenv, jenv->ExceptionOccurred()); - std::cout << "Error: ExceptionMatches: class '" << classname << "' : " << exc.message() << std::endl; - } -#endif - } - return matches; - } -} - diff --git a/mac/bin/swig/share/swig/4.1.0/java/enums.swg b/mac/bin/swig/share/swig/4.1.0/java/enums.swg deleted file mode 100755 index 81fe5787..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/enums.swg +++ /dev/null @@ -1,116 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enums.swg - * - * Include this file in order for C/C++ enums to be wrapped by proper Java enums. - * Note that the JNI layer handles the enum as an int. The Java enum has extra - * code generated to store the C++ int value. This is required for C++ enums that - * specify a value for the enum item, as native Java enums do not support this. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "$*javaclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$*javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) const enum SWIGTYPE & "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput.swigValue()" -%typemap(javaout) const enum SWIGTYPE & { - return $*javaclassname.swigToEnum($jnicall); - } - - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "$javaclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="L$packagepath/$javaclassname;") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) enum SWIGTYPE "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -%typemap(javaclassmodifiers) enum SWIGTYPE "public enum" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" - -/* - * SwigNext static inner class used instead of a static int as static fields cannot be accessed from enum initialisers. - * The swigToEnum method is used to find the Java enum from a C++ enum integer value. The default one here takes - * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial - * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be - * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. - */ -%typemap(javabody) enum SWIGTYPE %{ - public final int swigValue() { - return swigValue; - } - - public static $javaclassname swigToEnum(int swigValue) { - $javaclassname[] swigValues = $javaclassname.class.getEnumConstants(); - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for ($javaclassname swigEnum : swigValues) - if (swigEnum.swigValue == swigValue) - return swigEnum; - throw new IllegalArgumentException("No enum " + $javaclassname.class + " with value " + swigValue); - } - - @SuppressWarnings("unused") - private $javaclassname() { - this.swigValue = SwigNext.next++; - } - - @SuppressWarnings("unused") - private $javaclassname(int swigValue) { - this.swigValue = swigValue; - SwigNext.next = swigValue+1; - } - - @SuppressWarnings("unused") - private $javaclassname($javaclassname swigEnum) { - this.swigValue = swigEnum.swigValue; - SwigNext.next = this.swigValue+1; - } - - private final int swigValue; - - private static class SwigNext { - private static int next = 0; - } -%} - -%javaenum(proper); - diff --git a/mac/bin/swig/share/swig/4.1.0/java/enumsimple.swg b/mac/bin/swig/share/swig/4.1.0/java/enumsimple.swg deleted file mode 100755 index c270149b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/enumsimple.swg +++ /dev/null @@ -1,71 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumsimple.swg - * - * This file provides backwards compatible enum wrapping. SWIG versions 1.3.21 - * and earlier wrapped global enums with constant integers in the module class - * or Constants interface. Enums declared within a C++ class were wrapped by - * constant integers in the Java proxy class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "int" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$jniinput" -%typemap(javadirectorout) const enum SWIGTYPE & "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput" -%typemap(javaout) const enum SWIGTYPE & { - return $jnicall; - } - - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "int" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$jniinput" -%typemap(javadirectorout) enum SWIGTYPE "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput" -%typemap(javaout) enum SWIGTYPE { - return $jnicall; - } - -%typemap(javaclassmodifiers) enum SWIGTYPE "" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" -%typemap(javabody) enum SWIGTYPE "" - -%javaenum(simple); - diff --git a/mac/bin/swig/share/swig/4.1.0/java/enumtypesafe.swg b/mac/bin/swig/share/swig/4.1.0/java/enumtypesafe.swg deleted file mode 100755 index c2012f56..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/enumtypesafe.swg +++ /dev/null @@ -1,117 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumtypesafe.swg - * - * Include this file in order for C/C++ enums to be wrapped by the so called - * typesafe enum pattern. Each enum has an equivalent Java class named after the - * enum and each enum item is a static instance of this class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "$*javaclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$*javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) const enum SWIGTYPE & "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput.swigValue()" -%typemap(javaout) const enum SWIGTYPE & { - return $*javaclassname.swigToEnum($jnicall); - } - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "$javaclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="L$packagepath/$javaclassname;") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) enum SWIGTYPE "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -// '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not -%typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" - -/* - * The swigToEnum method is used to find the Java enum from a C++ enum integer value. The default one here takes - * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial - * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be - * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. - * The special variable, $enumvalues, is replaced with a comma separated list of all the enum values. - */ -%typemap(javabody) enum SWIGTYPE %{ - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static $javaclassname swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + $javaclassname.class + " with value " + swigValue); - } - - private $javaclassname(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private $javaclassname(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private $javaclassname(String swigName, $javaclassname swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static $javaclassname[] swigValues = { $enumvalues }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -%} - -%javaenum(typesafe); - diff --git a/mac/bin/swig/share/swig/4.1.0/java/enumtypeunsafe.swg b/mac/bin/swig/share/swig/4.1.0/java/enumtypeunsafe.swg deleted file mode 100755 index 31fb8a79..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/enumtypeunsafe.swg +++ /dev/null @@ -1,72 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumtypeunsafe.swg - * - * Include this file in order for C/C++ enums to be wrapped by integers values. - * Each enum has an equivalent class named after the enum and the enum items are - * wrapped by constant integers within this class. The enum items are not - * typesafe as they are all integers. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "int" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$jniinput" -%typemap(javadirectorout) const enum SWIGTYPE & "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput" -%typemap(javaout) const enum SWIGTYPE & { - return $jnicall; - } - - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "int" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$jniinput" -%typemap(javadirectorout) enum SWIGTYPE "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput" -%typemap(javaout) enum SWIGTYPE { - return $jnicall; - } - -// '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not -%typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" -%typemap(javabody) enum SWIGTYPE "" - -%javaenum(typeunsafe); - diff --git a/mac/bin/swig/share/swig/4.1.0/java/java.swg b/mac/bin/swig/share/swig/4.1.0/java/java.swg deleted file mode 100755 index 8719818b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/java.swg +++ /dev/null @@ -1,1458 +0,0 @@ -/* ----------------------------------------------------------------------------- - * java.swg - * - * Java typemaps - * ----------------------------------------------------------------------------- */ - -%include - -/* The jni, jtype and jstype typemaps work together and so there should be one of each. - * The jni typemap contains the JNI type used in the JNI (C/C++) code. - * The jtype typemap contains the Java type used in the JNI intermediary class. - * The jstype typemap contains the Java type used in the Java proxy classes, type wrapper classes and module class. */ - -/* Fragments */ -%fragment("SWIG_PackData", "header") { -/* Pack binary data into a string */ -SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} -} - -%fragment("SWIG_UnPackData", "header") { -/* Unpack binary data from a string */ -SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} -} - -%fragment("SWIG_JavaIntFromSize_t", "header") { -/* Check for overflow converting to Java int (always signed 32-bit) from (unsigned variable-bit) size_t */ -SWIGINTERN jint SWIG_JavaIntFromSize_t(size_t size) { - static const jint JINT_MAX = 0x7FFFFFFF; - return (size > (size_t)JINT_MAX) ? -1 : (jint)size; -} -} - -/* Primitive types */ -%typemap(jni) bool, const bool & "jboolean" -%typemap(jni) char, const char & "jchar" -%typemap(jni) signed char, const signed char & "jbyte" -%typemap(jni) unsigned char, const unsigned char & "jshort" -%typemap(jni) short, const short & "jshort" -%typemap(jni) unsigned short, const unsigned short & "jint" -%typemap(jni) int, const int & "jint" -%typemap(jni) unsigned int, const unsigned int & "jlong" -%typemap(jni) long, const long & "jint" -%typemap(jni) unsigned long, const unsigned long & "jlong" -%typemap(jni) long long, const long long & "jlong" -%typemap(jni) unsigned long long, const unsigned long long & "jobject" -%typemap(jni) float, const float & "jfloat" -%typemap(jni) double, const double & "jdouble" -%typemap(jni) void "void" - -%typemap(jtype) bool, const bool & "boolean" -%typemap(jtype) char, const char & "char" -%typemap(jtype) signed char, const signed char & "byte" -%typemap(jtype) unsigned char, const unsigned char & "short" -%typemap(jtype) short, const short & "short" -%typemap(jtype) unsigned short, const unsigned short & "int" -%typemap(jtype) int, const int & "int" -%typemap(jtype) unsigned int, const unsigned int & "long" -%typemap(jtype) long, const long & "int" -%typemap(jtype) unsigned long, const unsigned long & "long" -%typemap(jtype) long long, const long long & "long" -%typemap(jtype) unsigned long long, const unsigned long long & "java.math.BigInteger" -%typemap(jtype) float, const float & "float" -%typemap(jtype) double, const double & "double" -%typemap(jtype) void "void" - -%typemap(jstype) bool, const bool & "boolean" -%typemap(jstype) char, const char & "char" -%typemap(jstype) signed char, const signed char & "byte" -%typemap(jstype) unsigned char, const unsigned char & "short" -%typemap(jstype) short, const short & "short" -%typemap(jstype) unsigned short, const unsigned short & "int" -%typemap(jstype) int, const int & "int" -%typemap(jstype) unsigned int, const unsigned int & "long" -%typemap(jstype) long, const long & "int" -%typemap(jstype) unsigned long, const unsigned long & "long" -%typemap(jstype) long long, const long long & "long" -%typemap(jstype) unsigned long long, const unsigned long long & "java.math.BigInteger" -%typemap(jstype) float, const float & "float" -%typemap(jstype) double, const double & "double" -%typemap(jstype) void "void" - -%typemap(jboxtype) bool, const bool & "Boolean" -%typemap(jboxtype) char, const char & "Character" -%typemap(jboxtype) signed char, const signed char & "Byte" -%typemap(jboxtype) unsigned char, const unsigned char & "Short" -%typemap(jboxtype) short, const short & "Short" -%typemap(jboxtype) unsigned short, const unsigned short & "Integer" -%typemap(jboxtype) int, const int & "Integer" -%typemap(jboxtype) unsigned int, const unsigned int & "Long" -%typemap(jboxtype) long, const long & "Integer" -%typemap(jboxtype) unsigned long, const unsigned long & "Long" -%typemap(jboxtype) long long, const long long & "Long" -%typemap(jboxtype) unsigned long long, const unsigned long long & "java.math.BigInteger" -%typemap(jboxtype) float, const float & "Float" -%typemap(jboxtype) double, const double & "Double" - -%typemap(jni) char *, char *&, char[ANY], char[] "jstring" -%typemap(jtype) char *, char *&, char[ANY], char[] "String" -%typemap(jstype) char *, char *&, char[ANY], char[] "String" - -/* JNI types */ -%typemap(jni) jboolean "jboolean" -%typemap(jni) jchar "jchar" -%typemap(jni) jbyte "jbyte" -%typemap(jni) jshort "jshort" -%typemap(jni) jint "jint" -%typemap(jni) jlong "jlong" -%typemap(jni) jfloat "jfloat" -%typemap(jni) jdouble "jdouble" -%typemap(jni) jstring "jstring" -%typemap(jni) jobject "jobject" -%typemap(jni) jbooleanArray "jbooleanArray" -%typemap(jni) jcharArray "jcharArray" -%typemap(jni) jbyteArray "jbyteArray" -%typemap(jni) jshortArray "jshortArray" -%typemap(jni) jintArray "jintArray" -%typemap(jni) jlongArray "jlongArray" -%typemap(jni) jfloatArray "jfloatArray" -%typemap(jni) jdoubleArray "jdoubleArray" -%typemap(jni) jobjectArray "jobjectArray" - -%typemap(jtype) jboolean "boolean" -%typemap(jtype) jchar "char" -%typemap(jtype) jbyte "byte" -%typemap(jtype) jshort "short" -%typemap(jtype) jint "int" -%typemap(jtype) jlong "long" -%typemap(jtype) jfloat "float" -%typemap(jtype) jdouble "double" -%typemap(jtype) jstring "String" -%typemap(jtype) jobject "java.lang.Object" -%typemap(jtype) jbooleanArray "boolean[]" -%typemap(jtype) jcharArray "char[]" -%typemap(jtype) jbyteArray "byte[]" -%typemap(jtype) jshortArray "short[]" -%typemap(jtype) jintArray "int[]" -%typemap(jtype) jlongArray "long[]" -%typemap(jtype) jfloatArray "float[]" -%typemap(jtype) jdoubleArray "double[]" -%typemap(jtype) jobjectArray "java.lang.Object[]" - -%typemap(jstype) jboolean "boolean" -%typemap(jstype) jchar "char" -%typemap(jstype) jbyte "byte" -%typemap(jstype) jshort "short" -%typemap(jstype) jint "int" -%typemap(jstype) jlong "long" -%typemap(jstype) jfloat "float" -%typemap(jstype) jdouble "double" -%typemap(jstype) jstring "String" -%typemap(jstype) jobject "java.lang.Object" -%typemap(jstype) jbooleanArray "boolean[]" -%typemap(jstype) jcharArray "char[]" -%typemap(jstype) jbyteArray "byte[]" -%typemap(jstype) jshortArray "short[]" -%typemap(jstype) jintArray "int[]" -%typemap(jstype) jlongArray "long[]" -%typemap(jstype) jfloatArray "float[]" -%typemap(jstype) jdoubleArray "double[]" -%typemap(jstype) jobjectArray "java.lang.Object[]" - -/* Non primitive types */ -%typemap(jni) SWIGTYPE "jlong" -%typemap(jtype) SWIGTYPE "long" -%typemap(jstype) SWIGTYPE "$&javaclassname" -%typemap(jboxtype) SWIGTYPE "$typemap(jstype, $1_type)" - -%typemap(jni) SWIGTYPE [] "jlong" -%typemap(jtype) SWIGTYPE [] "long" -%typemap(jstype) SWIGTYPE [] "$javaclassname" - -%typemap(jni) SWIGTYPE * "jlong" -%typemap(jtype) SWIGTYPE * "long" -%typemap(jstype) SWIGTYPE * "$javaclassname" - -%typemap(jni) SWIGTYPE & "jlong" -%typemap(jtype) SWIGTYPE & "long" -%typemap(jstype) SWIGTYPE & "$javaclassname" - -%typemap(jni) SWIGTYPE && "jlong" -%typemap(jtype) SWIGTYPE && "long" -%typemap(jstype) SWIGTYPE && "$javaclassname" - -/* pointer to a class member */ -%typemap(jni) SWIGTYPE (CLASS::*) "jstring" -%typemap(jtype) SWIGTYPE (CLASS::*) "String" -%typemap(jstype) SWIGTYPE (CLASS::*) "$javaclassname" - -/* The following are the in, out, freearg, argout typemaps. These are the JNI code generating typemaps for converting from Java to C and visa versa. */ - -/* primitive types */ -%typemap(in) bool -%{ $1 = $input ? true : false; %} - -%typemap(directorout) bool -%{ $result = $input ? true : false; %} - -%typemap(javadirectorin) bool "$jniinput" -%typemap(javadirectorout) bool "$javacall" - -%typemap(in) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double -%{ $1 = ($1_ltype)$input; %} - -%typemap(directorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin, descriptor="Z") bool "$input = (jboolean) $1;" -%typemap(directorin, descriptor="C") char "$input = (jint) $1;" -%typemap(directorin, descriptor="B") signed char "$input = (jbyte) $1;" -%typemap(directorin, descriptor="S") unsigned char "$input = (jshort) $1;" -%typemap(directorin, descriptor="S") short "$input = (jshort) $1;" -%typemap(directorin, descriptor="I") unsigned short "$input = (jint) $1;" -%typemap(directorin, descriptor="I") int "$input = (jint) $1;" -%typemap(directorin, descriptor="J") unsigned int "$input = (jlong) $1;" -%typemap(directorin, descriptor="I") long "$input = (jint) $1;" -%typemap(directorin, descriptor="J") unsigned long "$input = (jlong) $1;" -%typemap(directorin, descriptor="J") long long "$input = (jlong) $1;" -%typemap(directorin, descriptor="F") float "$input = (jfloat) $1;" -%typemap(directorin, descriptor="D") double "$input = (jdouble) $1;" - -%typemap(javadirectorin) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double - "$jniinput" - -%typemap(javadirectorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double - "$javacall" - -%typemap(out) bool %{ $result = (jboolean)$1; %} -%typemap(out) char %{ $result = (jchar)$1; %} -%typemap(out) signed char %{ $result = (jbyte)$1; %} -%typemap(out) unsigned char %{ $result = (jshort)$1; %} -%typemap(out) short %{ $result = (jshort)$1; %} -%typemap(out) unsigned short %{ $result = (jint)$1; %} -%typemap(out) int %{ $result = (jint)$1; %} -%typemap(out) unsigned int %{ $result = (jlong)$1; %} -%typemap(out) long %{ $result = (jint)$1; %} -%typemap(out) unsigned long %{ $result = (jlong)$1; %} -%typemap(out) long long %{ $result = (jlong)$1; %} -%typemap(out) float %{ $result = (jfloat)$1; %} -%typemap(out) double %{ $result = (jdouble)$1; %} - -/* unsigned long long */ -/* Convert from BigInteger using the toByteArray member function */ -%typemap(in) unsigned long long { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, $input); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - $1 = 0; - if (sz > 0) { - $1 = ($1_type)(signed char)bae[0]; - for(i=1; i 0) { - $result = ($1_type)(signed char)bae[0]; - for(i=1; i", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)($1>>8*(8-i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - $result = bigint; -} - -/* Convert to BigInteger (see out typemap) */ -%typemap(directorin, descriptor="Ljava/math/BigInteger;", noblock=1) 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"); - jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "", "([B)V"); - jobject bigint; - int swig_i; - - bae[0] = 0; - for(swig_i=1; swig_i<9; swig_i++ ) { - bae[swig_i] = (jbyte)($1>>8*(8-swig_i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - $input = bigint; -} -Swig::LocalRefGuard $1_refguard(jenv, $input); } - -%typemap(javadirectorin) unsigned long long "$jniinput" -%typemap(javadirectorout) unsigned long long "$javacall" - -/* char * - treat as String */ -%typemap(in, noblock=1) char * { - $1 = 0; - if ($input) { - $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$1) return $null; - } -} - -%typemap(directorout, noblock=1, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * { - $1 = 0; - if ($input) { - $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$result) return $null; - } -} - -%typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char * { - $input = 0; - if ($1) { - $input = JCALL1(NewStringUTF, jenv, (const char *)$1); - if (!$input) return $null; - } - Swig::LocalRefGuard $1_refguard(jenv, $input); -} - -%typemap(freearg, noblock=1) char * { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); } -%typemap(out, noblock=1) char * { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); } -%typemap(javadirectorin) char * "$jniinput" -%typemap(javadirectorout) char * "$javacall" - -/* char *& - treat as String */ -%typemap(in, noblock=1) char *& ($*1_ltype temp = 0) { - $1 = 0; - if ($input) { - temp = ($*1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!temp) return $null; - } - $1 = &temp; -} -%typemap(freearg, noblock=1) char *& { if ($1 && *$1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)*$1); } -%typemap(out, noblock=1) char *& { if (*$1) $result = JCALL1(NewStringUTF, jenv, (const char *)*$1); } - -%typemap(out) void "" -%typemap(javadirectorin) void "$jniinput" -%typemap(javadirectorout) void "$javacall" -%typemap(directorin, descriptor="V") void "" - -/* primitive types by reference */ -%typemap(in) const bool & ($*1_ltype temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & -%{ static $*1_ltype temp; - temp = $input ? true : false; - $result = &temp; %} - -%typemap(javadirectorin) const bool & "$jniinput" -%typemap(javadirectorout) const bool & "$javacall" - -%typemap(in) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const float &, - const double & -%{ static $*1_ltype temp; - temp = ($*1_ltype)$input; - $result = &temp; %} - -%typemap(directorin, descriptor="Z") const bool & "$input = (jboolean)$1;" -%typemap(directorin, descriptor="C") const char & "$input = (jchar)$1;" -%typemap(directorin, descriptor="B") const signed char & "$input = (jbyte)$1;" -%typemap(directorin, descriptor="S") const unsigned char & "$input = (jshort)$1;" -%typemap(directorin, descriptor="S") const short & "$input = (jshort)$1;" -%typemap(directorin, descriptor="I") const unsigned short & "$input = (jint)$1;" -%typemap(directorin, descriptor="I") const int & "$input = (jint)$1;" -%typemap(directorin, descriptor="J") const unsigned int & "$input = (jlong)$1;" -%typemap(directorin, descriptor="I") const long & "$input = (jint)$1;" -%typemap(directorin, descriptor="J") const unsigned long & "$input = (jlong)$1;" -%typemap(directorin, descriptor="J") const long long & "$input = (jlong)$1;" -%typemap(directorin, descriptor="F") const float & "$input = (jfloat)$1;" -%typemap(directorin, descriptor="D") const double & "$input = (jdouble)$1;" - -%typemap(javadirectorin) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$jniinput" - -%typemap(javadirectorout) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$javacall" - - -%typemap(out) const bool & %{ $result = (jboolean)*$1; %} -%typemap(out) const char & %{ $result = (jchar)*$1; %} -%typemap(out) const signed char & %{ $result = (jbyte)*$1; %} -%typemap(out) const unsigned char & %{ $result = (jshort)*$1; %} -%typemap(out) const short & %{ $result = (jshort)*$1; %} -%typemap(out) const unsigned short & %{ $result = (jint)*$1; %} -%typemap(out) const int & %{ $result = (jint)*$1; %} -%typemap(out) const unsigned int & %{ $result = (jlong)*$1; %} -%typemap(out) const long & %{ $result = (jint)*$1; %} -%typemap(out) const unsigned long & %{ $result = (jlong)*$1; %} -%typemap(out) const long long & %{ $result = (jlong)*$1; %} -%typemap(out) const float & %{ $result = (jfloat)*$1; %} -%typemap(out) const double & %{ $result = (jdouble)*$1; %} - -/* const unsigned long long & */ -/* Similar to unsigned long long */ -%typemap(in) const unsigned long long & ($*1_ltype temp) { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, $input); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - $1 = &temp; - temp = 0; - if (sz > 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; i 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; i", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(*$1>>8*(8-i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - $result = bigint; -} - -%typemap(javadirectorin) const unsigned long long & "$jniinput" -%typemap(javadirectorout) const unsigned long long & "$javacall" - -/* Default handling. Object passed by value. Convert to a pointer */ -%typemap(in) SWIGTYPE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} - -%typemap(directorout) SWIGTYPE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *argp; %} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ *($&1_ltype*)&$result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - *($&1_ltype*)&$result = $1ptr; -} -#endif - -%typemap(directorin,descriptor="L$packagepath/$&javaclassname;") SWIGTYPE -%{ $input = 0; - *(($&1_ltype*)&$input) = new $1_ltype(SWIG_STD_MOVE($1)); %} -%typemap(javadirectorin) SWIGTYPE "new $&javaclassname($jniinput, true)" -%typemap(javadirectorout) SWIGTYPE "$&javaclassname.getCPtr($javacall)" - -/* Generic pointers and references */ -%typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)&$input; %} -%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) { - const char *temp = 0; - if ($input) { - temp = JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!temp) return $null; - } - SWIG_UnpackData(temp, (void *)&$1, sizeof($1)); -} -%typemap(in) SWIGTYPE & %{ $1 = *($&1_ltype)&$input; - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type is null"); - return $null; - } %} -%typemap(in, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ $1 = *($&1_ltype)&$input; - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type is null"); - return $null; - } - rvrdeleter.reset($1); %} -%typemap(out) SWIGTYPE * -%{ *($&1_ltype)&$result = $1; %} -%typemap(out, fragment="SWIG_PackData", noblock=1) SWIGTYPE (CLASS::*) { - char buf[128]; - char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); - *data = '\0'; - $result = JCALL1(NewStringUTF, jenv, buf); -} -%typemap(out) SWIGTYPE & -%{ *($&1_ltype)&$result = $1; %} -%typemap(out) SWIGTYPE && -%{ *($&1_ltype)&$result = $1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * -%{ $result = *($&1_ltype)&$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) -%{ $result = *($&1_ltype)&$input; %} - -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE * -%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE (CLASS::*) -%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & -%{ if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *($&1_ltype)&$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE && -%{ if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *($&1_ltype)&$input; %} -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE & -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE && -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} - -%typemap(javadirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($jniinput == 0) ? null : new $javaclassname($jniinput, false)" -%typemap(javadirectorin) SWIGTYPE & "new $javaclassname($jniinput, false)" -%typemap(javadirectorin) SWIGTYPE && "new $javaclassname($jniinput, false)" -%typemap(javadirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE &, SWIGTYPE && "$javaclassname.getCPtr($javacall)" - -/* Default array handling */ -%typemap(in) SWIGTYPE [] %{ $1 = *($&1_ltype)&$input; %} -%typemap(out) SWIGTYPE [] %{ *($&1_ltype)&$result = $1; %} -%typemap(freearg) SWIGTYPE [ANY], SWIGTYPE [] "" - -/* char arrays - treat as String */ -%typemap(in, noblock=1) char[ANY], char[] { - $1 = 0; - if ($input) { - $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$1) return $null; - } -} - -%typemap(directorout, noblock=1) char[ANY], char[] { - $1 = 0; - if ($input) { - $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$result) return $null; - } -} - -%typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char[ANY], char[] { - $input = 0; - if ($1) { - $input = JCALL1(NewStringUTF, jenv, (const char *)$1); - if (!$input) return $null; - } - Swig::LocalRefGuard $1_refguard(jenv, $input); -} - -%typemap(argout) char[ANY], char[] "" -%typemap(freearg, noblock=1) char[ANY], char[] { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); } -%typemap(out, noblock=1) char[ANY], char[] { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); } -%typemap(javadirectorin) char[ANY], char[] "$jniinput" -%typemap(javadirectorout) char[ANY], char[] "$javacall" - -/* JNI types */ -%typemap(in) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray -%{ $1 = $input; %} - -%typemap(directorout) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray -%{ $result = $input; %} - -%typemap(out) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray -%{ $result = $1; %} - -%typemap(directorin,descriptor="Z") jboolean "$input = $1;" -%typemap(directorin,descriptor="C") jchar "$input = $1;" -%typemap(directorin,descriptor="B") jbyte "$input = $1;" -%typemap(directorin,descriptor="S") jshort "$input = $1;" -%typemap(directorin,descriptor="I") jint "$input = $1;" -%typemap(directorin,descriptor="J") jlong "$input = $1;" -%typemap(directorin,descriptor="F") jfloat "$input = $1;" -%typemap(directorin,descriptor="D") jdouble "$input = $1;" -%typemap(directorin,descriptor="Ljava/lang/String;") jstring "$input = $1;" -%typemap(directorin,descriptor="Ljava/lang/Object;",nouse="1") jobject "$input = $1;" -%typemap(directorin,descriptor="[Z") jbooleanArray "$input = $1;" -%typemap(directorin,descriptor="[C") jcharArray "$input = $1;" -%typemap(directorin,descriptor="[B") jbyteArray "$input = $1;" -%typemap(directorin,descriptor="[S") jshortArray "$input = $1;" -%typemap(directorin,descriptor="[I") jintArray "$input = $1;" -%typemap(directorin,descriptor="[J") jlongArray "$input = $1;" -%typemap(directorin,descriptor="[F") jfloatArray "$input = $1;" -%typemap(directorin,descriptor="[D") jdoubleArray "$input = $1;" -%typemap(directorin,descriptor="[Ljava/lang/Object;",nouse="1") jobjectArray "$input = $1;" - -%typemap(javadirectorin) jboolean, - 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 - "$javacall" - -/* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions - * that cannot be overloaded in Java as more than one C++ type maps to a single Java type */ - -%typecheck(SWIG_TYPECHECK_BOOL) /* Java boolean */ - jboolean, - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) /* Java char */ - jchar, - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) /* Java byte */ - jbyte, - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Java short */ - jshort, - unsigned char, - short, - const unsigned char &, - const short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Java int */ - jint, - unsigned short, - int, - long, - const unsigned short &, - const int &, - const long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Java long */ - jlong, - unsigned int, - unsigned long, - long long, - const unsigned int &, - const unsigned long &, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_INT128) /* Java BigInteger */ - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) /* Java float */ - jfloat, - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) /* Java double */ - jdouble, - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) /* Java String */ - jstring, - char *, - char *&, - char[ANY], - char [] - "" - -%typecheck(SWIG_TYPECHECK_BOOL_ARRAY) /* Java boolean[] */ - jbooleanArray - "" - -%typecheck(SWIG_TYPECHECK_CHAR_ARRAY) /* Java char[] */ - jcharArray - "" - -%typecheck(SWIG_TYPECHECK_INT8_ARRAY) /* Java byte[] */ - jbyteArray - "" - -%typecheck(SWIG_TYPECHECK_INT16_ARRAY) /* Java short[] */ - jshortArray - "" - -%typecheck(SWIG_TYPECHECK_INT32_ARRAY) /* Java int[] */ - jintArray - "" - -%typecheck(SWIG_TYPECHECK_INT64_ARRAY) /* Java long[] */ - jlongArray - "" - -%typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) /* Java float[] */ - jfloatArray - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) /* Java double[] */ - jdoubleArray - "" - -%typecheck(SWIG_TYPECHECK_OBJECT_ARRAY) /* Java jobject[] */ - jobjectArray - "" - -%typecheck(SWIG_TYPECHECK_POINTER) /* Default */ - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE *const&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - - -/* Exception handling */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short -%{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, error_msg); - return $null; %} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(throws) char * -%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1); - return $null; %} - -/* For methods to raise/throw the original Java exception thrown in a director method */ -%typemap(throws) Swig::DirectorException -%{ $1.throwException(jenv); - return $null; %} - -/* Java to C++ DirectorException should already be handled. Suppress warning and do nothing in the - event a user specifies a global: %catches(Swig::DirectorException); */ -%typemap(directorthrows) Swig::DirectorException "" - -/* Typemaps for code generation in proxy classes and Java type wrapper classes */ - -/* The javain typemap is used for converting function parameter types from the type - * used in the proxy, module or type wrapper class to the type used in the JNI class. */ -%typemap(javain) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double & - "$javainput" -%typemap(javain) char *, char *&, char[ANY], char[] "$javainput" -%typemap(javain) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray - "$javainput" -%typemap(javain) SWIGTYPE "$&javaclassname.getCPtr($javainput)" -%typemap(javain) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$javaclassname.getCPtr($javainput)" -%typemap(javain) SWIGTYPE && "$javaclassname.swigRelease($javainput)" -%typemap(javain) SWIGTYPE (CLASS::*) "$javaclassname.getCMemberPtr($javainput)" - -/* The javaout typemap is used for converting function return types from the return type - * used in the JNI class to the type returned by the proxy, module or type wrapper class. */ -%typemap(javaout) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double & { - return $jnicall; - } -%typemap(javaout) char *, char *&, char[ANY], char[] { - return $jnicall; - } -%typemap(javaout) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray { - return $jnicall; - } -%typemap(javaout) void { - $jnicall; - } -%typemap(javaout) SWIGTYPE { - return new $&javaclassname($jnicall, true); - } -%typemap(javaout) SWIGTYPE & { - return new $javaclassname($jnicall, $owner); - } -%typemap(javaout) SWIGTYPE && { - return new $javaclassname($jnicall, $owner); - } -%typemap(javaout) SWIGTYPE *, SWIGTYPE [] { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner); - } -%typemap(javaout) SWIGTYPE (CLASS::*) { - String cMemberPtr = $jnicall; - return (cMemberPtr == null) ? null : new $javaclassname(cMemberPtr, $owner); - } - -/* Pointer reference typemaps */ -%typemap(jni) SWIGTYPE *const& "jlong" -%typemap(jtype) SWIGTYPE *const& "long" -%typemap(jstype) SWIGTYPE *const& "$*javaclassname" -%typemap(javain) SWIGTYPE *const& "$*javaclassname.getCPtr($javainput)" -%typemap(javaout) SWIGTYPE *const& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $*javaclassname(cPtr, $owner); - } -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ temp = *($1_ltype)&$input; - $1 = ($1_ltype)&temp; %} -%typemap(out) SWIGTYPE *const& -%{ *($1_ltype)&$result = *$1; %} -%typemap(directorin,descriptor="L$packagepath/$*javaclassname;") SWIGTYPE *const& -%{ *(($1_ltype)&$input) = ($*1_ltype) $1; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = *($1_ltype)&$input; - $result = &swig_temp; %} -%typemap(javadirectorin) SWIGTYPE *const& "($jniinput == 0) ? null : new $*javaclassname($jniinput, false)" -%typemap(javadirectorout) SWIGTYPE *const& "$*javaclassname.getCPtr($javacall)" - -/* Typemaps used for the generation of proxy and type wrapper class code */ -%typemap(javabase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javaclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class" -%typemap(javacode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javaimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javainterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javainterfacemodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public interface" - -/* javabody typemaps */ - -%define SWIG_JAVABODY_METHODS(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE) %enddef // legacy name - -%define SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY static long swigRelease($javaclassname obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGUpcast(cPtr), cMemoryOwn); - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY static long swigRelease($javaclassname obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } -%} -%enddef - -%define SWIG_JAVABODY_TYPEWRAPPER(PTRCTOR_VISIBILITY, DEFAULTCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Typewrapper classes -%typemap(javabody) TYPE *, TYPE &, TYPE &&, TYPE [] %{ - private transient long swigCPtr; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - DEFAULTCTOR_VISIBILITY $javaclassname() { - swigCPtr = 0; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY static long swigRelease($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -%typemap(javabody) TYPE (CLASS::*) %{ - private transient String swigCMemberPtr; - - PTRCTOR_VISIBILITY $javaclassname(String cMemberPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCMemberPtr = cMemberPtr; - } - - DEFAULTCTOR_VISIBILITY $javaclassname() { - swigCMemberPtr = null; - } - - CPTR_VISIBILITY static String getCMemberPtr($javaclassname obj) { - return obj.swigCMemberPtr; - } -%} -%enddef - -/* Set the default javabody typemaps to use protected visibility. - Use the macros to change to public if using multiple modules. */ -SWIG_JAVABODY_PROXY(protected, protected, SWIGTYPE) -SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE) - -%typemap(javafinalize) SWIGTYPE %{ - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } -%} - -/* - * Java constructor typemaps: - * - * The javaconstruct typemap is inserted when a proxy class's constructor is generated. - * This typemap allows control over what code is executed in the constructor as - * well as specifying who owns the underlying C/C++ object. Normally, Java has - * ownership and the underlying C/C++ object is deallocated when the Java object - * is finalized (swigCMemOwn is true.) If swigCMemOwn is false, C/C++ is - * ultimately responsible for deallocating the underlying object's memory. - * - * The SWIG_PROXY_CONSTRUCTOR macro defines the javaconstruct typemap for a proxy - * class for a particular TYPENAME. OWNERSHIP is passed as the value of - * swigCMemOwn to the pointer constructor method. WEAKREF determines which kind - * of Java object reference will be used by the C++ director class (WeakGlobalRef - * vs. GlobalRef.) - * - * The SWIG_DIRECTOR_OWNED macro sets the ownership of director-based proxy - * classes and the weak reference flag to false, meaning that the underlying C++ - * object will be reclaimed by C++. - */ - -%define SWIG_PROXY_CONSTRUCTOR(OWNERSHIP, WEAKREF, TYPENAME...) -%typemap(javaconstruct,directorconnect="\n $imclassname.$javaclazznamedirector_connect(this, swigCPtr, OWNERSHIP, WEAKREF);") TYPENAME { - this($imcall, OWNERSHIP);$directorconnect - } -%enddef - -%define SWIG_DIRECTOR_OWNED(TYPENAME...) -SWIG_PROXY_CONSTRUCTOR(true, false, TYPENAME) -%enddef - -// Set the default for SWIGTYPE: Java owns the C/C++ object. -SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - $jnicall; - } - swigCPtr = 0; - } - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - $jnicall; - } - swigCPtr = 0; - } - super.delete(); - } - -%typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{ - protected void $methodname() { - swigCMemOwn = false; - $jnicall; - } -%} - -%typemap(directorowner_release, methodname="swigReleaseOwnership") SWIGTYPE %{ - public void $methodname() { - swigCMemOwn = false; - $jnicall; - } -%} - -%typemap(directorowner_take, methodname="swigTakeOwnership") SWIGTYPE %{ - public void $methodname() { - swigCMemOwn = true; - $jnicall; - } -%} - -/* Java specific directives */ -#define %javaconst(flag) %feature("java:const","flag") -#define %javaconstvalue(value) %feature("java:constvalue",value) -#define %javaenum(wrapapproach) %feature("java:enum","wrapapproach") -#define %javamethodmodifiers %feature("java:methodmodifiers") -#define %javaexception(exceptionclasses) %feature("except",throws=exceptionclasses) -#define %nojavaexception %feature("except","0",throws="") -#define %clearjavaexception %feature("except","",throws="") -#define %proxycode %insert("proxycode") - -%pragma(java) jniclassclassmodifiers="public class" -%pragma(java) moduleclassmodifiers="public class" - -/* Some ANSI C typemaps */ - -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* String & length */ -%typemap(jni) (const char *STRING, size_t LENGTH) "jbyteArray" -%typemap(jtype) (const char *STRING, size_t LENGTH) "byte[]" -%typemap(jstype) (const char *STRING, size_t LENGTH) "byte[]" -%typemap(javain) (const char *STRING, size_t LENGTH) "$javainput" -%typemap(freearg) (const char *STRING, size_t LENGTH) "" -%typemap(in) (const char *STRING, size_t LENGTH) { - if ($input) { - $1 = ($1_ltype) JCALL2(GetByteArrayElements, jenv, $input, 0); - $2 = ($2_type) JCALL1(GetArrayLength, jenv, $input); - } else { - $1 = 0; - $2 = 0; - } -} -%typemap(argout) (const char *STRING, size_t LENGTH) { - if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, JNI_ABORT); -} -%typemap(directorin, descriptor="[B", noblock=1) (const char *STRING, size_t LENGTH) { - $input = 0; - if ($1) { - $input = JCALL1(NewByteArray, jenv, (jsize)$2); - if (!$input) return $null; - JCALL4(SetByteArrayRegion, jenv, $input, 0, (jsize)$2, (jbyte *)$1); - } - Swig::LocalRefGuard $1_refguard(jenv, $input); -} -%typemap(javadirectorin, descriptor="[B") (const char *STRING, size_t LENGTH) "$jniinput" -%apply (const char *STRING, size_t LENGTH) { (char *STRING, size_t LENGTH) } -/* Enable write-back for non-const version */ -%typemap(argout) (char *STRING, size_t LENGTH) { - if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0); -} -%typemap(directorargout, noblock=1) (char *STRING, size_t LENGTH) -{ if ($input && $1) JCALL4(GetByteArrayRegion, jenv, $input, 0, (jsize)$2, (jbyte *)$1); } -%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) } - -/* java keywords */ -%include - -// Default enum handling -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/java/javahead.swg b/mac/bin/swig/share/swig/4.1.0/java/javahead.swg deleted file mode 100755 index 758a037d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/javahead.swg +++ /dev/null @@ -1,91 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javahead.swg - * - * Java support code - * ----------------------------------------------------------------------------- */ - - -/* JNI function calls require different calling conventions for C and C++. These JCALL macros are used so - * that the same typemaps can be used for generating code for both C and C++. The SWIG preprocessor can expand - * the macros thereby generating the correct calling convention. It is thus essential that all typemaps that - * use the macros are not within %{ %} brackets as they won't be run through the SWIG preprocessor. */ -#ifdef __cplusplus -# define JCALL0(func, jenv) jenv->func() -# define JCALL1(func, jenv, ar1) jenv->func(ar1) -# define JCALL2(func, jenv, ar1, ar2) jenv->func(ar1, ar2) -# define JCALL3(func, jenv, ar1, ar2, ar3) jenv->func(ar1, ar2, ar3) -# define JCALL4(func, jenv, ar1, ar2, ar3, ar4) jenv->func(ar1, ar2, ar3, ar4) -# define JCALL5(func, jenv, ar1, ar2, ar3, ar4, ar5) jenv->func(ar1, ar2, ar3, ar4, ar5) -# define JCALL6(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6) jenv->func(ar1, ar2, ar3, ar4, ar5, ar6) -# define JCALL7(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) jenv->func(ar1, ar2, ar3, ar4, ar5, ar6, ar7) -#else -# define JCALL0(func, jenv) (*jenv)->func(jenv) -# define JCALL1(func, jenv, ar1) (*jenv)->func(jenv, ar1) -# define JCALL2(func, jenv, ar1, ar2) (*jenv)->func(jenv, ar1, ar2) -# define JCALL3(func, jenv, ar1, ar2, ar3) (*jenv)->func(jenv, ar1, ar2, ar3) -# define JCALL4(func, jenv, ar1, ar2, ar3, ar4) (*jenv)->func(jenv, ar1, ar2, ar3, ar4) -# define JCALL5(func, jenv, ar1, ar2, ar3, ar4, ar5) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5) -# define JCALL6(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5, ar6) -# define JCALL7(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) -#endif - -%insert(runtime) %{ -#include -#include -#include -%} - -%insert(runtime) %{ -/* Support for throwing Java exceptions */ -typedef enum { - SWIG_JavaOutOfMemoryError = 1, - SWIG_JavaIOException, - SWIG_JavaRuntimeException, - SWIG_JavaIndexOutOfBoundsException, - SWIG_JavaArithmeticException, - SWIG_JavaIllegalArgumentException, - SWIG_JavaNullPointerException, - SWIG_JavaDirectorPureVirtual, - SWIG_JavaUnknownError, - SWIG_JavaIllegalStateException, -} SWIG_JavaExceptionCodes; - -typedef struct { - SWIG_JavaExceptionCodes code; - const char *java_exception; -} SWIG_JavaExceptions_t; -%} - -%insert(runtime) { -static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { - jclass excep; - static const SWIG_JavaExceptions_t java_exceptions[] = { - { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, - { SWIG_JavaIOException, "java/io/IOException" }, - { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, - { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, - { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, - { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, - { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, - { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, - { SWIG_JavaUnknownError, "java/lang/UnknownError" }, - { SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" }, - { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } - }; - const SWIG_JavaExceptions_t *except_ptr = java_exceptions; - - while (except_ptr->code != code && except_ptr->code) - except_ptr++; - - JCALL0(ExceptionClear, jenv); - excep = JCALL1(FindClass, jenv, except_ptr->java_exception); - if (excep) - JCALL2(ThrowNew, jenv, excep, msg); -} -} - -%insert(runtime) %{ -/* Contract support */ - -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } } while (0) -%} diff --git a/mac/bin/swig/share/swig/4.1.0/java/javakw.swg b/mac/bin/swig/share/swig/4.1.0/java/javakw.swg deleted file mode 100755 index 8a5b76ee..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/javakw.swg +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef JAVA_JAVAKW_SWG_ -#define JAVA_JAVAKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVAKW(x) %keywordwarn("'" `x` "' is a java keyword",rename="_%s") `x` - -/* - from - http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html -*/ - -JAVAKW(abstract); -JAVAKW(double); -JAVAKW(int); -JAVAKW(strictfp); -JAVAKW(boolean); -JAVAKW(else); -JAVAKW(interface); -JAVAKW(super); -JAVAKW(break); -JAVAKW(extends); -JAVAKW(long); -JAVAKW(switch); -JAVAKW(byte); -JAVAKW(final); -JAVAKW(native); -JAVAKW(synchronized); -JAVAKW(case); -JAVAKW(finally); -JAVAKW(new); -JAVAKW(this); -JAVAKW(catch); -JAVAKW(float); -JAVAKW(package); -JAVAKW(throw); -JAVAKW(char); -JAVAKW(for); -JAVAKW(private); -JAVAKW(throws); -JAVAKW(class); -JAVAKW(goto); -JAVAKW(protected); -JAVAKW(transient); -JAVAKW(const); -JAVAKW(if); -JAVAKW(public); -JAVAKW(try); -JAVAKW(continue); -JAVAKW(implements); -JAVAKW(return); -JAVAKW(void); -JAVAKW(default); -JAVAKW(import); -JAVAKW(short); -JAVAKW(volatile); -JAVAKW(do); -JAVAKW(instanceof); -JAVAKW(static); -JAVAKW(while); - - -/* others bad names */ - -/* Note here that only *::clone() is bad, and *::clone(int) is ok */ -%namewarn("321:clone() is a java bad method name") *::clone(); - - -#undef JAVAKW - -#endif //JAVA_JAVAKW_SWG_ diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_array.i b/mac/bin/swig/share/swig/4.1.0/java/std_array.i deleted file mode 100755 index d3436cc6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_array.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_array.i - * ----------------------------------------------------------------------------- */ - -%include - -namespace std { - - template class array { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - array(); - array(const array& other); - - size_type size() const; - %rename(isEmpty) empty; - bool empty() const; - void fill(const T& u); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i "jlong" -%typemap (jtype) std::auto_ptr< TYPE > "long" -%typemap (jstype) std::auto_ptr< TYPE > "$typemap(jstype, TYPE)" - -%typemap(in) std::auto_ptr< TYPE > (TYPE *auto_temp) -%{ auto_temp = *(TYPE **)&$input; - $1.reset(auto_temp); %} - -%typemap(javain) std::auto_ptr< TYPE > "$typemap(jstype, TYPE).swigRelease($javainput)" - -%typemap (out) std::auto_ptr< TYPE > %{ - jlong lpp = 0; - *(TYPE **) &lpp = $1.release(); - $result = lpp; -%} - -%typemap(javaout) std::auto_ptr< TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_common.i b/mac/bin/swig/share/swig/4.1.0/java/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_deque.i b/mac/bin/swig/share/swig/4.1.0/java/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_except.i b/mac/bin/swig/share/swig/4.1.0/java/std_except.i deleted file mode 100755 index 91d2f92c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_except.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. - * These typemaps are used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws) std::bad_cast "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::bad_exception "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::domain_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::exception "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::invalid_argument "SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, $1.what());\n return $null;" -%typemap(throws) std::length_error "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" -%typemap(throws) std::logic_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::out_of_range "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" -%typemap(throws) std::overflow_error "SWIG_JavaThrowException(jenv, SWIG_JavaArithmeticException, $1.what());\n return $null;" -%typemap(throws) std::range_error "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" -%typemap(throws) std::runtime_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::underflow_error "SWIG_JavaThrowException(jenv, SWIG_JavaArithmeticException, $1.what());\n return $null;" - diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_list.i b/mac/bin/swig/share/swig/4.1.0/java/std_list.i deleted file mode 100755 index 1077bd0a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_list.i +++ /dev/null @@ -1,225 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list. - * The Java proxy class extends java.util.AbstractSequentialList. The std::list - * container looks and feels much like a java.util.LinkedList from Java. - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -%fragment("SWIG_ListSize", "header", fragment="SWIG_JavaIntFromSize_t") { -SWIGINTERN jint SWIG_ListSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) - throw std::out_of_range("list size is too large to fit into a Java int"); - return sz; -} -} - -%javamethodmodifiers std::list::begin "private"; -%javamethodmodifiers std::list::insert "private"; -%javamethodmodifiers std::list::doSize "private"; -%javamethodmodifiers std::list::doPreviousIndex "private"; -%javamethodmodifiers std::list::doNextIndex "private"; -%javamethodmodifiers std::list::doHasNext "private"; - -// Match Java style better: -%rename(Iterator) std::list::iterator; - -%nodefaultctor std::list::iterator; - -namespace std { - template class list { - -%typemap(javabase) std::list "java.util.AbstractSequentialList<$typemap(jboxtype, T)>" -%proxycode %{ - public $javaclassname(java.util.Collection c) { - this(); - java.util.ListIterator<$typemap(jboxtype, T)> it = listIterator(0); - // Special case the "copy constructor" here to avoid lots of cross-language calls - for (java.lang.Object o : c) { - it.add(($typemap(jboxtype, T))o); - } - } - - public int size() { - return doSize(); - } - - public boolean add($typemap(jboxtype, T) value) { - addLast(value); - return true; - } - - public java.util.ListIterator<$typemap(jboxtype, T)> listIterator(int index) { - return new java.util.ListIterator<$typemap(jboxtype, T)>() { - private Iterator pos; - private Iterator last; - - private java.util.ListIterator<$typemap(jboxtype, T)> init(int index) { - if (index < 0 || index > $javaclassname.this.size()) - throw new IndexOutOfBoundsException("Index: " + index); - pos = $javaclassname.this.begin(); - pos = pos.advance_unchecked(index); - return this; - } - - public void add($typemap(jboxtype, T) v) { - // Technically we can invalidate last here, but this makes more sense - last = $javaclassname.this.insert(pos, v); - } - - public void set($typemap(jboxtype, T) v) { - if (null == last) { - throw new IllegalStateException(); - } - last.set_unchecked(v); - } - - public void remove() { - if (null == last) { - throw new IllegalStateException(); - } - $javaclassname.this.remove(last); - last = null; - } - - public int previousIndex() { - return $javaclassname.this.doPreviousIndex(pos); - } - - public int nextIndex() { - return $javaclassname.this.doNextIndex(pos); - } - - public $typemap(jboxtype, T) previous() { - if (previousIndex() < 0) { - throw new java.util.NoSuchElementException(); - } - last = pos; - pos = pos.previous_unchecked(); - return last.deref_unchecked(); - } - - public $typemap(jboxtype, T) next() { - if (!hasNext()) { - throw new java.util.NoSuchElementException(); - } - last = pos; - pos = pos.next_unchecked(); - return last.deref_unchecked(); - } - - public boolean hasPrevious() { - // This call to previousIndex() will be much slower than the hasNext() implementation, but it's simpler like this with C++ forward iterators - return previousIndex() != -1; - } - - public boolean hasNext() { - return $javaclassname.this.doHasNext(pos); - } - }.init(index); - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - /* - * We'd actually be better off having the nested class *not* be static in the wrapper - * output, but this doesn't actually remove the $static from the nested class still. - * (This would allow us to somewhat simplify the implementation of the ListIterator - * interface and give "natural" semantics to Java users of the C++ iterator) - */ - //%typemap(javaclassmodifiers) iterator "public class" - //%typemap(javainterfaces) iterator "java.util.ListIterator<$typemap(jboxtype, T)>" - - struct iterator { - %extend { - void set_unchecked(const T &v) { - **$self = v; - } - - iterator next_unchecked() const { - std::list::iterator ret = *$self; - ++ret; - return ret; - } - - iterator previous_unchecked() const { - std::list::iterator ret = *$self; - --ret; - return ret; - } - - T deref_unchecked() const { - return **$self; - } - - iterator advance_unchecked(size_type index) const { - std::list::iterator ret = *$self; - std::advance(ret, index); - return ret; - } - } - }; - - list(); - list(const list& other); - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(remove) erase; - iterator erase(iterator pos); - %rename(removeLast) pop_back; - void pop_back(); - %rename(removeFirst) pop_front; - void pop_front(); - %rename(addLast) push_back; - void push_back(const T &value); - %rename(addFirst) push_front; - void push_front(const T &value); - iterator begin(); - iterator end(); - iterator insert(iterator pos, const T &value); - - %extend { - %fragment("SWIG_ListSize"); - - list(jint count, const T &value) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("list count must be positive"); - return new std::list(static_cast::size_type>(count), value); - } - - jint doSize() const throw (std::out_of_range) { - return SWIG_ListSize(self->size()); - } - - jint doPreviousIndex(const iterator &pos) const throw (std::out_of_range) { - return pos == self->begin() ? -1 : SWIG_ListSize(std::distance(self->begin(), static_cast::const_iterator>(pos))); - } - - jint doNextIndex(const iterator &pos) const throw (std::out_of_range) { - return pos == self->end() ? SWIG_ListSize(self->size()) : SWIG_ListSize(std::distance(self->begin(), static_cast::const_iterator>(pos))); - } - - bool doHasNext(const iterator &pos) const { - return pos != $self->end(); - } - } - }; -} diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_map.i b/mac/bin/swig/share/swig/4.1.0/java/std_map.i deleted file mode 100755 index 6d5ca1aa..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_map.i +++ /dev/null @@ -1,224 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * The Java proxy class extends java.util.AbstractMap. The std::map - * container looks and feels much like a java.util.HashMap from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_MapSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_MapSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("map size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::map::sizeImpl "private"; -%javamethodmodifiers std::map::containsImpl "private"; -%javamethodmodifiers std::map::putUnchecked "private"; -%javamethodmodifiers std::map::removeUnchecked "private"; -%javamethodmodifiers std::map::find "private"; -%javamethodmodifiers std::map::begin "private"; -%javamethodmodifiers std::map::end "private"; - -%rename(Iterator) std::map::iterator; -%nodefaultctor std::map::iterator; -%javamethodmodifiers std::map::iterator::getNextUnchecked "private"; -%javamethodmodifiers std::map::iterator::isNot "private"; -%javamethodmodifiers std::map::iterator::getKey "private"; -%javamethodmodifiers std::map::iterator::getValue "private"; -%javamethodmodifiers std::map::iterator::setValue "private"; - -namespace std { - -template > class map { - -%typemap(javabase) std::map< K, T, C > - "java.util.AbstractMap<$typemap(jboxtype, K), $typemap(jboxtype, T)>" - -%proxycode %{ - - public int size() { - return sizeImpl(); - } - - public boolean containsKey(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return false; - } - - return containsImpl(($typemap(jboxtype, K))key); - } - - public $typemap(jboxtype, T) get(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - return itr.getValue(); - } - - return null; - } - - public $typemap(jboxtype, T) put($typemap(jboxtype, K) key, $typemap(jboxtype, T) value) { - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - itr.setValue(value); - return oldValue; - } else { - putUnchecked(key, value); - return null; - } - } - - public $typemap(jboxtype, T) remove(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - removeUnchecked(itr); - return oldValue; - } else { - return null; - } - } - - public java.util.Set> entrySet() { - java.util.Set> setToReturn = - new java.util.HashSet>(); - - Iterator itr = begin(); - final Iterator end = end(); - while (itr.isNot(end)) { - setToReturn.add(new Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)>() { - private Iterator iterator; - - private Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)> init(Iterator iterator) { - this.iterator = iterator; - return this; - } - - public $typemap(jboxtype, K) getKey() { - return iterator.getKey(); - } - - public $typemap(jboxtype, T) getValue() { - return iterator.getValue(); - } - - public $typemap(jboxtype, T) setValue($typemap(jboxtype, T) newValue) { - $typemap(jboxtype, T) oldValue = iterator.getValue(); - iterator.setValue(newValue); - return oldValue; - } - }.init(itr)); - itr = itr.getNextUnchecked(); - } - - return setToReturn; - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - std::map< K, T, C >::iterator getNextUnchecked() { - std::map< K, T, C >::iterator copy = (*$self); - return ++copy; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - - K getKey() const { - return (*$self)->first; - } - - T getValue() const { - return (*$self)->second; - } - - void setValue(const T& newValue) { - (*$self)->second = newValue; - } - } - }; - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator find(const K& key); - iterator begin(); - iterator end(); - %extend { - %fragment("SWIG_MapSize"); - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_MapSize(self->size()); - } - - bool containsImpl(const K& key) { - return (self->count(key) > 0); - } - - void putUnchecked(const K& key, const T& value) { - (*self)[key] = value; - } - - void removeUnchecked(const std::map< K, T, C >::iterator itr) { - self->erase(itr); - } - } -}; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_pair.i b/mac/bin/swig/share/swig/4.1.0/java/std_pair.i deleted file mode 100755 index 75ad3031..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_pair.i +++ /dev/null @@ -1,37 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_set.i b/mac/bin/swig/share/swig/4.1.0/java/std_set.i deleted file mode 100755 index 053866bc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_set.i +++ /dev/null @@ -1,207 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_set.i - * - * SWIG typemaps for std::set - * The Java proxy class extends java.util.AbstractSet. The std::set - * container looks and feels much like a java.util.HashSet from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::set -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_SetSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_SetSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("set size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::set::sizeImpl "private"; -%javamethodmodifiers std::set::containsImpl "private"; -%javamethodmodifiers std::set::removeImpl "private"; -%javamethodmodifiers std::set::hasNextImpl "private"; -%javamethodmodifiers std::set::begin "private"; -%javamethodmodifiers std::set::end "private"; - -%rename(Iterator) std::set::iterator; -%nodefaultctor std::set::iterator; -%javamethodmodifiers std::set::iterator::incrementUnchecked "private"; -%javamethodmodifiers std::set::iterator::derefUnchecked "private"; -%javamethodmodifiers std::set::iterator::isNot "private"; - -namespace std { - -template -class set { - -%typemap(javabase) std::set "java.util.AbstractSet<$typemap(jboxtype, T)>" -%proxycode %{ - public $javaclassname(java.util.Collection collection) { - this(); - addAll(collection); - } - - public int size() { - return sizeImpl(); - } - - public boolean add($typemap(jboxtype, T) key) { - return addImpl(key); - } - - public boolean addAll(java.util.Collection collection) { - boolean didAddElement = false; - for (java.lang.Object object : collection) { - didAddElement |= add(($typemap(jboxtype, T))object); - } - - return didAddElement; - } - - public java.util.Iterator<$typemap(jboxtype, T)> iterator() { - return new java.util.Iterator<$typemap(jboxtype, T)>() { - private Iterator curr; - private Iterator end; - - private java.util.Iterator<$typemap(jboxtype, T)> init() { - curr = $javaclassname.this.begin(); - end = $javaclassname.this.end(); - return this; - } - - public $typemap(jboxtype, T) next() { - if (!hasNext()) { - throw new java.util.NoSuchElementException(); - } - - // Save the current position, increment it, - // then return the value at the position before the increment. - final $typemap(jboxtype, T) currValue = curr.derefUnchecked(); - curr.incrementUnchecked(); - return currValue; - } - - public boolean hasNext() { - return curr.isNot(end); - } - - public void remove() { - throw new java.lang.UnsupportedOperationException(); - } - }.init(); - } - - public boolean containsAll(java.util.Collection collection) { - for (java.lang.Object object : collection) { - if (!contains(object)) { - return false; - } - } - - return true; - } - - public boolean contains(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, T))) { - return false; - } - - return containsImpl(($typemap(jboxtype, T))object); - } - - public boolean removeAll(java.util.Collection collection) { - boolean didRemoveElement = false; - for (java.lang.Object object : collection) { - didRemoveElement |= remove(object); - } - - return didRemoveElement; - } - - public boolean remove(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, T))) { - return false; - } - - return removeImpl(($typemap(jboxtype, T))object); - } -%} - - public: - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - void incrementUnchecked() { - ++(*$self); - } - - T derefUnchecked() const { - return **$self; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - } - }; - - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T key_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - set(); - set(const set& other); - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator begin(); - iterator end(); - - %extend { - %fragment("SWIG_SetSize"); - - // Returns whether item was inserted. - bool addImpl(const T& key) { - return self->insert(key).second; - } - - // Returns whether set contains key. - bool containsImpl(const T& key) { - return (self->count(key) > 0); - } - - // Returns whether the item was erased. - bool removeImpl(const T& key) { - return (self->erase(key) > 0); - } - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_SetSize(self->size()); - } - - bool hasNextImpl(const iterator& itr) const { - return (itr != $self->end()); - } - } -}; - -} diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/java/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_string.i b/mac/bin/swig/share/swig/4.1.0/java/std_string.i deleted file mode 100755 index 830a8961..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_string.i +++ /dev/null @@ -1,121 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a Java String and are passed around by value. - * - * To use non-const std::string references use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -// string -%typemap(jni) string "jstring" -%typemap(jtype) string "String" -%typemap(jstype) string "String" -%typemap(javadirectorin) string "$jniinput" -%typemap(javadirectorout) string "$javacall" - -%typemap(in) string -%{ if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - $1.assign($1_pstr); - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorout) string -%{ if(!$input) { - if (!jenv->ExceptionCheck()) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - } - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - $result.assign($1_pstr); - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorin,descriptor="Ljava/lang/String;") string -%{ $input = jenv->NewStringUTF($1.c_str()); - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(out) string -%{ $result = jenv->NewStringUTF($1.c_str()); %} - -%typemap(javain) string "$javainput" - -%typemap(javaout) string { - return $jnicall; - } - -%typemap(typecheck) string = char *; - -%typemap(throws) string -%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); - return $null; %} - -// const string & -%typemap(jni) const string & "jstring" -%typemap(jtype) const string & "String" -%typemap(jstype) const string & "String" -%typemap(javadirectorin) const string & "$jniinput" -%typemap(javadirectorout) const string & "$javacall" - -%typemap(in) const string & -%{ if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - $*1_ltype $1_str($1_pstr); - $1 = &$1_str; - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - /* possible thread/reentrant code problem */ - static $*1_ltype $1_str; - $1_str = $1_pstr; - $result = &$1_str; - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorin,descriptor="Ljava/lang/String;") const string & -%{ $input = jenv->NewStringUTF($1.c_str()); - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(out) const string & -%{ $result = jenv->NewStringUTF($1->c_str()); %} - -%typemap(javain) const string & "$javainput" - -%typemap(javaout) const string & { - return $jnicall; - } - -%typemap(typecheck) const string & = char *; - -%typemap(throws) const string & -%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); - return $null; %} - -} - diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/java/std_unique_ptr.i deleted file mode 100755 index 838ca495..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_unique_ptr.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) - -%typemap (jni) std::unique_ptr< TYPE > "jlong" -%typemap (jtype) std::unique_ptr< TYPE > "long" -%typemap (jstype) std::unique_ptr< TYPE > "$typemap(jstype, TYPE)" - -%typemap(in) std::unique_ptr< TYPE > (TYPE *unique_temp) -%{ unique_temp = *(TYPE **)&$input; - $1.reset(unique_temp); %} - -%typemap(javain) std::unique_ptr< TYPE > "$typemap(jstype, TYPE).swigRelease($javainput)" - -%typemap (out) std::unique_ptr< TYPE > %{ - jlong lpp = 0; - *(TYPE **) &lpp = $1.release(); - $result = lpp; -%} - -%typemap(javaout) std::unique_ptr< TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_unordered_map.i b/mac/bin/swig/share/swig/4.1.0/java/std_unordered_map.i deleted file mode 100755 index 283a9b46..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_unordered_map.i +++ /dev/null @@ -1,211 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unordered_map.i - * - * SWIG typemaps for std::unordered_map - * The Java proxy class extends java.util.AbstractMap. The std::unordered_map - * container looks and feels much like a java.util.HashMap from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::unordered_map -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_MapSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_MapSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("map size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::unordered_map::sizeImpl "private"; -%javamethodmodifiers std::unordered_map::containsImpl "private"; -%javamethodmodifiers std::unordered_map::putUnchecked "private"; -%javamethodmodifiers std::unordered_map::removeUnchecked "private"; -%javamethodmodifiers std::unordered_map::find "private"; -%javamethodmodifiers std::unordered_map::begin "private"; -%javamethodmodifiers std::unordered_map::end "private"; - -%rename(Iterator) std::unordered_map::iterator; -%nodefaultctor std::unordered_map::iterator; -%javamethodmodifiers std::unordered_map::iterator::getNextUnchecked "private"; -%javamethodmodifiers std::unordered_map::iterator::isNot "private"; -%javamethodmodifiers std::unordered_map::iterator::getKey "private"; -%javamethodmodifiers std::unordered_map::iterator::getValue "private"; -%javamethodmodifiers std::unordered_map::iterator::setValue "private"; - -namespace std { - -template class unordered_map { - -%typemap(javabase) std::unordered_map - "java.util.AbstractMap<$typemap(jboxtype, K), $typemap(jboxtype, T)>" - -%proxycode %{ - - public int size() { - return sizeImpl(); - } - - public boolean containsKey(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return false; - } - - return containsImpl(($typemap(jboxtype, K))key); - } - - public $typemap(jboxtype, T) get(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - return itr.getValue(); - } - - return null; - } - - public $typemap(jboxtype, T) put($typemap(jboxtype, K) key, $typemap(jboxtype, T) value) { - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - itr.setValue(value); - return oldValue; - } else { - putUnchecked(key, value); - return null; - } - } - - public $typemap(jboxtype, T) remove(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - removeUnchecked(itr); - return oldValue; - } else { - return null; - } - } - - public java.util.Set> entrySet() { - java.util.Set> setToReturn = - new java.util.HashSet>(); - - Iterator itr = begin(); - final Iterator end = end(); - while (itr.isNot(end)) { - setToReturn.add(new Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)>() { - private Iterator iterator; - - private Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)> init(Iterator iterator) { - this.iterator = iterator; - return this; - } - - public $typemap(jboxtype, K) getKey() { - return iterator.getKey(); - } - - public $typemap(jboxtype, T) getValue() { - return iterator.getValue(); - } - - public $typemap(jboxtype, T) setValue($typemap(jboxtype, T) newValue) { - $typemap(jboxtype, T) oldValue = iterator.getValue(); - iterator.setValue(newValue); - return oldValue; - } - }.init(itr)); - itr = itr.getNextUnchecked(); - } - - return setToReturn; - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - unordered_map(); - unordered_map(const unordered_map& other); - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - std::unordered_map< K, T >::iterator getNextUnchecked() { - std::unordered_map< K, T >::iterator copy = (*$self); - return ++copy; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - - K getKey() const { - return (*$self)->first; - } - - T getValue() const { - return (*$self)->second; - } - - void setValue(const T& newValue) { - (*$self)->second = newValue; - } - } - }; - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator find(const K& key); - iterator begin(); - iterator end(); - %extend { - %fragment("SWIG_MapSize"); - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_MapSize(self->size()); - } - - bool containsImpl(const K& key) { - return (self->count(key) > 0); - } - - void putUnchecked(const K& key, const T& value) { - (*self)[key] = value; - } - - void removeUnchecked(const std::unordered_map< K, T >::iterator itr) { - self->erase(itr); - } - } -}; - -} diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_unordered_set.i b/mac/bin/swig/share/swig/4.1.0/java/std_unordered_set.i deleted file mode 100755 index ddcedf05..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_unordered_set.i +++ /dev/null @@ -1,203 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unordered_set.i - * - * SWIG typemaps for std::unordered_set - * The Java proxy class extends java.util.AbstractSet. The std::unordered_set - * container looks and feels much like a java.util.HashSet from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::unordered_set -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_UnorderedSetSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_UnorderedSetSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("unordered_set size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::unordered_set::sizeImpl "private"; -%javamethodmodifiers std::unordered_set::containsImpl "private"; -%javamethodmodifiers std::unordered_set::removeImpl "private"; -%javamethodmodifiers std::unordered_set::hasNextImpl "private"; -%javamethodmodifiers std::unordered_set::begin "private"; -%javamethodmodifiers std::unordered_set::end "private"; - -%rename(Iterator) std::unordered_set::iterator; -%nodefaultctor std::unordered_set::iterator; -%javamethodmodifiers std::unordered_set::iterator::incrementUnchecked "private"; -%javamethodmodifiers std::unordered_set::iterator::derefUnchecked "private"; -%javamethodmodifiers std::unordered_set::iterator::isNot "private"; - -namespace std { - -template -class unordered_set { - -%typemap(javabase) std::unordered_set "java.util.AbstractSet<$typemap(jboxtype, Key)>" -%proxycode %{ - public $javaclassname(java.util.Collection collection) { - this(); - addAll(collection); - } - - public int size() { - return sizeImpl(); - } - - public boolean addAll(java.util.Collection collection) { - boolean didAddElement = false; - for (java.lang.Object object : collection) { - didAddElement |= add(($typemap(jboxtype, Key))object); - } - - return didAddElement; - } - - public java.util.Iterator<$typemap(jboxtype, Key)> iterator() { - return new java.util.Iterator<$typemap(jboxtype, Key)>() { - private Iterator curr; - private Iterator end; - - private java.util.Iterator<$typemap(jboxtype, Key)> init() { - curr = $javaclassname.this.begin(); - end = $javaclassname.this.end(); - return this; - } - - public $typemap(jboxtype, Key) next() { - if (!hasNext()) { - throw new java.util.NoSuchElementException(); - } - - // Save the current position, increment it, - // then return the value at the position before the increment. - final $typemap(jboxtype, Key) currValue = curr.derefUnchecked(); - curr.incrementUnchecked(); - return currValue; - } - - public boolean hasNext() { - return curr.isNot(end); - } - - public void remove() { - throw new java.lang.UnsupportedOperationException(); - } - }.init(); - } - - public boolean containsAll(java.util.Collection collection) { - for (java.lang.Object object : collection) { - if (!contains(object)) { - return false; - } - } - - return true; - } - - public boolean contains(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, Key))) { - return false; - } - - return containsImpl(($typemap(jboxtype, Key))object); - } - - public boolean removeAll(java.util.Collection collection) { - boolean didRemoveElement = false; - for (java.lang.Object object : collection) { - didRemoveElement |= remove(object); - } - - return didRemoveElement; - } - - public boolean remove(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, Key))) { - return false; - } - - return removeImpl(($typemap(jboxtype, Key))object); - } -%} - - public: - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - void incrementUnchecked() { - ++(*$self); - } - - Key derefUnchecked() const { - return **$self; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - } - }; - - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef Key value_type; - typedef Key key_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - unordered_set(); - unordered_set(const unordered_set& other); - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator begin(); - iterator end(); - - %extend { - %fragment("SWIG_UnorderedSetSize"); - - // Returns whether item was inserted. - bool add(const Key& key) { - return self->insert(key).second; - } - - // Returns whether set contains key. - bool containsImpl(const Key& key) { - return (self->count(key) > 0); - } - - // Returns whether the item was erased. - bool removeImpl(const Key& key) { - return (self->erase(key) > 0); - } - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_UnorderedSetSize(self->size()); - } - - bool hasNextImpl(const iterator& itr) const { - return (itr != $self->end()); - } - } -}; - -} diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_vector.i b/mac/bin/swig/share/swig/4.1.0/java/std_vector.i deleted file mode 100755 index 60ee23eb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_vector.i +++ /dev/null @@ -1,185 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector. - * The Java proxy class extends java.util.AbstractList and implements - * java.util.RandomAccess. The std::vector container looks and feels much like a - * java.util.ArrayList from Java. - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -%fragment("SWIG_VectorSize", "header", fragment="SWIG_JavaIntFromSize_t") { -SWIGINTERN jint SWIG_VectorSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) - throw std::out_of_range("vector size is too large to fit into a Java int"); - return sz; -} -} - -%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CTYPE, CONST_REFERENCE) -%typemap(javabase) std::vector< CTYPE > "java.util.AbstractList<$typemap(jboxtype, CTYPE)>" -%typemap(javainterfaces) std::vector< CTYPE > "java.util.RandomAccess" -%proxycode %{ - public $javaclassname($typemap(jstype, CTYPE)[] initialElements) { - this(); - reserve(initialElements.length); - - for ($typemap(jstype, CTYPE) element : initialElements) { - add(element); - } - } - - public $javaclassname(Iterable<$typemap(jboxtype, CTYPE)> initialElements) { - this(); - for ($typemap(jstype, CTYPE) element : initialElements) { - add(element); - } - } - - public $typemap(jboxtype, CTYPE) get(int index) { - return doGet(index); - } - - public $typemap(jboxtype, CTYPE) set(int index, $typemap(jboxtype, CTYPE) e) { - return doSet(index, e); - } - - public boolean add($typemap(jboxtype, CTYPE) e) { - modCount++; - doAdd(e); - return true; - } - - public void add(int index, $typemap(jboxtype, CTYPE) e) { - modCount++; - doAdd(index, e); - } - - public $typemap(jboxtype, CTYPE) remove(int index) { - modCount++; - return doRemove(index); - } - - protected void removeRange(int fromIndex, int toIndex) { - modCount++; - doRemoveRange(fromIndex, toIndex); - } - - public int size() { - return doSize(); - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef CTYPE *pointer; - typedef CTYPE const *const_pointer; - typedef CTYPE &reference; - typedef CONST_REFERENCE const_reference; - - vector(); - vector(const vector &other); - - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %extend { - %fragment("SWIG_VectorSize"); - - vector(jint count, const CTYPE &value) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("vector count must be positive"); - return new std::vector< CTYPE >(static_cast::size_type>(count), value); - } - - jint doSize() const throw (std::out_of_range) { - return SWIG_VectorSize(self->size()); - } - - void doAdd(const value_type& x) { - self->push_back(x); - } - - void doAdd(jint index, const value_type& x) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (0 <= index && index <= size) { - self->insert(self->begin() + index, x); - } else { - throw std::out_of_range("vector index out of range"); - } - } - - value_type doRemove(jint index) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (0 <= index && index < size) { - CTYPE const old_value = (*self)[index]; - self->erase(self->begin() + index); - return old_value; - } else { - throw std::out_of_range("vector index out of range"); - } - } - - CONST_REFERENCE doGet(jint index) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (index >= 0 && index < size) - return (*self)[index]; - else - throw std::out_of_range("vector index out of range"); - } - - value_type doSet(jint index, const value_type& val) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (index >= 0 && index < size) { - CTYPE const old_value = (*self)[index]; - (*self)[index] = val; - return old_value; - } - else - throw std::out_of_range("vector index out of range"); - } - - void doRemoveRange(jint fromIndex, jint toIndex) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (0 <= fromIndex && fromIndex <= toIndex && toIndex <= size) { - self->erase(self->begin() + fromIndex, self->begin() + toIndex); - } else { - throw std::out_of_range("vector index out of range"); - } - } - } -%enddef - -%javamethodmodifiers std::vector::doSize "private"; -%javamethodmodifiers std::vector::doAdd "private"; -%javamethodmodifiers std::vector::doGet "private"; -%javamethodmodifiers std::vector::doSet "private"; -%javamethodmodifiers std::vector::doRemove "private"; -%javamethodmodifiers std::vector::doRemoveRange "private"; - -namespace std { - - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(T, const value_type&) - }; - - // bool specialization - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(bool, bool) - }; -} - -%define specialize_std_vector(T) -#warning "specialize_std_vector - specialization for type T no longer needed" -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/java/std_wstring.i b/mac/bin/swig/share/swig/4.1.0/java/std_wstring.i deleted file mode 100755 index efa9e63b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/std_wstring.i +++ /dev/null @@ -1,180 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_wstring.i - * - * Typemaps for std::wstring and const std::wstring& - * - * These are mapped to a Java String and are passed around by value. - * Warning: Unicode / multibyte characters are handled differently on different - * OSs so the std::wstring typemaps may not always work as intended. - * - * To use non-const std::wstring references use the following %apply. Note - * that they are passed by value. - * %apply const std::wstring & {std::wstring &}; - * ----------------------------------------------------------------------------- */ - -namespace std { - -%naturalvar wstring; - -class wstring; - -// wstring -%typemap(jni) wstring "jstring" -%typemap(jtype) wstring "String" -%typemap(jstype) wstring "String" -%typemap(javadirectorin) wstring "$jniinput" -%typemap(javadirectorout) wstring "$javacall" - -%typemap(in) wstring -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - if ($1_len) { - $1.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $1.push_back((wchar_t)$1_pstr[i]); - } - } - jenv->ReleaseStringChars($input, $1_pstr); - %} - -%typemap(directorout) wstring -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - if ($1_len) { - $result.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $result.push_back((wchar_t)$1_pstr[i]); - } - } - jenv->ReleaseStringChars($input, $1_pstr); - %} - -%typemap(directorin,descriptor="Ljava/lang/String;") wstring %{ - jsize $1_len = (jsize)$1.length(); - jchar *$1_conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - $1_conv_buf[i] = (jchar)$1[i]; - } - $input = jenv->NewString($1_conv_buf, $1_len); - Swig::LocalRefGuard $1_refguard(jenv, $input); - delete [] $1_conv_buf; -%} - -%typemap(out) wstring -%{jsize $1_len = (jsize)$1.length(); - jchar *conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - conv_buf[i] = (jchar)$1[i]; - } - $result = jenv->NewString(conv_buf, $1_len); - delete [] conv_buf; %} - -%typemap(javain) wstring "$javainput" - -%typemap(javaout) wstring { - return $jnicall; - } - -//%typemap(typecheck) wstring = wchar_t *; - -%typemap(throws) wstring -%{std::string message($1.size(), '\0'); - for (size_t i = 0; i < $1.size(); ++i) { - message[i] = (char)$1[i]; - } - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str()); - return $null; %} - -// const wstring & -%typemap(jni) const wstring & "jstring" -%typemap(jtype) const wstring & "String" -%typemap(jstype) const wstring & "String" -%typemap(javadirectorin) const wstring & "$jniinput" -%typemap(javadirectorout) const wstring & "$javacall" - -%typemap(in) const wstring & -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - std::wstring $1_str; - if ($1_len) { - $1_str.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $1_str.push_back((wchar_t)$1_pstr[i]); - } - } - $1 = &$1_str; - jenv->ReleaseStringChars($input, $1_pstr); - %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring & -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - /* possible thread/reentrant code problem */ - static std::wstring $1_str; - if ($1_len) { - $1_str.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $1_str.push_back((wchar_t)$1_pstr[i]); - } - } - $result = &$1_str; - jenv->ReleaseStringChars($input, $1_pstr); %} - -%typemap(directorin,descriptor="Ljava/lang/String;") const wstring & %{ - jsize $1_len = (jsize)$1.length(); - jchar *$1_conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - $1_conv_buf[i] = (jchar)($1)[i]; - } - $input = jenv->NewString($1_conv_buf, $1_len); - Swig::LocalRefGuard $1_refguard(jenv, $input); - delete [] $1_conv_buf; -%} - -%typemap(out) const wstring & -%{jsize $1_len = (jsize)$1->length(); - jchar *conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - conv_buf[i] = (jchar)(*$1)[i]; - } - $result = jenv->NewString(conv_buf, $1_len); - delete [] conv_buf; %} - -%typemap(javain) const wstring & "$javainput" - -%typemap(javaout) const wstring & { - return $jnicall; - } - -//%typemap(typecheck) const wstring & = wchar_t *; - -%typemap(throws) const wstring & -%{std::string message($1.size(), '\0'); - for (size_t i = 0; i < $1.size(); ++i) { - message[i] = (char)$1[i]; - } - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str()); - return $null; %} - -} - diff --git a/mac/bin/swig/share/swig/4.1.0/java/stl.i b/mac/bin/swig/share/swig/4.1.0/java/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/java/swiginterface.i b/mac/bin/swig/share/swig/4.1.0/java/swiginterface.i deleted file mode 100755 index c3ca97d3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/swiginterface.i +++ /dev/null @@ -1,74 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swiginterface.i - * - * SWIG interface feature and typemaps implementation providing: - * %interface - * %interface_impl - * %interface_custom - * ----------------------------------------------------------------------------- */ - -%define INTERFACE_TYPEMAPS(CTYPE...) -%typemap(jtype) CTYPE, CTYPE *, CTYPE *const&, CTYPE [], CTYPE & "long" -%typemap(jstype) CTYPE "$&javainterfacename" -%typemap(jstype) CTYPE *, CTYPE [], CTYPE & "$javainterfacename" -%typemap(jstype) CTYPE *const& "$*javainterfacename" -%typemap(javain) CTYPE "$javainput.$&interfacename_GetInterfaceCPtr()" -%typemap(javain) CTYPE & "$javainput.$interfacename_GetInterfaceCPtr()" -%typemap(javain) CTYPE *, CTYPE [] "($javainput == null) ? 0 : $javainput.$interfacename_GetInterfaceCPtr()" -%typemap(javain) CTYPE *const& "($javainput == null) ? 0 : $javainput.$*interfacename_GetInterfaceCPtr()" -%typemap(javaout) CTYPE { - return ($&javainterfacename)new $&javaclassname($jnicall, true); - } -%typemap(javaout) CTYPE & { - return ($javainterfacename)new $javaclassname($jnicall, $owner); - } -%typemap(javaout) CTYPE *, CTYPE [] { - long cPtr = $jnicall; - return (cPtr == 0) ? null : ($javainterfacename)new $javaclassname(cPtr, $owner); - } -%typemap(javaout) CTYPE *const& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : ($*javainterfacename)new $*javaclassname(cPtr, $owner); - } - -%typemap(javadirectorin) CTYPE "($&javainterfacename)new $&javaclassname($jniinput, true)" -%typemap(javadirectorin) CTYPE & "($javainterfacename)new $javaclassname($jniinput, false)" -%typemap(javadirectorin) CTYPE *, CTYPE [] "($jniinput == 0) ? null : ($javainterfacename)new $javaclassname($jniinput, false)" -%typemap(javadirectorin) CTYPE *const& "($jniinput == 0) ? null : ($*javainterfacename)new $*javaclassname($jniinput, false)" -%typemap(javadirectorout) CTYPE "$javacall.$&interfacename_GetInterfaceCPtr()" -%typemap(javadirectorout) CTYPE *, CTYPE [], CTYPE & "$javacall.$interfacename_GetInterfaceCPtr()" -%typemap(javadirectorout) CTYPE *const& "$javacall.$*interfacename_GetInterfaceCPtr()" -%typemap(directorin,descriptor="L$packagepath/$&javainterfacename;") CTYPE -%{ $input = 0; - *(($&1_ltype*)&$input) = new $1_ltype(SWIG_STD_MOVE($1)); %} -%typemap(directorin,descriptor="L$packagepath/$javainterfacename;") CTYPE *, CTYPE [] -%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} -%typemap(directorin,descriptor="L$packagepath/$javainterfacename;") CTYPE & -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} -%typemap(directorin,descriptor="L$packagepath/$*javainterfacename;") CTYPE *const& -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} - -%typemap(javainterfacecode, declaration=" long $interfacename_GetInterfaceCPtr();\n", cptrmethod="$interfacename_GetInterfaceCPtr") CTYPE %{ - public long $interfacename_GetInterfaceCPtr() { - return $imclassname.$javaclazzname$interfacename_GetInterfaceCPtr(swigCPtr); - } -%} -%enddef - -%define %interface(CTYPE...) -%feature("interface", name="%sSwigInterface") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_impl(CTYPE...) -%rename("%sSwigImpl") CTYPE; -%feature("interface", name="%(rstrip:[SwigImpl])s") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_custom(PROXY, INTERFACE, CTYPE...) -%rename(PROXY) CTYPE; -%feature("interface", name=INTERFACE) CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - diff --git a/mac/bin/swig/share/swig/4.1.0/java/swigmove.i b/mac/bin/swig/share/swig/4.1.0/java/swigmove.i deleted file mode 100755 index 671b988a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/swigmove.i +++ /dev/null @@ -1,16 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in) SWIGTYPE MOVE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - SwigValueWrapper< $1_ltype >::reset($1, argp); %} - -%typemap(javain) SWIGTYPE MOVE "$&javaclassname.swigRelease($javainput)" diff --git a/mac/bin/swig/share/swig/4.1.0/java/typemaps.i b/mac/bin/swig/share/swig/4.1.0/java/typemaps.i deleted file mode 100755 index e130c193..00000000 --- a/mac/bin/swig/share/swig/4.1.0/java/typemaps.i +++ /dev/null @@ -1,529 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps remap a C pointer or C++ reference to be an "INPUT" value which is -passed by value instead of reference. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In Java you could then use it like this: - double answer = modulename.fadd(10.0, 20.0); - -There are no char *INPUT typemaps, however you can apply the signed char * typemaps instead: - %include - %apply signed char *INPUT {char *input}; - void f(char *input); -*/ - -%define INPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JNIDESC) -%typemap(jni) TYPE *INPUT, TYPE &INPUT "JNITYPE" -%typemap(jtype) TYPE *INPUT, TYPE &INPUT "JTYPE" -%typemap(jstype) TYPE *INPUT, TYPE &INPUT "JTYPE" -%typemap(javain) TYPE *INPUT, TYPE &INPUT "$javainput" - -%typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(freearg) TYPE *INPUT, TYPE &INPUT "" - -%typemap(typecheck) TYPE *INPUT = TYPE; -%typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, jboolean, boolean, "Z"); -INPUT_TYPEMAP(signed char, jbyte, byte, "B"); -INPUT_TYPEMAP(unsigned char, jshort, short, "S"); -INPUT_TYPEMAP(short, jshort, short, "S"); -INPUT_TYPEMAP(unsigned short, jint, int, "I"); -INPUT_TYPEMAP(int, jint, int, "I"); -INPUT_TYPEMAP(unsigned int, jlong, long, "J"); -INPUT_TYPEMAP(long, jint, int, "I"); -INPUT_TYPEMAP(unsigned long, jlong, long, "J"); -INPUT_TYPEMAP(long long, jlong, long, "J"); -INPUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, "Ljava/math/BigInteger;"); -INPUT_TYPEMAP(float, jfloat, float, "F"); -INPUT_TYPEMAP(double, jdouble, double, "D"); - -#undef INPUT_TYPEMAP - -/* Convert from BigInteger using the toByteArray member function */ -/* Overrides the typemap in the INPUT_TYPEMAP macro */ -%typemap(in) unsigned long long *INPUT($*1_ltype temp), unsigned long long &INPUT($*1_ltype temp) { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, $input); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - temp = 0; - if (sz > 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Java output of the function would be the function return value and the -value in the single element array. In Java you would use it like this: - - double[] ptr = {0.0}; - double fraction = modulename.modf(5.0,ptr); - -There are no char *OUTPUT typemaps, however you can apply the signed char * typemaps instead: - %include - %apply signed char *OUTPUT {char *output}; - void f(char *output); -*/ - -/* Java BigInteger[] */ -%typecheck(SWIG_TYPECHECK_INT128_ARRAY) SWIGBIGINTEGERARRAY "" - -%define OUTPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE) -%typemap(jni) TYPE *OUTPUT, TYPE &OUTPUT %{JNITYPE##Array%} -%typemap(jtype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" -%typemap(jstype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" -%typemap(javain) TYPE *OUTPUT, TYPE &OUTPUT "$javainput" -%typemap(javadirectorin) TYPE *OUTPUT, TYPE &OUTPUT "$jniinput" -%typemap(javadirectorout) TYPE *OUTPUT, TYPE &OUTPUT "$javacall" - -%typemap(in) TYPE *OUTPUT($*1_ltype temp), TYPE &OUTPUT($*1_ltype temp) -{ - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - temp = ($*1_ltype)0; - $1 = &temp; -} - -%typemap(freearg) TYPE *OUTPUT, TYPE &OUTPUT "" - -%typemap(argout) TYPE *OUTPUT, TYPE &OUTPUT -{ - JNITYPE jvalue = (JNITYPE)temp$argnum; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &jvalue); -} - -%typemap(directorin,descriptor=JNIDESC) TYPE &OUTPUT %{ - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorin,descriptor=JNIDESC) TYPE *OUTPUT %{ - if ($1) { - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - } - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorargout, noblock=1) TYPE &OUTPUT -{ - JNITYPE $1_jvalue; - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = ($*1_ltype)$1_jvalue; -} - -%typemap(directorargout, noblock=1) TYPE *OUTPUT -{ - if ($result) { - JNITYPE $1_jvalue; - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = ($*1_ltype)$1_jvalue; - } -} - -%typemap(typecheck) TYPE *OUTPUT = TYPECHECKTYPE; -%typemap(typecheck) TYPE &OUTPUT = TYPECHECKTYPE; -%enddef - -OUTPUT_TYPEMAP(bool, jboolean, boolean, Boolean, "[Z", jbooleanArray); -OUTPUT_TYPEMAP(signed char, jbyte, byte, Byte, "[B", jbyteArray); -OUTPUT_TYPEMAP(unsigned char, jshort, short, Short, "[S", jshortArray); -OUTPUT_TYPEMAP(short, jshort, short, Short, "[S", jshortArray); -OUTPUT_TYPEMAP(unsigned short, jint, int, Int, "[I", jintArray); -OUTPUT_TYPEMAP(int, jint, int, Int, "[I", jintArray); -OUTPUT_TYPEMAP(unsigned int, jlong, long, Long, "[J", jlongArray); -OUTPUT_TYPEMAP(long, jint, int, Int, "[I", jintArray); -OUTPUT_TYPEMAP(unsigned long, jlong, long, Long, "[J", jlongArray); -OUTPUT_TYPEMAP(long long, jlong, long, Long, "[J", jlongArray); -OUTPUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, Object, "[Ljava/math/BigInteger;", jobjectArray); -OUTPUT_TYPEMAP(float, jfloat, float, Float, "[F", jfloatArray); -OUTPUT_TYPEMAP(double, jdouble, double, Double, "[D", jdoubleArray); - -#undef OUTPUT_TYPEMAP - -%typemap(in) bool *OUTPUT($*1_ltype temp), bool &OUTPUT($*1_ltype temp) -{ - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - temp = false; - $1 = &temp; -} - -%typemap(directorargout, noblock=1) bool &OUTPUT -{ - jboolean $1_jvalue; - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = $1_jvalue ? true : false; -} - -%typemap(directorargout, noblock=1) bool *OUTPUT -{ - if ($result) { - jboolean $1_jvalue; - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = $1_jvalue ? true : false; - } -} - - -/* Convert to BigInteger - byte array holds number in 2's complement big endian format */ -/* Use first element in BigInteger array for output */ -/* Overrides the typemap in the OUTPUT_TYPEMAP macro */ -%typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT { - jbyteArray ba = JCALL1(NewByteArray, jenv, 9); - jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger"); - jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(temp$argnum>>8*(8-i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - JCALL3(SetObjectArrayElement, jenv, $input, 0, bigint); -} - -/* -INOUT typemaps --------------- - -Mappings for a parameter that is both an input and an output parameter - -The following typemaps can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" typemaps described earlier. Output values are -returned as an element in a Java array. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -This works similarly to C in that the mapping directly modifies the -input value - the input must be an array with a minimum of one element. -The element in the array is the input and the output is the element in -the array. - - double x[] = {5.0}; - neg(x); - -The implementation of the OUTPUT and INOUT typemaps is different to other -languages in that other languages will return the output value as part -of the function return value. This difference is due to Java being a typed language. - -There are no char *INOUT typemaps, however you can apply the signed char * typemaps instead: - %include - %apply signed char *INOUT {char *inout}; - void f(char *inout); -*/ - -%define INOUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE) -%typemap(jni) TYPE *INOUT, TYPE &INOUT %{JNITYPE##Array%} -%typemap(jtype) TYPE *INOUT, TYPE &INOUT "JTYPE[]" -%typemap(jstype) TYPE *INOUT, TYPE &INOUT "JTYPE[]" -%typemap(javain) TYPE *INOUT, TYPE &INOUT "$javainput" -%typemap(javadirectorin) TYPE *INOUT, TYPE &INOUT "$jniinput" -%typemap(javadirectorout) TYPE *INOUT, TYPE &INOUT "$javacall" - -%typemap(in) TYPE *INOUT, TYPE &INOUT { - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - $1 = ($1_ltype) JCALL2(Get##JAVATYPE##ArrayElements, jenv, $input, 0); -} - -%typemap(freearg) TYPE *INOUT, TYPE &INOUT "" - -%typemap(argout) TYPE *INOUT, TYPE &INOUT -{ JCALL3(Release##JAVATYPE##ArrayElements, jenv, $input, (JNITYPE *)$1, 0); } - -%typemap(directorin,descriptor=JNIDESC) TYPE &INOUT %{ - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - JNITYPE $1_jvalue = (JNITYPE)$1; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorin,descriptor=JNIDESC) TYPE *INOUT %{ - if ($1) { - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - JNITYPE $1_jvalue = (JNITYPE)*$1; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - } - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorargout, noblock=1) TYPE &INOUT -{ - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = ($*1_ltype)$1_jvalue; -} - -%typemap(directorargout, noblock=1) TYPE *INOUT -{ - if ($result) { - JNITYPE $1_jvalue; - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = ($*1_ltype)$1_jvalue; - } -} - -%typemap(typecheck) TYPE *INOUT = TYPECHECKTYPE; -%typemap(typecheck) TYPE &INOUT = TYPECHECKTYPE; -%enddef - -INOUT_TYPEMAP(bool, jboolean, boolean, Boolean, "[Z", jbooleanArray); -INOUT_TYPEMAP(signed char, jbyte, byte, Byte, "[B", jbyteArray); -INOUT_TYPEMAP(unsigned char, jshort, short, Short, "[S", jshortArray); -INOUT_TYPEMAP(short, jshort, short, Short, "[S", jshortArray); -INOUT_TYPEMAP(unsigned short, jint, int, Int, "[I", jintArray); -INOUT_TYPEMAP(int, jint, int, Int, "[I", jintArray); -INOUT_TYPEMAP(unsigned int, jlong, long, Long, "[J", jlongArray); -INOUT_TYPEMAP(long, jint, int, Int, "[I", jintArray); -INOUT_TYPEMAP(unsigned long, jlong, long, Long, "[J", jlongArray); -INOUT_TYPEMAP(long long, jlong, long, Long, "[J", jlongArray); -INOUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, Object, "[java/math/BigInteger;", jobjectArray); -INOUT_TYPEMAP(float, jfloat, float, Float, "[F", jfloatArray); -INOUT_TYPEMAP(double, jdouble, double, Double, "[D", jdoubleArray); - -#undef INOUT_TYPEMAP - -/* Override typemaps in the INOUT_TYPEMAP macro for booleans to fix casts - as a jboolean isn't always the same size as a bool */ -%typemap(in) bool *INOUT (bool btemp, jboolean *jbtemp), bool &INOUT (bool btemp, jboolean *jbtemp) { - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - jbtemp = JCALL2(GetBooleanArrayElements, jenv, $input, 0); - btemp = (*jbtemp) ? true : false; - $1 = &btemp; -} - -%typemap(argout) bool *INOUT, bool &INOUT { - *jbtemp$argnum = btemp$argnum ? (jboolean)1 : (jboolean)0; - JCALL3(ReleaseBooleanArrayElements, jenv, $input , (jboolean *)jbtemp$argnum, 0); -} - -%typemap(directorargout, noblock=1) bool &INOUT -{ - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = $1_jvalue ? true : false; -} - -%typemap(directorargout, noblock=1) bool *INOUT -{ - if ($result) { - jboolean $1_jvalue; - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = $1_jvalue ? true : false; - } -} - - -/* Override the typemap in the INOUT_TYPEMAP macro for unsigned long long */ -%typemap(in) unsigned long long *INOUT ($*1_ltype temp), unsigned long long &INOUT ($*1_ltype temp) { - jobject bigint; - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - bigint = JCALL2(GetObjectArrayElement, jenv, $input, 0); - if (!bigint) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array element null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, bigint); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, bigint, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - temp = 0; - if (sz > 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; igetPrivateObject()->tryAllowDestroyInGC(); %} \ No newline at end of file diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_common.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_common.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_complex.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_complex.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_deque.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_deque.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_except.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_except.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_map.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_map.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_pair.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_pair.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_string.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_string.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_vector.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/std_vector.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/stl.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/stl.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/cocos/typemaps.i b/mac/bin/swig/share/swig/4.1.0/javascript/cocos/typemaps.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/arrays_javascript.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/arrays_javascript.i deleted file mode 100755 index 713b7ef2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/arrays_javascript.i +++ /dev/null @@ -1,94 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_javascript.i - * - * These typemaps give more natural support for arrays. The typemaps are not efficient - * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from JavaScript and vice versa. The JavaScript array is expected to be the same size as the C array. - * An exception is thrown if they are not. - * - * Example usage: - * Wrapping: - * - * %include - * %inline %{ - * extern int FiddleSticks[3]; - * %} - * - * Use from JavaScript like this: - * - * var fs = [10, 11, 12]; - * example.FiddleSticks = fs; - * fs = example.FiddleSticks; - * ----------------------------------------------------------------------------- */ - - -%fragment("SWIG_JSCGetIntProperty", "header", fragment=SWIG_AsVal_frag(int)) {} -%fragment("SWIG_JSCGetNumberProperty", "header", fragment=SWIG_AsVal_frag(double)) {} -%fragment("SWIG_JSCOutInt", "header", fragment=SWIG_From_frag(int)) {} -%fragment("SWIG_JSCOutNumber", "header", fragment=SWIG_From_frag(double)) {} - -%define JAVASCRIPT_ARRAYS_IN_DECL(NAME, CTYPE, ANY, ANYLENGTH) - -%typemap(in, fragment=NAME) CTYPE[ANY] { - if (JSValueIsObject(context, $input)) - { - int i; - // Convert into Array - JSObjectRef array = JSValueToObject(context, $input, NULL); - - int length = ANYLENGTH; - - $1 = ($*1_ltype *)malloc(sizeof($*1_ltype) * length); - - // Get each element from array - for (i = 0; i < length; i++) - { - JSValueRef jsvalue = JSObjectGetPropertyAtIndex(context, array, i, NULL); - $*1_ltype temp; - - // Get primitive value from JSObject - int res = SWIG_AsVal(CTYPE)(jsvalue, &temp); - if (!SWIG_IsOK(res)) - { - SWIG_exception_fail(SWIG_ERROR, "Failed to convert $input to double"); - } - arg$argnum[i] = temp; - } - } - else - { - SWIG_exception_fail(SWIG_ERROR, "$input is not JSObjectRef"); - } -} - -%typemap(freearg) CTYPE[ANY] { - free($1); -} - -%enddef - -%define JAVASCRIPT_ARRAYS_OUT_DECL(NAME, CTYPE) - -%typemap(out, fragment=NAME) CTYPE[ANY] { - int length = $1_dim0; - JSValueRef values[length]; - int i; - - for (i = 0; i < length; i++) - { - values[i] = SWIG_From(CTYPE)($1[i]); - } - - $result = JSObjectMakeArray(context, length, values, NULL); -} - -%enddef - -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, , SWIGJSC_ArrayLength(context, array)) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, ANY, $1_dim0) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, , SWIGJSC_ArrayLength(context, array)) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, ANY, $1_dim0) - -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutInt", int) -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutNumber", double) - diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/ccomplex.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/ccomplex.i deleted file mode 100755 index e58dbf71..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/ccomplex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ccomplex.i - * - * C complex typemaps - * ISO C99: 7.3 Complex arithmetic - * ----------------------------------------------------------------------------- */ - - -%include - -%{ -#include -%} - -#define complex _Complex - -/* C complex constructor */ -#define CCplxConst(r, i) ((r) + I*(i)) - -%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); - -/* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/cdata.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/complex.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/complex.i deleted file mode 100755 index 4c3b3c5e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/complex.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __cplusplus -%include -#else -%include -#endif - diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/exception.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/exception.i deleted file mode 100755 index 0246cfde..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/exception.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascript.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascript.swg deleted file mode 100755 index 3a83b649..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascript.swg +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascript.swg - * - * Javascript typemaps - * ----------------------------------------------------------------------------- */ - -%include - -%include - -%include - -%include - -%include - -%include - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcode.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcode.swg deleted file mode 100755 index 4050a6ee..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcode.swg +++ /dev/null @@ -1,429 +0,0 @@ -/* ----------------------------------------------------------------------------- - * js_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - goto fail; - fail: - return NULL; -} -%} - -/* ----------------------------------------------------------------------------- - * js_veto_ctor: a vetoing ctor for abstract classes - * - $jswrapper: name of wrapper - * - $jsname: class name - * ----------------------------------------------------------------------------- */ -%fragment ("js_veto_ctor", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, - size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - SWIG_exception(SWIG_ERROR, "Class $jsname can not be instantiated"); -fail: - return 0; -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatcher: dispatcher for overloaded constructors - * - $jswrapper: name of wrapper - * - $jsname: class name - * - $jsdispatchcases: part containing code for dispatching - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatcher", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, - size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSObjectRef thisObject = NULL; - - // switch all cases by means of series of if-returns. - $jsdispatchcases - - // default: - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of $jsname"); - - fail: - return thisObject; -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ -%fragment ("js_overloaded_ctor", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - $jscode - return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - - goto fail; - fail: - return NULL; -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatch_case: template for a dispatch case for calling an overloaded ctor. - * - $jsargcount: number of arguments of called ctor - * - $jswrapper: wrapper of called ctor - * - * Note: a try-catch-like mechanism is used to switch cases - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatch_case", "templates") -%{ - if(argc == $jsargcount) { - thisObject = $jswrapper(context, NULL, argc, argv, exception); - if(thisObject != NULL) { *exception=0; return thisObject; } /* reset exception and return */ - } -%} - - -/* ----------------------------------------------------------------------------- - * js_dtor: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtor", "templates") -%{ -static void $jswrapper(JSObjectRef thisObject) -{ - SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); - if(t) { - if (t->swigCMemOwn) { - free (($jstype)t->swigCObject); - } - JSObjectSetPrivate(thisObject, NULL); - free(t); - } -} -%} - -/* ----------------------------------------------------------------------------- - * js_dtor: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * - ${destructor_action}: The custom destructor action to invoke. - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtoroverride", "templates") -%{ -static void $jswrapper(JSObjectRef thisObject) -{ - SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); - if(t) { - if (t->swigCMemOwn) { - $jstype arg1 = ($jstype)t->swigCObject; - ${destructor_action} - } - /* remove the private data to make sure that it isn't accessed elsewhere */ - JSObjectSetPrivate(thisObject, NULL); - free(t); - } -} -%} - -/* ----------------------------------------------------------------------------- - * js_getter: template for getter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_getter", "templates") -%{ -static JSValueRef $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) -{ - $jslocals - JSValueRef jsresult; - - $jscode - return jsresult; - - goto fail; - fail: - return JSValueMakeUndefined(context); -} -%} - -/* ----------------------------------------------------------------------------- - * js_setter: template for setter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_setter", "templates") -%{ -static bool $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) -{ - $jslocals - $jscode - - return true; - - goto fail; - fail: - return false; -} -%} - -/* ----------------------------------------------------------------------------- - * js_function: template for function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function", "templates") -%{ -static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - JSValueRef jsresult; - - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - return jsresult; - - goto fail; - fail: - return JSValueMakeUndefined(context); -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatcher: template for a function dispatcher for overloaded functions - * - $jswrapper: wrapper function name - * - $jsname: name of the wrapped function - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function_dispatcher", "templates") -%{ -static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - JSValueRef jsresult; - int res; - $jscode - - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function $jsname."); - return jsresult; - - goto fail; - fail: - return JSValueMakeUndefined(context); -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_function: template for a overloaded function - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_overloaded_function", "templates") -%{ -static int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception, JSValueRef* p_result) -{ - $jslocals - JSValueRef jsresult; - - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - *p_result = jsresult; - return SWIG_OK; - - goto fail; - fail: - return SWIG_TypeError; -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatch_case: template for a case used in the function dispatcher - * - $jswrapper: wrapper function name - * - $jsargcount: number of arguments of overloaded function - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function_dispatch_case", "templates") -%{ - if(argc == $jsargcount) { - res = $jswrapper(context, function, thisObject, argc, argv, exception, &jsresult); - if(res == SWIG_OK) { *exception = 0; return jsresult; } - } -%} - -/* ----------------------------------------------------------------------------- - * jsc_variable_declaration: template for a variable table entry - * - $jsname: name of the variable - * - $jsgetter: wrapper of getter function - * - $jssetter: wrapper of setter function - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_variable_declaration", "templates") -%{ - {"$jsname", $jsgetter, $jssetter, kJSPropertyAttributeNone}, -%} - - -/* ----------------------------------------------------------------------------- - * jsc_function_declaration: template for a function table entry - * - $jsname: name of the variable - * - $jswrapper: wrapper function - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_function_declaration", "templates") -%{ - {"$jsname", $jswrapper, kJSPropertyAttributeNone}, -%} - -/* ----------------------------------------------------------------------------- - * jsc_classtemplate_declaration: template for a namespace declaration - * - $jsmangledname: mangled class name - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_declaration", "templates") -%{ -static JSClassDefinition $jsmangledname_classDefinition; - -static JSClassDefinition $jsmangledname_objectDefinition; - -static JSClassRef $jsmangledname_classRef; -%} - -/* ----------------------------------------------------------------------------- - * jsc_class_tables: template for a namespace declaration - * - $jsmangledname: mangled class name - * - $jsstaticclassvariables: list of static variable entries - * - $jsstaticclassfunctions: list of static function entries - * - $jsclassvariables: list of member variable entries - * - $jsclassfunctions: list of member function entries - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_tables", "templates") -%{ -static JSStaticValue $jsmangledname_staticValues[] = { - $jsstaticclassvariables - { 0, 0, 0, 0 } -}; - -static JSStaticFunction $jsmangledname_staticFunctions[] = { - $jsstaticclassfunctions - { 0, 0, 0 } -}; - -static JSStaticValue $jsmangledname_values[] = { - $jsclassvariables - { 0, 0, 0, 0 } -}; - -static JSStaticFunction $jsmangledname_functions[] = { - $jsclassfunctions - { 0, 0, 0 } -}; -%} - -/* ----------------------------------------------------------------------------- - * jsc_define_class_template: template for defining a class template - * - $jsmangledname: mangled class name - * - $jsmangledtype: mangled class type - * - $jsctor: wrapper of ctor - * - $jsbaseclass: mangled name of base class - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_definition", "templates") -%{ - $jsmangledname_classDefinition.staticFunctions = $jsmangledname_staticFunctions; - $jsmangledname_classDefinition.staticValues = $jsmangledname_staticValues; - $jsmangledname_classDefinition.callAsConstructor = $jsctor; - $jsmangledname_objectDefinition.finalize = $jsdtor; - $jsmangledname_objectDefinition.staticValues = $jsmangledname_values; - $jsmangledname_objectDefinition.staticFunctions = $jsmangledname_functions; - $jsclass_inheritance - $jsmangledname_classRef = JSClassCreate(&$jsmangledname_objectDefinition); - SWIGTYPE_$jsmangledtype->clientdata = $jsmangledname_classRef; -%} - -%fragment ("jsc_class_inherit", templates) -%{ - if (SWIGTYPE_p$jsbaseclassmangled != NULL) { - $jsmangledname_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p$jsbaseclassmangled->clientdata; - } -%} - -%fragment ("jsc_class_noinherit", templates) -%{ - $jsmangledname_objectDefinition.parentClass = _SwigObject_classRef; -%} - - -/* ----------------------------------------------------------------------------- - * jsc_register_class: template for registration of a class - * - $jsname: class name - * - $jsmangledname: mangled class name - * - $jsnspace: mangled name of namespace - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_registration", "templates") -%{ - JS_registerClass(context, $jsnspace_object, "$jsname", &$jsmangledname_classDefinition); -%} - - -/* ----------------------------------------------------------------------------- - * jsc_nspace_declaration: template for a namespace declaration - * - $jsnspace: mangled name of the namespace - * - $jsglobalvariables: list of variable entries - * - $jsglobalfunctions: list of function entries - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_nspace_declaration", "templates") -%{ -static JSStaticValue $jsnspace_values[] = { - $jsglobalvariables - { 0, 0, 0, 0 } -}; - -static JSStaticFunction $jsnspace_functions[] = { - $jsglobalfunctions - { 0, 0, 0 } -}; - -static JSClassDefinition $jsnspace_classDefinition; -static JSObjectRef $jsmangledname_object; -%} - -/* ----------------------------------------------------------------------------- - * jsc_nspace_definition: template for definition of a namespace object - * - $jsmangledname: mangled name of namespace - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_nspace_definition", "templates") -%{ - $jsmangledname_classDefinition.staticFunctions = $jsmangledname_functions; - $jsmangledname_classDefinition.staticValues = $jsmangledname_values; - $jsmangledname_object = JSObjectMake(context, JSClassCreate(&$jsmangledname_classDefinition), NULL); -%} - -/* ----------------------------------------------------------------------------- - * jsc_nspace_registration: template for registration of a namespace object - * - $jsname: name of namespace - * - $jsmangledname: mangled name of namespace - * - $jsparent: mangled name of parent namespace - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_nspace_registration", "templates") -%{ - JS_registerNamespace(context, $jsmangledname_object, $jsparent_object, "$jsname"); -%} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcomplex.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcomplex.swg deleted file mode 100755 index dcc205db..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcomplex.swg +++ /dev/null @@ -1,146 +0,0 @@ -/* - Defines the As/From converters for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header", - fragment=SWIG_From_frag(double)) -{ -SWIGINTERNINLINE JSObjectRef -SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) -{ - JSValueRef vals[2]; - vals[0] = SWIG_From(double)(Real(c)); - vals[1] = SWIG_From(double)(Imag(c)); - return JSObjectMakeArray(context, 2, vals, NULL); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ -SWIGINTERN int -SWIG_AsVal_dec(Type) (JSValueRef o, Type* val) -{ - if (JSValueIsObject(context, o)) { - JSObjectRef array; - JSValueRef exception, js_re, js_im; - double re, im; - int res; - - exception = 0; - res = 0; - - array = JSValueToObject(context, o, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_re = JSObjectGetPropertyAtIndex(context, array, 0, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_im = JSObjectGetPropertyAtIndex(context, array, 1, &exception); - if(exception != 0) - return SWIG_TypeError; - - res = SWIG_AsVal(double)(js_re, &re); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(js_im, &im); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if (val) *val = Constructor(re, im); - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { -SWIGINTERN int -SWIG_AsVal_dec(Type)(JSValueRef o, Type *val) -{ - if (JSValueIsObject(context, o)) { - JSObjectRef array; - JSValueRef exception, js_re, js_im; - double re, im; - int res; - - exception = 0; - res = 0; - - array = JSValueToObject(context, o, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_re = JSObjectGetPropertyAtIndex(context, array, 0, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_im = JSObjectGetPropertyAtIndex(context, array, 1, &exception); - if(exception != 0) - return SWIG_TypeError; - - res = SWIG_AsVal(double)(js_re, &re); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(js_im, &im); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0f); - return res; - } - } - return SWIG_TypeError; -} -} - -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptfragments.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptfragments.swg deleted file mode 100755 index 4778bf03..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'javascriptfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the default ones defined by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascripthelpers.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascripthelpers.swg deleted file mode 100755 index 45765433..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascripthelpers.swg +++ /dev/null @@ -1,69 +0,0 @@ -%insert(wrapper) %{ - -SWIGINTERN bool JS_registerClass(JSGlobalContextRef context, JSObjectRef parentObject, - const char* className, - JSClassDefinition* definition) { - - JSStringRef js_className = JSStringCreateWithUTF8CString(className); - JSObjectRef classObject = JSObjectMake(context, JSClassCreate(definition), NULL); - JSObjectSetProperty(context, parentObject, - js_className, classObject, - kJSPropertyAttributeNone, NULL); - JSStringRelease(js_className); - - return true; -} - -SWIGINTERN bool JS_registerNamespace(JSGlobalContextRef context, - JSObjectRef namespaceObj, JSObjectRef parentNamespace, - const char* name) -{ - JSStringRef js_name = JSStringCreateWithUTF8CString(name); - JSObjectSetProperty(context, parentNamespace, - js_name, namespaceObj, - kJSPropertyAttributeNone, NULL); - JSStringRelease(js_name); - - return true; -} - - -SWIGINTERN bool JS_registerFunction(JSGlobalContextRef context, JSObjectRef object, - const char* functionName, JSObjectCallAsFunctionCallback callback) -{ - JSStringRef js_functionName = JSStringCreateWithUTF8CString(functionName); - JSObjectSetProperty(context, object, js_functionName, - JSObjectMakeFunctionWithCallback(context, js_functionName, callback), - kJSPropertyAttributeNone, NULL); - JSStringRelease(js_functionName); - return true; -} - -SWIGINTERN bool JS_veto_set_variable(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) -{ - char buffer[256]; - char msg[512]; - int res; - - JSStringGetUTF8CString(propertyName, buffer, 256); - res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); - - if(res<0) { - SWIG_exception(SWIG_ERROR, "Tried to write read-only variable."); - } else { - SWIG_exception(SWIG_ERROR, msg); - } -fail: - return false; -} - -SWIGINTERN JSValueRef JS_CharPtrToJSValue(JSContextRef context, char* cstr) { - JSValueRef val; - - JSStringRef jsstring = JSStringCreateWithUTF8CString((char*) cstr); - val = JSValueMakeString(context, jsstring); - JSStringRelease(jsstring); - - return val; -} -%} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptinit.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptinit.swg deleted file mode 100755 index b0138b39..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptinit.swg +++ /dev/null @@ -1,112 +0,0 @@ -%insert(init) %{ -SWIGRUNTIME void -SWIG_JSC_SetModule(JSGlobalContextRef context, swig_module_info *swig_module) { - JSObjectRef globalObject; - JSStringRef moduleName; - JSClassDefinition classDef; - JSClassRef classRef; - JSObjectRef object; - - if(context == 0){ - return; - } - - globalObject = JSContextGetGlobalObject(context); - moduleName = JSStringCreateWithUTF8CString("swig_module_info_data"); - - classDef = kJSClassDefinitionEmpty; - classRef = JSClassCreate(&classDef); - - object = JSObjectMake(context, classRef, NULL); - JSObjectSetPrivate(object, (void*)swig_module); - - JSObjectSetProperty(context, globalObject, moduleName, object, kJSPropertyAttributeNone, NULL); - - JSClassRelease(classRef); - JSStringRelease(moduleName); -} -SWIGRUNTIME swig_module_info * -SWIG_JSC_GetModule(JSGlobalContextRef context) { - JSObjectRef globalObject; - JSStringRef moduleName; - JSValueRef value; - JSObjectRef object; - - if(context == 0){ - return 0; - } - - globalObject = JSContextGetGlobalObject(context); - moduleName = JSStringCreateWithUTF8CString("swig_module_info_data"); - - if(JSObjectHasProperty(context, globalObject, moduleName) == false) { - JSStringRelease(moduleName); - return 0; - } - - value = JSObjectGetProperty(context, globalObject, moduleName, NULL); - object = JSValueToObject(context, value, NULL); - JSStringRelease(moduleName); - - return (swig_module_info*)JSObjectGetPrivate(object); -} - -#define SWIG_GetModule(clientdata) SWIG_JSC_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_JSC_SetModule(clientdata, pointer) -#define SWIG_INIT_CLIENT_DATA_TYPE JSGlobalContextRef -%} - -%insert(init) "swiginit.swg" - -%fragment ("js_initializer_define", "templates") %{ -#define SWIGJSC_INIT $jsname_initialize -%} - -// Open the initializer function -%insert(init) -%{ - -#ifdef __cplusplus -extern "C" { -#endif - -bool SWIGJSC_INIT (JSGlobalContextRef context, JSObjectRef *exports) { - SWIG_InitializeModule(context); -%} - -/* ----------------------------------------------------------------------------- - * js_initializer: template for the module initializer function - * - $jsname: module name - * - $jscreatenamespaces: part with code for creating namespace objects - * - $jscreateclasses: part with code for creating classes - * - $jsregisternamespaces: part with code for registration of namespaces - * ----------------------------------------------------------------------------- */ -%fragment ("js_initializer", "templates") %{ - /* Initialize the base swig type object */ - _SwigObject_objectDefinition.staticFunctions = _SwigObject_functions; - _SwigObject_objectDefinition.staticValues = _SwigObject_values; - _SwigObject_classRef = JSClassCreate(&_SwigObject_objectDefinition); - - /* Initialize the PackedData class */ - _SwigPackedData_objectDefinition.staticFunctions = _SwigPackedData_functions; - _SwigPackedData_objectDefinition.staticValues = _SwigPackedData_values; - _SwigPackedData_objectDefinition.finalize = _wrap_SwigPackedData_delete; - _SwigPackedData_classRef = JSClassCreate(&_SwigPackedData_objectDefinition); - - /* Create objects for namespaces */ - $jscreatenamespaces - - /* Register classes */ - $jsregisterclasses - - /* Register namespaces */ - $jsregisternamespaces - - *exports = exports_object; - - return true; -} -#ifdef __cplusplus -} -#endif -%} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptkw.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptkw.swg deleted file mode 100755 index c3c11839..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptkw.swg +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef JAVASCRIPT_JAVASCRIPTKW_SWG_ -#define JAVASCRIPT_JAVASCRIPTKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVASCRIPTKW(x) %keywordwarn("'" `x` "' is a javascript keyword, renaming to '_"`x`"'",rename="_%s") `x` - -/* Taken from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words */ - -JAVASCRIPTKW(break); -JAVASCRIPTKW(case); -JAVASCRIPTKW(catch); -JAVASCRIPTKW(continue); -JAVASCRIPTKW(default); -JAVASCRIPTKW(delete); -JAVASCRIPTKW(do); -JAVASCRIPTKW(else); -JAVASCRIPTKW(finally); -JAVASCRIPTKW(for); -JAVASCRIPTKW(function); -JAVASCRIPTKW(if); -JAVASCRIPTKW(in); -JAVASCRIPTKW(instanceof); -JAVASCRIPTKW(new); -JAVASCRIPTKW(return); -JAVASCRIPTKW(switch); -JAVASCRIPTKW(this); -JAVASCRIPTKW(throw); -JAVASCRIPTKW(try); -JAVASCRIPTKW(typeof); -JAVASCRIPTKW(var); -JAVASCRIPTKW(void); -JAVASCRIPTKW(while); -JAVASCRIPTKW(with); - -/* others bad names if any*/ -// for example %namewarn("321:clone() is a javascript bad method name") *::clone(); - -#undef JAVASCRIPTKW - -#endif //JAVASCRIPT_JAVASCRIPTKW_SWG_ diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptprimtypes.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptprimtypes.swg deleted file mode 100755 index 20d575d9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptprimtypes.swg +++ /dev/null @@ -1,192 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE -JSValueRef SWIG_From_dec(bool)(bool value) -{ - return JSValueMakeBoolean(context, value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN -int SWIG_AsVal_dec(bool)(JSValueRef obj, bool *val) -{ - if(!JSValueIsBoolean(context, obj)) { - return SWIG_ERROR; - } - if (val) *val = JSValueToBoolean(context, obj); - return SWIG_OK; -} -} - -/* int */ - -%fragment(SWIG_From_frag(int),"header") { -SWIGINTERNINLINE JSValueRef - SWIG_From_dec(int)(int value) -{ - return JSValueMakeNumber(context, value); -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE JSValueRef -SWIG_From_dec(long)(long value) -{ - return JSValueMakeNumber(context, value); -} -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(long)(JSValueRef obj, long* val) -{ - if (!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - if(val) *val = (long) JSValueToNumber(context, obj, NULL); - - return SWIG_OK; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE JSValueRef -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return (value > LONG_MAX) ? - JSValueMakeNumber(context, value) : JSValueMakeNumber(context, %numeric_cast(value,long)); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(JSValueRef obj, unsigned long *val) -{ - long longVal; - if(!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - - longVal = (long) JSValueToNumber(context, obj, NULL); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -} - -/* long long */ -// Note: these are copied from 'long' and probably need fixing - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE JSValueRef -SWIG_From_dec(long long)(long long value) -{ - return JSValueMakeNumber(context, value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment=SWIG_AsVal_frag(long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(JSValueRef obj, long long* val) -{ - if (!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - if(val) *val = (long long) JSValueToNumber(context, obj, NULL); - - return SWIG_OK; -} -%#endif -} - -/* unsigned long long */ -// Note: these are copied from 'unsigned long' and probably need fixing - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment=SWIG_From_frag(long long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN JSValueRef -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return (value > LONG_MAX) ? - JSValueMakeNumber(context, value) : JSValueMakeNumber(context, %numeric_cast(value,long)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(JSValueRef obj, unsigned long long *val) -{ - long long longVal; - if(!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - - longVal = (unsigned long long) JSValueToNumber(context, obj, NULL); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERN JSValueRef -SWIG_From_dec(double) (double val) -{ - return JSValueMakeNumber(context, val); -} -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(JSValueRef obj, double *val) -{ - if(!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - if(val) *val = JSValueToNumber(context, obj, NULL); - - return SWIG_OK; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptrun.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptrun.swg deleted file mode 100755 index 4d5a9355..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptrun.swg +++ /dev/null @@ -1,369 +0,0 @@ -/* ---------------------------------------------------------------------------- - * Errors and exceptions - * - * ---------------------------------------------------------------------------*/ - -#define SWIG_Error(code, msg) SWIG_JSC_exception(context, exception, code, msg) -#define SWIG_exception(code, msg) do { SWIG_JSC_exception(context, exception, code, msg); SWIG_fail; } while (0) -#define SWIG_fail goto fail - -SWIGRUNTIME void SWIG_Javascript_Raise_ValueRef(JSContextRef context, JSValueRef *exception, JSValueRef valRef) { - JSValueRef error_arguments[1]; - JSObjectRef exception_object; - /* Converting the result to an object will let JavascriptCore add - "sourceURL" (file) and "line" (number) and "message" to the exception, - instead of just returning a raw string. This is extremely important for debugging your errors. - Using JSObjectMakeError is better than JSValueToObject because the latter only populates - "sourceURL" and "line", but not "message" or any others I don't know about. - */ - error_arguments[0] = valRef; - exception_object = JSObjectMakeError(context, 1, error_arguments, NULL); - - /* Return the exception_object */ - *exception = exception_object; -} - -SWIGRUNTIME void SWIG_Javascript_Raise(JSContextRef context, JSValueRef *exception, const char* msg) { - JSStringRef message = JSStringCreateWithUTF8CString(msg); - JSValueRef exception_value = JSValueMakeString(context, message); - - SWIG_Javascript_Raise_ValueRef(context, exception, exception_value); - - JSStringRelease(message); -} - -SWIGRUNTIME void SWIG_JSC_exception(JSContextRef context, JSValueRef *exception, int code, const char* msg) { - SWIG_Javascript_Raise(context, exception, msg); -} - -/* ---------------------------------------------------------------------------- - * The parent class of all Proxies - * - * ---------------------------------------------------------------------------*/ - -typedef struct { - bool swigCMemOwn; - void *swigCObject; - swig_type_info *info; -} SwigPrivData; - -SWIGRUNTIME JSValueRef _wrap_SwigObject_disown(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSValueRef jsresult; - - JSObjectRef obj = JSValueToObject(context, thisObject, NULL); - SwigPrivData *cdata = (SwigPrivData *) JSObjectGetPrivate(obj); - - cdata->swigCMemOwn = false; - - jsresult = JSValueMakeUndefined(context); - return jsresult; -} - -SWIGRUNTIME JSValueRef _wrap_SwigObject_getCPtr(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSValueRef jsresult; - long result; - - JSObjectRef obj = JSValueToObject(context, thisObject, NULL); - SwigPrivData *cdata = (SwigPrivData*) JSObjectGetPrivate(obj); - - result = (long) cdata->swigCObject; - jsresult = JSValueMakeNumber(context, result); - - return jsresult; -} - -SWIGRUNTIME JSValueRef _wrap_SwigObject_equals(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSValueRef jsresult; - bool result; - - JSObjectRef obj = JSValueToObject(context, thisObject, NULL); - SwigPrivData *cdata = (SwigPrivData*) JSObjectGetPrivate(obj); - - JSObjectRef obj2 = JSValueToObject(context, argv[0], NULL); - SwigPrivData *cdata2 = (SwigPrivData*) JSObjectGetPrivate(obj2); - - result = (cdata->swigCObject == cdata2->swigCObject); - jsresult = JSValueMakeBoolean(context, result); - - return jsresult; -} - -SWIGRUNTIME JSStaticValue _SwigObject_values[] = { - { - 0, 0, 0, 0 - } -}; - -SWIGRUNTIME JSStaticFunction _SwigObject_functions[] = { - { - "disown",_wrap_SwigObject_disown, kJSPropertyAttributeNone - }, - { - "equals",_wrap_SwigObject_equals, kJSPropertyAttributeNone - }, - { - "getCPtr",_wrap_SwigObject_getCPtr, kJSPropertyAttributeNone - }, - { - 0, 0, 0 - } -}; - -SWIGRUNTIME JSClassDefinition _SwigObject_objectDefinition; - -SWIGRUNTIME JSClassRef _SwigObject_classRef; - - -SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** ptr, swig_type_info *info, int flags) { - SwigPrivData *cdata; - - cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); - if (cdata == NULL) { - return SWIG_ERROR; - } - assert(ptr); - *ptr = NULL; - if (!info || cdata->info == info) { - *ptr = cdata->swigCObject; - } else { - swig_cast_info *tc = SWIG_TypeCheckStruct(cdata->info, info); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, cdata->swigCObject, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !cdata->swigCMemOwn) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (flags & SWIG_POINTER_DISOWN) { - cdata->swigCMemOwn = false; - } - if (flags & SWIG_POINTER_CLEAR) { - cdata->swigCObject = 0; - } - } - - return SWIG_OK; -} - -SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { - JSObjectRef objRef; - - /* special case: JavaScript null => C NULL pointer */ - if(JSValueIsNull(context, valRef)) { - *ptr=0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - if(!JSValueIsObject(context, valRef)) { - return SWIG_TypeError; - } - - objRef = JSValueToObject(context, valRef, NULL); - if(objRef == NULL) { - return SWIG_ERROR; - } - - return SWIG_JSC_ConvertInstancePtr(context, objRef, ptr, info, flags); -} - -SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, swig_type_info *info, int flags) { - JSClassRef classRef; - JSObjectRef result; - SwigPrivData *cdata; - - if (ptr == NULL) { - // HACK: it is not possible to use JSValueToObject (causing seg-fault) - // This static cast turned out to be a workaround - // In future, we should change the interface of this method - // to return JSValueRef instead of JSObjectRef. - return (JSObjectRef) JSValueMakeNull(context); - } - - if(info->clientdata == NULL) { - classRef = _SwigObject_classRef; - } else { - classRef = (JSClassRef) info->clientdata; - } - - result = JSObjectMake(context, classRef, NULL); - - cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); - cdata->swigCObject = ptr; - cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; - cdata->info = info; - - JSObjectSetPrivate(result, cdata); - - return result; -} - -#define SWIG_ConvertPtr(obj, ptr, info, flags) SWIG_JSC_ConvertPtr(context, obj, ptr, info, flags) -#define SWIG_NewPointerObj(ptr, info, flags) SWIG_JSC_NewPointerObj(context, ptr, info, flags) - -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_JSC_ConvertInstancePtr(context, obj, pptr, type, flags) -#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_JSC_NewPointerObj(context, thisvalue, type, flags) - -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_JSC_ConvertPtr(context, obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_JSC_NewPointerObj(context, ptr, type, 0) - -/* ---------------------------------------------------------------------------- - * A class for packed data - * - * ---------------------------------------------------------------------------*/ - -typedef struct { - void *data; - size_t size; - swig_type_info *type; -} SwigPackedData; - -SWIGRUNTIME JSStaticValue _SwigPackedData_values[] = { - { - 0, 0, 0, 0 - } -}; -SWIGRUNTIME JSStaticFunction _SwigPackedData_functions[] = { - { - 0, 0, 0 - } -}; -SWIGRUNTIME JSClassDefinition _SwigPackedData_objectDefinition; -SWIGRUNTIME JSClassRef _SwigPackedData_classRef; - -SWIGRUNTIMEINLINE -int SwigJSCPacked_Check(JSContextRef context, JSValueRef valRef) { - return JSValueIsObjectOfClass(context, valRef, _SwigPackedData_classRef); -} - -SWIGRUNTIME -swig_type_info* SwigJSCPacked_UnpackData(JSContextRef context, JSValueRef valRef, void *ptr, size_t size) { - if (SwigJSCPacked_Check(context, valRef)) { - JSObjectRef objRef = JSValueToObject(context, valRef, NULL); - SwigPackedData *sobj = (SwigPackedData *) JSObjectGetPrivate(objRef); - if (sobj->size != size) return 0; - memcpy(ptr, sobj->data, size); - return sobj->type; - } else { - return 0; - } -} - -SWIGRUNTIME -int SWIG_JSC_ConvertPacked(JSContextRef context, JSValueRef valRef, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigJSCPacked_UnpackData(context, valRef, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -SWIGRUNTIME -JSValueRef SWIG_JSC_NewPackedObj(JSContextRef context, void *data, size_t size, swig_type_info *type) { - - JSClassRef classRef = _SwigObject_classRef; - JSObjectRef result = JSObjectMake(context, classRef, NULL); - - SwigPackedData* cdata = (SwigPackedData*) malloc(sizeof(SwigPackedData)); - cdata->data = data; - cdata->size = size; - cdata->type = type; - - JSObjectSetPrivate(result, cdata); - - return result; -} - -/* SwigPackedData wrappers */ -SWIGRUNTIME -void _wrap_SwigPackedData_delete(JSObjectRef obj) -{ - SwigPackedData* cdata = (SwigPackedData*) JSObjectGetPrivate(obj); - if (cdata) { - free(cdata->data); - } -} - -/* for C++ member pointers, ie, member methods */ - -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_JSC_ConvertPacked(context, obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_JSC_NewPackedObj(context, ptr, sz, type) - - -/* --------------------------------------------------------------------------- - * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) - * - * ---------------------------------------------------------------------------*/ -SWIGRUNTIME -unsigned int SWIGJSC_ArrayLength(JSContextRef context, JSObjectRef arr) { - static JSStringRef LENGTH = 0; - JSValueRef exception = NULL; - JSValueRef js_length; - double length; - - if (LENGTH == 0) { - LENGTH = JSStringCreateWithUTF8CString("length"); - } - - js_length = JSObjectGetProperty(context, arr, LENGTH, &exception); - if (exception == 0 && JSValueIsNumber(context, js_length)) { - length = JSValueToNumber(context, js_length, 0); - return (unsigned int) length; - } else { - return 0; - } -} - -SWIGRUNTIME -bool SWIGJSC_ValueIsArray(JSContextRef context, JSValueRef value) { - if (JSValueIsObject(context, value)) { - static JSStringRef ArrayString = NULL; - static JSStringRef isArrayString = NULL; - JSObjectRef array = NULL; - JSObjectRef isArray = NULL; - JSValueRef retval = NULL; - - if (!ArrayString) - ArrayString = JSStringCreateWithUTF8CString("Array"); - if (!isArrayString) - isArrayString = JSStringCreateWithUTF8CString("isArray"); - - array = (JSObjectRef)JSObjectGetProperty(context, JSContextGetGlobalObject(context), ArrayString, NULL); - isArray = (JSObjectRef)JSObjectGetProperty(context, array, isArrayString, NULL); - retval = JSObjectCallAsFunction(context, isArray, NULL, 1, &value, NULL); - - if (JSValueIsBoolean(context, retval)) - return JSValueToBoolean(context, retval); - } - return false; -} - -SWIGRUNTIME -JSValueRef SWIGJSC_AppendOutput(JSContextRef context, JSValueRef value, JSValueRef obj) { - JSObjectRef arr; - unsigned int length; - - if (JSValueIsUndefined(context, value)) { - arr = JSObjectMakeArray(context, 0, 0, 0); - } else if (!SWIGJSC_ValueIsArray(context, value)) { - arr = JSObjectMakeArray(context, 1, &value, 0); - } else { - arr = JSValueToObject(context, value, 0); - } - - length = SWIGJSC_ArrayLength(context, arr); - JSObjectSetPropertyAtIndex(context, arr, length, obj, 0); - return arr; -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptruntime.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptruntime.swg deleted file mode 100755 index a626390c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptruntime.swg +++ /dev/null @@ -1,20 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascriptruntime.swg - * - * Javascript support code - * ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ -#include -#include -#include -#include -#include -#include -#include -%} - -%insert(runtime) "swigrun.swg"; /* SWIG API */ -%insert(runtime) "swigerrors.swg"; /* SWIG errors */ - -%insert(runtime) "javascriptrun.swg"; /* SWIG errors */ diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptstrings.swg b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptstrings.swg deleted file mode 100755 index 5c8081a8..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptstrings.swg +++ /dev/null @@ -1,187 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_JSC_AsCharPtrAndSize(JSContextRef context, JSValueRef valRef, char** cptr, size_t* psize, int *alloc) -{ - if(JSValueIsString(context, valRef)) { - JSStringRef js_str = JSValueToStringCopy(context, valRef, NULL); - size_t len = JSStringGetMaximumUTF8CStringSize(js_str); - char* cstr = (char*) %new_array(len, char); - /* JSStringGetUTF8CString returns the length including 0-terminator */ - len = JSStringGetUTF8CString(js_str, cstr, len); - - if(alloc) *alloc = SWIG_NEWOBJ; - if(psize) *psize = len; - if(cptr) *cptr = cstr; - - return SWIG_OK; - } else { - if(JSValueIsObject(context, valRef)) { - JSObjectRef obj = JSValueToObject(context, valRef, NULL); - // try if the object is a wrapped char[] - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - return SWIG_TypeError; - } else { - return SWIG_TypeError; - } - } -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE JSValueRef -SWIG_JSC_FromCharPtrAndSize(JSContextRef context, const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - // TODO: handle extra long strings - //swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - //return pchar_descriptor ? - // SWIG_InternalNewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : SWIG_Py_Void(); - return JSValueMakeUndefined(context); - } else { - JSStringRef jsstring; - JSValueRef result; - if(size < 2) { - char c[2]; - int i; - for(i=0;i - -/* Look for user fragments file. */ -%include - -/* Javascript fragments for fundamental types */ -%include - -/* Javascript fragments for char* strings */ -%include - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -#define SWIG_Object JSValueRef -#define VOID_Object JSValueMakeUndefined(context) - -/* append output */ -#define SWIG_AppendOutput(result, obj) SWIGJSC_AppendOutput(context, result, obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) - -/* raise */ -#define SWIG_Raise(obj, type, desc) SWIG_Javascript_Raise_ValueRef(context, exception, obj) - -%insert("runtime") %{ -#define SWIG_JSC_FROM_DECL_ARGS(arg1) (JSContextRef context, arg1) -#define SWIG_JSC_FROM_CALL_ARGS(arg1) (context, arg1) -#define SWIG_JSC_AS_DECL_ARGS(arg1, arg2) (JSContextRef context, arg1, arg2) -#define SWIG_JSC_AS_CALL_ARGS(arg1, arg2) (context, arg1, arg2) -%} - -/* Include the unified typemap library */ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_common.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_complex.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_complex.i deleted file mode 100755 index a252e0aa..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_complex.i +++ /dev/null @@ -1,26 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_deque.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_except.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_map.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_map.i deleted file mode 100755 index 9fa10880..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_map.i +++ /dev/null @@ -1,81 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_pair.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_string.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_vector.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_vector.i deleted file mode 100755 index 586ac5c6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/std_vector.i +++ /dev/null @@ -1,99 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/swigmove.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/typemaps.i b/mac/bin/swig/share/swig/4.1.0/javascript/jsc/typemaps.i deleted file mode 100755 index b5b441bc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/jsc/typemaps.i +++ /dev/null @@ -1,148 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Python tuple. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Python output of the function would be a tuple containing both -output values. - -*/ - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Python tuple. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Python). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Python variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/arrays_javascript.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/arrays_javascript.i deleted file mode 100755 index 6dc7e4b9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/arrays_javascript.i +++ /dev/null @@ -1,86 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_javascript.i - * - * These typemaps give more natural support for arrays. The typemaps are not efficient - * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from JavaScript and vice versa. The JavaScript array is expected to be the same size as the C array. - * An exception is thrown if they are not. - * - * Example usage: - * Wrapping: - * - * %include - * %inline %{ - * extern int FiddleSticks[3]; - * %} - * - * Use from JavaScript like this: - * - * var fs = [10, 11, 12]; - * example.FiddleSticks = fs; - * fs = example.FiddleSticks; - * ----------------------------------------------------------------------------- */ - - -%fragment("SWIG_JSCGetIntProperty", "header", fragment=SWIG_AsVal_frag(int)) {} -%fragment("SWIG_JSCGetNumberProperty", "header", fragment=SWIG_AsVal_frag(double)) {} -%fragment("SWIG_JSCOutInt", "header", fragment=SWIG_From_frag(int)) {} -%fragment("SWIG_JSCOutNumber", "header", fragment=SWIG_From_frag(double)) {} - -%define JAVASCRIPT_ARRAYS_IN_DECL(NAME, CTYPE, ANY, ANYLENGTH) - -%typemap(in, fragment=NAME) CTYPE[ANY] { - if ($input->IsArray()) { - // Convert into Array - v8::Local array = v8::Local::Cast($input); - - int length = ANYLENGTH; - - $1 = ($*1_ltype *)malloc(sizeof($*1_ltype) * length); - - // Get each element from array - for (int i = 0; i < length; i++) { - v8::Local jsvalue = SWIGV8_ARRAY_GET(array, i); - $*1_ltype temp; - - // Get primitive value from JSObject - int res = SWIG_AsVal(CTYPE)(jsvalue, &temp); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ERROR, "Failed to convert $input to double"); - } - arg$argnum[i] = temp; - } - } else { - SWIG_exception_fail(SWIG_ERROR, "$input is not an array"); - } -} - -%typemap(freearg) CTYPE[ANY] { - free($1); -} - -%enddef - -%define JAVASCRIPT_ARRAYS_OUT_DECL(NAME, CTYPE) - -%typemap(out, fragment=NAME) CTYPE[ANY] { - int length = $1_dim0; - v8::Local array = SWIGV8_ARRAY_NEW(length); - - for (int i = 0; i < length; i++) { - SWIGV8_ARRAY_SET(array, i, SWIG_From(CTYPE)($1[i])); - } - - $result = array; -} - -%enddef - -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, , array->Length()) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, ANY, $1_dim0) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, , array->Length()) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, ANY, $1_dim0) - -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutInt", int) -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutNumber", double) - diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/ccomplex.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/ccomplex.i deleted file mode 100755 index e58dbf71..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/ccomplex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ccomplex.i - * - * C complex typemaps - * ISO C99: 7.3 Complex arithmetic - * ----------------------------------------------------------------------------- */ - - -%include - -%{ -#include -%} - -#define complex _Complex - -/* C complex constructor */ -#define CCplxConst(r, i) ((r) + I*(i)) - -%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); - -/* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/cdata.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/complex.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/complex.i deleted file mode 100755 index 4c3b3c5e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/complex.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __cplusplus -%include -#else -%include -#endif - diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/exception.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/exception.i deleted file mode 100755 index 0246cfde..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/exception.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascript.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascript.swg deleted file mode 100755 index 3a83b649..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascript.swg +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascript.swg - * - * Javascript typemaps - * ----------------------------------------------------------------------------- */ - -%include - -%include - -%include - -%include - -%include - -%include - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcode.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcode.swg deleted file mode 100755 index dcda0ee6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcode.swg +++ /dev/null @@ -1,435 +0,0 @@ -/* ----------------------------------------------------------------------------- - * js_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ - -%fragment("js_ctor", "templates") %{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_OBJECT self = args.Holder(); - $jslocals - if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper."); - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - $jscode - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_veto_ctor: a vetoing ctor for abstract classes - * - $jswrapper: name of wrapper - * - $jsname: class name - * ----------------------------------------------------------------------------- */ -%fragment ("js_veto_ctor", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIG_exception(SWIG_ERROR, "Class $jsname can not be instantiated"); -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatcher: dispatcher for overloaded constructors - * - $jswrapper: name of wrapper - * - $jsname: class name - * - $jsdispatchcases: part containing code for dispatching - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatcher", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - OverloadErrorHandler errorHandler; - SWIGV8_VALUE self; - - // switch all cases by means of series of if-returns. - $jsdispatchcases - - // default: - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of $jsmangledname"); - -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ -%fragment("js_overloaded_ctor", "templates") %{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_OBJECT self = args.Holder(); - $jslocals - if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper."); - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - $jscode - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatch_case: template for a dispatch case for calling an overloaded ctor. - * - $jsargcount: number of arguments of called ctor - * - $jswrapper: wrapper of called ctor - * - * Note: a try-catch-like mechanism is used to switch cases - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatch_case", "templates") -%{ - if(args.Length() == $jsargcount) { - errorHandler.err.Clear(); - $jswrapper(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } - } -%} - -/* ----------------------------------------------------------------------------- - * js_dtor: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtor", "templates") -%{ - -static void $jswrapper(const v8::WeakCallbackInfo &data) { - SWIGV8_Proxy *proxy = data.GetParameter(); - - if(proxy->swigCMemOwn && proxy->swigCObject) { -#ifdef SWIGRUNTIME_DEBUG - printf("Deleting wrapped instance: %s\n", proxy->info->name); -#endif - $jsfree proxy->swigCObject; - } - delete proxy; -} -%} - -/* ----------------------------------------------------------------------------- - * js_dtoroverride: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * - ${destructor_action}: The custom destructor action to invoke. - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtoroverride", "templates") -%{ -static void $jswrapper(const v8::WeakCallbackInfo &data) { - SWIGV8_Proxy *proxy = data.GetParameter(); - - if(proxy->swigCMemOwn && proxy->swigCObject) { - $jstype arg1 = ($jstype)proxy->swigCObject; - ${destructor_action} - } - delete proxy; -} -%} - -/* ----------------------------------------------------------------------------- - * js_getter: template for getter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_getter", "templates") -%{ -static SwigV8ReturnValue $jswrapper(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - $jslocals - $jscode - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} -%} - -/* ----------------------------------------------------------------------------- - * js_setter: template for setter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_setter", "templates") -%{ -static void $jswrapper(v8::Local property, v8::Local value, const SwigV8PropertyCallbackInfoVoid &info) { - SWIGV8_HANDLESCOPE(); - - $jslocals - $jscode - goto fail; -fail: - return; -} -%} - -/* ----------------------------------------------------------------------------- - * js_function: template for function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_function", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - $jslocals - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatcher: template for a function dispatcher for overloaded functions - * - $jswrapper: wrapper function name - * - $jsname: name of the wrapped function - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_function_dispatcher", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - OverloadErrorHandler errorHandler; - $jscode - - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function $jsname."); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_function: template for a overloaded function - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_overloaded_function", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) -{ - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - $jslocals - $jscode - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatch_case: template for a case used in the function dispatcher - * - $jswrapper: wrapper function name - * - $jsargcount: number of arguments of overloaded function - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function_dispatch_case", "templates") -%{ - - if(args.Length() == $jsargcount) { - errorHandler.err.Clear(); - $jswrapper(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } - } -%} - -/* ----------------------------------------------------------------------------- - * jsv8_declare_class_template: template for a class template declaration. - * - $jsmangledname: mangled class name - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_declare_class_template", "templates") -%{ - SWIGV8_ClientData $jsmangledname_clientData; -%} - -/* ----------------------------------------------------------------------------- - * jsv8_define_class_template: template for a class template definition. - * - $jsmangledname: mangled class name - * - $jsmangledtype: mangled class type - * - $jsdtor: the dtor wrapper - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_define_class_template", "templates") -%{ - /* Name: $jsmangledname, Type: $jsmangledtype, Dtor: $jsdtor */ - SWIGV8_FUNCTION_TEMPLATE $jsmangledname_class = SWIGV8_CreateClassTemplate("$jsmangledname"); - SWIGV8_SET_CLASS_TEMPL($jsmangledname_clientData.class_templ, $jsmangledname_class); - $jsmangledname_clientData.dtor = $jsdtor; - if (SWIGTYPE_$jsmangledtype->clientdata == 0) { - SWIGTYPE_$jsmangledtype->clientdata = &$jsmangledname_clientData; - } -%} - - -/* ----------------------------------------------------------------------------- - * jsv8_inherit: template for an class inherit statement. - * - $jsmangledname: mangled class name - * - $jsbaseclass: mangled name of the base class - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_inherit", "templates") -%{ - if (SWIGTYPE_p$jsbaseclass->clientdata && !(static_cast(SWIGTYPE_p$jsbaseclass->clientdata)->class_templ.IsEmpty())) - { - $jsmangledname_class->Inherit( - v8::Local::New( - v8::Isolate::GetCurrent(), - static_cast(SWIGTYPE_p$jsbaseclass->clientdata)->class_templ) - ); - -#ifdef SWIGRUNTIME_DEBUG - printf("Inheritance successful $jsmangledname $jsbaseclass\n"); -#endif - } else { -#ifdef SWIGRUNTIME_DEBUG - printf("Unable to inherit baseclass, it didn't exist $jsmangledname $jsbaseclass\n"); -#endif - } -%} - -/* ----------------------------------------------------------------------------- - * jsv8_create_class_instance: template for creating an class object. - * - $jsname: class name - * - $jsmangledname: mangled class name - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_create_class_instance", "templates") -%{ - /* Class: $jsname ($jsmangledname) */ - SWIGV8_FUNCTION_TEMPLATE $jsmangledname_class_0 = SWIGV8_CreateClassTemplate("$jsname"); - $jsmangledname_class_0->SetCallHandler($jsctor); - $jsmangledname_class_0->Inherit($jsmangledname_class); -#if (SWIG_V8_VERSION < 0x0704) - $jsmangledname_class_0->SetHiddenPrototype(true); - v8::Local $jsmangledname_obj = $jsmangledname_class_0->GetFunction(); -#else - v8::Local $jsmangledname_obj = $jsmangledname_class_0->GetFunction(context).ToLocalChecked(); -#endif -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_class: template for a statement that registers a class in a parent namespace. - * - $jsname: class name - * - $jsmangledname: mangled class name - * - $jsparent: mangled name of parent namespace - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_class", "templates") -%{ - SWIGV8_MAYBE_CHECK($jsparent_obj->Set(context, SWIGV8_SYMBOL_NEW("$jsname"), $jsmangledname_obj)); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_create_namespace: template for a statement that creates a namespace object. - * - $jsmangledname: mangled namespace name - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_create_namespace", "templates") -%{ - SWIGV8_OBJECT $jsmangledname_obj = SWIGV8_OBJECT_NEW(); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_namespace: template for a statement that registers a namespace in a parent namespace. - * - $jsname: name of namespace - * - $jsmangledname: mangled name of namespace - * - $jsparent: mangled name of parent namespace - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_namespace", "templates") -%{ - SWIGV8_MAYBE_CHECK($jsparent_obj->Set(context, SWIGV8_SYMBOL_NEW("$jsname"), $jsmangledname_obj)); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_member_function: template for a statement that registers a member function. - * - $jsmangledname: mangled class name - * - $jsname: name of the function - * - $jswrapper: wrapper of the member function - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_member_function", "templates") -%{ - SWIGV8_AddMemberFunction($jsmangledname_class, "$jsname", $jswrapper); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_member_variable: template for a statement that registers a member variable. - * - $jsmangledname: mangled class name - * - $jsname: name of the function - * - $jsgetter: wrapper of the getter function - * - $jssetter: wrapper of the setter function - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_member_variable", "templates") -%{ - SWIGV8_AddMemberVariable($jsmangledname_class, "$jsname", $jsgetter, $jssetter); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_static_function: template for a statement that registers a static class function. - * - $jsname: function name - * - $jswrapper: wrapper of the function - * - $jsparent: mangled name of parent namespace - * - * Note: this template is also used for global functions. - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_static_function", "templates") -%{ - SWIGV8_AddStaticFunction($jsparent_obj, "$jsname", $jswrapper, context); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_static_variable: template for a statement that registers a static variable. - * - $jsname: variable name - * - $jsparent: mangled name of parent namespace - * - $jsgetter: wrapper of the getter function - * - $jssetter: wrapper of the setter function - * - * Note: this template is also used for global variables. - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_static_variable", "templates") -%{ - SWIGV8_AddStaticVariable($jsparent_obj, "$jsname", $jsgetter, $jssetter, context); -%} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcomplex.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcomplex.swg deleted file mode 100755 index 7b3c5547..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcomplex.swg +++ /dev/null @@ -1,124 +0,0 @@ -/* - Defines the As/From converters for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header", - fragment=SWIG_From_frag(double)) -{ -SWIGINTERNINLINE SWIGV8_VALUE -SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) -{ - SWIGV8_HANDLESCOPE_ESC(); - - v8::Local vals = SWIGV8_ARRAY_NEW(0); - - SWIGV8_ARRAY_SET(vals, 0, SWIG_From(double)(Real(c))); - SWIGV8_ARRAY_SET(vals, 1, SWIG_From(double)(Imag(c))); - SWIGV8_ESCAPE(vals); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ -SWIGINTERN int -SWIG_AsVal_dec(Type) (SWIGV8_VALUE o, Type* val) -{ - SWIGV8_HANDLESCOPE(); - - if (o->IsArray()) { - SWIGV8_ARRAY array = SWIGV8_ARRAY::Cast(o); - - if (array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); - double re, im; - int res; - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 0), &re); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 1), &im); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if (val) *val = Constructor(re, im); - return SWIG_OK; - } else if (o->IsNumber()) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { -SWIGINTERN int -SWIG_AsVal_dec(Type) (SWIGV8_VALUE o, Type* val) -{ - SWIGV8_HANDLESCOPE(); - - if (o->IsArray()) { - SWIGV8_ARRAY array = SWIGV8_ARRAY::Cast(o); - - if (array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); - double re, im; - int res; - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 0), &re); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 1), &im); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else if (o->IsNumber()) { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptfragments.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptfragments.swg deleted file mode 100755 index 4778bf03..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'javascriptfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the default ones defined by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascripthelpers.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascripthelpers.swg deleted file mode 100755 index ea303fa3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascripthelpers.swg +++ /dev/null @@ -1,87 +0,0 @@ -%insert(runtime) %{ - -typedef v8::FunctionCallback SwigV8FunctionCallback; -typedef v8::AccessorNameGetterCallback SwigV8AccessorGetterCallback; -typedef v8::AccessorNameSetterCallback SwigV8AccessorSetterCallback; -typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfoVoid; - -/** - * Creates a class template for a class with specified initialization function. - */ -SWIGRUNTIME SWIGV8_FUNCTION_TEMPLATE SWIGV8_CreateClassTemplate(const char* symbol) { - SWIGV8_HANDLESCOPE_ESC(); - - v8::Local class_templ = SWIGV8_FUNCTEMPLATE_NEW_VOID(); - class_templ->SetClassName(SWIGV8_SYMBOL_NEW(symbol)); - - SWIGV8_OBJECT_TEMPLATE inst_templ = class_templ->InstanceTemplate(); - inst_templ->SetInternalFieldCount(1); - - SWIGV8_OBJECT_TEMPLATE equals_templ = class_templ->PrototypeTemplate(); - equals_templ->Set(SWIGV8_SYMBOL_NEW("equals"), SWIGV8_FUNCTEMPLATE_NEW(_SWIGV8_wrap_equals)); - - SWIGV8_OBJECT_TEMPLATE cptr_templ = class_templ->PrototypeTemplate(); - cptr_templ->Set(SWIGV8_SYMBOL_NEW("getCPtr"), SWIGV8_FUNCTEMPLATE_NEW(_wrap_getCPtr)); - - SWIGV8_ESCAPE(class_templ); -} - -/** - * Registers a class method with given name for a given class template. - */ -SWIGRUNTIME void SWIGV8_AddMemberFunction(SWIGV8_FUNCTION_TEMPLATE class_templ, const char* symbol, - SwigV8FunctionCallback _func) { - SWIGV8_OBJECT_TEMPLATE proto_templ = class_templ->PrototypeTemplate(); - proto_templ->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)); -} - -/** - * Registers a class property with given name for a given class template. - */ -SWIGRUNTIME void SWIGV8_AddMemberVariable(SWIGV8_FUNCTION_TEMPLATE class_templ, const char* symbol, - SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) { - SWIGV8_OBJECT_TEMPLATE proto_templ = class_templ->InstanceTemplate(); - proto_templ->SetAccessor(SWIGV8_SYMBOL_NEW(symbol), getter, setter); -} - -/** - * Registers a class method with given name for a given object. - */ -SWIGRUNTIME void SWIGV8_AddStaticFunction(SWIGV8_OBJECT obj, const char* symbol, - const SwigV8FunctionCallback& _func, v8::Local context) { - SWIGV8_MAYBE_CHECK(obj->Set(context, SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)->GetFunction(context).ToLocalChecked())); -} - -/** - * Registers a class method with given name for a given object. - */ -SWIGRUNTIME void SWIGV8_AddStaticVariable(SWIGV8_OBJECT obj, const char* symbol, - SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter, - v8::Local context) { - SWIGV8_MAYBE_CHECK(obj->SetAccessor(context, SWIGV8_SYMBOL_NEW(symbol), getter, setter)); -} - -SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local value, const SwigV8PropertyCallbackInfoVoid& info) -{ - char buffer[256]; - char msg[512]; - int res; - - v8::Local sproperty; - if (property->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocal(&sproperty)) { - SWIGV8_WRITE_UTF8(sproperty, buffer, 256); - res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); - } - else { - res = -1; - } - - if(res<0) { - SWIG_exception(SWIG_ERROR, "Tried to write read-only variable."); - } else { - SWIG_exception(SWIG_ERROR, msg); - } -fail: ; -} - -%} // v8_helper_functions diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptinit.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptinit.swg deleted file mode 100755 index 3bf8c416..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptinit.swg +++ /dev/null @@ -1,126 +0,0 @@ -%insert(header) %{ -#include -%} - -%insert(init) %{ - -SWIGRUNTIME void -SWIG_V8_SetModule(v8::Local context, swig_module_info *swig_module) { - v8::Local global_obj = context->Global(); - v8::Local mod = SWIGV8_EXTERNAL_NEW(swig_module); - assert(!mod.IsEmpty()); - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("swig_module_info_data")); - global_obj->SetPrivate(context, privateKey, mod); -} - -SWIGRUNTIME swig_module_info * -SWIG_V8_GetModule(v8::Local context) { - v8::Local global_obj = context->Global(); - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("swig_module_info_data")); - v8::Local moduleinfo; - if (!global_obj->GetPrivate(context, privateKey).ToLocal(&moduleinfo)) - return 0; - - if (moduleinfo.IsEmpty() || moduleinfo->IsNull() || moduleinfo->IsUndefined()) - { - // It's not yet loaded - return 0; - } - - v8::Local moduleinfo_extern = v8::Local::Cast(moduleinfo); - - if (moduleinfo_extern.IsEmpty() || moduleinfo_extern->IsNull() || moduleinfo_extern->IsUndefined()) - { - // Something's not right - return 0; - } - - void *ptr = moduleinfo_extern->Value(); - assert(ptr); - swig_module_info *retptr = static_cast(ptr); - assert(retptr); - return retptr; -} - -#define SWIG_GetModule(clientdata) SWIG_V8_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_V8_SetModule(clientdata, pointer) -#define SWIG_INIT_CLIENT_DATA_TYPE v8::Local - -%} - -%insert(init) "swiginit.swg" - -// Open the initializer function definition here - -%fragment ("js_initializer_define", "templates") %{ -#define SWIGV8_INIT $jsname_initialize -%} - -%insert(init) %{ -#if !defined(NODE_MODULE_VERSION) || (NODE_MODULE_VERSION < 12) -// Note: 'extern "C"'' disables name mangling which makes it easier to load the symbol manually -extern "C" void SWIGV8_INIT (SWIGV8_OBJECT exports_obj) -#elif (NODE_MODULE_VERSION < 64) -void SWIGV8_INIT (SWIGV8_OBJECT exports_obj, SWIGV8_VALUE /*module*/, void*) -#else -void SWIGV8_INIT (SWIGV8_OBJECT exports_obj, SWIGV8_VALUE /*module*/, v8::Local context, void*) -#endif -{ -#if !defined(NODE_MODULE_VERSION) || NODE_MODULE_VERSION < 64 - v8::Local context = SWIGV8_CURRENT_CONTEXT(); -#endif - - SWIG_InitializeModule(context); -%} - - -/* ----------------------------------------------------------------------------- - * js_initializer: template for the module initializer function - * - $jsname: module name - * - $jsv8nspaces: part with code creating namespace objects - * - $jsv8classtemplates: part with code creating class templates - * - $jsv8wrappers: part with code that registers wrapper functions - * - $jsv8inheritance: part with inherit statements - * - $jsv8classinstances: part with code creating class objects - * - $jsv8staticwrappers: part with code adding static functions to class objects - * - $jsv8registerclasses: part with code that registers class objects in namespaces - * - $jsv8registernspaces: part with code that registers namespaces in parent namespaces - * ----------------------------------------------------------------------------- */ -%fragment("js_initializer", "templates") -%{ - // a class template for creating proxies of undefined types - SWIGV8_SET_CLASS_TEMPL(SWIGV8_SWIGTYPE_Proxy_class_templ, SWIGV8_CreateClassTemplate("SwigProxy")); - - /* create objects for namespaces */ - $jsv8nspaces - - /* create class templates */ - $jsv8classtemplates - - /* register wrapper functions */ - $jsv8wrappers - - /* setup inheritances */ - $jsv8inheritance - - /* class instances */ - $jsv8classinstances - - /* add static class functions and variables */ - $jsv8staticwrappers - - /* register classes */ - $jsv8registerclasses - - /* create and register namespace objects */ - $jsv8registernspaces -} - -#if defined(BUILDING_NODE_EXTENSION) -#if (NODE_MODULE_VERSION < 64) -NODE_MODULE($jsname, $jsname_initialize) -#else -NODE_MODULE_CONTEXT_AWARE($jsname, $jsname_initialize) -#endif -#endif -%} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptkw.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptkw.swg deleted file mode 100755 index c3c11839..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptkw.swg +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef JAVASCRIPT_JAVASCRIPTKW_SWG_ -#define JAVASCRIPT_JAVASCRIPTKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVASCRIPTKW(x) %keywordwarn("'" `x` "' is a javascript keyword, renaming to '_"`x`"'",rename="_%s") `x` - -/* Taken from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words */ - -JAVASCRIPTKW(break); -JAVASCRIPTKW(case); -JAVASCRIPTKW(catch); -JAVASCRIPTKW(continue); -JAVASCRIPTKW(default); -JAVASCRIPTKW(delete); -JAVASCRIPTKW(do); -JAVASCRIPTKW(else); -JAVASCRIPTKW(finally); -JAVASCRIPTKW(for); -JAVASCRIPTKW(function); -JAVASCRIPTKW(if); -JAVASCRIPTKW(in); -JAVASCRIPTKW(instanceof); -JAVASCRIPTKW(new); -JAVASCRIPTKW(return); -JAVASCRIPTKW(switch); -JAVASCRIPTKW(this); -JAVASCRIPTKW(throw); -JAVASCRIPTKW(try); -JAVASCRIPTKW(typeof); -JAVASCRIPTKW(var); -JAVASCRIPTKW(void); -JAVASCRIPTKW(while); -JAVASCRIPTKW(with); - -/* others bad names if any*/ -// for example %namewarn("321:clone() is a javascript bad method name") *::clone(); - -#undef JAVASCRIPTKW - -#endif //JAVASCRIPT_JAVASCRIPTKW_SWG_ diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptprimtypes.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptprimtypes.swg deleted file mode 100755 index 8ed571df..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptprimtypes.swg +++ /dev/null @@ -1,203 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE -SWIGV8_VALUE -SWIG_From_dec(bool)(bool value) -{ - return SWIGV8_BOOLEAN_NEW(value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN -int SWIG_AsVal_dec(bool)(SWIGV8_VALUE obj, bool *val) -{ - if(!obj->IsBoolean()) { - return SWIG_ERROR; - } - - if (val) *val = SWIGV8_BOOLEAN_VALUE(obj); - return SWIG_OK; -} -} - -/* int */ - -%fragment(SWIG_From_frag(int),"header") { -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(int)(int value) -{ - return SWIGV8_INT32_NEW(value); -} -} - -%fragment(SWIG_AsVal_frag(int),"header") { -SWIGINTERN -int SWIG_AsVal_dec(int)(SWIGV8_VALUE valRef, int* val) -{ - if (!valRef->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = SWIGV8_INTEGER_VALUE(valRef); - - return SWIG_OK; -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(long)(long value) -{ - return SWIGV8_NUMBER_NEW(value); -} -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN -int SWIG_AsVal_dec(long)(SWIGV8_VALUE obj, long* val) -{ - if (!obj->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = (long) SWIGV8_INTEGER_VALUE(obj); - - return SWIG_OK; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(unsigned long)(unsigned long value) -{ - return value <= UINT32_MAX ? (SWIGV8_VALUE)SWIGV8_INTEGER_NEW_UNS(value) : (SWIGV8_VALUE)SWIGV8_NUMBER_NEW(static_cast(value)); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN -int SWIG_AsVal_dec(unsigned long)(SWIGV8_VALUE obj, unsigned long *val) -{ - if(!obj->IsNumber()) { - return SWIG_TypeError; - } - - long longVal = (long) SWIGV8_NUMBER_VALUE(obj); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -} - -/* long long */ -// Note: these are copied from 'long' and probably need fixing - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(long long)(long long value) -{ - return SWIGV8_NUMBER_NEW(value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment=SWIG_AsVal_frag(long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN -int SWIG_AsVal_dec(long long)(SWIGV8_VALUE obj, long long* val) -{ - if (!obj->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = (long long) SWIGV8_INTEGER_VALUE(obj); - - return SWIG_OK; -} -%#endif -} - -/* unsigned long long */ -// Note: these are copied from 'unsigned long' and probably need fixing - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment=SWIG_From_frag(long long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return value <= UINT32_MAX ? (SWIGV8_VALUE)SWIGV8_INTEGER_NEW_UNS(value) : (SWIGV8_VALUE)SWIGV8_NUMBER_NEW(static_cast(value)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN -int SWIG_AsVal_dec(unsigned long long)(SWIGV8_VALUE obj, unsigned long long *val) -{ - if(!obj->IsNumber()) { - return SWIG_TypeError; - } - - long long longVal = (long long) SWIGV8_NUMBER_VALUE(obj); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERN -SWIGV8_VALUE SWIG_From_dec(double) (double val) -{ - return SWIGV8_NUMBER_NEW(val); -} -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN -int SWIG_AsVal_dec(double)(SWIGV8_VALUE obj, double *val) -{ - if(!obj->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = SWIGV8_NUMBER_VALUE(obj); - - return SWIG_OK; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptrun.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptrun.swg deleted file mode 100755 index f7627085..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptrun.swg +++ /dev/null @@ -1,487 +0,0 @@ -/* --------------------------------------------------------------------------- - * These typedefs and defines are used to deal with v8 API changes - * - * Useful table of versions: https://nodejs.org/en/download/releases/ - * ---------------------------------------------------------------------------*/ - -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_STRING_NEW2(cstr, len) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::String::kNormalString, len) -#else -#define SWIGV8_STRING_NEW2(cstr, len) (v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::NewStringType::kNormal, len)).ToLocalChecked() -#endif - -typedef void SwigV8ReturnValue; -typedef v8::FunctionCallbackInfo SwigV8Arguments; -typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; -#define SWIGV8_RETURN(val) args.GetReturnValue().Set(val); return -#define SWIGV8_RETURN_INFO(val, info) info.GetReturnValue().Set(val); return - -#define SWIGV8_HANDLESCOPE() v8::HandleScope scope(v8::Isolate::GetCurrent()); -#define SWIGV8_HANDLESCOPE_ESC() v8::EscapableHandleScope scope(v8::Isolate::GetCurrent()); -#define SWIGV8_ESCAPE(val) return scope.Escape(val) - -#define SWIGV8_ADJUST_MEMORY(size) v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size) -#define SWIGV8_CURRENT_CONTEXT() v8::Isolate::GetCurrent()->GetCurrentContext() -#define SWIGV8_THROW_EXCEPTION(err) v8::Isolate::GetCurrent()->ThrowException(err) - -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_STRING_NEW(str) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str, v8::String::kNormalString) -#define SWIGV8_SYMBOL_NEW(sym) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym, v8::String::kNormalString) -#else -#define SWIGV8_STRING_NEW(str) (v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str, v8::NewStringType::kNormal)).ToLocalChecked() -#define SWIGV8_SYMBOL_NEW(sym) (v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym, v8::NewStringType::kNormal)).ToLocalChecked() -#endif - -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_MAYBE_CHECK(maybe) maybe.FromJust() -#else -#define SWIGV8_MAYBE_CHECK(maybe) maybe.Check() -#endif - -#define SWIGV8_ARRAY_NEW(size) v8::Array::New(v8::Isolate::GetCurrent(), size) -#define SWIGV8_BOOLEAN_NEW(bool) v8::Boolean::New(v8::Isolate::GetCurrent(), bool) -#define SWIGV8_EXTERNAL_NEW(val) v8::External::New(v8::Isolate::GetCurrent(), val) -#define SWIGV8_FUNCTEMPLATE_NEW(func) v8::FunctionTemplate::New(v8::Isolate::GetCurrent(), func) -#define SWIGV8_FUNCTEMPLATE_NEW_VOID() v8::FunctionTemplate::New(v8::Isolate::GetCurrent()) -#define SWIGV8_INT32_NEW(num) v8::Int32::New(v8::Isolate::GetCurrent(), num) -#define SWIGV8_INTEGER_NEW(num) v8::Integer::New(v8::Isolate::GetCurrent(), num) -#define SWIGV8_INTEGER_NEW_UNS(num) v8::Integer::NewFromUnsigned(v8::Isolate::GetCurrent(), num) -#define SWIGV8_NUMBER_NEW(num) v8::Number::New(v8::Isolate::GetCurrent(), num) -#define SWIGV8_OBJECT_NEW() v8::Object::New(v8::Isolate::GetCurrent()) -#define SWIGV8_UNDEFINED() v8::Undefined(v8::Isolate::GetCurrent()) -#define SWIGV8_ARRAY v8::Local -#define SWIGV8_FUNCTION_TEMPLATE v8::Local -#define SWIGV8_OBJECT v8::Local -#define SWIGV8_OBJECT_TEMPLATE v8::Local -#define SWIGV8_VALUE v8::Local -#define SWIGV8_NULL() v8::Null(v8::Isolate::GetCurrent()) -#define SWIGV8_ARRAY_GET(array, index) (array)->Get(SWIGV8_CURRENT_CONTEXT(), index).ToLocalChecked() -#define SWIGV8_ARRAY_SET(array, index, value) SWIGV8_MAYBE_CHECK((array)->Set(SWIGV8_CURRENT_CONTEXT(), index, value)) - -#define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ.Reset(v8::Isolate::GetCurrent(), class); - -#if SWIG_V8_VERSION < 0x0608 -#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject() -#define SWIGV8_TO_STRING(handle) (handle)->ToString() -#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue() -#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue() -#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue() -#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(buffer, len) -#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length() -#else -#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() -#define SWIGV8_TO_STRING(handle) (handle)->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() -#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() -#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() -#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(v8::Isolate::GetCurrent(), buffer, len) -#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length(v8::Isolate::GetCurrent()) -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() -#else -#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(v8::Isolate::GetCurrent()) -#endif -#endif - -/* --------------------------------------------------------------------------- - * Error handling - * - * ---------------------------------------------------------------------------*/ - -#define SWIG_Error(code, msg) SWIGV8_ErrorHandler.error(code, msg) -#define SWIG_exception(code, msg) do { SWIGV8_ErrorHandler.error(code, msg); SWIG_fail; } while (0) -#define SWIG_fail goto fail -#define SWIGV8_OVERLOAD false - -SWIGINTERN void SWIG_V8_Raise(const char *msg) { - SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_STRING_NEW(msg))); -} - -SWIGINTERN void SWIG_V8_Raise(SWIGV8_VALUE obj, const char *msg) { - SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_TO_STRING(obj))); -} - - -/* - Note: There are two contexts for handling errors. - A static V8ErrorHandler is used in not overloaded methods. - For overloaded methods the throwing type checking mechanism is used - during dispatching. As V8 exceptions can not be reset properly - the trick is to use a dynamic ErrorHandler with same local name as the global - one. - - - See definition of SWIG_Error above. - - See code templates 'JS_function_dispatcher', 'JS_functionwrapper_overload', - and 'JS_function_dispatch_case' in javascriptcode.swg - -*/ -class V8ErrorHandler { -public: - virtual ~V8ErrorHandler() {} - virtual void error(int code, const char *msg) { - SWIG_V8_Raise(msg); - } -}; -// this is used in usually -SWIGRUNTIME V8ErrorHandler SWIGV8_ErrorHandler; - -// instances of this are used in overloaded functions -class OverloadErrorHandler: public V8ErrorHandler { -public: - virtual void error(int code, const char *msg) { - err = v8::Exception::Error(SWIGV8_STRING_NEW(msg)); - if(code != SWIG_TypeError) { - SWIGV8_THROW_EXCEPTION(err); - } - } - SWIGV8_VALUE err; -}; - -/* --------------------------------------------------------------------------- - * Basic Proxy object - * - * ---------------------------------------------------------------------------*/ - -// Note: to trigger the v8 gc more often one can tell v8 about the memory consumption -// TODO: we could add a v8 specific parameter to control this value -#define SWIGV8_AVG_OBJ_SIZE 1000 - -class SWIGV8_Proxy { -public: - SWIGV8_Proxy(): swigCMemOwn(false), swigCObject(0), info(0) { - SWIGV8_ADJUST_MEMORY(SWIGV8_AVG_OBJ_SIZE); - }; - - ~SWIGV8_Proxy() { - handle.ClearWeak(); - handle.Reset(); - - SWIGV8_ADJUST_MEMORY(-SWIGV8_AVG_OBJ_SIZE); - } - - bool swigCMemOwn; - void *swigCObject; - swig_type_info *info; - v8::Persistent handle; -}; - -class SWIGV8_ClientData { -public: - v8::Persistent class_templ; - - void (*dtor) (const v8::WeakCallbackInfo &data); -}; - -SWIGRUNTIME v8::Persistent SWIGV8_SWIGTYPE_Proxy_class_templ; - -SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(SWIGV8_OBJECT objRef, void **ptr, swig_type_info *info, int flags) { - SWIGV8_HANDLESCOPE(); - - if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; - - SWIGV8_Proxy *cdata = static_cast(objRef->GetAlignedPointerFromInternalField(0)); - - if(cdata == NULL) { - return SWIG_ERROR; - } - if(info && cdata->info != info) { - swig_cast_info *tc = SWIG_TypeCheckStruct(cdata->info, info); - if (!tc && cdata->info->name) { - tc = SWIG_TypeCheck(cdata->info->name, info); - } - bool type_valid = tc != 0; - if(!type_valid) { - return SWIG_TypeError; - } - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, cdata->swigCObject, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - *ptr = cdata->swigCObject; - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !cdata->swigCMemOwn) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (flags & SWIG_POINTER_DISOWN) { - cdata->swigCMemOwn = false; - } - if (flags & SWIG_POINTER_CLEAR) { - cdata->swigCObject = 0; - } - } - return SWIG_OK; -} - - -SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackInfo &data) { - SWIGV8_Proxy *proxy = data.GetParameter(); - delete proxy; -} - -SWIGRUNTIME int SWIG_V8_GetInstancePtr(SWIGV8_VALUE valRef, void **ptr) { - if(!valRef->IsObject()) { - return SWIG_TypeError; - } - SWIGV8_OBJECT objRef = SWIGV8_OBJECT::Cast(valRef); - - if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; - - SWIGV8_Proxy *cdata = static_cast(objRef->GetAlignedPointerFromInternalField(0)); - - if(cdata == NULL) { - return SWIG_ERROR; - } - - *ptr = cdata->swigCObject; - - return SWIG_OK; -} - -SWIGRUNTIME void SWIGV8_SetPrivateData(SWIGV8_OBJECT obj, void *ptr, swig_type_info *info, int flags) { - SWIGV8_Proxy *cdata = new SWIGV8_Proxy(); - cdata->swigCObject = ptr; - cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; - cdata->info = info; - - obj->SetAlignedPointerInInternalField(0, cdata); - - cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); - - if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { - cdata->handle.SetWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor, v8::WeakCallbackType::kParameter); - } else { - cdata->handle.SetWeak(cdata, SWIGV8_Proxy_DefaultDtor, v8::WeakCallbackType::kParameter); - } - -#if (SWIG_V8_VERSION < 0x0704) - cdata->handle.MarkIndependent(); -// Looks like future versions do not require that anymore: -// https://monorail-prod.appspot.com/p/chromium/issues/detail?id=923361#c11 -#endif -} - -SWIGRUNTIME int SWIG_V8_ConvertPtr(SWIGV8_VALUE valRef, void **ptr, swig_type_info *info, int flags) { - SWIGV8_HANDLESCOPE(); - - /* special case: JavaScript null => C NULL pointer */ - if(valRef->IsNull()) { - *ptr=0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - if(!valRef->IsObject()) { - return SWIG_TypeError; - } - SWIGV8_OBJECT objRef = SWIGV8_OBJECT::Cast(valRef); - return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); -} - -SWIGRUNTIME SWIGV8_VALUE SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { - SWIGV8_HANDLESCOPE_ESC(); - - SWIGV8_FUNCTION_TEMPLATE class_templ; - - if (ptr == NULL) { - v8::Local result = SWIGV8_NULL(); - SWIGV8_ESCAPE(result); - } - - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - - if(info->clientdata != 0) { - class_templ = v8::Local::New(isolate, ((SWIGV8_ClientData*) info->clientdata)->class_templ); - } else { - class_templ = v8::Local::New(isolate, SWIGV8_SWIGTYPE_Proxy_class_templ); - } - - v8::Local result = class_templ->InstanceTemplate()->NewInstance(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked(); - - SWIGV8_SetPrivateData(result, ptr, info, flags); - - SWIGV8_ESCAPE(result); -} - -#define SWIG_ConvertPtr(obj, ptr, info, flags) SWIG_V8_ConvertPtr(obj, ptr, info, flags) -#define SWIG_NewPointerObj(ptr, info, flags) SWIG_V8_NewPointerObj(ptr, info, flags) - -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_V8_ConvertInstancePtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_V8_NewPointerObj(thisvalue, type, flags) - -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_V8_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_V8_NewPointerObj(ptr, type, 0) - -#define SWIG_GetInstancePtr(obj, ptr) SWIG_V8_GetInstancePtr(obj, ptr) - -SWIGRUNTIME SwigV8ReturnValue _SWIGV8_wrap_equals(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - void *arg1 = (void *) 0 ; - void *arg2 = (void *) 0 ; - bool result; - int res1; - int res2; - - if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for equals."); - - res1 = SWIG_GetInstancePtr(args.Holder(), &arg1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ERROR, "Could not get pointer from 'this' object for equals."); - } - res2 = SWIG_GetInstancePtr(args[0], &arg2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "equals" "', argument " "1"" of type '" "void *""'"); - } - - result = (bool)(arg1 == arg2); - jsresult = SWIGV8_BOOLEAN_NEW(result); - - SWIGV8_RETURN(jsresult); - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - -SWIGRUNTIME SwigV8ReturnValue _wrap_getCPtr(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - void *arg1 = (void *) 0 ; - long result; - int res1; - - res1 = SWIG_GetInstancePtr(args.Holder(), &arg1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getCPtr" "', argument " "1"" of type '" "void *""'"); - } - - result = (long)arg1; - jsresult = SWIGV8_NUMBER_NEW(result); - - SWIGV8_RETURN(jsresult); - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - -/* --------------------------------------------------------------------------- - * PackedData object - * - * ---------------------------------------------------------------------------*/ - -class SwigV8PackedData { -public: - SwigV8PackedData(void *data, size_t size, swig_type_info *type): data(data), size(size), type(type) {}; - - ~SwigV8PackedData() { - }; - - void *data; - size_t size; - swig_type_info *type; - - v8::Persistent handle; -}; - -SWIGRUNTIMEINLINE -int SwigV8Packed_Check(SWIGV8_VALUE valRef) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_OBJECT objRef = SWIGV8_TO_OBJECT(valRef); - if(objRef->InternalFieldCount() < 1) return false; - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("__swig__packed_data__")); - v8::Local flag; - if (!objRef->GetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey).ToLocal(&flag)) - return false; - return (flag->IsBoolean() && SWIGV8_BOOLEAN_VALUE(flag)); -} - -SWIGRUNTIME -swig_type_info *SwigV8Packed_UnpackData(SWIGV8_VALUE valRef, void *ptr, size_t size) { - if (SwigV8Packed_Check(valRef)) { - SWIGV8_HANDLESCOPE(); - - SwigV8PackedData *sobj; - - SWIGV8_OBJECT objRef = SWIGV8_TO_OBJECT(valRef); - - sobj = static_cast(objRef->GetAlignedPointerFromInternalField(0)); - if (sobj == NULL || sobj->size != size) return 0; - memcpy(ptr, sobj->data, size); - return sobj->type; - } else { - return 0; - } -} - -SWIGRUNTIME -int SWIGV8_ConvertPacked(SWIGV8_VALUE valRef, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigV8Packed_UnpackData(valRef, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackInfo &data) { - SwigV8PackedData *cdata = data.GetParameter(); - delete cdata; -} - -SWIGRUNTIME -SWIGV8_VALUE SWIGV8_NewPackedObj(void *data, size_t size, swig_type_info *type) { - SWIGV8_HANDLESCOPE_ESC(); - - SwigV8PackedData *cdata = new SwigV8PackedData(data, size, type); -// v8::Handle obj = SWIGV8_OBJECT_NEW(); - v8::Local obj = SWIGV8_OBJECT_NEW(); - - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("__swig__packed_data__")); - obj->SetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey, SWIGV8_BOOLEAN_NEW(true)); - - obj->SetAlignedPointerInInternalField(0, cdata); - - cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); - - cdata->handle.SetWeak(cdata, _wrap_SwigV8PackedData_delete, v8::WeakCallbackType::kParameter); - -#if (SWIG_V8_VERSION < 0x0704) - cdata->handle.MarkIndependent(); -// Looks like future versions do not require that anymore: -// https://monorail-prod.appspot.com/p/chromium/issues/detail?id=923361#c11 -#endif - - SWIGV8_ESCAPE(obj); - -} - -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIGV8_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIGV8_NewPackedObj(ptr, sz, type) - - -/* --------------------------------------------------------------------------- - * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) - * - * ---------------------------------------------------------------------------*/ - -SWIGRUNTIME - -SWIGV8_VALUE SWIGV8_AppendOutput(SWIGV8_VALUE result, SWIGV8_VALUE obj) { - SWIGV8_HANDLESCOPE_ESC(); - - if (result->IsUndefined()) { - result = SWIGV8_ARRAY_NEW(0); - } else if (!result->IsArray()) { - SWIGV8_ARRAY tmparr = SWIGV8_ARRAY_NEW(0); - SWIGV8_ARRAY_SET(tmparr, 0, result); - result = tmparr; - } - - SWIGV8_ARRAY arr = SWIGV8_ARRAY::Cast(result); - SWIGV8_ARRAY_SET(arr, arr->Length(), obj); - SWIGV8_ESCAPE(arr); -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptruntime.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptruntime.swg deleted file mode 100755 index 4e93fc4c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptruntime.swg +++ /dev/null @@ -1,47 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascriptruntime.swg - * - * ----------------------------------------------------------------------------- */ - -// V8 Version Macro -// ---------------- -// -// v8 added version macros V8_MAJOR_VERSION, V8_MINOR_VERSION, V8_BUILD_NUMBER -// and V8_PATCH_LEVEL in version 4.3.0. SWIG doesn't support anything that -// old so SWIG generated code can rely on these. - -// Node support -// ------------ - -#ifdef BUILDING_NODE_EXTENSION -%insert("runtime") %{ -#include -//Older version of node.h does not include this -#include -%} -#endif - - -// V8 runtime -// ---------- - -%insert(runtime) %{ -#include - -#undef SWIG_V8_VERSION -#define SWIG_V8_VERSION ((V8_MAJOR_VERSION / 10) * 4096 + \ - (V8_MAJOR_VERSION % 10) * 256 + \ - (V8_MINOR_VERSION / 10) * 16 + \ - (V8_MINOR_VERSION % 10)) - -#include -#include -#include -#include -%} - -%insert(runtime) "swigrun.swg"; /* SWIG API */ -%insert(runtime) "swigerrors.swg"; /* SWIG errors */ - -%insert(runtime) "javascriptrun.swg" - diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptstrings.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptstrings.swg deleted file mode 100755 index 8dc2d945..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascriptstrings.swg +++ /dev/null @@ -1,59 +0,0 @@ - -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ -%fragment("SWIG_AsCharPtrAndSize", "header", fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(SWIGV8_VALUE valRef, char** cptr, size_t* psize, int *alloc) -{ - if(valRef->IsString()) { - v8::Local js_str = v8::Local::Cast(valRef); - - size_t len = SWIGV8_UTF8_LENGTH(js_str) + 1; - char* cstr = (char*) %new_array(len, char); - SWIGV8_WRITE_UTF8(js_str, cstr, len); - - if(alloc) *alloc = SWIG_NEWOBJ; - if(psize) *psize = len; - if(cptr) *cptr = cstr; - - return SWIG_OK; - } else { - if(valRef->IsObject()) { - SWIGV8_OBJECT obj = SWIGV8_OBJECT::Cast(valRef); - // try if the object is a wrapped char[] - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - return SWIG_TypeError; - } else { - return SWIG_TypeError; - } - } -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE SWIGV8_VALUE -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - // TODO: handle extra long strings - return SWIGV8_UNDEFINED(); - } else { - v8::Local js_str = SWIGV8_STRING_NEW2(carray, size); - return js_str; - } - } else { - return SWIGV8_UNDEFINED(); - } -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascripttypemaps.swg b/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascripttypemaps.swg deleted file mode 100755 index c4d341be..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/javascripttypemaps.swg +++ /dev/null @@ -1,43 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Javascript - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ - -/* Include fundamental fragemt definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Javascript fragments for fundamental types */ -%include - -/* Javascript fragments for char* strings */ -%include - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* Javascript types */ - -#define SWIG_Object SWIGV8_VALUE -#define VOID_Object SWIGV8_UNDEFINED() - -/* Overload of the output/constant/exception/dirout handling */ - -/* append output */ -#define SWIG_AppendOutput(result, obj) SWIGV8_AppendOutput(result, obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) - -/* raise */ -#define SWIG_Raise(obj, type, desc) SWIG_V8_Raise(obj, type) - -/* Include the unified typemap library */ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_common.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_complex.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_complex.i deleted file mode 100755 index a252e0aa..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_complex.i +++ /dev/null @@ -1,26 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_deque.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_except.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_map.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_map.i deleted file mode 100755 index 3b8b0936..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_map.i +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_pair.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_pair.i deleted file mode 100755 index b72c50b9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_pair.i +++ /dev/null @@ -1,35 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_string.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_vector.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_vector.i deleted file mode 100755 index 586ac5c6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/std_vector.i +++ /dev/null @@ -1,99 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/swigmove.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/javascript/v8/typemaps.i b/mac/bin/swig/share/swig/4.1.0/javascript/v8/typemaps.i deleted file mode 100755 index e88f0019..00000000 --- a/mac/bin/swig/share/swig/4.1.0/javascript/v8/typemaps.i +++ /dev/null @@ -1,148 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Python tuple. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Python output of the function would be a tuple containing both -output values. - -*/ - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Python tuple. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Python). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Python variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/linkruntime.c b/mac/bin/swig/share/swig/4.1.0/linkruntime.c old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/lua/_std_common.i b/mac/bin/swig/share/swig/4.1.0/lua/_std_common.i deleted file mode 100755 index 567e68b7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/_std_common.i +++ /dev/null @@ -1,93 +0,0 @@ -/* ----------------------------------------------------------------------------- - * _std_common.i - * - * std::helpers for LUA - * ----------------------------------------------------------------------------- */ - -%include // the general exceptions - -/* -The basic idea here, is instead of trying to feed SWIG all the -horribly templated STL code, to give it a neatened version. - -These %defines cover some of the more common methods -so the class declarations become just a set of %defines - -*/ - -/* #define for basic container features -note: I allow front(), back() & pop_back() to throw exceptions -upon empty containers, rather than coredump -(as we haven't defined the methods, we can use %extend to add with -new features) - -*/ -%define %STD_CONTAINER_METHODS(CLASS,T) -public: - CLASS(); - CLASS(const CLASS&); - unsigned int size() const; - unsigned int max_size() const; - bool empty() const; - void clear(); - %extend { // the extra stuff which must be checked - T front()const throw (std::out_of_range){ // only read front & back - if (self->empty()) - throw std::out_of_range("in "#CLASS"::front()"); - return self->front(); - } - T back()const throw (std::out_of_range){ // not write to them - if (self->empty()) - throw std::out_of_range("in "#CLASS"::back()"); - return self->back(); - } - } -%enddef - -/* push/pop for front/back -also note: front & back are read only methods, not used for writing -*/ -%define %STD_FRONT_ACCESS_METHODS(CLASS,T) -public: - void push_front(const T& val); - %extend { // must check this - void pop_front() throw (std::out_of_range){ - if (self->empty()) - throw std::out_of_range("in "#CLASS"::pop_front()"); - self->pop_back(); - } - } -%enddef - -%define %STD_BACK_ACCESS_METHODS(CLASS,T) -public: - void push_back(const T& val); - %extend { // must check this - void pop_back() throw (std::out_of_range){ - if (self->empty()) - throw std::out_of_range("in "#CLASS"::pop_back()"); - self->pop_back(); - } - } -%enddef - -/* -Random access methods -*/ -%define %STD_RANDOM_ACCESS_METHODS(CLASS,T) - %extend // this is a extra bit of SWIG code - { - // [] is replaced by __getitem__ & __setitem__ - // simply throws a string, which causes a lua error - T __getitem__(unsigned int idx) throw (std::out_of_range){ - if (idx>=self->size()) - throw std::out_of_range("in "#CLASS"::__getitem__()"); - return (*self)[idx]; - } - void __setitem__(unsigned int idx,const T& val) throw (std::out_of_range){ - if (idx>=self->size()) - throw std::out_of_range("in "#CLASS"::__setitem__()"); - (*self)[idx]=val; - } - }; -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/lua/argcargv.i b/mac/bin/swig/share/swig/4.1.0/lua/argcargv.i deleted file mode 100755 index 94cc8ed4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/argcargv.i +++ /dev/null @@ -1,57 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - - Use it as follows: - - %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) } - extern int mainApp(size_t argc, const char **argv); - - then from lua: - - args = { "arg0", "arg1" } - mainApp(args) - - * ------------------------------------------------------------ */ - -%{ -SWIGINTERN int SWIG_argv_size(lua_State* L, int index) { - int n=0; - while(1){ - lua_rawgeti(L,index,n+1); - if (lua_isnil(L,-1)) - break; - ++n; - lua_pop(L,1); - } - lua_pop(L,1); - return n; -} -%} - -%typemap(in) (int ARGC, char **ARGV) { - if (lua_istable(L,$input)) { - int i, size = SWIG_argv_size(L,$input); - $1 = ($1_ltype) size; - $2 = (char **) malloc((size+1)*sizeof(char *)); - for (i = 0; i < size; i++) { - lua_rawgeti(L,$input,i+1); - if (lua_isnil(L,-1)) - break; - $2[i] = (char *)lua_tostring(L, -1); - lua_pop(L,1); - } - $2[i]=NULL; - } else { - $1 = 0; $2 = 0; - lua_pushstring(L,"Expecting argv array"); - lua_error(L); - } -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = lua_istable(L,$input); -} - -%typemap(freearg) (int ARGC, char **ARGV) { - free((char *) $2); -} diff --git a/mac/bin/swig/share/swig/4.1.0/lua/carrays.i b/mac/bin/swig/share/swig/4.1.0/lua/carrays.i deleted file mode 100755 index 1bc45d81..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/carrays.i +++ /dev/null @@ -1,8 +0,0 @@ -/* Small change to the standard carrays.i -renaming the field to __getitem & __setitem -for operator[] access -*/ -%rename(__getitem) *::getitem; // the v=X[i] (get operator) -%rename(__setitem) *::setitem; // the X[i]=v (set operator) - -%include <../carrays.i> diff --git a/mac/bin/swig/share/swig/4.1.0/lua/factory.i b/mac/bin/swig/share/swig/4.1.0/lua/factory.i deleted file mode 100755 index 7e605c5d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/factory.i +++ /dev/null @@ -1,23 +0,0 @@ -/* - A modification of factory.swg from the generic UTL library. -*/ - -%include - -%define %_factory_dispatch(Type) -if (!dcast) { - Type *dobj = dynamic_cast($1); - if (dobj) { - dcast = 1; - SWIG_NewPointerObj(L, dobj, $descriptor(Type *), $owner); SWIG_arg++; - } -}%enddef - -%define %factory(Method,Types...) -%typemap(out) Method { - int dcast = 0; - %formacro(%_factory_dispatch, Types) - if (!dcast) { - SWIG_NewPointerObj(L, $1, $descriptor, $owner); SWIG_arg++; - } -}%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/lua/lua.swg b/mac/bin/swig/share/swig/4.1.0/lua/lua.swg deleted file mode 100755 index 12c635d7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/lua.swg +++ /dev/null @@ -1,236 +0,0 @@ -/* ----------------------------------------------------------------------------- - * lua.swg - * - * SWIG Configuration File for Lua. - * This file is parsed by SWIG before reading any other interface file. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * includes - * ----------------------------------------------------------------------------- */ - -%include /* The typemaps */ -%include /* The runtime stuff */ -%include /* Warnings for Lua keywords */ - -//%include -/* ----------------------------------------------------------------------------- - * constants typemaps - * ----------------------------------------------------------------------------- */ -// this basically adds to a table of constants -%typemap(consttab) int, unsigned int, short, unsigned short, long, unsigned long, unsigned char, signed char, bool, enum SWIGTYPE - {SWIG_LUA_CONSTTAB_INT("$symname", $value)} - -%typemap(consttab) float, double - {SWIG_LUA_CONSTTAB_FLOAT("$symname", $value)} - -%typemap(consttab) long long, unsigned long long, signed long long - {SWIG_LUA_CONSTTAB_FLOAT("$symname", $value)} - -%typemap(consttab) const long long&, const unsigned long long&, const signed long long& - {SWIG_LUA_CONSTTAB_FLOAT("$symname", *$value)} - -%typemap(consttab) char *, const char *, char [], const char [] - {SWIG_LUA_CONSTTAB_STRING("$symname", $value)} - -// note: char is treated as a separate special type -// signed char & unsigned char are numbers -%typemap(consttab) char - {SWIG_LUA_CONSTTAB_CHAR("$symname", $value)} - -%typemap(consttab) long long, unsigned long long - {SWIG_LUA_CONSTTAB_STRING("$symname", "$value")} - -%typemap(consttab) SWIGTYPE *, SWIGTYPE *const, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] - { SWIG_LUA_CONSTTAB_POINTER("$symname",$value, $1_descriptor) } - -%typemap(consttab) SWIGTYPE - { SWIG_LUA_CONSTTAB_POINTER("$symname",&$value, $&1_descriptor) } - -// member function pointers -%typemap(consttab) SWIGTYPE (CLASS::*) - { SWIG_LUA_CONSTTAB_BINARY("$symname", sizeof($type),&$value, $1_descriptor) } - - -/* ----------------------------------------------------------------------------- - * Overloaded operator support - * ----------------------------------------------------------------------------- */ -// lua calls the + operator '__add' -// python likes to call it '__add__' -// Assuming most SWIGers will probably use the __add__ if they extend their classes -// we have two sets of renames -// one to rename the operator+() to __add() -// (this lets SWIG rename the operator overloads) -// another is to rename __add__() to __add() -// (this means that people who wrote SWIG code to do that add will also work) - -#ifdef __cplusplus -// this is extra renaming for lua -// not all operators are supported, so only those that are, are listed -%rename(__add) *::operator+; -%rename(__sub) *::operator-; -%rename(__mul) *::operator*; -%rename(__div) *::operator/; -%rename(__unm) *::operator-(); -%rename(__unm) *::operator-() const; - -%rename(__eq) *::operator==; -%ignore *::operator!=; // note: Lua does not have a notequal operator - // it just uses 'not (a==b)' -%rename(__lt) *::operator<; -%ignore *::operator>; // ditto less than vs greater than -%rename(__le) *::operator<=; -%ignore *::operator>=; // ditto less than vs greater than -%ignore *::operator!; // does not support not - -%rename(__call) *::operator(); // the fn call operator - -// lua does not support overloading of: -// logical/bitwise operators -// assign operator -// +=,-=,*=, etc -// therefore ignoring them for now -// it also doesn't support non class operators -// eg friends or XX operator+(XX,XX) -// also ignoring -// note: some of these might be better to rename, but not doing that for now -%ignore *::operator&&; %ignore operator&&; -%ignore *::operator||; %ignore operator||; -%ignore *::operator+=; -%ignore *::operator-=; -%ignore *::operator*=; -%ignore *::operator/=; -%ignore *::operator%=; -%ignore *::operator++; %ignore *::operator--; - -%ignore *::operator=; // note: this might be better to rename to assign() or similar - -%ignore operator+; -%ignore operator-; -%ignore operator*; -%ignore operator/; -%ignore operator%; -%ignore operator[]; -%ignore operator>; %ignore operator>=; -%ignore operator<; %ignore operator<=; -%ignore operator==; %ignore operator!=; - - -// renaming the python operators to be compatible with lua -// this means that if a developer has written a fn __add__() -// it will be used for the lua + -%rename(__add) *::__add__; -%rename(__sub) *::__sub__; -%rename(__mul) *::__mul__; -%rename(__div) *::__div__; -%rename(__unm) *::__neg__; // lua calls unary minus,'unm' not 'neg' -%rename(__tostring) *::__str__; // both map to __tostring -%rename(__tostring) *::__repr__; // both map to __tostring - - -%rename(__pow) *::__pow__; // lua power '^' operator -%rename(__concat) *::__concat__; // lua concat '..' operator -%rename(__eq) *::__eq__; -%rename(__lt) *::__lt__; -%rename(__le) *::__le__; -%rename(__call) *::__call__; // the fn call operator() - -// the [] operator has two parts, the get & the set -%rename(__getitem) *::__getitem__; // the v=X[i] (get operator) -%rename(__setitem) *::__setitem__; // the X[i]=v (set operator) - - -#endif - - -/* ------------------------------------------------------------ - * Exceptions - * ------------------------------------------------------------ */ -/* Confession: I don't really like C++ exceptions -The python/lua ones are great, but C++ ones I don't like -(mainly because I cannot get the stack trace out of it) -Therefore I have not bothered to try doing much in this - -Therefore currently it's just enough to get a few test cases running ok - -note: if you wish to throw anything related to std::exception -use %include instead -*/ - -// number as number+error -%typemap(throws) int,unsigned int,signed int, - long,unsigned long,signed long, - short,unsigned short,signed short, - float,double, - long long,unsigned long long, - unsigned char, signed char, - int&,unsigned int&,signed int&, - long&,unsigned long&,signed long&, - short&,unsigned short&,signed short&, - float&,double&, - long long&,unsigned long long&, - unsigned char&, signed char& -%{lua_pushnumber(L,(lua_Number)$1);SWIG_fail; %} - -%typemap(throws) bool,bool& -%{lua_pushboolean(L,(int)($1==true));SWIG_fail; %} - -// enum as number+error -%typemap(throws) enum SWIGTYPE -%{lua_pushnumber(L,(lua_Number)(int)$1);SWIG_fail; %} - -// strings are just sent as errors -%typemap(throws) char *, const char * -%{lua_pushstring(L,$1);SWIG_fail;%} - -// char is changed to a string -%typemap(throws) char -%{lua_pushlstring(L,&$1,1);SWIG_fail;%} - -/* -Throwing object is a serious problem: -Assuming some code throws a 'FooBar' -There are a few options: -- return a pointer to it: but it's unclear how long this will last for. -- return a copy of it: but not all objects are copyable - (see exception_partial_info in the test suite for a case where you cannot do this) -- convert to a string & throw that - it's not so useful, but it works (this is more lua like). -The third option (though not nice) is used -For a more useful solution: see std_except for more details -*/ - -// basic typemap for structs, classes, pointers & references -// convert to string and error -%typemap(throws) SWIGTYPE -%{(void)$1; /* ignore it */ -lua_pushfstring(L,"object exception:%s",SWIG_TypePrettyName($1_descriptor)); -SWIG_fail;%} - -// code to make a copy of the object and return this -// if you have a function which throws a FooBar & you want SWIG to return a copy of the object as its error -// then use one of the below -// %apply SWIGTYPE EXCEPTION_BY_VAL {FooBar}; -// %apply SWIGTYPE& EXCEPTION_BY_VAL {FooBar&}; // note: need & twice -%typemap(throws) SWIGTYPE EXCEPTION_BY_VAL -%{SWIG_NewPointerObj(L,(void *)new $1_ltype($1),$&1_descriptor,1); -SWIG_fail;%} - -// similar for object reference -// note: swig typemaps seem a little confused around here, therefore we use $basetype -%typemap(throws) SWIGTYPE& EXCEPTION_BY_VAL -%{SWIG_NewPointerObj(L,(void *)new $basetype($1),$1_descriptor,1); -SWIG_fail;%} - - -// note: no support for object pointers -// it's not clear how long the pointer is valid for, therefore not supporting it - -/* ----------------------------------------------------------------------------- - * extras - * ----------------------------------------------------------------------------- */ -// this %define is to allow insertion of lua source code into the wrapper file -#define %luacode %insert("luacode") - - -/* ------------------------------ end lua.swg ------------------------------ */ diff --git a/mac/bin/swig/share/swig/4.1.0/lua/lua_fnptr.i b/mac/bin/swig/share/swig/4.1.0/lua/lua_fnptr.i deleted file mode 100755 index 81fa54bd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/lua_fnptr.i +++ /dev/null @@ -1,124 +0,0 @@ -/* ----------------------------------------------------------------------------- - * lua_fnptr.i - * - * SWIG Library file containing the main typemap code to support Lua modules. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Basic function pointer support - * ----------------------------------------------------------------------------- */ -/* -The structure: SWIGLUA_FN provides a simple (local only) wrapping for a function. - -For example if you wanted to have a C/C++ function take a lua function as a parameter. -You could declare it as: - int my_func(int a, int b, SWIGLUA_FN fn); -note: it should be passed by value, not byref or as a pointer. - -The SWIGLUA_FN holds a pointer to the lua_State, and the stack index where the function is held. -The macro SWIGLUA_FN_GET() will put a copy of the lua function at the top of the stack. -After that it's fairly simple to write the rest of the code (assuming know how to use lua), -just push the parameters, call the function and return the result. - - int my_func(int a, int b, SWIGLUA_FN fn) - { - SWIGLUA_FN_GET(fn); - lua_pushnumber(fn.L,a); - lua_pushnumber(fn.L,b); - lua_call(fn.L,2,1); // 2 in, 1 out - return luaL_checknumber(fn.L,-1); - } - -SWIG will automatically performs the wrapping of the arguments in and out. - -However: if you wish to store the function between calls, look to the SWIGLUA_REF below. - -*/ -// this is for the C code only, we don't want SWIG to wrapper it for us. -%{ -typedef struct{ - lua_State* L; /* the state */ - int idx; /* the index on the stack */ -}SWIGLUA_FN; - -#define SWIGLUA_FN_GET(fn) {lua_pushvalue(fn.L,fn.idx);} -%} - -// the actual typemap -%typemap(in,checkfn="lua_isfunction") SWIGLUA_FN -%{ $1.L=L; $1.idx=$input; %} - -/* ----------------------------------------------------------------------------- - * Storing lua object support - * ----------------------------------------------------------------------------- */ -/* -The structure: SWIGLUA_REF provides a mechanism to store object (usually functions) -between calls to the interpreter. - -For example if you wanted to have a C/C++ function take a lua function as a parameter. -Then call it later, You could declare it as: - SWIGLUA_REF myref; - void set_func(SWIGLUA_REF ref); - SWIGLUA_REF get_func(); - void call_func(int val); -note: it should be passed by value, not byref or as a pointer. - -The SWIGLUA_REF holds a pointer to the lua_State, and an integer reference to the object. -Because it holds a permanent ref to an object, the SWIGLUA_REF must be handled with a bit more care. -It should be initialised to {0,0}. The function swiglua_ref_set() should be used to set it. -swiglua_ref_clear() should be used to clear it when not in use, and swiglua_ref_get() to get the -data back. - -Note: the typemap does not check that the object is in fact a function, -if you need that you must add it yourself. - - - int my_func(int a, int b, SWIGLUA_FN fn) - { - SWIGLUA_FN_GET(fn); - lua_pushnumber(fn.L,a); - lua_pushnumber(fn.L,b); - lua_call(fn.L,2,1); // 2 in, 1 out - return luaL_checknumber(fn.L,-1); - } - -SWIG will automatically performs the wrapping of the arguments in and out. - -However: if you wish to store the function between calls, look to the SWIGLUA_REF below. - -*/ - -%{ -typedef struct{ - lua_State* L; /* the state */ - int ref; /* a ref in the lua global index */ -}SWIGLUA_REF; - - -void swiglua_ref_clear(SWIGLUA_REF* pref){ - if (pref->L!=0 && pref->ref!=LUA_NOREF && pref->ref!=LUA_REFNIL){ - luaL_unref(pref->L,LUA_REGISTRYINDEX,pref->ref); - } - pref->L=0; pref->ref=0; -} - -void swiglua_ref_set(SWIGLUA_REF* pref,lua_State* L,int idx){ - pref->L=L; - lua_pushvalue(L,idx); /* copy obj to top */ - pref->ref=luaL_ref(L,LUA_REGISTRYINDEX); /* remove obj from top & put into registry */ -} - -void swiglua_ref_get(SWIGLUA_REF* pref){ - if (pref->L!=0) - lua_rawgeti(pref->L,LUA_REGISTRYINDEX,pref->ref); -} - -%} - -%typemap(in) SWIGLUA_REF -%{ swiglua_ref_set(&$1,L,$input); %} - -%typemap(out) SWIGLUA_REF -%{ if ($1.L!=0) {swiglua_ref_get(&$1);} else {lua_pushnil(L);} - SWIG_arg++; %} - diff --git a/mac/bin/swig/share/swig/4.1.0/lua/luakw.swg b/mac/bin/swig/share/swig/4.1.0/lua/luakw.swg deleted file mode 100755 index 394e4005..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/luakw.swg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Warnings for Lua keywords, built-in names and bad names. -*/ - -#define LUAKW(x) %keywordwarn("'" `x` "' is a Lua keyword", rename="c_%s") `x` -#define LUABN(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "'" `x` "' conflicts with a basic function in Lua"), %$not %$ismember) `x` - -/* - Warnings for Lua keywords - http://www.lua.org/manual/5.2/manual.html#3.1 -*/ - -LUAKW(and); -LUAKW(break); -LUAKW(do); -LUAKW(else); -LUAKW(elseif); -LUAKW(end); -LUAKW(false); -LUAKW(for); -LUAKW(function); -LUAKW(goto); -LUAKW(if); -LUAKW(in); -LUAKW(local); -LUAKW(nil); -LUAKW(not); -LUAKW(or); -LUAKW(repeat); -LUAKW(return); -LUAKW(then); -LUAKW(true); -LUAKW(until); -LUAKW(while); - -/* - Basic functions - http://www.lua.org/manual/5.2/manual.html#6.1 -*/ - -LUABN(assert); -LUABN(collectgarbage); -LUABN(dofile); -LUABN(error); -LUABN(_G); // Not actually a function -LUABN(getmetatable); -LUABN(ipairs); -LUABN(load); -LUABN(loadfile); -LUABN(next); -LUABN(pairs); -LUABN(pcall); -LUABN(print); -LUABN(rawequal); -LUABN(rawget); -LUABN(rawlen); -LUABN(rawset); -LUABN(select); -LUABN(setmetatable); -LUABN(tonumber); -LUABN(tostring); -LUABN(type); -LUABN(_VERSION); // Not actually a function -LUABN(xpcall); - -#undef LUABN -#undef LUAKW diff --git a/mac/bin/swig/share/swig/4.1.0/lua/luarun.swg b/mac/bin/swig/share/swig/4.1.0/lua/luarun.swg deleted file mode 100755 index f47fd4fa..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/luarun.swg +++ /dev/null @@ -1,1950 +0,0 @@ -/* ----------------------------------------------------------------------------- - * luarun.swg - * - * This file contains the runtime support for Lua modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "lua.h" -#include "lauxlib.h" -#include /* for malloc */ -#include /* for a few sanity tests */ - -/* ----------------------------------------------------------------------------- - * Lua flavors - * ----------------------------------------------------------------------------- */ - -#define SWIG_LUA_FLAVOR_LUA 1 -#define SWIG_LUA_FLAVOR_ELUA 2 -#define SWIG_LUA_FLAVOR_ELUAC 3 - -#if !defined(SWIG_LUA_TARGET) -# error SWIG_LUA_TARGET not defined -#endif - -#if defined(SWIG_LUA_ELUA_EMULATE) - -struct swig_elua_entry; - -typedef struct swig_elua_key { - int type; - union { - const char* strkey; - lua_Number numkey; - } key; -} swig_elua_key; - -typedef struct swig_elua_val { - int type; - union { - lua_Number number; - const struct swig_elua_entry *table; - const char *string; - lua_CFunction function; - struct { - char member; - long lvalue; - void *pvalue; - swig_type_info **ptype; - } userdata; - } value; -} swig_elua_val; - -typedef struct swig_elua_entry { - swig_elua_key key; - swig_elua_val value; -} swig_elua_entry; - -#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} } -#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} } -#define LNILKEY {LUA_TNIL, {.strkey = 0} } - -#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} } -#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} } -#define LROVAL(x) {LUA_TTABLE, {.table = x} } -#define LNILVAL {LUA_TNIL, {.string = 0} } -#define LSTRVAL(x) {LUA_TSTRING, {.string = x} } - -#define LUA_REG_TYPE swig_elua_entry - -#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable" - -#define lua_pushrotable(L,p)\ - lua_newtable(L);\ - assert(p);\ - SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p)); - -#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ - LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } } - -#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\ - LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } } -#endif - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) -# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) -# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) -# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) - /* Those two types of constants are not supported in elua */ - -#ifndef SWIG_LUA_CONSTTAB_POINTER -#warning eLua does not support pointers as constants. By default, nil will be used as value -#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL -#endif - -#ifndef SWIG_LUA_CONSTTAB_BINARY -#warning eLua does not support pointers to member as constants. By default, nil will be used as value -#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL -#endif -#else /* SWIG_LUA_FLAVOR_LUA */ -# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 -# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 -# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 -# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 -# define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ - SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D -# define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\ - SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D -#endif - -#ifndef SWIG_LUA_ELUA_EMULATE -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} -# define LSTRVAL LRO_STRVAL -#endif -#endif /* SWIG_LUA_ELUA_EMULATE*/ - -#ifndef SWIG_LUA_ELUA_EMULATE -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) - -#ifndef MIN_OPT_LEVEL -#define MIN_OPT_LEVEL 2 -#endif - -#include "lrodefs.h" -#include "lrotable.h" -#endif -#endif /* SWIG_LUA_ELUA_EMULATE*/ -/* ----------------------------------------------------------------------------- - * compatibility defines - * ----------------------------------------------------------------------------- */ - -/* History of Lua C API length functions: In Lua 5.0 (and before?) - there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen", - but a compatibility define of "lua_strlen" was added. In Lua 5.2, - this function was again renamed, to "lua_rawlen" (to emphasize that - it doesn't call the "__len" metamethod), and the compatibility - define of lua_strlen was removed. All SWIG uses have been updated - to "lua_rawlen", and we add our own defines of that here for older - versions of Lua. */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 -# define lua_rawlen lua_strlen -#elif LUA_VERSION_NUM == 501 -# define lua_rawlen lua_objlen -#endif - - -/* lua_pushglobaltable is the recommended "future-proof" way to get - the global table for Lua 5.2 and later. Here we define - lua_pushglobaltable ourselves for Lua versions before 5.2. */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) -#endif - -/* lua_absindex was introduced in Lua 5.2 */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) -#endif - -/* lua_rawsetp was introduced in Lua 5.2 */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -#define lua_rawsetp(L,index,ptr)\ - lua_pushlightuserdata(L,(void*)(ptr));\ - lua_insert(L,-2);\ - lua_rawset(L,index); - -#define lua_rawgetp(L,index,ptr)\ - lua_pushlightuserdata(L,(void*)(ptr));\ - lua_rawget(L,index); - -#endif - -/* -------------------------------------------------------------------------- - * Helper functions for error handling - * -------------------------------------------------------------------------- */ - -/* Push the string STR on the Lua stack, like lua_pushstring, but - prefixed with the location of the innermost Lua call-point - (as formatted by luaL_where). */ -SWIGRUNTIME void -SWIG_Lua_pusherrstring (lua_State *L, const char *str) -{ - luaL_where (L, 1); - lua_pushstring (L, str); - lua_concat (L, 2); -} - -/* Push a formatted string generated from FMT and following args on - the Lua stack, like lua_pushfstring, but prefixed with the - location of the innermost Lua call-point (as formatted by luaL_where). */ -SWIGRUNTIME void -SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...) -{ - va_list argp; - va_start(argp, fmt); - luaL_where(L, 1); - lua_pushvfstring(L, fmt, argp); - va_end(argp); - lua_concat(L, 2); -} - - -/* ----------------------------------------------------------------------------- - * global swig types - * ----------------------------------------------------------------------------- */ -/* Constant table */ -#define SWIG_LUA_INT 1 -#define SWIG_LUA_FLOAT 2 -#define SWIG_LUA_STRING 3 -#define SWIG_LUA_POINTER 4 -#define SWIG_LUA_BINARY 5 -#define SWIG_LUA_CHAR 6 - -/* Structure for variable linking table */ -typedef struct { - const char *name; - lua_CFunction get; - lua_CFunction set; -} swig_lua_var_info; - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -typedef const LUA_REG_TYPE swig_lua_method; -typedef const LUA_REG_TYPE swig_lua_const_info; -#else /* Normal lua */ -typedef luaL_Reg swig_lua_method; - -/* Constant information structure */ -typedef struct { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_lua_const_info; - -#endif - -typedef struct { - const char *name; - lua_CFunction getmethod; - lua_CFunction setmethod; -} swig_lua_attribute; - - -struct swig_lua_class; -/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */ -typedef struct swig_lua_namespace { - const char *name; - swig_lua_method *ns_methods; - swig_lua_attribute *ns_attributes; - swig_lua_const_info *ns_constants; - struct swig_lua_class **ns_classes; - struct swig_lua_namespace **ns_namespaces; -} swig_lua_namespace; - -typedef struct swig_lua_class { - const char *name; /* Name that this class has in Lua */ - const char *fqname; /* Fully qualified name - Scope + class name */ - swig_type_info **type; - lua_CFunction constructor; - void (*destructor)(void *); - swig_lua_method *methods; - swig_lua_attribute *attributes; - swig_lua_namespace *cls_static; - swig_lua_method *metatable; /* 0 for -eluac */ - struct swig_lua_class **bases; - const char **base_names; -} swig_lua_class; - -/* this is the struct for wrapping all pointers in SwigLua -*/ -typedef struct { - swig_type_info *type; - int own; /* 1 if owned & must be destroyed */ - void *ptr; -} swig_lua_userdata; - -/* this is the struct for wrapping arbitrary packed binary data -(currently it is only used for member function pointers) -the data ordering is similar to swig_lua_userdata, but it is currently not possible -to tell the two structures apart within SWIG, other than by looking at the type -*/ -typedef struct { - swig_type_info *type; - int own; /* 1 if owned & must be destroyed */ - char data[1]; /* arbitrary amount of data */ -} swig_lua_rawdata; - -/* Common SWIG API */ -#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) -#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) -#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) -#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) - -/* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) -#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer) -#define SWIG_MODULE_CLIENTDATA_TYPE lua_State* - -/* Contract support */ -#define SWIG_contract_assert(expr, msg) \ - do { if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } } while (0) - - -/* helper #defines */ -#define SWIG_fail {goto fail;} -#define SWIG_fail_arg(func_name,argnum,type) \ - {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ - func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ - goto fail;} -#define SWIG_fail_ptr(func_name,argnum,type) \ - SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") -#define SWIG_check_num_args(func_name,a,b) \ - if (lua_gettop(L)b) \ - {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ - goto fail;} - - -#define SWIG_Lua_get_table(L,n) \ - (lua_pushstring(L, n), lua_rawget(L,-2)) - -#define SWIG_Lua_add_function(L,n,f) \ - (lua_pushstring(L, n), \ - lua_pushcfunction(L, f), \ - lua_rawset(L,-3)) - -#define SWIG_Lua_add_boolean(L,n,b) \ - (lua_pushstring(L, n), \ - lua_pushboolean(L, b), \ - lua_rawset(L,-3)) - -/* special helper for allowing 'nil' for usertypes */ -#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) - -#ifdef __cplusplus -/* Special helper for member function pointers -it gets the address, casts it, then dereferences it */ -/*#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) */ -#endif - -/* storing/access of swig_module_info */ -SWIGRUNTIME swig_module_info * -SWIG_Lua_GetModule(lua_State *L) { - swig_module_info *ret = 0; - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_rawget(L,LUA_REGISTRYINDEX); - if (lua_islightuserdata(L,-1)) - ret=(swig_module_info*)lua_touserdata(L,-1); - lua_pop(L,1); /* tidy */ - return ret; -} - -SWIGRUNTIME void -SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) { - /* add this all into the Lua registry: */ - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_pushlightuserdata(L,(void*)module); - lua_rawset(L,LUA_REGISTRYINDEX); -} - -/* ----------------------------------------------------------------------------- - * global variable support code: modules - * ----------------------------------------------------------------------------- */ - -/* this function is called when trying to set an immutable. -default action is to print an error. -This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ -SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L) -{ -/* there should be 1 param passed in: the new value */ -#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE - lua_pop(L,1); /* remove it */ - luaL_error(L,"This variable is immutable"); -#endif - return 0; /* should not return anything */ -} - -#ifdef SWIG_LUA_ELUA_EMULATE - -SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own); -SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type); -static int swig_lua_elua_emulate_unique_key; - -/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */ -SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table) -{ - int i, table_parsed, parsed_tables_array, target_table; - assert(lua_istable(L,-1)); - target_table = lua_gettop(L); - /* Get the registry where we put all parsed tables to avoid loops */ - lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); - if(lua_isnil(L,-1)) { - lua_pop(L,1); - lua_newtable(L); - lua_pushvalue(L,-1); - lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key)); - } - parsed_tables_array = lua_gettop(L); - lua_pushvalue(L,target_table); - lua_rawsetp(L, parsed_tables_array, table); - table_parsed = 0; - const int SWIGUNUSED pairs_start = lua_gettop(L); - for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++) - { - const swig_elua_entry *entry = table + i; - int is_metatable = 0; - switch(entry->key.type) { - case LUA_TSTRING: - lua_pushstring(L,entry->key.key.strkey); - if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0) - is_metatable = 1; - break; - case LUA_TNUMBER: - lua_pushnumber(L,entry->key.key.numkey); - break; - case LUA_TNIL: - lua_pushnil(L); - break; - default: - assert(0); - } - switch(entry->value.type) { - case LUA_TSTRING: - lua_pushstring(L,entry->value.value.string); - break; - case LUA_TNUMBER: - lua_pushnumber(L,entry->value.value.number); - break; - case LUA_TFUNCTION: - lua_pushcfunction(L,entry->value.value.function); - break; - case LUA_TTABLE: - lua_rawgetp(L,parsed_tables_array, entry->value.value.table); - table_parsed = !lua_isnil(L,-1); - if(!table_parsed) { - lua_pop(L,1); /*remove nil */ - lua_newtable(L); - SWIG_Lua_elua_emulate_register(L,entry->value.value.table); - } - if(is_metatable) { - assert(lua_istable(L,-1)); - lua_pushvalue(L,-1); - lua_setmetatable(L,target_table); - } - - break; - case LUA_TUSERDATA: - if(entry->value.value.userdata.member) - SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue, - entry->value.value.userdata.lvalue, - *(entry->value.value.userdata.ptype)); - else - SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue, - *(entry->value.value.userdata.ptype),0); - break; - case LUA_TNIL: - lua_pushnil(L); - break; - default: - assert(0); - } - assert(lua_gettop(L) == pairs_start + 2); - lua_rawset(L,target_table); - } - lua_pop(L,1); /* Removing parsed tables storage */ - assert(lua_gettop(L) == target_table); -} - -SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L) -{ - lua_pushnil(L); - lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); -} - -SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L); - -SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L) -{ - SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1); - SWIG_Lua_get_class_registry(L); - lua_getfield(L,-1,"lua_getmetatable"); - lua_remove(L,-2); /* remove the registry*/ - assert(!lua_isnil(L,-1)); - lua_pushvalue(L,1); - assert(lua_gettop(L) == 3); /* object | function | object again */ - lua_call(L,1,1); - if(!lua_isnil(L,-1)) /*There is an ordinary metatable */ - return 1; - /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/ - assert(lua_gettop(L) == 2); - if(lua_istable(L,-2)) { - lua_pop(L,1); /*remove the nil*/ - lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY); - } - assert(lua_gettop(L) == 2); - return 1; - -fail: - lua_error(L); - return 0; -} - -SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L) -{ - SWIG_Lua_get_class_registry(L); - lua_pushglobaltable(L); - lua_pushstring(L,"lua_getmetatable"); - lua_getfield(L,-2,"getmetatable"); - assert(!lua_isnil(L,-1)); - lua_rawset(L,-4); - lua_pushstring(L, "getmetatable"); - lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable); - lua_rawset(L,-3); - lua_pop(L,2); - -} -/* END OF REMOVE */ - -#endif -/* ----------------------------------------------------------------------------- - * global variable support code: namespaces and modules (which are the same thing) - * ----------------------------------------------------------------------------- */ - -SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) -{ -/* there should be 2 params passed in - (1) table (not the meta table) - (2) string name of the attribute -*/ - assert(lua_istable(L,-2)); /* just in case */ - lua_getmetatable(L,-2); - assert(lua_istable(L,-1)); - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); - /* look for the key in the .get table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,-2); /* stack tidy, remove .get table */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - /* ok, so try the .fn table */ - SWIG_Lua_get_table(L,".fn"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); /* look for the fn */ - lua_remove(L,-2); /* stack tidy, remove .fn table */ - if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */ - { /* found it so return the fn & let lua call it */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - return 0; -} - -SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L) -{ -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value -*/ - - assert(lua_istable(L,1)); - lua_getmetatable(L,1); /* get the meta table */ - assert(lua_istable(L,-1)); - - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,3); /* value */ - lua_call(L,1,0); - return 0; - } - lua_pop(L,1); /* remove the value */ - } - lua_pop(L,1); /* remove the value .set table */ - lua_pop(L,1); /* remote metatable */ - lua_rawset(L,-3); - return 0; -} - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ -SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */ -SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */ -SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss); - -/* helper function - register namespace methods and attributes into namespace */ -SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns) -{ - int i; - /* There must be namespace table (not metatable) at the top of the stack */ - assert(lua_istable(L,-1)); - SWIG_Lua_InstallConstants(L, ns->ns_constants); - - /* add methods to the namespace/module table */ - for(i=0;ns->ns_methods[i].name;i++){ - SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func); - } - lua_getmetatable(L,-1); - - /* add fns */ - for(i=0;ns->ns_attributes[i].name;i++){ - SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); - } - - /* clear stack - remove metatble */ - lua_pop(L,1); - return 0; -} - -/* Register all classes in the namespace */ -SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns) -{ - swig_lua_class **classes; - - /* There must be a module/namespace table at the top of the stack */ - assert(lua_istable(L,-1)); - - classes = ns->ns_classes; - - if( classes != 0 ) { - while(*classes != 0) { - SWIG_Lua_class_register(L, *classes); - classes++; - } - } -} - -/* Helper function. Creates namespace table and adds it to module table - if 'reg' is true, then will register namespace table to parent one (must be on top of the stack - when function is called). - Function always returns newly registered table on top of the stack. -*/ -SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg) -{ - swig_lua_namespace **sub_namespace; - /* 1 argument - table on the top of the stack */ - const int SWIGUNUSED begin = lua_gettop(L); - assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */ - lua_checkstack(L,5); - lua_newtable(L); /* namespace itself */ - lua_newtable(L); /* metatable for namespace */ - - /* add a table called ".get" */ - lua_pushstring(L,".get"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".set" */ - lua_pushstring(L,".set"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".fn" */ - lua_pushstring(L,".fn"); - lua_newtable(L); - lua_rawset(L,-3); - - /* add accessor fns for using the .get,.set&.fn */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); - - lua_setmetatable(L,-2); /* set metatable */ - - /* Register all functions, variables etc */ - SWIG_Lua_add_namespace_details(L,ns); - /* Register classes */ - SWIG_Lua_add_namespace_classes(L,ns); - - sub_namespace = ns->ns_namespaces; - if( sub_namespace != 0) { - while(*sub_namespace != 0) { - SWIG_Lua_namespace_register(L, *sub_namespace, 1); - lua_pop(L,1); /* removing sub-namespace table */ - sub_namespace++; - } - } - - if (reg) { - lua_pushstring(L,ns->name); - lua_pushvalue(L,-2); - lua_rawset(L,-4); /* add namespace to module table */ - } - assert(lua_gettop(L) == begin+1); -} -#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ - -/* ----------------------------------------------------------------------------- - * global variable support code: classes - * ----------------------------------------------------------------------------- */ - -SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname); - -typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret); - -SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type, - int first_arg, swig_lua_base_iterator_func func, int *const ret) -{ - /* first_arg - position of the object in stack. Everything that is above are arguments - * and is passed to every evocation of the func */ - int last_arg = lua_gettop(L);/* position of last argument */ - int original_metatable = last_arg + 1; - size_t bases_count; - int result = SWIG_ERROR; - int bases_table; - (void)swig_type; - lua_getmetatable(L,first_arg); - - /* initialise base search */ -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - SWIG_Lua_get_table(L,".bases"); - assert(lua_istable(L,-1)); - bases_count = lua_rawlen(L,-1); - bases_table = lua_gettop(L); -#else - /* In elua .bases table doesn't exist. Use table from swig_lua_class */ - (void)bases_table; - assert(swig_type!=0); - swig_module_info *module=SWIG_GetModule(L); - swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases; - const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names; - bases_count = 0; - for(;base_names[bases_count]; - bases_count++);/* get length of bases */ -#endif - - if(ret) - *ret = 0; - if(bases_count>0) - { - int to_remove; - size_t i; - int j; - int subcall_last_arg; - int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */ - int valid = 1; - swig_type_info *base_swig_type = 0; - for(j=first_arg;j<=last_arg;j++) - lua_pushvalue(L,j); - subcall_last_arg = lua_gettop(L); - - /* Trick: temporarily replacing original metatable with metatable for base class and call getter */ - for(i=0;ifqname); - base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]); - assert(base_swig_type != 0); - } -#endif - - if(!valid) - continue; - assert(lua_isuserdata(L, subcall_first_arg)); - assert(lua_istable(L,-1)); - lua_setmetatable(L,subcall_first_arg); /* Set new metatable */ - assert(lua_gettop(L) == subcall_last_arg); - result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */ - if(result != SWIG_ERROR) { - break; - } - } - /* Restore original metatable */ - lua_pushvalue(L,original_metatable); - lua_setmetatable(L,first_arg); - /* Clear - remove everything between last_arg and subcall_last_arg including */ - to_remove = subcall_last_arg - last_arg; - for(j=0;jtype; - result = SWIG_Lua_class_do_get(L,type,1,&ret); - if(result == SWIG_OK) - return ret; - - result = SWIG_Lua_class_do_get_item(L,type,1,&ret); - if(result == SWIG_OK) - return ret; - - return 0; -} - -/* helper for the class.set method, performs the lookup of class attributes - * It returns error code. Number of function return values is passed inside 'ret' - */ -SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret) -{ -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value - */ - - int bases_search_result; - int substack_start = lua_gettop(L) - 3; - lua_checkstack(L,5); - assert(lua_isuserdata(L,substack_start+1)); /* just in case */ - lua_getmetatable(L,substack_start+1); /* get the meta table */ - assert(lua_istable(L,-1)); /* just in case */ - if(ret) - *ret = 0; /* it is setter - number of return values is always 0 */ - - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,substack_start+2); /* key */ - lua_rawget(L,-2); - lua_remove(L,-2); /* tidy stack, remove .set table */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,substack_start+1); /* userdata */ - lua_pushvalue(L,substack_start+3); /* value */ - lua_call(L,2,0); - lua_remove(L,substack_start+4); /*remove metatable*/ - return SWIG_OK; - } - lua_pop(L,1); /* remove the value */ - } else { - lua_pop(L,1); /* remove the answer for .set table request*/ - } - /* NEW: looks for the __setitem() fn - this is a user provided set fn */ - SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ - if (lua_iscfunction(L,-1)) /* if it's there */ - { /* found it so call the fn & return its value */ - lua_pushvalue(L,substack_start+1); /* the userdata */ - lua_pushvalue(L,substack_start+2); /* the parameter */ - lua_pushvalue(L,substack_start+3); /* the value */ - lua_call(L,3,0); /* 3 values in ,0 out */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return SWIG_OK; - } - lua_pop(L,1); /* remove value */ - - lua_pop(L,1); /* remove metatable */ - /* Search among bases */ - bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret); - if(ret) - assert(*ret == 0); - assert(lua_gettop(L) == substack_start + 3); - return bases_search_result; -} - -/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly - * handles return values. - */ -SWIGINTERN int SWIG_Lua_class_set(lua_State *L) -{ -/* There should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value - */ - int ret = 0; - int result; - swig_lua_userdata *usr; - swig_type_info *type; - assert(lua_isuserdata(L,1)); - usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - type = usr->type; - result = SWIG_Lua_class_do_set(L,type,1,&ret); - if(result != SWIG_OK) { - SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method."); - lua_error(L); - } else { - assert(ret==0); - } - return 0; -} - -/* the class.destruct method called by the interpreter */ -SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) -{ -/* there should be 1 params passed in - (1) userdata (not the meta table) */ - swig_lua_userdata *usr; - swig_lua_class *clss; - assert(lua_isuserdata(L,-1)); /* just in case */ - usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ - /* if must be destroyed & has a destructor */ - if (usr->own) /* if must be destroyed */ - { - clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ - if (clss && clss->destructor) /* there is a destroy fn */ - { - clss->destructor(usr->ptr); /* bye bye */ - } - } - return 0; -} - -/* the class.__tostring method called by the interpreter and print */ -SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) -{ -/* there should be 1 param passed in - (1) userdata (not the metatable) */ - swig_lua_userdata* userData; - assert(lua_isuserdata(L,1)); /* just in case */ - userData = (swig_lua_userdata*)lua_touserdata(L,1); /* get the userdata address */ - - lua_pushfstring(L, "", userData->type->str, userData->ptr); - return 1; -} - -/* to manually disown some userdata */ -SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) -{ -/* there should be 1 params passed in - (1) userdata (not the meta table) */ - swig_lua_userdata *usr; - assert(lua_isuserdata(L,-1)); /* just in case */ - usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ - - usr->own = 0; /* clear our ownership */ - return 0; -} - -/* lua callable function to compare userdata's value -the issue is that two userdata may point to the same thing -but to lua, they are different objects */ -SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) -{ - int result; - swig_lua_userdata *usr1,*usr2; - if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ - return 0; /* nil reply */ - usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ - /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ - result=(usr1->ptr==usr2->ptr); - lua_pushboolean(L,result); - return 1; -} - -/* populate table at the top of the stack with metamethods that ought to be inherited */ -SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) -{ - SWIG_Lua_add_boolean(L, "__add", 1); - SWIG_Lua_add_boolean(L, "__sub", 1); - SWIG_Lua_add_boolean(L, "__mul", 1); - SWIG_Lua_add_boolean(L, "__div", 1); - SWIG_Lua_add_boolean(L, "__mod", 1); - SWIG_Lua_add_boolean(L, "__pow", 1); - SWIG_Lua_add_boolean(L, "__unm", 1); - SWIG_Lua_add_boolean(L, "__len", 1 ); - SWIG_Lua_add_boolean(L, "__concat", 1 ); - SWIG_Lua_add_boolean(L, "__eq", 1); - SWIG_Lua_add_boolean(L, "__lt", 1); - SWIG_Lua_add_boolean(L, "__le", 1); - SWIG_Lua_add_boolean(L, "__call", 1); - SWIG_Lua_add_boolean(L, "__tostring", 1); - SWIG_Lua_add_boolean(L, "__gc", 0); -} - -/* creates the swig registry */ -SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L) -{ - /* create main SWIG registry table */ - lua_pushstring(L,"SWIG"); - lua_newtable(L); - /* populate it with some predefined data */ - - /* .library table. Placeholder */ - lua_pushstring(L,".library"); - lua_newtable(L); - { - /* list of metamethods that class inherits from its bases */ - lua_pushstring(L,"inheritable_metamethods"); - lua_newtable(L); - /* populate with list of metamethods */ - SWIG_Lua_populate_inheritable_metamethods(L); - lua_rawset(L,-3); - } - lua_rawset(L,-3); - - lua_rawset(L,LUA_REGISTRYINDEX); -} - -/* gets the swig registry (or creates it) */ -SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L) -{ - /* add this all into the swig registry: */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ - if (!lua_istable(L,-1)) /* not there */ - { /* must be first time, so add it */ - lua_pop(L,1); /* remove the result */ - SWIG_Lua_create_class_registry(L); - /* then get it */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); - } -} - -SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L) -{ - SWIG_Lua_get_class_registry(L); - lua_pushstring(L, ".library"); - lua_rawget(L,-2); - assert( !lua_isnil(L,-1) ); - lua_pushstring(L, "inheritable_metamethods"); - lua_rawget(L,-2); - - /* Remove class registry and library table */ - lua_remove(L,-2); - lua_remove(L,-2); -} - -/* Helper function to get the classes metatable from the register */ -SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname) -{ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,cname); /* get the name */ - lua_rawget(L,-2); /* get it */ - lua_remove(L,-2); /* tidy up (remove registry) */ -} - -/* Set up the base classes pointers. -Each class structure has a list of pointers to the base class structures. -This function fills them. -It cannot be done at compile time, as this will not work with hireachies -spread over more than one swig file. -Therefore it must be done at runtime, querying the SWIG type system. -*/ -SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss) -{ - int i=0; - swig_module_info *module=SWIG_GetModule(L); - for(i=0;clss->base_names[i];i++) - { - if (clss->bases[i]==0) /* not found yet */ - { - /* lookup and cache the base class */ - swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); - if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; - } - } -} - -#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) -/* Merges two tables */ -SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source) -{ - /* iterating */ - lua_pushnil(L); - while (lua_next(L,source) != 0) { - /* -1 - value, -2 - index */ - /* have to copy to assign */ - lua_pushvalue(L,-2); /* copy of index */ - lua_pushvalue(L,-2); /* copy of value */ - lua_rawset(L, target); - lua_pop(L,1); - /* only key is left */ - } -} - -/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */ -SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base) -{ - /* push original[name], then base[name] */ - lua_pushstring(L,name); - lua_rawget(L,original); - int original_table = lua_gettop(L); - lua_pushstring(L,name); - lua_rawget(L,base); - int base_table = lua_gettop(L); - SWIG_Lua_merge_tables_by_index(L, original_table, base_table); - /* clearing stack */ - lua_pop(L,2); -} - -/* Function takes all symbols from base and adds it to derived class. It's just a helper. */ -SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls) -{ - /* There is one parameter - original, i.e. 'derived' class metatable */ - assert(lua_istable(L,-1)); - int original = lua_gettop(L); - SWIG_Lua_get_class_metatable(L,base_cls->fqname); - int base = lua_gettop(L); - SWIG_Lua_merge_tables(L, ".fn", original, base ); - SWIG_Lua_merge_tables(L, ".set", original, base ); - SWIG_Lua_merge_tables(L, ".get", original, base ); - lua_pop(L,1); -} - -/* Function squashes all symbols from 'clss' bases into itself */ -SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss) -{ - int i; - SWIG_Lua_get_class_metatable(L,clss->fqname); - for(i=0;clss->base_names[i];i++) - { - if (clss->bases[i]==0) /* Somehow it's not found. Skip it */ - continue; - /* Thing is: all bases are already registered. Thus they have already executed - * this function. So we just need to squash them into us, because their bases - * are already squashed into them. No need for recursion here! - */ - SWIG_Lua_class_squash_base(L, clss->bases[i]); - } - lua_pop(L,1); /*tidy stack*/ -} -#endif - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ -/* helper add a variable to a registered class */ -SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn) -{ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,getFn); - lua_pop(L,1); /* tidy stack (remove table) */ - if (setFn) - { - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,setFn); - lua_pop(L,1); /* tidy stack (remove table) */ - } -} - -/* helper to recursively add class static details (static attributes, operations and constants) */ -SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss) -{ - int i = 0; - /* The class namespace table must be on the top of the stack */ - assert(lua_istable(L,-1)); - /* call all the base classes first: we can then override these later: */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_add_class_static_details(L,clss->bases[i]); - } - - SWIG_Lua_add_namespace_details(L, clss->cls_static); -} - -SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */ - -/* helper to recursively add class details (attributes & operations) */ -SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss) -{ - int i; - size_t bases_count = 0; - /* Add bases to .bases table */ - SWIG_Lua_get_table(L,".bases"); - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); - /* Base class must be already registered */ - assert(lua_istable(L,-1)); - lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */ - bases_count++; - } - assert(lua_rawlen(L,-1) == bases_count); - lua_pop(L,1); /* remove .bases table */ - /* add attributes */ - for(i=0;clss->attributes[i].name;i++){ - SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); - } - /* add methods to the metatable */ - SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;clss->methods[i].name;i++){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func); - } - lua_pop(L,1); /* tidy stack (remove table) */ - /* add operator overloads - This adds methods from metatable array to metatable. Can mess up garbage - collectind if someone defines __gc method - */ - if(clss->metatable) { - for(i=0;clss->metatable[i].name;i++) { - SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func); - } - } - -#if !defined(SWIG_LUA_SQUASH_BASES) - /* Adding metamethods that are defined in base classes. If bases were squashed - * then it is obviously unnecessary - */ - SWIG_Lua_add_class_user_metamethods(L, clss); -#endif -} - -/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed - for the following issue: Lua runtime checks for metamethod existence with rawget function - ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method - search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly - in metatable and not in object). - Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants - are automatically given a special proxy __x that calls the real __x method. - Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime, - those changes must be reflected in all descendants. -*/ - -SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/ - -/* The real function that resolves a metamethod. - * Function searches given class and all its bases (recursively) for first instance of something that is - * not equal to SWIG_Lua_resolve_metamethod. (Almost always this 'something' is actual metamethod implementation - * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the - * answer. - * Returns 1 if found, 0 otherwise. - * clss is class which metatable we will search for method - * metamethod_name_idx is index in L where metamethod name (as string) lies - * skip_check allows skipping searching metamethod in the given class and immediately going to searching in bases. skip_check - * is not carried to subsequent recursive calls - false is always passed. It is set to true only at first call from - * SWIG_Lua_resolve_metamethod - * */ -SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx, - int skip_check) -{ - /* This function is called recursively */ - int result = 0; - int i = 0; - - if (!skip_check) { - SWIG_Lua_get_class_metatable(L, clss->fqname); - lua_pushvalue(L, metamethod_name_idx); - lua_rawget(L,-2); - /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then - * this isn't the function we are looking for :) - * lua_tocfunction will return NULL if not cfunction - */ - if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) { - lua_remove(L,-2); /* removing class metatable */ - return 1; - } - lua_pop(L,2); /* remove class metatable and query result */ - } - - /* Forwarding calls to bases */ - for(i=0;clss->bases[i];i++) - { - result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0); - if (result) - break; - } - - return result; -} - -/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method - * and calls it */ -SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) -{ - int numargs; - int metamethod_name_idx; - const swig_lua_class* clss; - int result; - - lua_checkstack(L,5); - numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */ - - /* Get upvalues from closure */ - lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/ - metamethod_name_idx = lua_gettop(L); - - lua_pushvalue(L, lua_upvalueindex(2)); - clss = (const swig_lua_class*)(lua_touserdata(L,-1)); - lua_pop(L,1); /* remove lightuserdata with clss from stack */ - - /* Actual work */ - result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1); - if (!result) { - SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation."); - lua_error(L); - return 0; - } - - lua_remove(L,-2); /* remove metamethod key */ - lua_insert(L,1); /* move function to correct position */ - lua_call(L, numargs, LUA_MULTRET); - return lua_gettop(L); /* return all results */ -} - - -/* If given metamethod must be present in given class, then creates appropriate proxy - * Returns 1 if successfully added, 0 if not added because no base class has it, -1 - * if method is defined in the class metatable itself - */ -SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index) -{ - int key_index; - int success = 0; - int i = 0; - - /* metamethod name - on the top of the stack */ - assert(lua_isstring(L,-1)); - - key_index = lua_gettop(L); - - /* Check whether method is already defined in metatable */ - lua_pushvalue(L,key_index); /* copy of the key */ - lua_gettable(L,metatable_index); - if( !lua_isnil(L,-1) ) { - lua_pop(L,1); - return -1; - } - lua_pop(L,1); - - /* Iterating over immediate bases */ - for(i=0;clss->bases[i];i++) - { - const swig_lua_class *base = clss->bases[i]; - SWIG_Lua_get_class_metatable(L, base->fqname); - lua_pushvalue(L, key_index); - lua_rawget(L, -2); - if( !lua_isnil(L,-1) ) { - lua_pushvalue(L, key_index); - - /* Add proxy function */ - lua_pushvalue(L, key_index); /* first closure value is function name */ - lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */ - lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2); - - lua_rawset(L, metatable_index); - success = 1; - } - lua_pop(L,1); /* remove function or nil */ - lua_pop(L,1); /* remove base class metatable */ - - if( success ) - break; - } - - return success; -} - -SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss) -{ - int metatable_index; - int metamethods_info_index; - int tostring_undefined; - int eq_undefined = 0; - - SWIG_Lua_get_class_metatable(L, clss->fqname); - metatable_index = lua_gettop(L); - SWIG_Lua_get_inheritable_metamethods(L); - assert(lua_istable(L,-1)); - metamethods_info_index = lua_gettop(L); - lua_pushnil(L); /* first key */ - while(lua_next(L, metamethods_info_index) != 0 ) { - /* key at index -2, value at index -1 */ - const int is_inheritable = lua_toboolean(L,-2); - lua_pop(L,1); /* remove value - we don't need it anymore */ - - if(is_inheritable) { /* if metamethod is inheritable */ - SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index); - } - } - - lua_pop(L,1); /* remove inheritable metamethods table */ - - /* Special handling for __tostring method */ - lua_pushstring(L, "__tostring"); - lua_pushvalue(L,-1); - lua_rawget(L,metatable_index); - tostring_undefined = lua_isnil(L,-1); - lua_pop(L,1); - if( tostring_undefined ) { - lua_pushcfunction(L, SWIG_Lua_class_tostring); - lua_rawset(L, metatable_index); - } else { - lua_pop(L,1); /* remove copy of the key */ - } - - /* Special handling for __eq method */ - lua_pushstring(L, "__eq"); - lua_pushvalue(L,-1); - lua_rawget(L,metatable_index); - eq_undefined = lua_isnil(L,-1); - lua_pop(L,1); - if( eq_undefined ) { - lua_pushcfunction(L, SWIG_Lua_class_equal); - lua_rawset(L, metatable_index); - } else { - lua_pop(L,1); /* remove copy of the key */ - } - /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[] - * a __getitem/__setitem method should be defined - */ - lua_pop(L,1); /* pop class metatable */ -} - -/* Register class static methods,attributes etc as well as constructor proxy */ -SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss) -{ - const int SWIGUNUSED begin = lua_gettop(L); - lua_checkstack(L,5); /* just in case */ - assert(lua_istable(L,-1)); /* just in case */ - assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */ - - SWIG_Lua_namespace_register(L,clss->cls_static, 1); - - assert(lua_istable(L,-1)); /* just in case */ - - /* add its constructor to module with the name of the class - so you can do MyClass(...) as well as new_MyClass(...) - BUT only if a constructor is defined - (this overcomes the problem of pure virtual classes without constructors)*/ - if (clss->constructor) - { - lua_getmetatable(L,-1); - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,"__call", clss->constructor); - lua_pop(L,1); - } - - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_class_static_details(L, clss); - - /* clear stack */ - lua_pop(L,1); - assert( lua_gettop(L) == begin ); -} - -/* Performs the instance (non-static) class registration process. Metatable for class is created - * and added to the class registry. - */ -SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss) -{ - const int SWIGUNUSED begin = lua_gettop(L); - int i; - /* if name already there (class is already registered) then do nothing */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - lua_rawget(L,-2); - if(!lua_isnil(L,-1)) { - lua_pop(L,2); - assert(lua_gettop(L)==begin); - return; - } - lua_pop(L,2); /* tidy stack */ - /* Recursively initialize all bases */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_class_register_instance(L,clss->bases[i]); - } - /* Again, get registry and push name */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - lua_newtable(L); /* create the metatable */ -#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - /* If squashing is requested, then merges all bases metatable into this one. - * It would get us all special methods: __getitem, __add etc. - * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away - */ - { - int new_metatable_index = lua_absindex(L,-1); - for(i=0;clss->bases[i];i++) - { - int base_metatable; - SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); - base_metatable = lua_absindex(L,-1); - SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); - lua_pop(L,1); - } - } - /* And now we will overwrite all incorrectly set data */ -#endif - /* add string of class name called ".type" */ - lua_pushstring(L,".type"); - lua_pushstring(L,clss->fqname); - lua_rawset(L,-3); - /* add a table called bases */ - lua_pushstring(L,".bases"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".get" */ - lua_pushstring(L,".get"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".set" */ - lua_pushstring(L,".set"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".fn" */ - lua_pushstring(L,".fn"); - lua_newtable(L); - /* add manual disown method */ - SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown); - lua_rawset(L,-3); - /* add accessor fns for using the .get,.set&.fn */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); - SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); - /* add it */ - lua_rawset(L,-3); /* metatable into registry */ - lua_pop(L,1); /* tidy stack (remove registry) */ - assert(lua_gettop(L) == begin); - -#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */ - SWIG_Lua_class_squash_bases(L,clss); -#endif - SWIG_Lua_get_class_metatable(L,clss->fqname); - SWIG_Lua_add_class_instance_details(L,clss); /* recursive adding of details (atts & ops) */ - lua_pop(L,1); /* tidy stack (remove class metatable) */ - assert( lua_gettop(L) == begin ); -} - -SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) -{ - int SWIGUNUSED begin; - assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */ - SWIG_Lua_class_register_instance(L,clss); - SWIG_Lua_class_register_static(L,clss); - - /* Add links from static part to instance part and vice versa */ - /* [SWIG registry] [Module] - * "MyClass" ----> [MyClass metatable] <===== "MyClass" -+> [static part] - * ".get" ----> ... | | getmetatable()----| - * ".set" ----> ... | | | - * ".static" --------------)----------------/ [static part metatable] - * | ".get" --> ... - * | ".set" --> .... - * |=============================== ".instance" - */ - begin = lua_gettop(L); - lua_pushstring(L,clss->cls_static->name); - lua_rawget(L,-2); /* get class static table */ - assert(lua_istable(L,-1)); - lua_getmetatable(L,-1); - assert(lua_istable(L,-1)); /* get class static metatable */ - lua_pushstring(L,".instance"); /* prepare key */ - - SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */ - assert(lua_istable(L,-1)); - lua_pushstring(L,".static"); /* prepare key */ - lua_pushvalue(L, -4); /* push static class TABLE */ - assert(lua_istable(L,-1)); - lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */ - lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */ - lua_pop(L,2); - assert(lua_gettop(L) == begin); -} -#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss) -{ - const int SWIGUNUSED begin = lua_gettop(L); - int i; - /* if name already there (class is already registered) then do nothing */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - lua_rawget(L,-2); - if(!lua_isnil(L,-1)) { - lua_pop(L,2); - assert(lua_gettop(L)==begin); - return; - } - lua_pop(L,2); /* tidy stack */ - /* Recursively initialize all bases */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_elua_class_register_instance(L,clss->bases[i]); - } - /* Again, get registry and push name */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - assert(clss->metatable); - lua_pushrotable(L, (void*)(clss->metatable)); /* create the metatable */ - lua_rawset(L,-3); - lua_pop(L,1); - assert(lua_gettop(L) == begin); -} -#endif /* elua && eluac */ - -/* ----------------------------------------------------------------------------- - * Class/structure conversion fns - * ----------------------------------------------------------------------------- */ - -/* helper to add metatable to new lua object */ -SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type) -{ - if (type->clientdata) /* there is clientdata: so add the metatable */ - { - SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname); - if (lua_istable(L,-1)) - { - lua_setmetatable(L,-2); - } - else - { - lua_pop(L,1); - } - } -} - -/* pushes a new object into the lua stack */ -SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own) -{ - swig_lua_userdata *usr; - if (!ptr){ - lua_pushnil(L); - return; - } - usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ - usr->ptr=ptr; /* set the ptr */ - usr->type=type; - usr->own=own; -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - SWIG_Lua_AddMetatable(L,type); /* add metatable */ -#endif -} - -/* takes a object from the lua stack & converts it into an object of the correct type - (if possible) */ -SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags) -{ - int ret = SWIG_ERROR; - swig_lua_userdata *usr; - swig_cast_info *cast; - /* special case: lua nil => NULL pointer */ - if (lua_isnil(L,index)) - { - *ptr=0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - if (lua_islightuserdata(L,index)) - { - *ptr=lua_touserdata(L,index); - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ - if (usr) - { - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !usr->own) - { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ - { - usr->own = 0; - } - if (!type) /* special cast void*, no casting fn */ - { - *ptr=usr->ptr; - ret = SWIG_OK; - } - else - { - cast=SWIG_TypeCheck(usr->type->name,type); /* performs normal type checking */ - if (cast) - { - int newmemory = 0; - *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - ret = SWIG_OK; - } - } - if ((ret == SWIG_OK) && (flags & SWIG_POINTER_CLEAR)) - { - usr->ptr = 0; - } - } - return ret; -} - -SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags, - int argnum,const char *func_name){ - void *result = 0; - if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ - luaL_error (L,"Error in %s, expected a %s at argument number %d\n", - func_name,(type && type->str)?type->str:"void*",argnum); - } - return result; -} - -/* pushes a packed userdata. user for member fn pointers only */ -SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type) -{ - swig_lua_rawdata *raw; - assert(ptr); /* not acceptable to pass in a NULL value */ - raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ - raw->type=type; - raw->own=0; - memcpy(raw->data,ptr,size); /* copy the data */ - SWIG_Lua_AddMetatable(L,type); /* add metatable */ -} - -/* converts a packed userdata. user for member fn pointers only */ -SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type) -{ - swig_lua_rawdata *raw; - raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ - if (!raw) return SWIG_ERROR; /* error */ - if (type==0 || type==raw->type) /* void* or identical type */ - { - memcpy(ptr,raw->data,size); /* copy it */ - return SWIG_OK; /* ok */ - } - return SWIG_ERROR; /* error */ -} - -/* a function to get the typestring of a piece of data */ -SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) -{ - swig_lua_userdata *usr; - if (lua_isuserdata(L,tp)) - { - usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ - if (usr && usr->type && usr->type->str) - return usr->type->str; - return "userdata (unknown type)"; - } - return lua_typename(L,lua_type(L,tp)); -} - -/* lua callable function to get the userdata's type */ -SWIGRUNTIME int SWIG_Lua_type(lua_State *L) -{ - lua_pushstring(L,SWIG_Lua_typename(L,1)); - return 1; -} - -/* ----------------------------------------------------------------------------- - * global variable support code: class/struct typemap functions - * ----------------------------------------------------------------------------- */ - -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) -/* Install Constants */ -SWIGINTERN void -SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) { - int i; - for (i = 0; constants[i].type; i++) { - switch(constants[i].type) { - case SWIG_LUA_INT: - lua_pushstring(L,constants[i].name); - lua_pushinteger(L,(lua_Integer)constants[i].lvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_FLOAT: - lua_pushstring(L,constants[i].name); - lua_pushnumber(L,(lua_Number)constants[i].dvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_CHAR: - lua_pushstring(L,constants[i].name); - { - char c = (char)constants[i].lvalue; - lua_pushlstring(L,&c,1); - } - lua_rawset(L,-3); - break; - case SWIG_LUA_STRING: - lua_pushstring(L,constants[i].name); - lua_pushstring(L,(char *) constants[i].pvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_POINTER: - lua_pushstring(L,constants[i].name); - SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0); - lua_rawset(L,-3); - break; - case SWIG_LUA_BINARY: - lua_pushstring(L,constants[i].name); - SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); - lua_rawset(L,-3); - break; - default: - break; - } - } -} -#endif - -/* ----------------------------------------------------------------------------- - * executing lua code from within the wrapper - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ -#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) -#endif -/* Executes a C string in Lua which is a really simple way of calling lua from C -Unfortunately lua keeps changing its APIs, so we need a conditional compile -In lua 5.0.X it's lua_dostring() -In lua 5.1.X it's luaL_dostring() -*/ -SWIGINTERN int -SWIG_Lua_dostring(lua_State *L, const char *str) { - int ok,top; - if (str==0 || str[0]==0) return 0; /* nothing to do */ - top=lua_gettop(L); /* save stack */ -#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) - ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ -#else - ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ -#endif - if (ok!=0) { - SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); - } - lua_settop(L,top); /* restore the stack */ - return ok; -} - -#ifdef __cplusplus -} -#endif - -/* ------------------------------ end luarun.swg ------------------------------ */ diff --git a/mac/bin/swig/share/swig/4.1.0/lua/luaruntime.swg b/mac/bin/swig/share/swig/4.1.0/lua/luaruntime.swg deleted file mode 100755 index 399bb640..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/luaruntime.swg +++ /dev/null @@ -1,104 +0,0 @@ -/* ----------------------------------------------------------------------------- - * luaruntime.swg - * - * all the runtime code for . - * ----------------------------------------------------------------------------- */ - -%runtime "swigrun.swg" /* Common C API type-checking code */ -%runtime "swigerrors.swg" /* SWIG errors */ -%runtime "luarun.swg" /* Lua runtime stuff */ - -%insert(initbeforefunc) "swiginit.swg" - -%insert(initbeforefunc) %{ - -/* Forward declaration of where the user's %init{} gets inserted */ -void SWIG_init_user(lua_State* L ); - -#ifdef __cplusplus -extern "C" { -#endif -/* this is the initialization function - added at the very end of the code - the function is always called SWIG_init, but an earlier #define will rename it -*/ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) -LUALIB_API int SWIG_init(lua_State* L) -#else -SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ -#endif -{ -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ - int i; - int globalRegister = 0; - /* start with global table */ - lua_pushglobaltable (L); - /* SWIG's internal initialisation */ - SWIG_InitializeModule((void*)L); - SWIG_PropagateClientData(); -#endif - -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE) - /* add a global fn */ - SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); - SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal); -#endif - -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - /* set up base class pointers (the hierarchy) */ - for (i = 0; swig_types[i]; i++){ - if (swig_types[i]->clientdata){ - SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); - } - } -#ifdef SWIG_LUA_MODULE_GLOBAL - globalRegister = 1; -#endif - - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister); -#endif - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) - for (i = 0; swig_types[i]; i++){ - if (swig_types[i]->clientdata){ - SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata)); - } - } -#endif - -#if defined(SWIG_LUA_ELUA_EMULATE) - lua_newtable(L); - SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods); - SWIG_Lua_elua_emulate_register_clear(L); - if(globalRegister) { - lua_pushstring(L,swig_SwigModule.name); - lua_pushvalue(L,-2); - lua_rawset(L,-4); - } -#endif - -#endif - -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - /* invoke user-specific initialization */ - SWIG_init_user(L); - /* end module */ - /* Note: We do not clean up the stack here (Lua will do this for us). At this - point, we have the globals table and out module table on the stack. Returning - one value makes the module table the result of the require command. */ - return 1; -#else - return 0; -#endif -} - -#ifdef __cplusplus -} -#endif - -%} - -/* Note: the initialization function is closed after all code is generated */ - diff --git a/mac/bin/swig/share/swig/4.1.0/lua/luatypemaps.swg b/mac/bin/swig/share/swig/4.1.0/lua/luatypemaps.swg deleted file mode 100755 index 7d23917e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/luatypemaps.swg +++ /dev/null @@ -1,418 +0,0 @@ -/* ----------------------------------------------------------------------------- - * luatypemaps.swg - * - * basic typemaps for Lua. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * standard typemaps - * ----------------------------------------------------------------------------- */ -/* NEW LANGUAGE NOTE: - the 'checkfn' param is something that I added for typemap(in) - it is an optional fn call to check the type of the lua object - the fn call must be of the form - int checkfn(lua_State *L, int index); - and return 1/0 depending upon if this is the correct type - For the typemap(out), an additional SWIG_arg parameter must be incremented - to reflect the number of values returned (normally SWIG_arg++; will do) -*/ -// numbers -%typemap(in,checkfn="lua_isnumber") int, short, long, - signed char, float, double -%{$1 = ($type)lua_tonumber(L, $input);%} - -// additional check for unsigned numbers, to not permit negative input -%typemap(in,checkfn="lua_isnumber") unsigned int, - unsigned short, unsigned long, unsigned char -%{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative"); -$1 = ($type)lua_tonumber(L, $input);%} - -%typemap(out) int,short,long, - unsigned int,unsigned short,unsigned long, - signed char,unsigned char, - float,double -%{ lua_pushnumber(L, (lua_Number) $1); SWIG_arg++;%} - -// we must also provide typemaps for primitives by const reference: -// given a function: -// int intbyref(const int& i); -// SWIG assumes that this code will need a pointer to int to be passed in -// (this might be ok for objects by const ref, but not for numeric primitives) -// therefore we add a set of typemaps to fix this (for both in & out) -%typemap(in,checkfn="lua_isnumber") const int&($*1_ltype temp) -%{ temp=($*1_ltype)lua_tonumber(L,$input); $1=&temp;%} - -%typemap(in,checkfn="lua_isnumber") const unsigned int&($*1_ltype temp) -%{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative"); -temp=($*1_ltype)lua_tonumber(L,$input); $1=&temp;%} - -%typemap(out) const int&, const unsigned int& -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} - -// for the other numbers we can just use an apply statement to cover them -%apply const int & {const short&,const long&,const signed char&, - const float&,const double&}; - -%apply const unsigned int & {const unsigned short&,const unsigned long&, - const unsigned char&}; - -/* enums have to be handled slightly differently - VC++ .net will not allow a cast from lua_Number(double) to enum directly. -*/ -%typemap(in,checkfn="lua_isnumber") enum SWIGTYPE -%{$1 = ($type)(int)lua_tonumber(L, $input);%} - -%typemap(out) enum SWIGTYPE -%{ lua_pushnumber(L, (lua_Number)(int)($1)); SWIG_arg++;%} - -// and const refs -%typemap(in,checkfn="lua_isnumber") const enum SWIGTYPE &($basetype temp) -%{ temp=($basetype)(int)lua_tonumber(L,$input); $1=&temp;%} -%typemap(in,checkfn="lua_isnumber") const enum SWIGTYPE &&($basetype temp) -%{ temp=($basetype)(int)lua_tonumber(L,$input); $1=&temp;%} -%typemap(out) const enum SWIGTYPE & -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} -%typemap(out) const enum SWIGTYPE && -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} - - -// boolean (which is a special type in lua) -// note: lua_toboolean() returns 1 or 0 -// note: 1 & 0 are not booleans in lua, only true & false -%typemap(in,checkfn="lua_isboolean") bool -%{$1 = (lua_toboolean(L, $input)!=0);%} - -%typemap(out) bool -%{ lua_pushboolean(L,(int)($1!=0)); SWIG_arg++;%} - -// for const bool&, SWIG treats this as a const bool* so we must dereference it -%typemap(in,checkfn="lua_isboolean") const bool& (bool temp) -%{temp=(lua_toboolean(L, $input)!=0); - $1=&temp;%} - -%typemap(out) const bool& -%{ lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%} - -// strings (char * and char[]) -%fragment("SWIG_lua_isnilstring", "header") { -SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) { - int ret = lua_isstring(L, idx); - if (!ret) - ret = lua_isnil(L, idx); - return ret; -} -} - -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char *, char * -%{$1 = ($ltype)lua_tostring(L, $input);%} - -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char[ANY], char[ANY] -%{$1 = ($ltype)lua_tostring(L, $input);%} - -%typemap(out) const char *, char * -%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} - -%typemap(out) const char[ANY], char[ANY] -%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} - -// char's -// currently treating chars as small strings, not as numbers -// (however signed & unsigned char's are numbers...) -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") char -%{$1 = (lua_tostring(L, $input))[0];%} - -%typemap(out) char -%{ lua_pushlstring(L, &$1, 1); SWIG_arg++;%} - -// by const ref -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char& (char temp) -%{temp = (lua_tostring(L, $input))[0]; $1=&temp;%} - -%typemap(out) const char& -%{ lua_pushlstring(L, $1, 1); SWIG_arg++;%} - -// pointers and references -// under SWIG rules, it is ok, to have a pass in a lua nil, -// it should be converted to a SWIG NULL. -// This will only be allowed for pointers & arrays, not refs or by value -// the checkfn lua_isuserdata will only work for userdata -// the checkfn SWIG_isptrtype will work for both userdata and nil -%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE*,SWIGTYPE[] -%{ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ - SWIG_fail_ptr("$symname",$argnum,$descriptor); - } -%} - -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE& -%{ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ - SWIG_fail_ptr("$symname",$argnum,$descriptor); - } -%} - -%typemap(in,checkfn="lua_isuserdata",fragment="") SWIGTYPE&& (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) %{ - res = SWIG_ConvertPtr(L, $input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type '$1_type' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $descriptor); - } - } - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -%} - -// out is simple -%typemap(out) SWIGTYPE*,SWIGTYPE& -%{SWIG_NewPointerObj(L,$1,$descriptor,$owner); SWIG_arg++; %} -%typemap(out) SWIGTYPE*,SWIGTYPE&& -%{SWIG_NewPointerObj(L,$1,$descriptor,$owner); SWIG_arg++; %} - -// dynamic casts -// this uses the SWIG_TypeDynamicCast() which relies on RTTI to find out what the pointer really is -// the we return it as the correct type -%typemap(out) SWIGTYPE *DYNAMIC, - SWIGTYPE &DYNAMIC -{ - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_NewPointerObj(L,(void*)$1,ty,$owner); SWIG_arg++; -} - - -// passing objects by value -// SWIG_ConvertPtr wants an object pointer (the $<ype argp) -// then dereferences it to get the object -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE ($<ype argp) -%{ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&argp,$&descriptor,0))){ - SWIG_fail_ptr("$symname",$argnum,$&descriptor); - } - $1 = *argp; -%} - -// Also needed for object ptrs by const ref -// eg A* const& ref_pointer(A* const& a); -// found in mixed_types.i -%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE *const&($*ltype temp) -%{temp=($*ltype)SWIG_MustGetPtr(L,$input,$*descriptor,0,$argnum,"$symname"); -$1=($1_ltype)&temp;%} - -%typemap(out) SWIGTYPE *const& -%{SWIG_NewPointerObj(L,*$1,$*descriptor,$owner); SWIG_arg++; %} - - -// DISOWN-ing typemaps -// if you have an object pointer which must be disowned, use this typemap -// eg. for void destroy_foo(Foo* toDie); -// use %apply SWIGTYPE* DISOWN {Foo* toDie}; -// you could just use %delobject, but this is more flexible -%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE* DISOWN,SWIGTYPE DISOWN[] -%{ if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("$symname",$argnum,$descriptor); - } -%} - - -// Primitive types--return by value -// must make a new object, copy the data & return the new object -// Note: the brackets are {...} and not %{..%}, because we want them to be included in the wrapper -// this is because typemap(out) does not support local variables, like in typemap(in) does -// and we need the $&1_ltype resultptr; to be declared -#ifdef __cplusplus -%typemap(out) SWIGTYPE -{ - $&1_ltype resultptr = new $1_ltype($1); - SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; -} -#else -%typemap(out) SWIGTYPE -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; -} -#endif - -// member function pointer -// a member fn ptr is not 4 bytes like a normal pointer, but 8 bytes (at least on mingw) -// so the standard wrapping cannot be done -// nor can you cast a member function pointer to a void* (obviously) -// therefore a special wrapping functions SWIG_ConvertMember() & SWIG_NewMemberObj() were written -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE (CLASS::*) -%{ - if (!SWIG_IsOK(SWIG_ConvertMember(L,$input,(void*)(&$1),sizeof($1),$descriptor))) - SWIG_fail_ptr("$symname",$argnum,$descriptor); -%} - -%typemap(out) SWIGTYPE (CLASS::*) -%{ - SWIG_NewMemberObj(L,(void*)(&$1),sizeof($1),$descriptor); SWIG_arg++; -%} - - -// void (must be empty without the SWIG_arg++) -%typemap(out) void "" - -/* void* is a special case -A function void fn(void*) should take any kind of pointer as a parameter (just like C/C++ does) -but if it's an output, then it should be wrapped like any other SWIG object (using default typemap) -*/ -%typemap(in,checkfn="SWIG_isptrtype") void* -%{$1=($1_ltype)SWIG_MustGetPtr(L,$input,0,0,$argnum,"$symname");%} - -/* long long is another special case: -as lua only supports one numeric type (lua_Number), we will just -cast it to that & accept the loss of precision. -An alternative solution would be a long long struct or class -with the relevant operators. -*/ -%apply long {long long, signed long long, unsigned long long}; -%apply const long& {const long long&, const signed long long&, const unsigned long long&}; - -/* It is possible to also pass a lua_State* into a function, so -void fn(int a, float b, lua_State* s) is wrappable as -> fn(1,4.3) -- note: the state is implicitly passed in -*/ -%typemap(in, numinputs=0) lua_State* -%{$1 = L;%} - - - -/* ----------------------------------------------------------------------------- - * typecheck rules - * ----------------------------------------------------------------------------- */ -/* These are needed for the overloaded functions -These define the detection routines which will spot what -parameters match which function -*/ - -// unfortunately lua only considers one type of number -// so all numbers (int,float,double) match -// you could add an advanced fn to get type & check if it's integral -%typecheck(SWIG_TYPECHECK_INTEGER) - int, short, long, - unsigned int, unsigned short, unsigned long, - signed char, unsigned char, - long long, unsigned long long, signed long long, - const int &, const short &, const long &, - const unsigned int &, const unsigned short &, const unsigned long &, - const signed char&, const unsigned char&, - const long long &, const unsigned long long &, - enum SWIGTYPE, const enum SWIGTYPE&, const enum SWIGTYPE &&, - float, double, const float &, const double& -{ - $1 = lua_isnumber(L,$input); -} - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, const bool & -{ - $1 = lua_isboolean(L,$input); -} - -// special check for a char (string of length 1) -%typecheck(SWIG_TYPECHECK_CHAR,fragment="SWIG_lua_isnilstring") char, const char& { - $1 = SWIG_lua_isnilstring(L,$input) && (lua_rawlen(L,$input)==1); -} - -%typecheck(SWIG_TYPECHECK_STRING,fragment="SWIG_lua_isnilstring") char *, char[] { - $1 = SWIG_lua_isnilstring(L,$input); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { - void *ptr; - if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE & { - void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE && { - void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $&1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, 0, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -// Also needed for object pointers by const ref -// eg const A* ref_pointer(A* const& a); -// found in mixed_types.i -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& -{ - void *ptr; - if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $*descriptor, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -/* ----------------------------------------------------------------------------- - * Others - * ----------------------------------------------------------------------------- */ - -// Array reference typemaps -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -// size_t (which is just a unsigned long) -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; - - -/* ----------------------------------------------------------------------------- - * Specials - * ----------------------------------------------------------------------------- */ -// swig::LANGUAGE_OBJ was added to allow containers of native objects -// however it's rather difficult to do this in lua, as you cannot hold pointers -// to native objects (they are held in the interpreter) -// therefore for now: just ignoring this feature -#ifdef __cplusplus -%ignore swig::LANGUAGE_OBJ; - -//%inline %{ -%{ -namespace swig { -typedef struct{} LANGUAGE_OBJ; -} -%} - -#endif // __cplusplus diff --git a/mac/bin/swig/share/swig/4.1.0/lua/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/lua/std_auto_ptr.i deleted file mode 100755 index b3b71d0f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, checkfn="SWIG_isptrtype", noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(L, $input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $descriptor(TYPE *)); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++; -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/lua/std_common.i b/mac/bin/swig/share/swig/4.1.0/lua/std_common.i deleted file mode 100755 index cee11e8c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/mac/bin/swig/share/swig/4.1.0/lua/std_deque.i b/mac/bin/swig/share/swig/4.1.0/lua/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/lua/std_except.i b/mac/bin/swig/share/swig/4.1.0/lua/std_except.i deleted file mode 100755 index 34ab6a1a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/std_except.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Typemaps used by the STL wrappers that throw exceptions. - * These typemaps are used when methods are declared with an STL exception - * specification, such as: - * size_t at() const throw (std::out_of_range); - * - * std_except.i - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} -%include - -namespace std -{ - %ignore exception; // not sure if I should ignore this... - class exception - { - public: - exception() throw() { } - virtual ~exception() throw(); - virtual const char* what() const throw(); - }; -} - -// normally objects which are thrown are returned to the interpreter as errors -// (which potentially may have problems if they are not copied) -// therefore all classes based upon std::exception are converted to their strings & returned as errors -%typemap(throws) std::bad_cast "SWIG_exception(SWIG_TypeError, $1.what());" -%typemap(throws) std::bad_exception "SWIG_exception(SWIG_RuntimeError, $1.what());" -%typemap(throws) std::domain_error "SWIG_exception(SWIG_ValueError, $1.what());" -%typemap(throws) std::exception "SWIG_exception(SWIG_SystemError, $1.what());" -%typemap(throws) std::invalid_argument "SWIG_exception(SWIG_ValueError, $1.what());" -%typemap(throws) std::length_error "SWIG_exception(SWIG_IndexError, $1.what());" -%typemap(throws) std::logic_error "SWIG_exception(SWIG_RuntimeError, $1.what());" -%typemap(throws) std::out_of_range "SWIG_exception(SWIG_IndexError, $1.what());" -%typemap(throws) std::overflow_error "SWIG_exception(SWIG_OverflowError, $1.what());" -%typemap(throws) std::range_error "SWIG_exception(SWIG_IndexError, $1.what());" -%typemap(throws) std::runtime_error "SWIG_exception(SWIG_RuntimeError, $1.what());" -%typemap(throws) std::underflow_error "SWIG_exception(SWIG_RuntimeError, $1.what());" diff --git a/mac/bin/swig/share/swig/4.1.0/lua/std_map.i b/mac/bin/swig/share/swig/4.1.0/lua/std_map.i deleted file mode 100755 index 773b6d0c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/std_map.i +++ /dev/null @@ -1,66 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; -} diff --git a/mac/bin/swig/share/swig/4.1.0/lua/std_pair.i b/mac/bin/swig/share/swig/4.1.0/lua/std_pair.i deleted file mode 100755 index 410da922..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/std_pair.i +++ /dev/null @@ -1,26 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * std::pair typemaps for LUA - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - T first; - U second; - }; - - template - pair make_pair(const T& first, const U& second); -} diff --git a/mac/bin/swig/share/swig/4.1.0/lua/std_string.i b/mac/bin/swig/share/swig/4.1.0/lua/std_string.i deleted file mode 100755 index b95a8a4a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/std_string.i +++ /dev/null @@ -1,125 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * std::string typemaps for LUA - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -/* -Only std::string and const std::string& are typemapped -they are converted to the Lua strings automatically - -std::string& and std::string* are not -they must be explicitly managed (see below) - -eg. - -std::string test_value(std::string x) { - return x; -} - -can be used as - -s="hello world" -s2=test_value(s) -assert(s==s2) -*/ - -namespace std { - -%naturalvar string; - -/* -Bug report #1526022: -Lua strings and std::string can contain embedded zero bytes -Therefore a standard out typemap should not be: - lua_pushstring(L,$1.c_str()); -but - lua_pushlstring(L,$1.data(),$1.size()); - -Similarly for getting the string - $1 = (char*)lua_tostring(L, $input); -becomes - $1.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); - -Not using: lua_tolstring() as this is only found in Lua 5.1 & not 5.0.2 -*/ - -%typemap(in,checkfn="lua_isstring") string -%{$1.assign(lua_tostring(L,$input),lua_rawlen(L,$input));%} - -%typemap(out) string -%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_arg++;%} - -%typemap(in,checkfn="lua_isstring") const string& ($*1_ltype temp) -%{temp.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); $1=&temp;%} - -%typemap(out) const string& -%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} - -// for throwing of any kind of string, string ref's and string pointers -// we convert all to lua strings -%typemap(throws) string, string&, const string& -%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_fail;%} - -%typemap(throws) string*, const string* -%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_fail;%} - -%typecheck(SWIG_TYPECHECK_STRING) string, const string& { - $1 = lua_isstring(L,$input); -} - -/* -std::string& can be wrapped, but you must inform SWIG if it is in or out - -eg: -void fn(std::string& str); -Is this an in/out/inout value? - -Therefore you need the usual -%apply (std::string& INOUT) {std::string& str}; -or -%apply std::string& INOUT {std::string& str}; -typemaps to tell SWIG what to do. -*/ - -%typemap(in) string &INPUT=const string &; -%typemap(in, numinputs=0) string &OUTPUT ($*1_ltype temp) -%{ $1 = &temp; %} -%typemap(argout) string &OUTPUT -%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} -%typemap(in) string &INOUT =const string &; -%typemap(argout) string &INOUT = string &OUTPUT; - -/* -A really cut down version of the string class - -This provides basic mapping of lua strings <-> std::string -and little else -(the std::string has a lot of unneeded functions anyway) - -note: no fn's taking the const string& -as this is overloaded by the const char* version -*/ - - class string { - public: - string(); - string(const char*); - unsigned int size() const; - unsigned int length() const; - bool empty() const; - // no support for operator[] - const char* c_str()const; - const char* data()const; - // assign does not return a copy of this object - // (no point in a scripting language) - void assign(const char*); - // no support for all the other features - // it's probably better to do it in lua - }; -} - diff --git a/mac/bin/swig/share/swig/4.1.0/lua/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/lua/std_unique_ptr.i deleted file mode 100755 index ad08f3b0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, checkfn="SWIG_isptrtype", noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(L, $input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $descriptor(TYPE *)); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++; -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/lua/std_vector.i b/mac/bin/swig/share/swig/4.1.0/lua/std_vector.i deleted file mode 100755 index 9eb85e9e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/std_vector.i +++ /dev/null @@ -1,140 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * std::vector typemaps for LUA - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} -%include // the general exceptions -/* -A really cut down version of the vector class. - -Note: this does not match the true std::vector class -but instead is an approximate, so that SWIG knows how to wrapper it. -(Eg, all access is by value, not ref, as SWIG turns refs to pointers) - -And no support for iterators & insert/erase - -It would be useful to have a vector<->Lua table conversion routine - -*/ -namespace std { - - template - class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(unsigned int); - vector(const vector& other); - vector(unsigned int,T); - - unsigned int size() const; - unsigned int max_size() const; - bool empty() const; - void clear(); - void push_back(T val); - void pop_back(); - T front()const; // only read front & back - T back()const; // not write to them - // operator [] given later: - - %extend // this is a extra bit of SWIG code - { - // [] is replaced by __getitem__ & __setitem__ - // simply throws a string, which causes a lua error - T __getitem__(unsigned int idx) throw (std::out_of_range) - { - if (idx>=self->size()) - throw std::out_of_range("in vector::__getitem__()"); - return (*self)[idx]; - } - void __setitem__(unsigned int idx,T val) throw (std::out_of_range) - { - if (idx>=self->size()) - throw std::out_of_range("in vector::__setitem__()"); - (*self)[idx]=val; - } - }; - }; - -} - -/* -Vector<->LuaTable fns -These look a bit like the array<->LuaTable fns -but are templated, not %defined -(you must have template support for STL) - -*/ -/* -%{ -// reads a table into a vector of numbers -// lua numbers will be cast into the type required (rounding may occur) -// return 0 if non numbers found in the table -// returns new'ed ptr if ok -template -std::vector* SWIG_read_number_vector(lua_State* L,int index) -{ - int i=0; - std::vector* vec=new std::vector(); - while(1) - { - lua_rawgeti(L,index,i+1); - if (!lua_isnil(L,-1)) - { - lua_pop(L,1); - break; // finished - } - if (!lua_isnumber(L,-1)) - { - lua_pop(L,1); - delete vec; - return 0; // error - } - vec->push_back((T)lua_tonumber(L,-1)); - lua_pop(L,1); - ++i; - } - return vec; // ok -} -// writes a vector of numbers out as a lua table -template -int SWIG_write_number_vector(lua_State* L,std::vector *vec) -{ - lua_newtable(L); - for(int i=0;isize();++i) - { - lua_pushnumber(L,(double)((*vec)[i])); - lua_rawseti(L,-2,i+1);// -1 is the number, -2 is the table - } -} -%} - -// then the typemaps - -%define SWIG_TYPEMAP_NUM_VECTOR(T) - -// in -%typemap(in) std::vector *INPUT -%{ $1 = SWIG_read_number_vector(L,$input); - if (!$1) SWIG_fail;%} - -%typemap(freearg) std::vector *INPUT -%{ delete $1;%} - -// out -%typemap(argout) std::vector *OUTPUT -%{ SWIG_write_number_vector(L,$1); SWIG_arg++; %} - -%enddef -*/ diff --git a/mac/bin/swig/share/swig/4.1.0/lua/stl.i b/mac/bin/swig/share/swig/4.1.0/lua/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/lua/swigmove.i b/mac/bin/swig/share/swig/4.1.0/lua/swigmove.i deleted file mode 100755 index d130e797..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/swigmove.i +++ /dev/null @@ -1,18 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, checkfn="lua_isuserdata", noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(L, $input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type '$1_type' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $&1_descriptor); - } - } - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/mac/bin/swig/share/swig/4.1.0/lua/typemaps.i b/mac/bin/swig/share/swig/4.1.0/lua/typemaps.i deleted file mode 100755 index 68f6f6cc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/typemaps.i +++ /dev/null @@ -1,554 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.swg - * - * SWIG Library file containing the main typemap code to support Lua modules. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Basic inout typemaps - * ----------------------------------------------------------------------------- */ -/* -These provide the basic ability for passing in & out of standard numeric data types -(int,long,float,double, etc) - -The basic code looks like this: - -%typemap(in,checkfn="lua_isnumber") int *INPUT(int temp), int &INPUT(int temp) -%{ temp = (int)lua_tonumber(L,$input); - $1 = &temp; %} - -%typemap(in, numinputs=0) int *OUTPUT (int temp) -%{ $1 = &temp; %} - -%typemap(argout) int *OUTPUT -%{ lua_pushnumber(L, (double) *$1); SWIG_arg++;%} - -%typemap(in) int *INOUT = int *INPUT; -%typemap(argout) int *INOUT = int *OUTPUT; - -However the code below is a mixture of #defines & such, so nowhere as easy to read - -To make you code work correctly it's not just a matter of %including this file -You also have to give SWIG the hints on which to use where - -eg -extern int add_pointer(int* a1,int* a2); // a1 & a2 are pointer values to be added -extern void swap(int* s1, int* s2); // does the swap - -You will need to either change the argument names -extern int add_pointer(int* INPUT,int* INPUT); - -or provide a %apply statement - -%apply int* INOUT{ int *s1, int *s2 }; - // if SWIG sees int* s1, int* s2, assume they are inout params -*/ - - -%define SWIG_NUMBER_TYPEMAP(TYPE) -%typemap(in,checkfn="lua_isnumber") TYPE *INPUT($*ltype temp), TYPE &INPUT($*ltype temp) -%{ temp = ($*ltype)lua_tonumber(L,$input); - $1 = &temp; %} -%typemap(in, numinputs=0) TYPE *OUTPUT ($*ltype temp) -%{ $1 = &temp; %} -%typemap(argout) TYPE *OUTPUT -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} -%typemap(in) TYPE *INOUT = TYPE *INPUT; -%typemap(argout) TYPE *INOUT = TYPE *OUTPUT; -%typemap(in) TYPE &OUTPUT = TYPE *OUTPUT; -%typemap(argout) TYPE &OUTPUT = TYPE *OUTPUT; -%typemap(in) TYPE &INOUT = TYPE *INPUT; -%typemap(argout) TYPE &INOUT = TYPE *OUTPUT; -// const version (the $*ltype is the basic number without ptr or const's) -%typemap(in,checkfn="lua_isnumber") const TYPE *INPUT($*ltype temp) -%{ temp = ($*ltype)lua_tonumber(L,$input); - $1 = &temp; %} -%enddef - -// now the code -SWIG_NUMBER_TYPEMAP(unsigned char); SWIG_NUMBER_TYPEMAP(signed char); - -SWIG_NUMBER_TYPEMAP(short); SWIG_NUMBER_TYPEMAP(unsigned short); SWIG_NUMBER_TYPEMAP(signed short); -SWIG_NUMBER_TYPEMAP(int); SWIG_NUMBER_TYPEMAP(unsigned int); SWIG_NUMBER_TYPEMAP(signed int); -SWIG_NUMBER_TYPEMAP(long); SWIG_NUMBER_TYPEMAP(unsigned long); SWIG_NUMBER_TYPEMAP(signed long); -SWIG_NUMBER_TYPEMAP(float); -SWIG_NUMBER_TYPEMAP(double); -SWIG_NUMBER_TYPEMAP(enum SWIGTYPE); -// also for long longs's -SWIG_NUMBER_TYPEMAP(long long); SWIG_NUMBER_TYPEMAP(unsigned long long); SWIG_NUMBER_TYPEMAP(signed long long); - -// note we don't do char, as a char* is probably a string not a ptr to a single char - -// similar for booleans -%typemap(in,checkfn="lua_isboolean") bool *INPUT(bool temp), bool &INPUT(bool temp) -%{ temp = (lua_toboolean(L,$input)!=0); - $1 = &temp; %} - -%typemap(in, numinputs=0) bool *OUTPUT (bool temp),bool &OUTPUT (bool temp) -%{ $1 = &temp; %} - -%typemap(argout) bool *OUTPUT,bool &OUTPUT -%{ lua_pushboolean(L, (int)((*$1)!=0)); SWIG_arg++;%} - -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; - -/* ----------------------------------------------------------------------------- - * Basic Array typemaps - * ----------------------------------------------------------------------------- */ -/* -I have no idea why this kind of code does not exist in SWIG as standard, -but here is it. -This code will convert to/from 1D numeric arrays. -In order to reduce code bloat, there are a few macros -and quite a few functions defined -(unfortunately this makes it a lot less clear) - -assuming we have functions -void process_array(int arr[3]); // nice fixed size array -void process_var_array(float arr[],int len); // variable sized array -void process_var_array_inout(double* arr,int len); // variable sized array - // data passed in & out -void process_enum_inout_array_var(enum Days *arrinout, int len); // using enums -void return_array_5(int arrout[5]); // out array only - -in order to wrap them correctly requires a typemap - -// inform SWIG of the correct typemap -// For fixed length, you must specify it as INPUT[ANY] -%apply (int INPUT[ANY]) {(int arr[3])}; -// variable length arrays are just the same -%apply (float INPUT[],int) {(float arr[],int len)}; -// it is also ok, to map the TYPE* instead of a TYPE[] -%apply (double *INOUT,int) {(double arr*,int len)}; -// for the enum's you must use enum SWIGTYPE -%apply (enum SWIGTYPE *INOUT,int) {(enum Days *arrinout, int len)}; -// fixed length out if also fine -%apply (int OUTPUT[ANY]) {(int arrout[5])}; - -Generally, you could use %typemap(...)=... -but the %apply is neater & easier - -a few things of note: -* all Lua tables are indexed from 1, all C/C++ arrays are indexed from 0 - therefore t={6,5,3} -- t[1]==6, t[2]==5, t[3]==3 - when passed to process_array(int arr[3]) becomes - arr[0]==6, arr[1]==5, arr[2]==3 -* for OUTPUT arrays, no array need be passed in, the fn will return a Lua table - so for the above mentioned return_array_5() would look like - arr=return_array_5() -- no parameters passed in -* for INOUT arrays, a table must be passed in, and a new table will be returned - (this is consistent with the way that numbers are processed) - if you want just use - arr={...} - arr=process_var_array_inout(arr) -- arr is replaced by the new version - -The following are not yet supported: -* variable length output only array (inout works ok) -* multidimensional arrays -* arrays of objects/structs -* arrays of pointers - -*/ - -/* -The internals of the array management stuff -helper fns/macros -SWIG_ALLOC_ARRAY(TYPE,LEN) // returns a typed array TYPE[LEN] -SWIG_FREE_ARRAY(PTR) // delete the ptr (if not zero) - -// counts the specified table & gets the size -// integer version -int SWIG_itable_size(lua_State* L, int index); -// other version -int SWIG_table_size(lua_State* L, int index); - -SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE) -// this fn declares up 4 functions for helping to read/write tables -// these can then be called by the macros ... -// all assume the table is an integer indexes from 1 -// but the C array is a indexed from 0 - // created a fixed size array, reads the specified table - // and then fills the array with numbers - // returns ptr to the array if ok, or 0 for error - // (also pushes a error message to the stack) -TYPE* SWIG_get_NAME_num_array_fixed(lua_State* L, int index, int size); - // as per SWIG_get_NAME_num_array_fixed() - // but reads the entire table & creates an array of the correct size - // (if the table is empty, it returns an error rather than a zero length array) -TYPE* SWIG_get_NAME_num_array_var(lua_State* L, int index, int* size); - // writes a table to Lua with all the specified numbers -void SWIG_write_NAME_num_array(lua_State* L,TYPE *array,int size); - // read the specified table, and fills the array with numbers - // returns 1 of ok (only fails if it doesn't find numbers) - // helper fn (called by SWIG_get_NAME_num_array_*() fns) -int SWIG_read_NAME_num_array(lua_State* L,int index,TYPE *array,int size); - -*/ - -%{ -#ifdef __cplusplus /* generic alloc/dealloc fns*/ -#define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN] -#define SWIG_FREE_ARRAY(PTR) delete[] PTR -#else -#define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE)) -#define SWIG_FREE_ARRAY(PTR) free(PTR) -#endif -/* counting the size of arrays:*/ -SWIGINTERN int SWIG_itable_size(lua_State* L, int index) -{ - int n=0; - while(1){ - lua_rawgeti(L,index,n+1); - if (lua_isnil(L,-1))break; - ++n; - lua_pop(L,1); - } - lua_pop(L,1); - return n; -} - -SWIGINTERN int SWIG_table_size(lua_State* L, int index) -{ - int n=0; - lua_pushnil(L); /* first key*/ - while (lua_next(L, index) != 0) { - ++n; - lua_pop(L, 1); /* removes `value'; keeps `key' for next iteration*/ - } - return n; -} - -/* super macro to declare array typemap helper fns */ -#define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\ - SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\ - int i;\ - for (i = 0; i < size; i++) {\ - lua_rawgeti(L,index,i+1);\ - if (lua_isnumber(L,-1)){\ - array[i] = (TYPE)lua_tonumber(L,-1);\ - } else {\ - lua_pop(L,1);\ - return 0;\ - }\ - lua_pop(L,1);\ - }\ - return 1;\ - }\ - SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\ - TYPE *array;\ - if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\ - SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);\ - return 0;\ - }\ - array=SWIG_ALLOC_ARRAY(TYPE,size);\ - if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\ - SWIG_Lua_pusherrstring(L,"table must contain numbers");\ - SWIG_FREE_ARRAY(array);\ - return 0;\ - }\ - return array;\ - }\ - SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\ - {\ - TYPE *array;\ - if (!lua_istable(L,index)) {\ - SWIG_Lua_pusherrstring(L,"expected a table");\ - return 0;\ - }\ - *size=SWIG_itable_size(L,index);\ - if (*size<1){\ - SWIG_Lua_pusherrstring(L,"table appears to be empty");\ - return 0;\ - }\ - array=SWIG_ALLOC_ARRAY(TYPE,*size);\ - if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\ - SWIG_Lua_pusherrstring(L,"table must contain numbers");\ - SWIG_FREE_ARRAY(array);\ - return 0;\ - }\ - return array;\ - }\ - SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\ - int i;\ - lua_newtable(L);\ - for (i = 0; i < size; i++){\ - lua_pushnumber(L,(lua_Number)array[i]);\ - lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \ - }\ - } -%} - -/* -This is one giant macro to define the typemaps & the helpers -for array handling -*/ -%define SWIG_TYPEMAP_NUM_ARR(NAME,TYPE) -%{SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)%} - -// fixed size array's -%typemap(in) TYPE INPUT[ANY] -%{ $1 = SWIG_get_##NAME##_num_array_fixed(L,$input,$1_dim0); - if (!$1) SWIG_fail;%} - -%typemap(freearg) TYPE INPUT[ANY] -%{ SWIG_FREE_ARRAY($1);%} - -// variable size array's -%typemap(in) (TYPE *INPUT,int) -%{ $1 = SWIG_get_##NAME##_num_array_var(L,$input,&$2); - if (!$1) SWIG_fail;%} - -%typemap(freearg) (TYPE *INPUT,int) -%{ SWIG_FREE_ARRAY($1);%} - -// out fixed arrays -%typemap(in,numinputs=0) TYPE OUTPUT[ANY] -%{ $1 = SWIG_ALLOC_ARRAY(TYPE,$1_dim0); %} - -%typemap(argout) TYPE OUTPUT[ANY] -%{ SWIG_write_##NAME##_num_array(L,$1,$1_dim0); SWIG_arg++; %} - -%typemap(freearg) TYPE OUTPUT[ANY] -%{ SWIG_FREE_ARRAY($1); %} - -// inout fixed arrays -%typemap(in) TYPE INOUT[ANY]=TYPE INPUT[ANY]; -%typemap(argout) TYPE INOUT[ANY]=TYPE OUTPUT[ANY]; -%typemap(freearg) TYPE INOUT[ANY]=TYPE INPUT[ANY]; -// inout variable arrays -%typemap(in) (TYPE *INOUT,int)=(TYPE *INPUT,int); -%typemap(argout) (TYPE *INOUT,int) -%{ SWIG_write_##NAME##_num_array(L,$1,$2); SWIG_arg++; %} -%typemap(freearg) (TYPE *INOUT,int)=(TYPE *INPUT,int); - -// TODO out variable arrays (is there a standard form for such things?) - -// referencing so that (int *INPUT,int) and (int INPUT[],int) are the same -%typemap(in) (TYPE INPUT[],int)=(TYPE *INPUT,int); -%typemap(freearg) (TYPE INPUT[],int)=(TYPE *INPUT,int); - -%enddef - -// the following line of code -// declares the C helper fns for the array typemaps -// as well as defining typemaps for -// fixed len arrays in & out, & variable length arrays in - -SWIG_TYPEMAP_NUM_ARR(schar,signed char); -SWIG_TYPEMAP_NUM_ARR(uchar,unsigned char); -SWIG_TYPEMAP_NUM_ARR(int,int); -SWIG_TYPEMAP_NUM_ARR(uint,unsigned int); -SWIG_TYPEMAP_NUM_ARR(short,short); -SWIG_TYPEMAP_NUM_ARR(ushort,unsigned short); -SWIG_TYPEMAP_NUM_ARR(long,long); -SWIG_TYPEMAP_NUM_ARR(ulong,unsigned long); -SWIG_TYPEMAP_NUM_ARR(float,float); -SWIG_TYPEMAP_NUM_ARR(double,double); - -// again enums are a problem so they need their own type -// we use the int conversion routine & recast it -%typemap(in) enum SWIGTYPE INPUT[ANY] -%{ $1 = ($ltype)SWIG_get_int_num_array_fixed(L,$input,$1_dim0); - if (!$1) SWIG_fail;%} - -%typemap(freearg) enum SWIGTYPE INPUT[ANY] -%{ SWIG_FREE_ARRAY($1);%} - -// variable size arrays -%typemap(in) (enum SWIGTYPE *INPUT,int) -%{ $1 = ($ltype)SWIG_get_int_num_array_var(L,$input,&$2); - if (!$1) SWIG_fail;%} - -%typemap(freearg) (enum SWIGTYPE *INPUT,int) -%{ SWIG_FREE_ARRAY($1);%} - -// out fixed arrays -%typemap(in,numinputs=0) enum SWIGTYPE OUTPUT[ANY] -%{ $1 = SWIG_ALLOC_ARRAY(enum SWIGTYPE,$1_dim0); %} - -%typemap(argout) enum SWIGTYPE OUTPUT[ANY] -%{ SWIG_write_int_num_array(L,(int*)$1,$1_dim0); SWIG_arg++; %} - -%typemap(freearg) enum SWIGTYPE OUTPUT[ANY] -%{ SWIG_FREE_ARRAY($1); %} - -// inout fixed arrays -%typemap(in) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; -%typemap(argout) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE OUTPUT[ANY]; -%typemap(freearg) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; -// inout variable arrays -%typemap(in) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); -%typemap(argout) (enum SWIGTYPE *INOUT,int) -%{ SWIG_write_int_num_array(L,(int*)$1,$2); SWIG_arg++; %} -%typemap(freearg) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); - - -/* Surprisingly pointer arrays are easier: -this is because all ptr arrays become void** -so only a few fns are needed & a few casts - -The function defined are - // created a fixed size array, reads the specified table - // and then fills the array with pointers (checking the type) - // returns ptr to the array if ok, or 0 for error - // (also pushes a error message to the stack) -void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type); - // as per SWIG_get_ptr_array_fixed() - // but reads the entire table & creates an array of the correct size - // (if the table is empty, it returns an error rather than a zero length array) -void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type); - // writes a table to Lua with all the specified pointers - // all pointers have the ownership value 'own' (normally 0) -void SWIG_write_ptr_array(lua_State* L,void **array,int size,int own); - // read the specified table, and fills the array with ptrs - // returns 1 of ok (only fails if it doesn't find correct type of ptrs) - // helper fn (called by SWIG_get_ptr_array_*() fns) -int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type); - -The key thing to remember is that it is assumed that there is no -modification of pointers ownership in the arrays - -eg A fn: -void pointers_in(TYPE* arr[],int len); -will make copies of the pointer into a temp array and then pass it into the fn -Lua does not remember that this fn held the pointers, so it is not safe to keep -these pointers until later - -eg A fn: -void pointers_out(TYPE* arr[3]); -will return a table containing three pointers -however these pointers are NOT owned by Lua, merely borrowed -so if the C/C++ frees then Lua is not aware - -*/ - -%{ -SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){ - int i; - for (i = 0; i < size; i++) { - lua_rawgeti(L,index,i+1); - if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){ - lua_pop(L,1); - return 0; - } - lua_pop(L,1); - } - return 1; -} -SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){ - void **array; - if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) { - SWIG_Lua_pushferrstring(L,"expected a table of size %d",size); - return 0; - } - array=SWIG_ALLOC_ARRAY(void*,size); - if (!SWIG_read_ptr_array(L,index,array,size,type)){ - SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name); - SWIG_FREE_ARRAY(array); - return 0; - } - return array; -} -SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){ - void **array; - if (!lua_istable(L,index)) { - SWIG_Lua_pusherrstring(L,"expected a table"); - return 0; - } - *size=SWIG_itable_size(L,index); - if (*size<1){ - SWIG_Lua_pusherrstring(L,"table appears to be empty"); - return 0; - } - array=SWIG_ALLOC_ARRAY(void*,*size); - if (!SWIG_read_ptr_array(L,index,array,*size,type)){ - SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name); - SWIG_FREE_ARRAY(array); - return 0; - } - return array; -} -SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){ - int i; - lua_newtable(L); - for (i = 0; i < size; i++){ - SWIG_NewPointerObj(L,array[i],type,own); - lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ - } -} -%} - -// fixed size array's -%typemap(in) SWIGTYPE* INPUT[ANY] -%{ $1 = ($ltype)SWIG_get_ptr_array_fixed(L,$input,$1_dim0,$*1_descriptor); - if (!$1) SWIG_fail;%} - -%typemap(freearg) SWIGTYPE* INPUT[ANY] -%{ SWIG_FREE_ARRAY($1);%} - -// variable size array's -%typemap(in) (SWIGTYPE **INPUT,int) -%{ $1 = ($ltype)SWIG_get_ptr_array_var(L,$input,&$2,$*1_descriptor); - if (!$1) SWIG_fail;%} - -%typemap(freearg) (SWIGTYPE **INPUT,int) -%{ SWIG_FREE_ARRAY($1);%} - -// out fixed arrays -%typemap(in,numinputs=0) SWIGTYPE* OUTPUT[ANY] -%{ $1 = SWIG_ALLOC_ARRAY($*1_type,$1_dim0); %} - -%typemap(argout) SWIGTYPE* OUTPUT[ANY] -%{ SWIG_write_ptr_array(L,(void**)$1,$1_dim0,$*1_descriptor,0); SWIG_arg++; %} - -%typemap(freearg) SWIGTYPE* OUTPUT[ANY] -%{ SWIG_FREE_ARRAY($1); %} - -// inout fixed arrays -%typemap(in) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; -%typemap(argout) SWIGTYPE* INOUT[ANY]=SWIGTYPE* OUTPUT[ANY]; -%typemap(freearg) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; -// inout variable arrays -%typemap(in) (SWIGTYPE** INOUT,int)=(SWIGTYPE** INPUT,int); -%typemap(argout) (SWIGTYPE** INOUT,int) -%{ SWIG_write_ptr_array(L,(void**)$1,$2,$*1_descriptor,0); SWIG_arg++; %} -%typemap(freearg) (SWIGTYPE**INOUT,int)=(SWIGTYPE**INPUT,int); - -/* ----------------------------------------------------------------------------- - * Pointer-Pointer typemaps - * ----------------------------------------------------------------------------- */ -/* -This code is to deal with the issue for pointer-pointer's -In particular for factory methods. - -for example take the following code segment: - -struct iMath; // some structure -int Create_Math(iMath** pptr); // its factory (assume it mallocs) - -to use it you might have the following C code: - -iMath* ptr; -int ok; -ok=Create_Math(&ptr); -// do things with ptr -//... -free(ptr); - -With the following SWIG code -%apply SWIGTYPE** OUTPUT{iMath **pptr }; - -You can get natural wrapping in Lua as follows: -ok,ptr=Create_Math() -- ptr is a iMath* which is returned with the int -ptr=nil -- the iMath* will be GC'ed as normal -*/ - -%typemap(in,numinputs=0) SWIGTYPE** OUTPUT ($*ltype temp) -%{ temp = ($*ltype)0; - $1 = &temp; %} -%typemap(argout) SWIGTYPE** OUTPUT -%{SWIG_NewPointerObj(L,*$1,$*descriptor,1); SWIG_arg++; %} - diff --git a/mac/bin/swig/share/swig/4.1.0/lua/wchar.i b/mac/bin/swig/share/swig/4.1.0/lua/wchar.i deleted file mode 100755 index 9f3be6fc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/lua/wchar.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wchar.i - * - * Typemaps for the wchar_t type - * These are mapped to a Lua string and are passed around by value. - * ----------------------------------------------------------------------------- */ - -// note: only support for pointer right now, not fixed length strings -// TODO: determine how long a const wchar_t* is so we can write wstr2str() -// & do the output typemap - -%{ -#include - -wchar_t* str2wstr(const char *str, int len) -{ - wchar_t* p; - if (str==0 || len<1) return 0; - p=(wchar_t *)malloc((len+1)*sizeof(wchar_t)); - if (p==0) return 0; - if (mbstowcs(p, str, len)==(size_t)-1) - { - free(p); - return 0; - } - p[len]=0; - return p; -} -%} - -%typemap(in, checkfn="SWIG_lua_isnilstring", fragment="SWIG_lua_isnilstring") wchar_t * -%{ -$1 = str2wstr(lua_tostring( L, $input ),lua_rawlen( L, $input )); -if ($1==0) {SWIG_Lua_pushferrstring(L,"Error in converting to wchar (arg %d)",$input);goto fail;} -%} - -%typemap(freearg) wchar_t * -%{ -free($1); -%} - -%typemap(typecheck) wchar_t * = char *; diff --git a/mac/bin/swig/share/swig/4.1.0/math.i b/mac/bin/swig/share/swig/4.1.0/math.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/Makefile b/mac/bin/swig/share/swig/4.1.0/mzscheme/Makefile deleted file mode 100755 index fba7fd5d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/Makefile +++ /dev/null @@ -1,3 +0,0 @@ - -co: - co RCS/*.i* RCS/*.swg* diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/mzrun.swg b/mac/bin/swig/share/swig/4.1.0/mzscheme/mzrun.swg deleted file mode 100755 index 57d04081..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/mzrun.swg +++ /dev/null @@ -1,521 +0,0 @@ -/* ----------------------------------------------------------------------------- - * mzrun.swg - * ----------------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Common SWIG API */ - -#define SWIG_ConvertPtr(s, result, type, flags) \ - SWIG_MzScheme_ConvertPtr(s, result, type, flags) -#define SWIG_NewPointerObj(ptr, type, owner) \ - SWIG_MzScheme_NewPointerObj((void *)ptr, type, owner) -#define SWIG_MustGetPtr(s, type, argnum, flags) \ - SWIG_MzScheme_MustGetPtr(s, type, argnum, flags, FUNC_NAME, argc, argv) - -#define SWIG_contract_assert(expr,msg) \ - do { \ - if (!(expr)) { \ - char *m=(char *) scheme_malloc(strlen(msg)+1000); \ - sprintf(m,"SWIG contract, assertion failed: function=%s, message=%s", \ - (char *) FUNC_NAME,(char *) msg); \ - scheme_signal_error(m); \ - } \ - } while (0) - -/* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_MzScheme_GetModule((Scheme_Env *)(clientdata)) -#define SWIG_SetModule(clientdata, pointer) SWIG_MzScheme_SetModule((Scheme_Env *) (clientdata), pointer) -#define SWIG_MODULE_CLIENTDATA_TYPE Scheme_Env * - -/* MzScheme-specific SWIG API */ - -#define SWIG_malloc(size) SWIG_MzScheme_Malloc(size, FUNC_NAME) -#define SWIG_free(mem) free(mem) -#define SWIG_NewStructFromPtr(ptr,type) \ - _swig_convert_struct_##type##(ptr) - -#define MAXVALUES 6 -#define swig_make_boolean(b) (b ? scheme_true : scheme_false) - -static long -SWIG_convert_integer(Scheme_Object *o, - long lower_bound, long upper_bound, - const char *func_name, int argnum, int argc, - Scheme_Object **argv) -{ - long value; - int status = scheme_get_int_val(o, &value); - if (!status) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - if (value < lower_bound || value > upper_bound) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - return value; -} - -static int -SWIG_is_integer(Scheme_Object *o) -{ - long value; - return scheme_get_int_val(o, &value); -} - -static unsigned long -SWIG_convert_unsigned_integer(Scheme_Object *o, - unsigned long lower_bound, unsigned long upper_bound, - const char *func_name, int argnum, int argc, - Scheme_Object **argv) -{ - unsigned long value; - int status = scheme_get_unsigned_int_val(o, &value); - if (!status) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - if (value < lower_bound || value > upper_bound) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - return value; -} - -static int -SWIG_is_unsigned_integer(Scheme_Object *o) -{ - unsigned long value; - return scheme_get_unsigned_int_val(o, &value); -} - -/* ----------------------------------------------------------------------- - * mzscheme 30X support code - * ----------------------------------------------------------------------- */ - -#ifndef SCHEME_STR_VAL -#define MZSCHEME30X 1 -#endif - -#ifdef MZSCHEME30X -/* - * This is MZSCHEME 299.100 or higher (30x). From version 299.100 of - * mzscheme upwards, strings are in unicode. These functions convert - * to and from utf8 encodings of these strings. NB! strlen(s) will be - * the size in bytes of the string, not the actual length. - */ -#define SCHEME_STR_VAL(obj) SCHEME_BYTE_STR_VAL(scheme_char_string_to_byte_string(obj)) -#define SCHEME_STRLEN_VAL(obj) SCHEME_BYTE_STRLEN_VAL(scheme_char_string_to_byte_string(obj)) -#define SCHEME_STRINGP(obj) SCHEME_CHAR_STRINGP(obj) -#define scheme_make_string(s) scheme_make_utf8_string(s) -#define scheme_make_sized_string(s,l) scheme_make_sized_utf8_string(s,l) -#define scheme_make_sized_offset_string(s,d,l) \ - scheme_make_sized_offset_utf8_string(s,d,l) -#define SCHEME_MAKE_STRING(s) scheme_make_utf8_string(s) -#else -#define SCHEME_MAKE_STRING(s) scheme_make_string_without_copying(s) -#endif -/* ----------------------------------------------------------------------- - * End of mzscheme 30X support code - * ----------------------------------------------------------------------- */ - -struct swig_mz_proxy { - Scheme_Type mztype; - swig_type_info *type; - void *object; - int own; -}; - -static Scheme_Type swig_type; - -static void -mz_free_swig(void *p, void *data) { - struct swig_mz_proxy *proxy = (struct swig_mz_proxy *) p; - if (SCHEME_NULLP((Scheme_Object*)p) || SCHEME_TYPE((Scheme_Object*)p) != swig_type) - return; - if (proxy->type) { - if (proxy->type->clientdata && proxy->own) { - ((Scheme_Prim *)proxy->type->clientdata)(1, (Scheme_Object **)&proxy); - } - } -} - -static Scheme_Object * -SWIG_MzScheme_NewPointerObj(void *ptr, swig_type_info *type, int owner) { - if (ptr) { - struct swig_mz_proxy *new_proxy; - new_proxy = (struct swig_mz_proxy *) scheme_malloc(sizeof(struct swig_mz_proxy)); - new_proxy->mztype = swig_type; - new_proxy->type = type; - new_proxy->object = ptr; - new_proxy->own = owner & SWIG_POINTER_OWN; - if (new_proxy->own) { - scheme_add_finalizer(new_proxy, mz_free_swig, NULL); - } - return (Scheme_Object *) new_proxy; - } else { - return scheme_make_null(); - } -} - -static int -SWIG_MzScheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, int flags) { - swig_cast_info *cast; - int ret = SWIG_ERROR; - - if (SCHEME_NULLP(s)) { - *result = NULL; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } else if (SCHEME_TYPE(s) == swig_type) { - struct swig_mz_proxy *proxy = (struct swig_mz_proxy *) s; - - if ((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE && !proxy->own) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - - if (type) { - cast = SWIG_TypeCheckStruct(proxy->type, type); - if (cast) { - int newmemory = 0; - *result = SWIG_TypeCast(cast, proxy->object, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - ret = SWIG_OK; - } else { - return SWIG_ERROR; - } - } else { - *result = proxy->object; - ret = SWIG_OK; - } - - if (flags & SWIG_POINTER_DISOWN) { - scheme_subtract_finalizer(proxy, mz_free_swig, NULL); - proxy->own = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - proxy->object = 0; - } - } - return ret; -} - -static SWIGINLINE void * -SWIG_MzScheme_MustGetPtr(Scheme_Object *s, swig_type_info *type, - int argnum, int flags, const char *func_name, - int argc, Scheme_Object **argv) { - void *result; - if (SWIG_MzScheme_ConvertPtr(s, &result, type, flags)) { - scheme_wrong_type(func_name, type->str ? type->str : "void *", argnum - 1, argc, argv); - } - return result; -} - -static SWIGINLINE void * -SWIG_MzScheme_Malloc(size_t size, const char *func_name) { - void *p = malloc(size); - if (p == NULL) { - scheme_signal_error("swig-memory-error"); - } else return p; -} - -static Scheme_Object * -SWIG_MzScheme_PackageValues(int num, Scheme_Object **values) { - /* ignore first value if void */ - if (num > 0 && SCHEME_VOIDP(values[0])) - num--, values++; - if (num == 0) return scheme_void; - else if (num == 1) return values[0]; - else return scheme_values(num, values); -} - -#ifndef scheme_make_inspector -#define scheme_make_inspector(x,y) \ - _scheme_apply(scheme_builtin_value("make-inspector"), x, y) -#endif - -/* Function to create a new struct. */ -static Scheme_Object * -SWIG_MzScheme_new_scheme_struct (Scheme_Env* env, const char* basename, - int num_fields, char** field_names) -{ - Scheme_Object *new_type; - int count_out, i; - Scheme_Object **struct_names; - Scheme_Object **vals; - Scheme_Object **a = (Scheme_Object**) \ - scheme_malloc(num_fields*sizeof(Scheme_Object*)); - - for (i=0; i -#else -#include -#endif - - static char **mz_dlopen_libraries=NULL; - static void **mz_libraries=NULL; - static char **mz_dynload_libpaths=NULL; - - static void mz_set_dlopen_libraries(const char *_libs) - { - int i,k,n; - int mz_dynload_debug=(1==0); - char *extra_paths[1000]; - char *EP; - - { - char *dbg=getenv("MZ_DYNLOAD_DEBUG"); - if (dbg!=NULL) { - mz_dynload_debug=atoi(dbg); - } - } - - { - char *ep=getenv("MZ_DYNLOAD_LIBPATH"); - int i,k,j; - k=0; - if (ep!=NULL) { - EP=strdup(ep); - for(i=0,j=0;EP[i]!='\0';i++) { - if (EP[i]==':') { - EP[i]='\0'; - extra_paths[k++]=&EP[j]; - j=i+1; - } - } - if (j!=i) { - extra_paths[k++]=&EP[j]; - } - } - else { - EP=strdup(""); - } - extra_paths[k]=NULL; - k+=1; - - if (mz_dynload_debug) { - fprintf(stderr,"SWIG:mzscheme:MZ_DYNLOAD_LIBPATH=%s\n",(ep==NULL) ? "(null)" : ep); - fprintf(stderr,"SWIG:mzscheme:extra_paths[%d]\n",k-1); - for(i=0;i %p\n",libp,mz_libraries[i]); - } - free(libp); - } - } - } - } - { - int i; - void *func=NULL; - - for(i=0;mz_dlopen_libraries[i]!=NULL && func==NULL;i++) { - if (mz_libraries[i]!=NULL) { -#ifdef __OS_WIN32 - func=GetProcAddress(mz_libraries[i],function); -#else - func=dlsym(mz_libraries[i],function); -#endif - } - if (mz_dynload_debug) { - fprintf(stderr, - "SWIG:mzscheme:library:%s;dlopen=%p,function=%s,func=%p\n", - mz_dlopen_libraries[i],mz_libraries[i],function,func - ); - } - } - - return func; - } - } - } - -/* The interpreter will store a pointer to this structure in a global - variable called swig-runtime-data-type-pointer. The instance of this - struct is only used if no other module has yet been loaded */ -struct swig_mzscheme_runtime_data { - swig_module_info *module_head; - Scheme_Type type; -}; -static struct swig_mzscheme_runtime_data swig_mzscheme_runtime_data; - - -static swig_module_info * -SWIG_MzScheme_GetModule(Scheme_Env *env) { - Scheme_Object *pointer, *symbol; - struct swig_mzscheme_runtime_data *data; - - /* first check if pointer already created */ - symbol = scheme_intern_symbol("swig-runtime-data-type-pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - pointer = scheme_lookup_global(symbol, env); - if (pointer && SCHEME_CPTRP(pointer)) { - data = (struct swig_mzscheme_runtime_data *) SCHEME_CPTR_VAL(pointer); - swig_type = data->type; - return data->module_head; - } else { - return NULL; - } -} - -static void -SWIG_MzScheme_SetModule(Scheme_Env *env, swig_module_info *module) { - Scheme_Object *pointer, *symbol; - struct swig_mzscheme_runtime_data *data; - - /* first check if pointer already created */ - symbol = scheme_intern_symbol("swig-runtime-data-type-pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - pointer = scheme_lookup_global(symbol, env); - if (pointer && SCHEME_CPTRP(pointer)) { - data = (struct swig_mzscheme_runtime_data *) SCHEME_CPTR_VAL(pointer); - swig_type = data->type; - data->module_head = module; - } else { - /* create a new type for wrapped pointer values */ - swig_type = scheme_make_type((char *)"swig"); - swig_mzscheme_runtime_data.module_head = module; - swig_mzscheme_runtime_data.type = swig_type; - - /* create a new pointer */ -#ifndef MZSCHEME30X - pointer = scheme_make_cptr((void *) &swig_mzscheme_runtime_data, "swig_mzscheme_runtime_data"); -#else - pointer = scheme_make_cptr((void *) &swig_mzscheme_runtime_data, - scheme_make_byte_string("swig_mzscheme_runtime_data")); -#endif - scheme_add_global_symbol(symbol, pointer, env); - } -} - -#ifdef __cplusplus -} -#endif - diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/mzscheme.swg b/mac/bin/swig/share/swig/4.1.0/mzscheme/mzscheme.swg deleted file mode 100755 index f45c8725..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/mzscheme.swg +++ /dev/null @@ -1,56 +0,0 @@ -/* ----------------------------------------------------------------------------- - * mzscheme.swg - * - * SWIG Configuration File for MzScheme. - * This file is parsed by SWIG before reading any other interface file. - * ----------------------------------------------------------------------------- */ - -/* Include headers */ -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors -%runtime "mzrun.swg" - -%define SWIG_APPEND_VALUE(value) - values[lenv++] = value -%enddef - -/* Definitions */ -#define SWIG_malloc(size) swig_malloc(size, FUNC_NAME) -#define SWIG_free(mem) free(mem) - -#define SWIG_convert_short(o) \ - SWIG_convert_integer(o, - (1 << (8 * sizeof(short) - 1)), \ - (1 << (8 * sizeof(short) - 1)) - 1, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_int(o) \ - SWIG_convert_integer(o, INT_MIN, INT_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_long(o) \ - SWIG_convert_integer(o, LONG_MIN, LONG_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_unsigned_short(o) \ - SWIG_convert_unsigned_integer(o, 0, \ - (1 << (8 * sizeof(short))) - 1, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_unsigned_int(o) \ - SWIG_convert_unsigned_integer(o, 0, UINT_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_unsigned_long(o) \ - SWIG_convert_unsigned_integer(o, 0, ULONG_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) - -/* Guile compatibility kludges */ -#define SCM_VALIDATE_VECTOR(argnum, value) (void)0 -#define SCM_VALIDATE_LIST(argnum, value) (void)0 - -/* Read in standard typemaps. */ -%include - -%insert(init) "swiginit.swg" - -%init %{ -Scheme_Object *scheme_reload(Scheme_Env *env) { - Scheme_Env *menv = SWIG_MZSCHEME_CREATE_MENV(env); - - SWIG_InitializeModule((void *) env); -%} diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/std_auto_ptr.i deleted file mode 100755 index c61bc8b2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'"); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_common.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/std_common.i deleted file mode 100755 index a83e2731..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_common.i +++ /dev/null @@ -1,23 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; - -%{ -#include - -SWIGINTERNINLINE -std::string swig_scm_to_string(Scheme_Object *x) { - return std::string(SCHEME_STR_VAL(x)); -} - -SWIGINTERNINLINE -Scheme_Object *swig_make_string(const std::string &s) { - return scheme_make_string(s.c_str()); -} -%} diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_deque.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_map.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/std_map.i deleted file mode 100755 index 1d3eec24..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_map.i +++ /dev/null @@ -1,1388 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// -// The aim of all that follows would be to integrate std::map with -// MzScheme as much as possible, namely, to allow the user to pass and -// be returned Scheme association lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::map), f(const std::map&), f(const std::map*): -// the parameter being read-only, either a Scheme alist or a -// previously wrapped std::map can be passed. -// -- f(std::map&), f(std::map*): -// the parameter must be modified; therefore, only a wrapped std::map -// can be passed. -// -- std::map f(): -// the map is returned by copy; therefore, a Scheme alist -// is returned which is most easily used in other Scheme functions -// -- std::map& f(), std::map* f(), const std::map& f(), -// const std::map* f(): -// the map is returned by reference; therefore, a wrapped std::map -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[*k] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[*k] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - K* key = new K(i->first); - T* val = new T(i->second); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - /* native sequence? */ - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - K* k; - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - /* native sequence? */ - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - K* k; - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, const T& x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - - - // specializations for built-ins - - %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) - - template class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[CONVERT_FROM(key)] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[CONVERT_FROM(key)] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - T* val = new T(i->second); - Scheme_Object* k = CONVERT_TO(i->first); - Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, const T& x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - Scheme_Object* k = CONVERT_TO(i->first); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) - template class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[*k] = CONVERT_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[*k] = CONVERT_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - Scheme_Object* x = CONVERT_TO(i->second); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - K* k; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - K* k; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, T x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, - T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) - template<> class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[CONVERT_K_FROM(key)] = - CONVERT_T_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - Scheme_Object* k = CONVERT_K_TO(i->first); - Scheme_Object* x = CONVERT_T_TO(i->second); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, T x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - Scheme_Object* k = CONVERT_K_TO(i->first); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - - specialize_std_map_on_key(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_key(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_key(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_key(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_map_on_value(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_value(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_value(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_value(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); -} diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_pair.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/std_pair.i deleted file mode 100755 index 75f6751c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_pair.i +++ /dev/null @@ -1,874 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - - -// ------------------------------------------------------------------------ -// std::pair -// -// See std_vector.i for the rationale of typemap application -// ------------------------------------------------------------------------ - -%{ -#include -%} - -// exported class - -namespace std { - - template struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(*x,*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = std::make_pair(*x,*y); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - T* x = new T($1.first); - U* y = new U($1.second); - Scheme_Object* first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - Scheme_Object* second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scheme_make_pair(first,second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // specializations for built-ins - - %define specialize_std_pair_on_first(T,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(CONVERT_FROM(first),*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = std::make_pair(CONVERT_FROM(first),*y); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - U* y = new U($1.second); - Scheme_Object* second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scheme_make_pair(CONVERT_TO($1.first),second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_second(U,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = std::make_pair(*x,CONVERT_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = std::make_pair(*x,CONVERT_FROM(second)); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - T* x = new T($1.first); - Scheme_Object* first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - $result = scheme_make_pair(first,CONVERT_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_both(T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO, - U,CHECK_U,CONVERT_U_FROM,CONVERT_U_TO) - template<> struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = make_pair(CONVERT_T_FROM(first), - CONVERT_U_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - Scheme_Object *first, *second; - T *x; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = make_pair(CONVERT_T_FROM(first), - CONVERT_U_FROM(second)); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - $result = scheme_make_pair(CONVERT_T_TO($1.first), - CONVERT_U_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - - specialize_std_pair_on_first(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_first(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_first(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_first(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_pair_on_second(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_second(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_second(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_second(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); -} diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_string.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/std_string.i deleted file mode 100755 index 70673ead..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_string.i +++ /dev/null @@ -1,64 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string types - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - /* Overloading check */ - - %typemap(typecheck) string = char *; - %typemap(typecheck) const string & = char *; - - %typemap(in) string { - if (SCHEME_STRINGP($input)) - $1.assign(SCHEME_STR_VAL($input)); - else - SWIG_exception(SWIG_TypeError, "string expected"); - } - - %typemap(in) const string & ($*1_ltype temp) { - if (SCHEME_STRINGP($input)) { - temp.assign(SCHEME_STR_VAL($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(out) string { - $result = scheme_make_string($1.c_str()); - } - - %typemap(out) const string & { - $result = scheme_make_string($1->c_str()); - } - - %typemap(throws) string { - scheme_signal_error("%s: %s", FUNC_NAME, $1.c_str()); - } - - %typemap(throws) const string & { - scheme_signal_error("%s: %s", FUNC_NAME, $1.c_str()); - } -} - - diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/std_unique_ptr.i deleted file mode 100755 index 53cf4669..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'"); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_vector.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/std_vector.i deleted file mode 100755 index 0ef5edb1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/std_vector.i +++ /dev/null @@ -1,451 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// MzScheme as much as possible, namely, to allow the user to pass and -// be returned MzScheme vectors or lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a MzScheme sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a MzScheme vector of T:s -// is returned which is most easily used in other MzScheme functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - $1 = std::vector(size); - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i(); - } else if (SCHEME_PAIRP($input)) { - Scheme_Object *head, *tail; - $1 = std::vector(); - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - $1.push_back(*((T*)SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const vector& (std::vector temp), - const vector* (std::vector temp) { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - temp = std::vector(size); - $1 = &temp; - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::vector(); - $1 = &temp; - Scheme_Object *head, *tail; - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - temp.push_back(*((T*) SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) vector { - $result = scheme_make_vector($1.size(),scheme_undefined); - Scheme_Object** els = SCHEME_VEC_ELS($result); - for (unsigned int i=0; i<$1.size(); i++) { - T* x = new T((($1_type &)$1)[i]); - els[i] = SWIG_NewPointerObj(x,$descriptor(T *), 1); - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - if (SWIG_ConvertPtr(items[0],(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - if (SWIG_ConvertPtr(items[0],(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T& ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - $1 = std::vector(size); - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i", - $argnum - 1, argc, argv); - } - } else if (SCHEME_NULLP($input)) { - $1 = std::vector(); - } else if (SCHEME_PAIRP($input)) { - Scheme_Object *head, *tail; - $1 = std::vector(); - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - if (CHECK(head)) - $1.push_back((T)(CONVERT_FROM(head))); - else - scheme_wrong_type(FUNC_NAME, "vector<" #T ">", - $argnum - 1, argc, argv); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const vector& (std::vector temp), - const vector* (std::vector temp) { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - temp = std::vector(size); - $1 = &temp; - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i", - $argnum - 1, argc, argv); - } - } else if (SCHEME_NULLP($input)) { - temp = std::vector(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::vector(); - $1 = &temp; - Scheme_Object *head, *tail; - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - if (CHECK(head)) - temp.push_back((T)(CONVERT_FROM(head))); - else - scheme_wrong_type(FUNC_NAME, "vector<" #T ">", - $argnum - 1, argc, argv); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum - 1, 0); - } - } - %typemap(out) vector { - $result = scheme_make_vector($1.size(),scheme_undefined); - Scheme_Object** els = SCHEME_VEC_ELS($result); - for (unsigned int i=0; i<$1.size(); i++) - els[i] = CONVERT_TO((($1_type &)$1)[i]); - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - $1 = CHECK(items[0]) ? 1 : 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) ? 1 : 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - $1 = CHECK(items[0]) ? 1 : 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) ? 1 : 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/swigmove.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/swigmove.i deleted file mode 100755 index bbfcdcb1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/swigmove.i +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type '$1_type'"); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (argp == NULL) scheme_signal_error(FUNC_NAME ": swig-type-error (null reference)"); - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/mac/bin/swig/share/swig/4.1.0/mzscheme/typemaps.i b/mac/bin/swig/share/swig/4.1.0/mzscheme/typemaps.i deleted file mode 100755 index 6c31aea5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/mzscheme/typemaps.i +++ /dev/null @@ -1,399 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * ----------------------------------------------------------------------------- */ - -#define %set_output(obj) $result = obj -#define %set_varoutput(obj) $result = obj -#define %argument_fail(code, type, name, argn) scheme_wrong_type(FUNC_NAME, type, argn, argc, argv) -#define %as_voidptr(ptr) (void*)(ptr) - - -/* The MzScheme module handles all types uniformly via typemaps. Here - are the definitions. */ - -/* Pointers */ - -%typemap(in) SWIGTYPE * { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} - -%typemap(in) void * { - $1 = SWIG_MustGetPtr($input, NULL, $argnum, 0); -} - -%typemap(varin) SWIGTYPE * { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, 1, 0); -} - -%typemap(varin) SWIGTYPE & { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE && { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE [ANY] { - void *temp; - int ii; - $1_basetype *b = 0; - temp = SWIG_MustGetPtr($input, $1_descriptor, 1, 0); - b = ($1_basetype *) $1; - for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii); -} - - -%typemap(varin) void * { - $1 = SWIG_MustGetPtr($input, NULL, 1, 0); -} - -%typemap(out) SWIGTYPE * { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE *DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj ($1, ty, $owner); -} - -%typemap(varout) SWIGTYPE *, SWIGTYPE [] { - $result = SWIG_NewPointerObj ($1, $descriptor, 0); -} - -%typemap(varout) SWIGTYPE & { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -%typemap(varout) SWIGTYPE && { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -/* C++ References */ - -#ifdef __cplusplus - -%typemap(in) SWIGTYPE & { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0); - if ($1 == NULL) scheme_signal_error(FUNC_NAME ": swig-type-error (null reference)"); -} - -%typemap(in, noblock=1, fragment="") SWIGTYPE && (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) { - res = SWIG_ConvertPtr($input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type '$1_type'"); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (argp == NULL) scheme_signal_error(FUNC_NAME ": swig-type-error (null reference)"); - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -} - -%typemap(out) SWIGTYPE &, SWIGTYPE && { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj ($1, ty, $owner); -} - -#endif - -/* Arrays */ - -%typemap(in) SWIGTYPE[] { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} - -%typemap(out) SWIGTYPE[] { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -/* Enums */ -%typemap(in) enum SWIGTYPE { - if (!SWIG_is_integer($input)) - scheme_wrong_type(FUNC_NAME, "integer", $argnum - 1, argc, argv); - $1 = ($1_type) SWIG_convert_int($input); -} - -%typemap(varin) enum SWIGTYPE { - if (!SWIG_is_integer($input)) - scheme_wrong_type(FUNC_NAME, "integer", 0, argc, argv); - $1 = ($1_type) SWIG_convert_int($input); -} - -%typemap(out) enum SWIGTYPE "$result = scheme_make_integer_value($1);" -%typemap(varout) enum SWIGTYPE "$result = scheme_make_integer_value($1);" - - -/* Pass-by-value */ - -%typemap(in) SWIGTYPE($&1_ltype argp) { - argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0); - $1 = *argp; -} - -%typemap(varin) SWIGTYPE { - $&1_ltype argp; - argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, 1, 0); - $1 = *argp; -} - - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype($1); - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 1); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1); -} -#endif - -%typemap(varout) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype($1); - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 0); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0); -} -#endif - -/* The SIMPLE_MAP macro below defines the whole set of typemaps needed - for simple types. */ - -%define SIMPLE_MAP(C_NAME, MZ_PREDICATE, MZ_TO_C, C_TO_MZ, MZ_NAME) -%typemap(in) C_NAME { - if (!MZ_PREDICATE($input)) - scheme_wrong_type(FUNC_NAME, #MZ_NAME, $argnum - 1, argc, argv); - $1 = MZ_TO_C($input); -} -%typemap(varin) C_NAME { - if (!MZ_PREDICATE($input)) - scheme_wrong_type(FUNC_NAME, #MZ_NAME, 0, argc, argv); - $1 = MZ_TO_C($input); -} -%typemap(out) C_NAME { - $result = C_TO_MZ($1); -} -%typemap(varout) C_NAME { - $result = C_TO_MZ($1); -} -%typemap(in) C_NAME *INPUT (C_NAME temp) { - temp = (C_NAME) MZ_TO_C($input); - $1 = &temp; -} -%typemap(in,numinputs=0) C_NAME *OUTPUT (C_NAME temp) { - $1 = &temp; -} -%typemap(argout) C_NAME *OUTPUT { - Scheme_Object *s; - s = C_TO_MZ(*$1); - SWIG_APPEND_VALUE(s); -} -%typemap(in) C_NAME *BOTH = C_NAME *INPUT; -%typemap(argout) C_NAME *BOTH = C_NAME *OUTPUT; -%typemap(in) C_NAME *INOUT = C_NAME *INPUT; -%typemap(argout) C_NAME *INOUT = C_NAME *OUTPUT; -%enddef - -SIMPLE_MAP(bool, SCHEME_BOOLP, SCHEME_TRUEP, - swig_make_boolean, boolean); -SIMPLE_MAP(char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -SIMPLE_MAP(unsigned char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -SIMPLE_MAP(int, SWIG_is_integer, SWIG_convert_int, - scheme_make_integer_value, integer); -SIMPLE_MAP(short, SWIG_is_integer, SWIG_convert_short, - scheme_make_integer_value, integer); -SIMPLE_MAP(long, SWIG_is_integer, SWIG_convert_long, - scheme_make_integer_value, integer); -SIMPLE_MAP(ptrdiff_t, SWIG_is_integer, SWIG_convert_long, - scheme_make_integer_value, integer); -SIMPLE_MAP(unsigned int, SWIG_is_unsigned_integer, SWIG_convert_unsigned_int, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(unsigned short, SWIG_is_unsigned_integer, SWIG_convert_unsigned_short, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(unsigned long, SWIG_is_unsigned_integer, SWIG_convert_unsigned_long, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(size_t, SWIG_is_unsigned_integer, SWIG_convert_unsigned_long, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(float, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); -SIMPLE_MAP(double, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); - -SIMPLE_MAP(char *, SCHEME_STRINGP, SCHEME_STR_VAL, - SCHEME_MAKE_STRING, string); -SIMPLE_MAP(const char *, SCHEME_STRINGP, SCHEME_STR_VAL, - SCHEME_MAKE_STRING, string); - -/* For MzScheme 30x: Use these typemaps if you are not going to use - UTF8 encodings in your C code. - SIMPLE_MAP(char *,SCHEME_BYTE_STRINGP, SCHEME_BYTE_STR_VAL, - scheme_make_byte_string_without_copying,bytestring); - SIMPLE_MAP(const char *,SCHEME_BYTE_STRINGP, SCHEME_BYTE_STR_VAL, - scheme_make_byte_string_without_copying,bytestring); -*/ - -/* Const primitive references. Passed by value */ - -%define REF_MAP(C_NAME, MZ_PREDICATE, MZ_TO_C, C_TO_MZ, MZ_NAME) - %typemap(in) const C_NAME & (C_NAME temp) { - if (!MZ_PREDICATE($input)) - scheme_wrong_type(FUNC_NAME, #MZ_NAME, $argnum - 1, argc, argv); - temp = MZ_TO_C($input); - $1 = &temp; - } - %typemap(out) const C_NAME & { - $result = C_TO_MZ(*$1); - } -%enddef - -REF_MAP(bool, SCHEME_BOOLP, SCHEME_TRUEP, - swig_make_boolean, boolean); -REF_MAP(char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -REF_MAP(unsigned char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -REF_MAP(int, SWIG_is_integer, SWIG_convert_int, - scheme_make_integer_value, integer); -REF_MAP(short, SWIG_is_integer, SWIG_convert_short, - scheme_make_integer_value, integer); -REF_MAP(long, SWIG_is_integer, SWIG_convert_long, - scheme_make_integer_value, integer); -REF_MAP(unsigned int, SWIG_is_unsigned_integer, SWIG_convert_unsigned_int, - scheme_make_integer_value_from_unsigned, integer); -REF_MAP(unsigned short, SWIG_is_unsigned_integer, SWIG_convert_unsigned_short, - scheme_make_integer_value_from_unsigned, integer); -REF_MAP(unsigned long, SWIG_is_unsigned_integer, SWIG_convert_unsigned_long, - scheme_make_integer_value_from_unsigned, integer); -REF_MAP(float, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); -REF_MAP(double, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); - -%typemap(throws) char * { - scheme_signal_error("%s: %s", FUNC_NAME, $1); -} - -/* Void */ - -%typemap(out) void "$result = scheme_void;" - -/* Pass through Scheme_Object * */ - -%typemap (in) Scheme_Object * "$1=$input;" -%typemap (out) Scheme_Object * "$result=$1;" -%typecheck(SWIG_TYPECHECK_POINTER) Scheme_Object * "$1=1;"; - - -/* ------------------------------------------------------------ - * String & length - * ------------------------------------------------------------ */ - -//%typemap(in) (char *STRING, int LENGTH) { -// int temp; -// $1 = ($1_ltype) SWIG_Guile_scm2newstr($input, &temp); -// $2 = ($2_ltype) temp; -//} - -/* ------------------------------------------------------------ - * Typechecking rules - * ------------------------------------------------------------ */ - -%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 -{ - $1 = (SWIG_is_integer($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_BOOL) bool, bool &, const bool & -{ - $1 = (SCHEME_BOOLP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) - float, double, - const float &, const double & -{ - $1 = (SCHEME_REALP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char { - $1 = (SCHEME_STRINGP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - $1 = (SCHEME_STRINGP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $1_descriptor, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE &, SWIGTYPE && { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $&1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, 0, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } - - diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/carray.i b/mac/bin/swig/share/swig/4.1.0/ocaml/carray.i deleted file mode 100755 index 4378f733..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/carray.i +++ /dev/null @@ -1,131 +0,0 @@ -%insert(mli) %{ -type _value = c_obj -%} - -%insert(ml) %{ -type _value = c_obj -%} - -%define %array_tmap_out(type,what,out_f) -%typemap(type) what [ANY] { - int i; - $result = caml_array_new($1_dim0); - for( i = 0; i < $1_dim0; i++ ) { - caml_array_set($result,i,out_f($1[i])); - } -} -%enddef - -%define %array_tmap_in(type,what,in_f) -%typemap(type) what [ANY] { - int i; - $1 = ($*1_type *)malloc( $1_size ); - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = in_f(caml_array_nth($input,i)); - } -} - -%typemap(free) what [ANY] { - free( (void *)$1 ); -} -%enddef - -%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(directorin,type,out_f); - -%array_tmap_in(in,type,in_f); -%array_tmap_in(varin,type,in_f); -%array_tmap_in(directorout,type,in_f); -%enddef - -%make_simple_array_typemap(bool,caml_val_bool,caml_long_val); -%make_simple_array_typemap(short,caml_val_short,caml_long_val); -%make_simple_array_typemap(unsigned short,caml_val_ushort,caml_long_val); -%make_simple_array_typemap(int,caml_val_int,caml_long_val); -%make_simple_array_typemap(unsigned int,caml_val_uint,caml_long_val); -%make_simple_array_typemap(long,caml_val_long,caml_long_val); -%make_simple_array_typemap(unsigned long,caml_val_ulong,caml_long_val); -%make_simple_array_typemap(size_t,caml_val_int,caml_long_val); -%make_simple_array_typemap(float,caml_val_float,caml_double_val); -%make_simple_array_typemap(double,caml_val_double,caml_double_val); - -#ifdef __cplusplus -%typemap(in) SWIGTYPE [] { - int i; - - $1 = new $*1_type [$1_dim0]; - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = *(($*1_ltype *) - caml_ptr_val(caml_array_nth($input,i), - $*1_descriptor)) ; - } -} -#else -%typemap(in) SWIGTYPE [] { - int i; - - $1 = ($*1_type *)malloc( $1_size ); - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = *(($*1_ltype) - caml_ptr_val(caml_array_nth($input), - $*1_descriptor)); - } -} -#endif - -%typemap(out) SWIGTYPE [] { - int i; - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - $result = caml_array_new($1_dim0); - - for( i = 0; i < $1_dim0; i++ ) { - if( fromval ) { - caml_array_set - ($result, - i, - caml_callback(*fromval,caml_val_ptr((void *)&$1[i],$*1_descriptor))); - } else { - caml_array_set - ($result, - i, - caml_val_ptr ((void *)&$1[i],$&1_descriptor)); - } - } -} - -%typemap(in) enum SWIGTYPE [] { - int i; - - $1 = ($*1_type *)malloc( $1_size ); - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = ($type) - caml_long_val_full(caml_array_nth($input), - "$type_marker"); - } -} - -%typemap(out) enum SWIGTYPE [] { - int i; - $result = caml_array_new($1_dim0); - - for( i = 0; i < $1_dim0; i++ ) { - caml_array_set - ($result, - i, - caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"), - *caml_named_value("$type_marker"), - Val_int($1[i]))); - } -} - -#ifdef __cplusplus -%typemap(freearg) SWIGTYPE [ANY] { - delete [] $1; -} -#else -%typemap(freearg) SWIGTYPE [ANY] { - free( (void *)$1 ); -} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/class.swg b/mac/bin/swig/share/swig/4.1.0/ocaml/class.swg deleted file mode 100755 index eb369cd7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/class.swg +++ /dev/null @@ -1,67 +0,0 @@ -(*Stream:class_ctors*) -let create_$classname_from_ptr raw_ptr = - C_obj -begin - let h = Hashtbl.create 20 in - List.iter (fun (nm,fn) -> Hashtbl.replace h nm fn) - [ "nop", (fun args -> C_void) ; - $classbody - "&", (fun args -> raw_ptr) ; - ":parents", - (fun args -> - C_list - (let out = ref [] in - Hashtbl.iter (fun x y -> out := (x,y) :: !out) h ; - (List.map - (fun (x,y) -> - C_string (String.sub x 2 ((String.length x) - 2))) - (List.filter - (fun (x,y) -> - ((String.length x) > 2) - && x.[0] == ':' && x.[1] == ':') !out)))) ; - ":classof", (fun args -> C_string "$realname") ; - ":methods", (fun args -> - C_list (let out = ref [] in - Hashtbl.iter (fun x y -> out := (C_string x) :: !out) h ; !out)) - ] ; - let rec invoke_inner raw_ptr mth arg = - begin - try - let application = Hashtbl.find h mth in - application - (match arg with - C_list l -> (C_list (raw_ptr :: l)) - | C_void -> (C_list [ raw_ptr ]) - | v -> (C_list [ raw_ptr ; v ])) - with Not_found -> - (* Try parent classes *) - begin - let parent_classes = [ - $baselist - ] in - let rec try_parent plist raw_ptr = - match plist with - p :: tl -> - begin - try - (invoke (p raw_ptr)) mth arg - with (BadMethodName (p,m,s)) -> - try_parent tl raw_ptr - end - | [] -> - raise (BadMethodName (raw_ptr,mth,"$realname")) - in try_parent parent_classes raw_ptr - end - end in - (fun mth arg -> invoke_inner raw_ptr mth arg) -end - -let _ = register_class_byname "$realname" create_$classname_from_ptr -let _ = Callback.register - "create_$normalized_from_ptr" - create_$classname_from_ptr - - -(*Stream:mli*) -val create_$classname_from_ptr : c_obj -> c_obj - diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/cstring.i b/mac/bin/swig/share/swig/4.1.0/ocaml/cstring.i deleted file mode 100755 index f1190ad5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/cstring.i +++ /dev/null @@ -1,268 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cstring.i - * - * This file provides typemaps and macros for dealing with various forms - * of C character string handling. The primary use of this module - * is in returning character data that has been allocated or changed in - * some way. - * ----------------------------------------------------------------------------- */ - -/* %cstring_input_binary(TYPEMAP, SIZE) - * - * Macro makes a function accept binary string data along with - * a size. - */ - -%define %cstring_input_binary(TYPEMAP, SIZE) -%apply (char *STRING, int LENGTH) { (TYPEMAP, SIZE) }; -%enddef - -/* - * %cstring_bounded_output(TYPEMAP, MAX) - * - * This macro is used to return a NULL-terminated output string of - * some maximum length. For example: - * - * %cstring_bounded_output(char *outx, 512); - * void foo(char *outx) { - * sprintf(outx,"blah blah\n"); - * } - * - */ - -%define %cstring_bounded_output(TYPEMAP,MAX) -%typemap(ignore) TYPEMAP(char temp[MAX+1]) { - $1 = ($1_ltype) temp; -} -%typemap(argout) TYPEMAP { - $1[MAX] = 0; - $result = caml_list_append($result,caml_val_string(str)); -} -%enddef - -/* - * %cstring_chunk_output(TYPEMAP, SIZE) - * - * This macro is used to return a chunk of binary string data. - * Embedded NULLs are okay. For example: - * - * %cstring_chunk_output(char *outx, 512); - * void foo(char *outx) { - * memmove(outx, somedata, 512); - * } - * - */ - -%define %cstring_chunk_output(TYPEMAP,SIZE) -%typemap(ignore) TYPEMAP(char temp[SIZE]) { - $1 = ($1_ltype) temp; -} -%typemap(argout) TYPEMAP { - $result = caml_list_append($result,caml_val_string_len($1,SIZE)); -} -%enddef - -/* - * %cstring_bounded_mutable(TYPEMAP, SIZE) - * - * This macro is used to wrap a string that's going to mutate. - * - * %cstring_bounded_mutable(char *in, 512); - * void foo(in *x) { - * while (*x) { - * *x = toupper(*x); - * x++; - * } - * } - * - */ - - -%define %cstring_bounded_mutable(TYPEMAP,MAX) -%typemap(in) TYPEMAP(char temp[MAX+1]) { - char *t = (char *)caml_ptr_val($input); - strncpy(temp,t,MAX); - $1 = ($1_ltype) temp; -} -%typemap(argout) TYPEMAP { - $result = caml_list_append($result,caml_val_string_len($1,MAX)); -} -%enddef - -/* - * %cstring_mutable(TYPEMAP [, expansion]) - * - * This macro is used to wrap a string that will mutate in place. - * It may change size up to a user-defined expansion. - * - * %cstring_mutable(char *in); - * void foo(in *x) { - * while (*x) { - * *x = toupper(*x); - * x++; - * } - * } - * - */ - -%define %cstring_mutable(TYPEMAP,...) -%typemap(in) TYPEMAP { - char *t = String_val($input); - int n = caml_string_length($input); - $1 = ($1_ltype) t; -#if #__VA_ARGS__ == "" -#ifdef __cplusplus - $1 = ($1_ltype) new char[n+1]; -#else - $1 = ($1_ltype) malloc(n+1); -#endif -#else -#ifdef __cplusplus - $1 = ($1_ltype) new char[n+1+__VA_ARGS__]; -#else - $1 = ($1_ltype) malloc(n+1+__VA_ARGS__); -#endif -#endif - memmove($1,t,n); - $1[n] = 0; -} - -%typemap(argout) TYPEMAP { - $result = caml_list_append($result,caml_val_string($1)); -#ifdef __cplusplus - delete[] $1; -#else - free($1); -#endif -} -%enddef - -/* - * %cstring_output_maxsize(TYPEMAP, SIZE) - * - * This macro returns data in a string of some user-defined size. - * - * %cstring_output_maxsize(char *outx, int max) { - * void foo(char *outx, int max) { - * sprintf(outx,"blah blah\n"); - * } - */ - -%define %cstring_output_maxsize(TYPEMAP, SIZE) -%typemap(in) (TYPEMAP, SIZE) { - $2 = caml_val_long($input); -#ifdef __cplusplus - $1 = ($1_ltype) new char[$2+1]; -#else - $1 = ($1_ltype) malloc($2+1); -#endif -} -%typemap(argout) (TYPEMAP,SIZE) { - $result = caml_list_append($result,caml_val_string($1)); -#ifdef __cplusplus - delete [] $1; -#else - free($1); -#endif -} -%enddef - -/* - * %cstring_output_withsize(TYPEMAP, SIZE) - * - * This macro is used to return character data along with a size - * parameter. - * - * %cstring_output_maxsize(char *outx, int *max) { - * void foo(char *outx, int *max) { - * sprintf(outx,"blah blah\n"); - * *max = strlen(outx); - * } - */ - -%define %cstring_output_withsize(TYPEMAP, SIZE) -%typemap(in) (TYPEMAP, SIZE) { - int n = caml_val_long($input); -#ifdef __cplusplus - $1 = ($1_ltype) new char[n+1]; - $2 = ($2_ltype) new $*1_ltype; -#else - $1 = ($1_ltype) malloc(n+1); - $2 = ($2_ltype) malloc(sizeof($*1_ltype)); -#endif - *$2 = n; -} -%typemap(argout) (TYPEMAP,SIZE) { - $result = caml_list_append($result,caml_val_string_len($1,$2)); -#ifdef __cplusplus - delete [] $1; - delete $2; -#else - free($1); - free($2); -#endif -} -%enddef - -/* - * %cstring_output_allocate(TYPEMAP, RELEASE) - * - * This macro is used to return character data that was - * allocated with new or malloc. - * - * %cstring_output_allocated(char **outx, free($1)); - * void foo(char **outx) { - * *outx = (char *) malloc(512); - * sprintf(outx,"blah blah\n"); - * } - */ - -%define %cstring_output_allocate(TYPEMAP, RELEASE) -%typemap(ignore) TYPEMAP($*1_ltype temp = 0) { - $1 = &temp; -} - -%typemap(argout) TYPEMAP { - if (*$1) { - $result = caml_list_append($result,caml_val_string($1)); - RELEASE; - } else { - $result = caml_list_append($result,caml_val_ptr($1)); - } -} -%enddef - -/* - * %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) - * - * This macro is used to return character data that was - * allocated with new or malloc. - * - * %cstring_output_allocated(char **outx, int *sz, free($1)); - * void foo(char **outx, int *sz) { - * *outx = (char *) malloc(512); - * sprintf(outx,"blah blah\n"); - * *sz = strlen(outx); - * } - */ - -%define %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) -%typemap(ignore) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) { - $1 = &temp; - $2 = &tempn; -} - -%typemap(argout)(TYPEMAP,SIZE) { - if (*$1) { - $result = caml_list_append($result,caml_val_string_len($1,$2)); - RELEASE; - } else - $result = caml_list_append($result,caml_val_ptr($1)); -} -%enddef - - - - - - diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/director.swg b/mac/bin/swig/share/swig/4.1.0/ocaml/director.swg deleted file mode 100755 index eb91aaf4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/director.swg +++ /dev/null @@ -1,101 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Ocaml proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#include -#include - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -namespace Swig { - /* base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - - public: - DirectorException(const char *msg="") : swig_msg(msg) { - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - /* type mismatch in the return value from a Ocaml method call */ - class DirectorTypeMismatchException : public DirectorException { - public: - DirectorTypeMismatchException(const char *msg="") : DirectorException(msg) { - } - }; - - /* any Ocaml exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException {}; - - /* attempt to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg="") : DirectorException(msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - /* simple thread abstraction for pthreads on win32 */ -#ifdef __THREAD__ -#define __PTHREAD__ -#if defined(_WIN32) || defined(__WIN32__) -#define pthread_mutex_lock EnterCriticalSection -#define pthread_mutex_unlock LeaveCriticalSection -#define pthread_mutex_t CRITICAL_SECTION -#define MUTEX_INIT(var) CRITICAL_SECTION var -#else -#include -#define MUTEX_INIT(var) pthread_mutex_t var = PTHREAD_MUTEX_INITIALIZER -#endif -#endif - - /* director base class */ - class Director { - private: - /* pointer to the wrapped ocaml object */ - CAML_VALUE swig_self; - /* flag indicating whether the object is owned by ocaml or c++ */ - mutable bool swig_disown_flag; - - public: - /* wrap a ocaml object. */ - Director(CAML_VALUE self) : swig_self(self), swig_disown_flag(false) { - caml_register_global_root(&swig_self); - } - - /* discard our reference at destruction */ - virtual ~Director() { - caml_remove_global_root(&swig_self); - swig_disown(); - // Disown is safe here because we're just divorcing a reference that points to us. - } - - /* return a pointer to the wrapped ocaml object */ - CAML_VALUE swig_get_self() const { - return swig_self; - } - - /* acquire ownership of the wrapped ocaml object (the sense of "disown" is from ocaml) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag=true; - caml_callback(*caml_named_value("caml_obj_disown"),swig_self); - } - } - }; -} - diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/extra-install.list b/mac/bin/swig/share/swig/4.1.0/ocaml/extra-install.list deleted file mode 100755 index 16486eb2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/extra-install.list +++ /dev/null @@ -1,4 +0,0 @@ -# see top-level Makefile.in -swigp4.ml -swig.mli -swig.ml diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/ocaml.i b/mac/bin/swig/share/swig/4.1.0/ocaml/ocaml.i deleted file mode 100755 index cc26d185..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/ocaml.i +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocaml.i - * - * SWIG Configuration File for Ocaml - * ----------------------------------------------------------------------------- */ - -/* Insert common stuff */ -%insert(runtime) "swigrun.swg" - -/* Include headers */ -%insert(runtime) "ocamlrundec.swg" - -/* Type registration */ -%insert(init) "swiginit.swg" -%insert(init) "typeregister.swg" - -%insert(mlitail) %{ - val swig_val : c_enum_type -> c_obj -> Swig.c_obj -%} - -%insert(mltail) %{ - let rec swig_val t v = - match v with - C_enum e -> enum_to_int t v - | C_list l -> Swig.C_list (List.map (swig_val t) l) - | C_array a -> Swig.C_array (Array.map (swig_val t) a) - | _ -> Obj.magic v -%} - -/*#ifndef SWIG_NOINCLUDE*/ -%insert(runtime) "ocamlrun.swg" -/*#endif*/ - -%insert(classtemplate) "class.swg" - -/* Read in standard typemaps. */ -%include -%include -%include -%include -%include - -/* ocaml keywords */ -/* There's no need to use this, because of my rewriting machinery. C++ - * words never collide with ocaml keywords */ - -/* still we include the file, but the warning says that the offending - name will be properly renamed. Just to let the user to know about - it. */ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/ocaml.swg b/mac/bin/swig/share/swig/4.1.0/ocaml/ocaml.swg deleted file mode 100755 index 703b7e44..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/ocaml.swg +++ /dev/null @@ -1,320 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocaml.swg - * - * The Ocaml module handles all types uniformly via typemaps. Here - * are the definitions. - * ----------------------------------------------------------------------------- */ - -/* Pointers */ - -%typemap(in) void "" - -%typemap(out) void "$result = Val_int(0);" - -%typemap(in) void * { - $1 = caml_ptr_val($input,$descriptor); -} - -%typemap(varin) void * { - $1 = ($ltype)caml_ptr_val($input,$descriptor); -} - -%typemap(out) void * { - $result = caml_val_ptr($1,$descriptor); -} - -%typemap(varout) void * { - $result = caml_val_ptr($1,$descriptor); -} - -%typemap(in) char *& (char *temp) { - temp = (char*)caml_val_ptr($1,$descriptor); - $1 = &temp; -} - -%typemap(argout) char *& { - swig_result = caml_list_append(swig_result,caml_val_string_len(*$1, strlen(*$1))); -} - -%typemap(in) SWIGTYPE & { - $1 = ($ltype) caml_ptr_val($input,$1_descriptor); -} - -%typemap(in, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ - $1 = ($ltype) caml_ptr_val($input,$1_descriptor); - rvrdeleter.reset($1); -%} - -%typemap(varin) SWIGTYPE & { - $1 = *(($ltype) caml_ptr_val($input,$1_descriptor)); -} - -%typemap(varin) SWIGTYPE && { - $1 = *(($ltype) caml_ptr_val($input,$1_descriptor)); -} - -%typemap(varout) SWIGTYPE &, SWIGTYPE && { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)&$1, $1_descriptor); -} - -%typemap(out) SWIGTYPE &, SWIGTYPE && { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); -} - -#if 0 -%typemap(argout) SWIGTYPE & { - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - swig_result = - caml_list_append(swig_result, - caml_callback(*fromval,caml_val_ptr((void *) $1, - $1_descriptor))); - } else { - swig_result = - caml_list_append(swig_result, - caml_val_ptr ((void *) $1,$1_descriptor)); - } -} -%typemap(argout) SWIGTYPE && { - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - swig_result = - caml_list_append(swig_result, - caml_callback(*fromval,caml_val_ptr((void *) $1, - $1_descriptor))); - } else { - swig_result = - caml_list_append(swig_result, - caml_val_ptr ((void *) $1,$1_descriptor)); - } -} -#endif - -%typemap(in) SWIGTYPE { - $1 = *(($&1_ltype) caml_ptr_val($input,$&1_descriptor)) ; -} - -%typemap(varout) SWIGTYPE { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)&$1, $&1_descriptor); -} - -#ifdef __cplusplus - -%typemap(out) SWIGTYPE { - $&1_ltype temp = new $1_ltype($1); - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)temp, $&1_descriptor); -} - -#else - -%typemap(out) SWIGTYPE { - void *temp = calloc(1,sizeof($ltype)); - memmove(temp, &$1, sizeof($1_type)); - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", temp, $&1_descriptor); -} - -#endif - -%typemap(varout) SWIGTYPE * { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); -} - -%typemap(directorin) SWIGTYPE { - $<ype temp = new $1_ltype(SWIG_STD_MOVE($1)); - swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)temp, $&1_descriptor); - args = caml_list_append(args, swig_result); -} - -%typemap(directorin) SWIGTYPE *, SWIGTYPE [], SWIGTYPE &, SWIGTYPE && { - swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)&$1, $&1_descriptor); - args = caml_list_append(args, swig_result); -} - -/* The SIMPLE_MAP macro below defines the whole set of typemaps needed - for simple types. */ - -%define SIMPLE_MAP(C_NAME, C_TO_OCAML, OCAML_TO_C) -/* In */ -%typemap(in) C_NAME { - $1 = OCAML_TO_C($input); -} -%typemap(varin) C_NAME { - $1 = OCAML_TO_C($input); -} -%typemap(in) const C_NAME & ($*1_ltype temp) { - temp = ($*1_ltype) OCAML_TO_C($input); - $1 = &temp; -} -%typemap(varin) const C_NAME & { - $1 = OCAML_TO_C($input); -} -%typemap(directorout) C_NAME { - $1 = OCAML_TO_C($input); -} -/* Out */ -%typemap(out) C_NAME { - $result = C_TO_OCAML($1); -} -%typemap(varout) C_NAME { - $result = C_TO_OCAML($1); -} -%typemap(varout) const C_NAME & { - $result = C_TO_OCAML($1); -} -%typemap(out) const C_NAME & { - $result = C_TO_OCAML(*$1); -} -%typemap(directorin) C_NAME { - args = caml_list_append(args, C_TO_OCAML($1)); -} -%enddef - -SIMPLE_MAP(bool, caml_val_bool, caml_long_val); -SIMPLE_MAP(char, caml_val_char, caml_long_val); -SIMPLE_MAP(signed char, caml_val_char, caml_long_val); -SIMPLE_MAP(unsigned char, caml_val_uchar, caml_long_val); -SIMPLE_MAP(int, caml_val_int, caml_long_val); -SIMPLE_MAP(short, caml_val_short, caml_long_val); -SIMPLE_MAP(wchar_t, caml_val_short, caml_long_val); -SIMPLE_MAP(long, caml_val_long, caml_long_val); -SIMPLE_MAP(ptrdiff_t, caml_val_int, caml_long_val); -SIMPLE_MAP(unsigned int, caml_val_uint, caml_long_val); -SIMPLE_MAP(unsigned short, caml_val_ushort, caml_long_val); -SIMPLE_MAP(unsigned long, caml_val_ulong, caml_long_val); -SIMPLE_MAP(size_t, caml_val_int, caml_long_val); -SIMPLE_MAP(float, caml_val_float, caml_double_val); -SIMPLE_MAP(double, caml_val_double, caml_double_val); -SIMPLE_MAP(long long,caml_val_ulong,caml_long_val); -SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); - -/* Void */ - -%typemap(out) void "$result = Val_unit;" - -/* Pass through value */ - -%typemap (in) CAML_VALUE "$1=$input;" -%typemap (out) CAML_VALUE "$result=$1;" - -#if 0 -%include -#endif - -/* Handle char arrays as strings */ - -%define %char_ptr_in(how) -%typemap(how) char *, signed char *, unsigned char * { - $1 = ($ltype)caml_string_val($input); -} -/* Again work around the empty array bound bug */ -%typemap(how) char [ANY], signed char [ANY], unsigned char [ANY] { - char *temp = caml_string_val($input); - strcpy((char *)$1,temp); -} -%enddef - -%char_ptr_in(in); -%char_ptr_in(varin); -%char_ptr_in(directorout); - -%define %char_ptr_out(how) -%typemap(how) - char *, signed char *, unsigned char *, - const char *, const signed char *, const unsigned char * { - $result = caml_val_string((char *)$1); -} -/* I'd like to use the length here but can't because it might be empty */ -%typemap(how) - char [ANY], signed char [ANY], unsigned char [ANY], - const char [ANY], const signed char [ANY], const unsigned char [ANY] { - $result = caml_val_string((char *)$1); -} -%enddef - -%char_ptr_out(out); -%char_ptr_out(varout); -%char_ptr_out(directorin); - -%define %swigtype_ptr_in(how) -%typemap(how) SWIGTYPE * { - $1 = ($ltype)caml_ptr_val($input,$1_descriptor); -} -%typemap(how) SWIGTYPE (CLASS::*) { - void *v = caml_ptr_val($input,$1_descriptor); - memcpy(& $1, &v, sizeof(v)); -} -%enddef - -%typemap(out) SWIGTYPE * { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); -} - -%define %swigtype_ptr_out(how) -%typemap(how) SWIGTYPE (CLASS::*) { - void *v; - memcpy(&v,& $1, sizeof(void *)); - $result = caml_val_ptr (v,$1_descriptor); -} -%enddef - -%swigtype_ptr_in(in); -%swigtype_ptr_in(varin); -%swigtype_ptr_in(directorout); -%swigtype_ptr_out(out); -%swigtype_ptr_out(varout); -%swigtype_ptr_out(directorin); - -%define %swigtype_array_fail(how,msg) -%typemap(how) SWIGTYPE [] { - caml_failwith(msg); -} -%enddef - -%swigtype_array_fail(in,"Array arguments for arbitrary types need a typemap"); -%swigtype_array_fail(varin,"Assignment to global arrays for arbitrary types need a typemap"); -%swigtype_array_fail(out,"Array arguments for arbitrary types need a typemap"); -%swigtype_array_fail(varout,"Array variables need a typemap"); -%swigtype_array_fail(directorin,"Array results with arbitrary types need a typemap"); -%swigtype_array_fail(directorout,"Array arguments with arbitrary types need a typemap"); - -/* C++ References */ - -/* Enums */ -%define %swig_enum_in(how) -%typemap(how) enum SWIGTYPE { - $1 = ($type)caml_long_val_full($input,"$type_marker"); -} -%enddef - -%define %swig_enum_out(how) -%typemap(how) enum SWIGTYPE { - $result = caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"),*caml_named_value("$type_marker"),Val_int((int)$1)); -} -%enddef - -%swig_enum_in(in) -%swig_enum_in(varin) -%swig_enum_in(directorout) -%swig_enum_out(out) -%swig_enum_out(varout) -%swig_enum_out(directorin) - -%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) { - $1 = ($1_ltype) caml_string_val($input); - $2 = ($2_ltype) caml_string_len($input); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **)&$1); - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, ty); -} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/ocamlkw.swg b/mac/bin/swig/share/swig/4.1.0/ocaml/ocamlkw.swg deleted file mode 100755 index 5e66085e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/ocamlkw.swg +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef OCAML_OCAMLKW_SWG_ -#define OCAML_OCAMLKW_SWG_ - -/* Warnings for Ocaml keywords */ -#define OCAMLKW(x) %namewarn("314: '" #x "' is an ocaml keyword and it will be appropriately renamed") #x - -/* - from - https://caml.inria.fr/pub/docs/manual-ocaml/lex.html -*/ - - -OCAMLKW(and); -OCAMLKW(as); -OCAMLKW(asr); -OCAMLKW(assert); -OCAMLKW(begin); -OCAMLKW(class); -OCAMLKW(constraint); -OCAMLKW(do); -OCAMLKW(done); -OCAMLKW(downto); -OCAMLKW(else); -OCAMLKW(end); -OCAMLKW(exception); -OCAMLKW(external); -OCAMLKW(false); -OCAMLKW(for); -OCAMLKW(fun); -OCAMLKW(function); -OCAMLKW(functor); -OCAMLKW(if); -OCAMLKW(in); -OCAMLKW(include); -OCAMLKW(inherit); -OCAMLKW(initializer); -OCAMLKW(land); -OCAMLKW(lazy); -OCAMLKW(let); -OCAMLKW(lor); -OCAMLKW(lsl); -OCAMLKW(lsr); -OCAMLKW(lxor); -OCAMLKW(match); -OCAMLKW(method); -OCAMLKW(mod); -OCAMLKW(module); -OCAMLKW(mutable); -OCAMLKW(new); -OCAMLKW(nonrec); -OCAMLKW(object); -OCAMLKW(of); -OCAMLKW(open); -OCAMLKW(or); -OCAMLKW(private); -OCAMLKW(rec); -OCAMLKW(sig); -OCAMLKW(struct); -OCAMLKW(then); -OCAMLKW(to); -OCAMLKW(true); -OCAMLKW(try); -OCAMLKW(type); -OCAMLKW(val); -OCAMLKW(virtual); -OCAMLKW(when); -OCAMLKW(while); -OCAMLKW(with); - -#undef OCAMLKW - -#endif //OCAML_OCAMLKW_SWG_ diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/ocamlrun.swg b/mac/bin/swig/share/swig/4.1.0/ocaml/ocamlrun.swg deleted file mode 100755 index 53ad952f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/ocamlrun.swg +++ /dev/null @@ -1,607 +0,0 @@ -/* -*-c-*- */ - -/* SWIG pointer structure */ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define C_bool 0 -#define C_char 1 -#define C_uchar 2 -#define C_short 3 -#define C_ushort 4 -#define C_int 5 -#define C_uint 6 -#define C_int32 7 -#define C_int64 8 -#define C_float 9 -#define C_double 10 -#define C_ptr 11 -#define C_array 12 -#define C_list 13 -#define C_obj 14 -#define C_string 15 -#define C_enum 16 -#define C_director_core 17 - - -/* Cast a pointer if possible; returns 1 if successful */ - - SWIGINTERN int - SWIG_Cast (void *source, swig_type_info *source_type, - void **ptr, swig_type_info *dest_type) - { - if( !source ) { /* Special case for NULL. This is a popular question - for other modules on the list, so I want an easy way out... */ - *ptr = 0; - return 0; - } - -#ifdef TYPE_CAST_VERBOSE - fprintf( stderr, "Trying to cast %s to %s\n", - source_type ? source_type->str : "", - dest_type ? dest_type->str : "" ); -#endif - if (dest_type != source_type) { - /* We have a type mismatch. Will have to look through our type - mapping table to figure out whether or not we can accept this - datatype. - -- - Ignore typechecks for void *. Allow any conversion. */ - if( !dest_type || !source_type || - !strcmp(dest_type->name,"_p_void") || - !strcmp(source_type->name,"_p_void") ) { - *ptr = source; - return 0; - } else { - swig_cast_info *tc = - SWIG_TypeCheckStruct(source_type, dest_type ); -#ifdef TYPE_CAST_VERBOSE - fprintf( stderr, "Typecheck -> %s\n", - tc ? tc->type->str : "" ); -#endif - if( tc ) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, source, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - return 0; - } else - return -1; - } - } else { - *ptr = source; - return 0; - } - } - -/* Return 0 if successful. */ - SWIGINTERN int - SWIG_GetPtr(void *inptr, void **outptr, - swig_type_info *intype, swig_type_info *outtype) { - if (intype) { - return SWIG_Cast(inptr, intype, - outptr, outtype) == -1; - } else { - *outptr = inptr; - return 0; - } - } - - SWIGINTERN void caml_print_list( CAML_VALUE v ); - - SWIGINTERN void caml_print_val( CAML_VALUE v ) { - switch( SWIG_Tag_val(v) ) { - case C_bool: - if( Bool_val(SWIG_Field(v,0)) ) fprintf( stderr, "true " ); - else fprintf( stderr, "false " ); - break; - case C_char: - case C_uchar: - fprintf( stderr, "'%c' (\\%03d) ", - (Int_val(SWIG_Field(v,0)) >= ' ' && - Int_val(SWIG_Field(v,0)) < 127) ? Int_val(SWIG_Field(v,0)) : '.', - Int_val(SWIG_Field(v,0)) ); - break; - case C_short: - case C_ushort: - case C_int: - fprintf( stderr, "%d ", (int)caml_long_val(v) ); - break; - - case C_uint: - case C_int32: - fprintf( stderr, "%ud ", (unsigned int)caml_long_val(v) ); - break; - case C_int64: - fprintf( stderr, "%ld ", caml_long_val(v) ); - break; - case C_float: - case C_double: - fprintf( stderr, "%f ", caml_double_val(v) ); - break; - - case C_ptr: - { - void *vout = 0; - swig_type_info *ty = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); - caml_ptr_val_internal(v,&vout,0); - fprintf( stderr, "PTR(%p,%s) ", - vout, - ty ? ty->name : "(null)" ); - } - break; - case C_array: - { - unsigned int i; - for( i = 0; i < Wosize_val( SWIG_Field(v,0) ); i++ ) - caml_print_val( SWIG_Field(SWIG_Field(v,0),i) ); - } - break; - case C_list: - caml_print_list( SWIG_Field(v,0) ); - break; - case C_obj: - fprintf( stderr, "OBJ(%p) ", (void *)SWIG_Field(v,0) ); - break; - case C_string: - { - void *cout; - caml_ptr_val_internal(v,&cout,0); - fprintf( stderr, "'%s' ", (char *)cout ); - } - break; - } - } - - SWIGINTERN void caml_print_list( CAML_VALUE v ) { - CAMLparam1(v); - while( v && Is_block(v) ) { - fprintf( stderr, "[ " ); - caml_print_val( SWIG_Field(v,0) ); - fprintf( stderr, "]\n" ); - v = SWIG_Field(v,1); - } - CAMLreturn0; - } - - SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) { - CAMLparam1(lst); - int i = 0; - while( i < n && lst && Is_block(lst) ) { - i++; lst = SWIG_Field(lst,1); - } - if( lst == Val_unit ) CAMLreturn(Val_unit); - else CAMLreturn(SWIG_Field(lst,0)); - } - - SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) { - CAMLparam2(lst,elt); - SWIG_CAMLlocal3(v,vt,lh); - lh = Val_unit; - v = Val_unit; - - /* Appending C_void should have no effect */ - if( !Is_block(elt) ) return lst; - - while( lst && Is_block(lst) ) { - if( v && v != Val_unit ) { - vt = caml_alloc_tuple(2); - SWIG_Store_field(v,1,vt); - v = vt; - } else { - v = lh = caml_alloc_tuple(2); - } - SWIG_Store_field(v,0,SWIG_Field(lst,0)); - lst = SWIG_Field(lst,1); - } - - if( v && Is_block(v) ) { - vt = caml_alloc_tuple(2); - SWIG_Store_field(v,1,vt); - v = vt; - } else { - v = lh = caml_alloc_tuple(2); - } - SWIG_Store_field(v,0,elt); - SWIG_Store_field(v,1,Val_unit); - - CAMLreturn(lh); - } - - SWIGINTERN int caml_list_length( CAML_VALUE lst ) { - CAMLparam1(lst); - int i = 0; - while( lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); } - CAMLreturn(i); - } - - SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) { - CAMLparam2(arr,item); - SWIG_Store_field(SWIG_Field(arr,0),n,item); - CAMLreturn0; - } - - SWIGINTERN value caml_array_nth( CAML_VALUE arr, int n ) { - CAMLparam1(arr); - if( SWIG_Tag_val(arr) == C_array ) - CAMLreturn(SWIG_Field(SWIG_Field(arr,0),n)); - else if( SWIG_Tag_val(arr) == C_list ) - CAMLreturn(caml_list_nth(arr,0)); - else - caml_failwith("Need array or list"); - } - - SWIGINTERN int caml_array_len( CAML_VALUE arr ) { - CAMLparam1(arr); - if( SWIG_Tag_val(arr) == C_array ) - CAMLreturn(Wosize_val(SWIG_Field(arr,0))); - else if( SWIG_Tag_val(arr) == C_list ) - CAMLreturn(caml_list_length(arr)); - else - caml_failwith("Need array or list"); - } - - SWIGINTERN CAML_VALUE caml_swig_alloc(int x,int y) { - return caml_alloc(x,y); - } - - SWIGINTERN value caml_array_new( int n ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - vv = caml_swig_alloc(1,C_array); - SWIG_Store_field(vv,0,caml_alloc_tuple(n)); - CAMLreturn(vv); - } - - SWIGINTERN CAML_VALUE caml_val_bool( int b ) { - CAMLparam0(); - SWIG_CAMLlocal1(bv); - bv = caml_swig_alloc(1,C_bool); - SWIG_Store_field(bv,0,Val_bool(b)); - CAMLreturn(bv); - } - - SWIGINTERN CAML_VALUE caml_val_char( char c ) { - CAMLparam0(); - SWIG_CAMLlocal1(cv); - cv = caml_swig_alloc(1,C_char); - SWIG_Store_field(cv,0,Val_int(c)); - CAMLreturn(cv); - } - - SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char uc ) { - CAMLparam0(); - SWIG_CAMLlocal1(ucv); - ucv = caml_swig_alloc(1,C_uchar); - SWIG_Store_field(ucv,0,Val_int(uc)); - CAMLreturn(ucv); - } - - SWIGINTERN CAML_VALUE caml_val_short( short s ) { - CAMLparam0(); - SWIG_CAMLlocal1(sv); - sv = caml_swig_alloc(1,C_short); - SWIG_Store_field(sv,0,Val_int(s)); - CAMLreturn(sv); - } - - SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short us ) { - CAMLparam0(); - SWIG_CAMLlocal1(usv); - usv = caml_swig_alloc(1,C_ushort); - SWIG_Store_field(usv,0,Val_int(us)); - CAMLreturn(usv); - } - - SWIGINTERN CAML_VALUE caml_val_int( int i ) { - CAMLparam0(); - SWIG_CAMLlocal1(iv); - iv = caml_swig_alloc(1,C_int); - SWIG_Store_field(iv,0,Val_int(i)); - CAMLreturn(iv); - } - - SWIGINTERN CAML_VALUE caml_val_uint( unsigned int ui ) { - CAMLparam0(); - SWIG_CAMLlocal1(uiv); - uiv = caml_swig_alloc(1,C_int); - SWIG_Store_field(uiv,0,Val_int(ui)); - CAMLreturn(uiv); - } - - SWIGINTERN CAML_VALUE caml_val_long( long l ) { - CAMLparam0(); - SWIG_CAMLlocal1(lv); - lv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(lv,0,caml_copy_int64(l)); - CAMLreturn(lv); - } - - SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long ul ) { - CAMLparam0(); - SWIG_CAMLlocal1(ulv); - ulv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(ulv,0,caml_copy_int64(ul)); - CAMLreturn(ulv); - } - - SWIGINTERN CAML_VALUE caml_val_float( float f ) { - CAMLparam0(); - SWIG_CAMLlocal1(fv); - fv = caml_swig_alloc(1,C_float); - SWIG_Store_field(fv,0,caml_copy_double((double)f)); - CAMLreturn(fv); - } - - SWIGINTERN CAML_VALUE caml_val_double( double d ) { - CAMLparam0(); - SWIG_CAMLlocal1(fv); - fv = caml_swig_alloc(1,C_double); - SWIG_Store_field(fv,0,caml_copy_double(d)); - CAMLreturn(fv); - } - - SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - vv = caml_swig_alloc(2,C_ptr); - SWIG_Store_field(vv,0,caml_copy_int64((long)p)); - SWIG_Store_field(vv,1,caml_copy_int64((long)info)); - CAMLreturn(vv); - } - - SWIGINTERN CAML_VALUE caml_val_string( const char *p ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - if( !p ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); - vv = caml_swig_alloc(1,C_string); - SWIG_Store_field(vv,0,caml_copy_string(p)); - CAMLreturn(vv); - } - - SWIGINTERN CAML_VALUE caml_val_string_len( const char *p, int len ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); - vv = caml_swig_alloc(1,C_string); - SWIG_Store_field(vv,0,caml_alloc_string(len)); - memcpy(Bp_val(SWIG_Field(vv,0)),p,len); - CAMLreturn(vv); - } - - #define caml_val_obj(v, name) caml_val_obj_helper(v, SWIG_TypeQuery((name)), name) - SWIGINTERN CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) { - CAMLparam0(); - CAMLreturn(caml_callback2(*caml_named_value("caml_create_object_fn"), - caml_val_ptr(v,type), - caml_copy_string(name))); - } - - SWIGINTERN long caml_long_val_full( CAML_VALUE v, const char *name ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_bool: - case C_char: - case C_uchar: - case C_short: - case C_ushort: - case C_int: - CAMLreturn(Int_val(SWIG_Field(v,0))); - case C_uint: - case C_int32: - CAMLreturn(Int32_val(SWIG_Field(v,0))); - case C_int64: - CAMLreturn((long)SWIG_Int64_val(SWIG_Field(v,0))); - case C_float: - case C_double: - CAMLreturn((long)Double_val(SWIG_Field(v,0))); - case C_string: - CAMLreturn((long)String_val(SWIG_Field(v,0))); - case C_ptr: - CAMLreturn((long)SWIG_Int64_val(SWIG_Field(SWIG_Field(v,0),0))); - case C_enum: { - SWIG_CAMLlocal1(ret); - const CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int"); - if( !name ) caml_failwith( "Not an enum conversion" ); - ret = caml_callback2(*enum_to_int,*caml_named_value(name),v); - CAMLreturn(caml_long_val(ret)); - } - default: - caml_failwith("No conversion to int"); - } - } - - SWIGINTERN long caml_long_val( CAML_VALUE v ) { - return caml_long_val_full(v,0); - } - - SWIGINTERN double caml_double_val( CAML_VALUE v ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0.0; - switch( SWIG_Tag_val(v) ) { - case C_bool: - case C_char: - case C_uchar: - case C_short: - case C_ushort: - case C_int: - CAMLreturn_type(Int_val(SWIG_Field(v,0))); - case C_uint: - case C_int32: - CAMLreturn_type(Int32_val(SWIG_Field(v,0))); - case C_int64: - CAMLreturn_type(SWIG_Int64_val(SWIG_Field(v,0))); - case C_float: - case C_double: - CAMLreturn_type(Double_val(SWIG_Field(v,0))); - default: - fprintf( stderr, "Unknown block tag %d\n", SWIG_Tag_val(v) ); - caml_failwith("No conversion to double"); - } - } - - SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, - swig_type_info *descriptor ) { - CAMLparam1(v); - void *outptr = NULL; - swig_type_info *outdescr = NULL; - static const CAML_VALUE *func_val = NULL; - - if( v == Val_unit ) { - *out = 0; - CAMLreturn_type(0); - } - if( !Is_block(v) ) return -1; - switch( SWIG_Tag_val(v) ) { - case C_obj: - if (!func_val) { - func_val = caml_named_value("caml_obj_ptr"); - } - CAMLreturn_type(caml_ptr_val_internal(caml_callback(*func_val, v), out, descriptor)); - case C_string: - outptr = (void *)String_val(SWIG_Field(v,0)); - break; - case C_ptr: - outptr = (void *)(long)SWIG_Int64_val(SWIG_Field(v,0)); - outdescr = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); - break; - default: - *out = 0; - CAMLreturn_type(1); - break; - } - - CAMLreturn_type(SWIG_GetPtr(outptr, out, outdescr, descriptor)); - } - - SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) { - CAMLparam0(); -#ifdef TYPE_CAST_VERBOSE - caml_print_val( v ); -#endif - void *out = NULL; - if( !caml_ptr_val_internal( v, &out, descriptor ) ) - CAMLreturn_type(out); - else - caml_failwith( "No appropriate conversion found." ); - } - - SWIGINTERN char *caml_string_val( CAML_VALUE v ) { - return (char *)caml_ptr_val( v, 0 ); - } - - SWIGINTERN int caml_string_len( CAML_VALUE v ) { - switch( SWIG_Tag_val(v) ) { - case C_string: - return caml_string_length(SWIG_Field(v,0)); - default: - return strlen((char *)caml_ptr_val(v,0)); - } - } - - SWIGINTERN int caml_bool_check( CAML_VALUE v ) { - CAMLparam1(v); - - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_bool: - case C_ptr: - case C_string: - CAMLreturn(1); - default: - CAMLreturn(0); - } - } - - SWIGINTERN int caml_int_check( CAML_VALUE v ) { - CAMLparam1(v); - - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_char: - case C_uchar: - case C_short: - case C_ushort: - case C_int: - case C_uint: - case C_int32: - case C_int64: - CAMLreturn(1); - - default: - CAMLreturn(0); - } - } - - SWIGINTERN int caml_float_check( CAML_VALUE v ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_float: - case C_double: - CAMLreturn(1); - - default: - CAMLreturn(0); - } - } - - SWIGINTERN int caml_ptr_check( CAML_VALUE v ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_string: - case C_ptr: - case C_int64: - CAMLreturn(1); - - default: - CAMLreturn(0); - } - } - - SWIGINTERN CAML_VALUE SWIG_Ocaml_ptr_to_val(const char *name, void *ptr, swig_type_info *descriptor) { - CAMLparam0(); - SWIG_CAMLlocal1(result); - - const CAML_VALUE *fromval = caml_named_value(name); - if (fromval) { - result = caml_callback(*fromval, caml_val_ptr(ptr, descriptor)); - } else { - result = caml_val_ptr(ptr, descriptor); - } - CAMLreturn(result); - } - - static swig_module_info *SWIG_Ocaml_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - CAML_VALUE pointer; - - pointer = caml_callback(*caml_named_value("swig_find_type_info"), caml_val_int(0)); - if (Is_block(pointer) && SWIG_Tag_val(pointer) == C_ptr) { - return (swig_module_info *)(void *)(long)SWIG_Int64_val(SWIG_Field(pointer,0)); - } - return 0; - } - - static void SWIG_Ocaml_SetModule(swig_module_info *pointer) { - CAML_VALUE mod_pointer; - - mod_pointer = caml_val_ptr(pointer, NULL); - caml_callback(*caml_named_value("swig_set_type_info"), mod_pointer); - } - -#ifdef __cplusplus -} -#endif -#undef value - diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/ocamlrundec.swg b/mac/bin/swig/share/swig/4.1.0/ocaml/ocamlrundec.swg deleted file mode 100755 index dde0b8e5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/ocamlrundec.swg +++ /dev/null @@ -1,212 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocamlrundec.swg - * - * Ocaml runtime code -- declarations - * ----------------------------------------------------------------------------- */ - -#include -#include -#include - -#ifdef __cplusplus -#define SWIGEXT extern "C" -SWIGEXT { -#else -#define SWIGEXT -#endif -#define value caml_value_t -#define CAML_VALUE caml_value_t -#define CAML_NAME_SPACE -#include -#include -#include -#include -#include -#include -#include - -#if defined(CAMLassert) -/* Both this macro and version.h were introduced in version 4.02.0 */ -#include -#else -#define OCAML_VERSION 0 /* Unknown, but < 40200 */ -#endif - -#define caml_array_set swig_caml_array_set - -/* Adapted from memory.h and mlvalues.h */ - -#define SWIG_CAMLlocal1(x) \ - caml_value_t x = 0; \ - CAMLxparam1 (x) - -#define SWIG_CAMLlocal2(x, y) \ - caml_value_t x = 0, y = 0; \ - CAMLxparam2 (x, y) - -#define SWIG_CAMLlocal3(x, y, z) \ - caml_value_t x = 0, y = 0, z = 0; \ - CAMLxparam3 (x, y, z) - -#define SWIG_CAMLlocal4(x, y, z, t) \ - caml_value_t x = 0, y = 0, z = 0, t = 0; \ - CAMLxparam4 (x, y, z, t) - -#define SWIG_CAMLlocal5(x, y, z, t, u) \ - caml_value_t x = 0, y = 0, z = 0, t = 0, u = 0; \ - CAMLxparam5 (x, y, z, t, u) - -#define SWIG_CAMLlocalN(x, size) \ - caml_value_t x [(size)] = { 0, /* 0, 0, ... */ }; \ - CAMLxparamN (x, (size)) - -#define SWIG_Field(x, i) (((caml_value_t *)(x)) [i]) /* Also an l-value. */ -#define SWIG_Store_field(block, offset, val) do{ \ - mlsize_t caml__temp_offset = (offset); \ - caml_value_t caml__temp_val = (val); \ - caml_modify (&SWIG_Field ((block), caml__temp_offset), caml__temp_val); \ -}while(0) - -#define SWIG_Data_custom_val(v) ((void *) &SWIG_Field((v), 1)) -#ifdef ARCH_BIG_ENDIAN -#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-1]) - /* Also an l-value. */ -#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [sizeof(caml_value_t)-1]) - /* Also an l-value. */ -#else -#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-sizeof(caml_value_t)]) - /* Also an l-value. */ -#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [0]) - /* Also an l-value. */ -#endif - -#ifdef CAMLreturn0 -#undef CAMLreturn0 -#endif -#define CAMLreturn0 do{ \ - caml_local_roots = caml__frame; \ - return; \ -}while (0) - -#ifdef CAMLreturn -#undef CAMLreturn -#endif -#define CAMLreturn(result) do{ \ - caml_value_t caml__temp_result = (result); \ - caml_local_roots = caml__frame; \ - return (caml__temp_result); \ -}while(0) - -#define CAMLreturn_type(result) do{ \ - caml_local_roots = caml__frame; \ - return result; \ -}while(0) - -#ifdef CAMLnoreturn -#undef CAMLnoreturn -#endif -#define CAMLnoreturn ((void) caml__frame) - - -#ifndef ARCH_ALIGN_INT64 -#if OCAML_VERSION >= 40300 -#define SWIG_Int64_val(v) (*((int64_t *) SWIG_Data_custom_val(v))) -#else -#define SWIG_Int64_val(v) (*((int64 *) SWIG_Data_custom_val(v))) -#endif -#else -#if OCAML_VERSION >= 40300 -CAMLextern int64_t Int64_val(caml_value_t v); -#else -CAMLextern int64 Int64_val(caml_value_t v); -#endif -#define SWIG_Int64_val(v) Int64_val(v) -#endif - -#define SWIG_NewPointerObj(p,type,flags) caml_val_ptr(p,type) -#define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer) - -typedef enum { - SWIG_OCamlArithmeticException, - SWIG_OCamlDirectorPureVirtual, - SWIG_OCamlOutOfMemoryError, - SWIG_OCamlOverflowException, - SWIG_OCamlIllegalArgumentException, - SWIG_OCamlIndexOutOfBoundsException, - SWIG_OCamlRuntimeException, - SWIG_OCamlSystemException, - SWIG_OCamlUnknownError -} SWIG_OCamlExceptionCodes; - -SWIGINTERN void SWIG_OCamlThrowException(SWIG_OCamlExceptionCodes code, const char *msg) { - CAMLparam0(); - SWIG_CAMLlocal1(str); - - switch (code) { - case SWIG_OCamlIllegalArgumentException: - caml_invalid_argument(msg); - break; - case SWIG_OCamlSystemException: - str = caml_copy_string(msg); - caml_raise_sys_error(str); - break; - case SWIG_OCamlArithmeticException: - case SWIG_OCamlIndexOutOfBoundsException: - case SWIG_OCamlOutOfMemoryError: - case SWIG_OCamlOverflowException: - case SWIG_OCamlRuntimeException: - case SWIG_OCamlUnknownError: - default: - caml_failwith(msg); - break; - } - CAMLreturn0; -} - -#define SWIG_contract_assert(expr, msg) do { if(!(expr)) {SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, msg);} } while (0) - - SWIGINTERN int - SWIG_GetPtr(void *source, void **result, swig_type_info *type, swig_type_info *result_type); - - SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ); - SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ); - SWIGINTERN int caml_list_length( CAML_VALUE lst ); - SWIGINTERN CAML_VALUE caml_array_new( int n ); - SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ); - SWIGINTERN CAML_VALUE caml_array_nth( CAML_VALUE arr, int n ); - SWIGINTERN int caml_array_len( CAML_VALUE arr ); - - SWIGINTERN CAML_VALUE caml_val_char( char c ); - SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char c ); - - SWIGINTERN CAML_VALUE caml_val_short( short s ); - SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short s ); - - SWIGINTERN CAML_VALUE caml_val_int( int x ); - SWIGINTERN CAML_VALUE caml_val_uint( unsigned int x ); - - SWIGINTERN CAML_VALUE caml_val_long( long x ); - SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long x ); - - SWIGINTERN CAML_VALUE caml_val_float( float f ); - SWIGINTERN CAML_VALUE caml_val_double( double d ); - - SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor ); - - SWIGINTERN CAML_VALUE caml_val_string( const char *str ); - SWIGINTERN CAML_VALUE caml_val_string_len( const char *str, int len ); - - SWIGINTERN long caml_long_val( CAML_VALUE v ); - SWIGINTERN double caml_double_val( CAML_VALUE v ); - - SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, - swig_type_info *descriptor ); - SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ); - - SWIGINTERN char *caml_string_val( CAML_VALUE v ); - SWIGINTERN int caml_string_len( CAML_VALUE v ); - -#ifdef __cplusplus -} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/preamble.swg b/mac/bin/swig/share/swig/4.1.0/ocaml/preamble.swg deleted file mode 100755 index 39374ce4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/preamble.swg +++ /dev/null @@ -1,17 +0,0 @@ -%insert(mli) %{ -exception BadArgs of string -exception BadMethodName of c_obj * string * string -exception NotObject of c_obj -exception NotEnumType of c_obj -exception LabelNotFromThisEnum of c_obj -exception InvalidDirectorCall of c_obj -%} - -%insert(ml) %{ -exception BadArgs of string -exception BadMethodName of c_obj * string * string -exception NotObject of c_obj -exception NotEnumType of c_obj -exception LabelNotFromThisEnum of c_obj -exception InvalidDirectorCall of c_obj -%} \ No newline at end of file diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/std_common.i b/mac/bin/swig/share/swig/4.1.0/ocaml/std_common.i deleted file mode 100755 index 7e64607d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/std_common.i +++ /dev/null @@ -1,23 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - -%{ -#include -SWIGINTERNINLINE -CAML_VALUE SwigString_FromString(const std::string &s) { - return caml_val_string((char *)s.c_str()); -} - -SWIGINTERNINLINE -std::string SwigString_AsString(CAML_VALUE o) { - return std::string((char *)caml_ptr_val(o,0)); -} -%} diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/std_complex.i b/mac/bin/swig/share/swig/4.1.0/ocaml/std_complex.i deleted file mode 100755 index 5192261a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/std_complex.i +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- -#ifndef SWIG_STD_COMPLEX_I_ -#define SWIG_STD_COMPLEX_I_ - -#ifdef SWIG - -%{ -#include -%} - -namespace std -{ - template class complex; - - %define specialize_std_complex(T) - - %typemap(in) complex { - if (PyComplex_Check($input)) { - $1 = std::complex(PyComplex_RealAsDouble($input), - PyComplex_ImagAsDouble($input)); - } else if (PyFloat_Check($input)) { - $1 = std::complex(PyFloat_AsDouble($input), 0); - } else if (PyInt_Check($input)) { - $1 = std::complex(PyInt_AsLong($input), 0); - } - else { - PyErr_SetString(PyExc_TypeError,"Expected a complex"); - SWIG_fail; - } - } - - %typemap(in) const complex& (std::complex temp) { - if (PyComplex_Check($input)) { - temp = std::complex(PyComplex_RealAsDouble($input), - PyComplex_ImagAsDouble($input)); - $1 = &temp; - } else if (PyFloat_Check($input)) { - temp = std::complex(PyFloat_AsDouble($input), 0); - $1 = &temp; - } else if (PyInt_Check($input)) { - temp = std::complex(PyInt_AsLong($input), 0); - $1 = &temp; - } else { - PyErr_SetString(PyExc_TypeError,"Expected a complex"); - SWIG_fail; - } - } - - %typemap(out) complex { - $result = PyComplex_FromDoubles($1.real(), $1.imag()); - } - - %typemap(out) const complex & { - $result = PyComplex_FromDoubles($1->real(), $1->imag()); - } - - %enddef - - specialize_std_complex(double); - specialize_std_complex(float); -} - -#endif // SWIG - -#endif //SWIG_STD_COMPLEX_I_ diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/std_deque.i b/mac/bin/swig/share/swig/4.1.0/ocaml/std_deque.i deleted file mode 100755 index 5b38962b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/std_deque.i +++ /dev/null @@ -1,28 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_deque.i - * - * Default std_deque wrapper - * ----------------------------------------------------------------------------- */ - -%module std_deque - -%rename(__getitem__) std::deque::getitem; -%rename(__setitem__) std::deque::setitem; -%rename(__delitem__) std::deque::delitem; -%rename(__getslice__) std::deque::getslice; -%rename(__setslice__) std::deque::setslice; -%rename(__delslice__) std::deque::delslice; - -%extend std::deque { - int __len__() { - return (int) self->size(); - } - int __nonzero__() { - return ! self->empty(); - } - void append(const T &x) { - self->push_back(x); - } -}; - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/std_except.i b/mac/bin/swig/share/swig/4.1.0/ocaml/std_except.i deleted file mode 100755 index 74ddcb51..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/std_except.i +++ /dev/null @@ -1,23 +0,0 @@ -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws) std::bad_cast "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::bad_exception "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::domain_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::exception "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::invalid_argument "SWIG_OCamlThrowException(SWIG_OCamlIllegalArgumentException, $1.what());" -%typemap(throws) std::length_error "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" -%typemap(throws) std::logic_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::out_of_range "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" -%typemap(throws) std::overflow_error "SWIG_OCamlThrowException(SWIG_OCamlArithmeticException, $1.what());" -%typemap(throws) std::range_error "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" -%typemap(throws) std::runtime_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::underflow_error "SWIG_OCamlThrowException(SWIG_OCamlArithmeticException, $1.what());" diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/std_list.i b/mac/bin/swig/share/swig/4.1.0/ocaml/std_list.i deleted file mode 100755 index e0524aa4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/std_list.i +++ /dev/null @@ -1,217 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list types - * ----------------------------------------------------------------------------- */ - -%include - -%module std_list -%{ -#include -#include -%} - - -namespace std { - template class list - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef T &iterator; - typedef const T& const_iterator; - - list(); - list(unsigned int size, const T& value = T()); - list(const list& other); - - void assign(unsigned int n, const T& value); - void swap(list &x); - - const_reference front(); - const_reference back(); - const_iterator begin(); - const_iterator end(); - - void resize(unsigned int n, T c = T()); - bool empty() const; - - void push_front(const T& x); - void push_back(const T& x); - - void pop_front(); - void pop_back(); - void clear(); - unsigned int size() const; - unsigned int max_size() const; - void resize(unsigned int n, const T& value); - - void remove(const T& value); - void unique(); - void reverse(); - void sort(); - - %extend - { - const_reference __getitem__(int i) throw (std::out_of_range) - { - std::list::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && i::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && i::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && ierase(first); - } - else throw std::out_of_range("list index out of range"); - } - std::list __getslice__(int i,int j) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - if (i>=j) i=j; - if (i>=0 && i=0) - { - for (int k=0;k tmp(j-i); - if (j>i) std::copy(first,end,tmp.begin()); - return tmp; - } - else throw std::out_of_range("list index out of range"); - } - void __delslice__(int i,int j) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - - for (int k=0;kerase(first,end); - } - void __setslice__(int i,int j, const std::list& v) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - - for (int k=0;kerase(first,end); - if (i+1 <= int(self->size())) - { - first = self->begin(); - for (int k=0;kinsert(first,v.begin(),v.end()); - } - else self->insert(self->end(),v.begin(),v.end()); - } - - } - unsigned int __len__() - { - return self->size(); - } - bool __nonzero__() - { - return !(self->empty()); - } - void append(const T& x) - { - self->push_back(x); - } - void pop() - { - self->pop_back(); - } - } - }; -} - - - - - - diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/std_map.i b/mac/bin/swig/share/swig/4.1.0/ocaml/std_map.i deleted file mode 100755 index 3f197baa..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/std_map.i +++ /dev/null @@ -1,79 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/std_pair.i b/mac/bin/swig/share/swig/4.1.0/ocaml/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/std_string.i b/mac/bin/swig/share/swig/4.1.0/ocaml/std_string.i deleted file mode 100755 index 2564cfb3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/std_string.i +++ /dev/null @@ -1,136 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%include -%include - -namespace std { - -%naturalvar string; -%naturalvar wstring; - -class string; -class wstring; - -/* Overloading check */ -%typemap(in) string { - if (caml_ptr_check($input)) - $1.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - else - SWIG_exception(SWIG_TypeError, "string expected"); -} - -%typemap(in) const string & ($*1_ltype temp) { - if (caml_ptr_check($input)) { - temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - -%typemap(in) string & ($*1_ltype temp) { - if (caml_ptr_check($input)) { - temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - -%typemap(in) string * ($*1_ltype *temp) { - if (caml_ptr_check($input)) { - temp = new $*1_ltype((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - -%typemap(free) string * ($*1_ltype *temp) { - delete temp; -} - -%typemap(argout) string & { - swig_result = caml_list_append(swig_result,caml_val_string_len((*$1).c_str(), (*$1).size())); -} - -%typemap(directorin) string { - swig_result = caml_val_string_len($1.c_str(), $1.size()); - args = caml_list_append(args, swig_result); -} - -%typemap(directorout) string { - $result.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); -} - -%typemap(out) string { - $result = caml_val_string_len($1.c_str(),$1.size()); -} - -%typemap(varout) string { - $result = caml_val_string_len($1.c_str(),$1.size()); -} - -%typemap(out) string * { - $result = caml_val_string_len((*$1).c_str(),(*$1).size()); -} - -%typemap(varout) string * { - $result = caml_val_string_len((*$1).c_str(),(*$1).size()); -} - -%typemap(typecheck) string, const string & = char *; - -%typemap(throws) string, const string & "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.c_str());" - -} - -#ifdef ENABLE_CHARPTR_ARRAY -char **c_charptr_array( const std::vector &str_v ); - -%{ - SWIGEXT char **c_charptr_array( const std::vector &str_v ) { - char **out = new char *[str_v.size() + 1]; - out[str_v.size()] = 0; - for( int i = 0; i < str_v.size(); i++ ) { - out[i] = (char *)str_v[i].c_str(); - } - return out; - } -%} -#endif - -#ifdef ENABLE_STRING_VECTOR -%template (StringVector) std::vector; - -%insert(ml) %{ - (* Some STL convenience items *) - - let string_array_to_vector sa = - let nv = _new_StringVector C_void in - ignore (array_to_vector nv (fun x -> C_string x) sa) ; nv - - let c_string_array ar = - _c_charptr_array (string_array_to_vector ar) -%} - -%insert(mli) %{ - val c_string_array: string array -> c_obj -%} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/std_vector.i b/mac/bin/swig/share/swig/4.1.0/ocaml/std_vector.i deleted file mode 100755 index 891d038c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/std_vector.i +++ /dev/null @@ -1,98 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector types - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Python as much as possible, namely, to allow the user to pass and -// be returned Python tuples or lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a Python sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a Python sequence of T:s -// is returned which is most easily used in other Python functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - void push_back(const T& x); - T operator [] ( int f ); - vector &operator = ( vector &other ); - %extend { - void set( int i, const T &x ) { - self->resize(i+1); - (*self)[i] = x; - } - }; - %extend { - T *to_array() { - T *array = new T[self->size() + 1]; - for( int i = 0; i < self->size(); i++ ) - array[i] = (*self)[i]; - return array; - } - }; - }; -}; - -%insert(ml) %{ - - let array_to_vector v argcons array = - for i = 0 to (Array.length array) - 1 do - ignore ((invoke v) "set" (C_list [ C_int i ; (argcons array.(i)) ])) - done ; - v - - let vector_to_array v argcons array = - for i = 0; to (get_int ((invoke v) "size" C_void)) - 1 do - array.(i) <- argcons ((invoke v) "[]" (C_int i)) - done ; - v - -%} - -%insert(mli) %{ - val array_to_vector : c_obj -> ('a -> c_obj) -> 'a array -> c_obj - val vector_to_array : c_obj -> (c_obj -> 'a) -> 'a array -> c_obj -%} diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/stl.i b/mac/bin/swig/share/swig/4.1.0/ocaml/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/swig.ml b/mac/bin/swig/share/swig/4.1.0/ocaml/swig.ml deleted file mode 100755 index 58a93347..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/swig.ml +++ /dev/null @@ -1,166 +0,0 @@ -(* -*- tuareg -*- *) -open Int32 -open Int64 - -type enum = [ `Int of int ] - -type 'a c_obj_t = - C_void - | C_bool of bool - | C_char of char - | C_uchar of char - | C_short of int - | C_ushort of int - | C_int of int - | C_uint of int32 - | C_int32 of int32 - | C_int64 of int64 - | C_float of float - | C_double of float - | C_ptr of int64 * int64 - | C_array of 'a c_obj_t array - | C_list of 'a c_obj_t list - | C_obj of (string -> 'a c_obj_t -> 'a c_obj_t) - | C_string of string - | C_enum of 'a - | C_director_core of 'a c_obj_t * 'a c_obj_t option ref - -type c_obj = enum c_obj_t - -exception BadArgs of string -exception BadMethodName of string * string -exception NotObject of c_obj -exception NotEnumType of c_obj -exception LabelNotFromThisEnum of c_obj -exception InvalidDirectorCall of c_obj -exception NoSuchClass of string -let rec invoke obj = - match obj with - C_obj o -> o - | C_director_core (o,r) -> invoke o - | _ -> raise (NotObject (Obj.magic obj)) -let _ = Callback.register "swig_runmethod" invoke - -let fnhelper arg = - match arg with C_list l -> l | C_void -> [] | _ -> [ arg ] - -let director_core_helper fnargs = - try - match List.hd fnargs with - | C_director_core (o,r) -> fnargs - | _ -> C_void :: fnargs - with Failure _ -> C_void :: fnargs - -let rec get_int x = - match x with - C_bool b -> if b then 1 else 0 - | C_char c - | C_uchar c -> (int_of_char c) - | C_short s - | C_ushort s - | C_int s -> s - | C_uint u - | C_int32 u -> (Int32.to_int u) - | C_int64 u -> (Int64.to_int u) - | C_float f -> (int_of_float f) - | C_double d -> (int_of_float d) - | C_ptr (p,q) -> (Int64.to_int p) - | C_obj o -> (try (get_int (o "int" C_void)) - with _ -> (get_int (o "&" C_void))) - | _ -> raise (Failure "Can't convert to int") - -let rec get_float x = - match x with - C_char c - | C_uchar c -> (float_of_int (int_of_char c)) - | C_short s -> (float_of_int s) - | C_ushort s -> (float_of_int s) - | C_int s -> (float_of_int s) - | C_uint u - | C_int32 u -> (float_of_int (Int32.to_int u)) - | C_int64 u -> (float_of_int (Int64.to_int u)) - | C_float f -> f - | C_double d -> d - | C_obj o -> (try (get_float (o "float" C_void)) - with _ -> (get_float (o "double" C_void))) - | _ -> raise (Failure "Can't convert to float") - -let rec get_char x = - (char_of_int (get_int x)) - -let rec get_string x = - match x with - C_string str -> str - | _ -> raise (Failure "Can't convert to string") - -let rec get_bool x = - match x with - C_bool b -> b - | _ -> - (try if get_int x != 0 then true else false - with _ -> raise (Failure "Can't convert to bool")) - -let disown_object obj = - match obj with - C_director_core (o,r) -> r := None - | _ -> raise (Failure "Not a director core object") -let _ = Callback.register "caml_obj_disown" disown_object -let addr_of obj = - match obj with - C_obj _ -> (invoke obj) "&" C_void - | C_director_core (self,r) -> (invoke self) "&" C_void - | C_ptr _ -> obj - | _ -> raise (Failure "Not a pointer.") -let _ = Callback.register "caml_obj_ptr" addr_of - -let make_float f = C_float f -let make_double f = C_double f -let make_string s = C_string s -let make_bool b = C_bool b -let make_char c = C_char c -let make_char_i c = C_char (char_of_int c) -let make_uchar c = C_uchar c -let make_uchar_i c = C_uchar (char_of_int c) -let make_short i = C_short i -let make_ushort i = C_ushort i -let make_int i = C_int i -let make_uint i = C_uint (Int32.of_int i) -let make_int32 i = C_int32 (Int32.of_int i) -let make_int64 i = C_int64 (Int64.of_int i) - -let new_derived_object cfun x_class args = - begin - let get_object ob = - match !ob with - None -> - raise (NotObject C_void) - | Some o -> o in - let ob_ref = ref None in - let class_fun class_f ob_r = - (fun meth args -> class_f (get_object ob_r) meth args) in - let new_class = class_fun x_class ob_ref in - let dircore = C_director_core (C_obj new_class,ob_ref) in - let obj = - cfun (match args with - C_list argl -> (C_list ((dircore :: argl))) - | C_void -> (C_list [ dircore ]) - | a -> (C_list [ dircore ; a ])) in - ob_ref := Some obj ; - obj - end - -let swig_current_type_info = ref C_void -let find_type_info obj = !swig_current_type_info -let _ = Callback.register "swig_find_type_info" find_type_info -let set_type_info obj = - match obj with - C_ptr _ -> swig_current_type_info := obj ; - obj - | _ -> raise (Failure "Internal error: passed non pointer to set_type_info") -let _ = Callback.register "swig_set_type_info" set_type_info - -let class_master_list = Hashtbl.create 20 -let register_class_byname nm co = - Hashtbl.replace class_master_list nm (Obj.magic co) -let create_class nm = - try (Obj.magic (Hashtbl.find class_master_list nm)) with _ -> raise (NoSuchClass nm) diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/swig.mli b/mac/bin/swig/share/swig/4.1.0/ocaml/swig.mli deleted file mode 100755 index c5ffadb1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/swig.mli +++ /dev/null @@ -1,62 +0,0 @@ -(* -*- tuareg -*- *) - -type enum = [ `Int of int ] - -type 'a c_obj_t = - C_void - | C_bool of bool - | C_char of char - | C_uchar of char - | C_short of int - | C_ushort of int - | C_int of int - | C_uint of int32 - | C_int32 of int32 - | C_int64 of int64 - | C_float of float - | C_double of float - | C_ptr of int64 * int64 - | C_array of 'a c_obj_t array - | C_list of 'a c_obj_t list - | C_obj of (string -> 'a c_obj_t -> 'a c_obj_t) - | C_string of string - | C_enum of 'a - | C_director_core of 'a c_obj_t * 'a c_obj_t option ref - -type c_obj = enum c_obj_t - -exception InvalidDirectorCall of c_obj -exception NoSuchClass of string - -val invoke : ('a c_obj_t) -> (string -> 'a c_obj_t -> 'a c_obj_t) -val fnhelper : 'a c_obj_t -> 'a c_obj_t list -val director_core_helper : 'a c_obj_t list -> 'a c_obj_t list - -val get_int : 'a c_obj_t -> int -val get_float : 'a c_obj_t -> float -val get_string : 'a c_obj_t -> string -val get_char : 'a c_obj_t -> char -val get_bool : 'a c_obj_t -> bool - -val make_float : float -> 'a c_obj_t -val make_double : float -> 'a c_obj_t -val make_string : string -> 'a c_obj_t -val make_bool : bool -> 'a c_obj_t -val make_char : char -> 'a c_obj_t -val make_char_i : int -> 'a c_obj_t -val make_uchar : char -> 'a c_obj_t -val make_uchar_i : int -> 'a c_obj_t -val make_short : int -> 'a c_obj_t -val make_ushort : int -> 'a c_obj_t -val make_int : int -> 'a c_obj_t -val make_uint : int -> 'a c_obj_t -val make_int32 : int -> 'a c_obj_t -val make_int64 : int -> 'a c_obj_t - -val new_derived_object: - ('a c_obj_t -> 'a c_obj_t) -> - ('a c_obj_t -> string -> 'a c_obj_t -> 'a c_obj_t) -> - 'a c_obj_t -> 'a c_obj_t - -val register_class_byname : string -> ('a c_obj_t -> 'a c_obj_t) -> unit -val create_class : string -> 'a c_obj_t -> 'a c_obj_t diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/swigmove.i b/mac/bin/swig/share/swig/4.1.0/ocaml/swigmove.i deleted file mode 100755 index 32f9903b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/swigmove.i +++ /dev/null @@ -1,11 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0) { - argp1 = ($&1_ltype) caml_ptr_val($input,$&1_descriptor); - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/swigp4.ml b/mac/bin/swig/share/swig/4.1.0/ocaml/swigp4.ml deleted file mode 100755 index 2f6074a9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/swigp4.ml +++ /dev/null @@ -1,135 +0,0 @@ -open Camlp4 - -module Id : Sig.Id = -struct - let name = "swigp4" - let version = "0.1" -end - -module Make (Syntax : Sig.Camlp4Syntax) = -struct - open Sig - include Syntax - - let _loc = Loc.ghost - let lap x y = x :: y - let c_ify e loc = - match e with - <:expr< $int:_$ >> -> <:expr< (C_int $e$) >> - | <:expr< $str:_$ >> -> <:expr< (C_string $e$) >> - | <:expr< $chr:_$ >> -> <:expr< (C_char $e$) >> - | <:expr< $flo:_$ >> -> <:expr< (C_double $e$) >> - | <:expr< True >> -> <:expr< (C_bool $e$) >> - | <:expr< False >> -> <:expr< (C_bool $e$) >> - | _ -> <:expr< $e$ >> - let mk_list args loc f = - let rec mk_list_inner args loc f = - match args with - [] -> <:expr< [] >> - | x :: xs -> - (let loc = Ast.loc_of_expr x in - <:expr< [ ($f x _loc$) ] @ ($mk_list_inner xs loc f$) >>) in - match args with - [] -> <:expr< (Obj.magic C_void) >> - | [ a ] -> <:expr< (Obj.magic $f a _loc$) >> - | _ -> <:expr< (Obj.magic (C_list ($mk_list_inner args loc f$))) >> ;; - - EXTEND Gram - GLOBAL: expr; - - expr: LEVEL "top" - [ [ e1 = expr ; "'" ; "[" ; e2 = expr ; "]" -> - <:expr< (invoke $e1$) "[]" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) $str:l$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) $str:u$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) $s$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "." ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) "()" ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke ((invoke $e1$) "->" C_void)) $str:l$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke ((invoke $e1$) "->" C_void)) $str:u$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke ((invoke $e1$) "->" C_void)) $s$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "++" -> - <:expr< (invoke $e1$) "++" C_void >> - | e1 = expr ; "'" ; "--" -> - <:expr< (invoke $e1$) "--" C_void >> - | e1 = expr ; "'" ; "-" ; e2 = expr -> - <:expr< (invoke $e1$) "-" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "+" ; e2 = expr -> <:expr< (invoke $e1$) "+" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "*" ; e2 = expr -> <:expr< (invoke $e1$) "*" (C_list [ $c_ify e2 _loc$ ]) >> - | "'" ; "&" ; e1 = expr -> - <:expr< (invoke $e1$) "&" C_void >> - | "'" ; "!" ; e1 = expr -> - <:expr< (invoke $e1$) "!" C_void >> - | "'" ; "~" ; e1 = expr -> - <:expr< (invoke $e1$) "~" C_void >> - | e1 = expr ; "'" ; "/" ; e2 = expr -> - <:expr< (invoke $e1$) "/" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "%" ; e2 = expr -> - <:expr< (invoke $e1$) "%" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsl" ; e2 = expr -> - <:expr< (invoke $e1$) ("<" ^ "<") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsr" ; e2 = expr -> - <:expr< (invoke $e1$) (">" ^ ">") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "<" ; e2 = expr -> - <:expr< (invoke $e1$) "<" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "<=" ; e2 = expr -> - <:expr< (invoke $e1$) "<=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; ">" ; e2 = expr -> - <:expr< (invoke $e1$) ">" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; ">=" ; e2 = expr -> - <:expr< (invoke $e1$) ">=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "==" ; e2 = expr -> - <:expr< (invoke $e1$) "==" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "!=" ; e2 = expr -> - <:expr< (invoke $e1$) "!=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "&" ; e2 = expr -> - <:expr< (invoke $e1$) "&" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "^" ; e2 = expr -> - <:expr< (invoke $e1$) "^" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "|" ; e2 = expr -> - <:expr< (invoke $e1$) "|" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "&&" ; e2 = expr -> - <:expr< (invoke $e1$) "&&" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "||" ; e2 = expr -> - <:expr< (invoke $e1$) "||" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "=" ; e2 = expr -> - <:expr< (invoke $e1$) "=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "+=" ; e2 = expr -> - <:expr< (invoke $e1$) "+=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "-=" ; e2 = expr -> - <:expr< (invoke $e1$) "-=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "*=" ; e2 = expr -> - <:expr< (invoke $e1$) "*=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "/=" ; e2 = expr -> - <:expr< (invoke $e1$) "/=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "%=" ; e2 = expr -> - <:expr< (invoke $e1$) "%=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsl" ; "=" ; e2 = expr -> - <:expr< (invoke $e1$) ("<" ^ "<=") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsr" ; "=" ; e2 = expr -> - <:expr< (invoke $e1$) (">" ^ ">=") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "&=" ; e2 = expr -> - <:expr< (invoke $e1$) "&=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "^=" ; e2 = expr -> - <:expr< (invoke $e1$) "^=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "|=" ; e2 = expr -> - <:expr< (invoke $e1$) "|=" (C_list [ $c_ify e2 _loc$ ]) >> - | "'" ; e = expr -> c_ify e _loc - | c = expr ; "as" ; id = LIDENT -> <:expr< $lid:"get_" ^ id$ $c$ >> - | c = expr ; "to" ; id = LIDENT -> <:expr< $uid:"C_" ^ id$ $c$ >> - | "`" ; "`" ; l = LIDENT -> <:expr< C_enum `$lid:l$ >> - | "`" ; "`" ; u = UIDENT -> <:expr< C_enum `$uid:u$ >> - | f = expr ; "'" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< $f$ ($mk_list args _loc c_ify$) >> - ] ] ; - END ;; - -end - -module M = Register.OCamlSyntaxExtension(Id)(Make) diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/typecheck.i b/mac/bin/swig/share/swig/4.1.0/ocaml/typecheck.i deleted file mode 100755 index 0c0a600a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/typecheck.i +++ /dev/null @@ -1,197 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typecheck.i - * - * Typechecking rules - * ----------------------------------------------------------------------------- */ - -%typecheck(SWIG_TYPECHECK_INT8) char, signed char, const char &, const signed char & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_char: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_UINT8) unsigned char, const unsigned char & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_uchar: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_INT16) short, signed short, const short &, const signed short &, wchar_t { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_short: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_UINT16) unsigned short, const unsigned short & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_ushort: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -// XXX arty -// Will move enum SWIGTYPE later when I figure out what to do with it... - -%typecheck(SWIG_TYPECHECK_INT32) int, signed int, const int &, const signed int &, enum SWIGTYPE { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_int: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_UINT32) unsigned int, const unsigned int & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_uint: $1 = 1; break; - case C_int32: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_INT64) - long, signed long, unsigned long, - long long, signed long long, unsigned long long, - const long &, const signed long &, const unsigned long &, - const long long &, const signed long long &, const unsigned long long &, - size_t, const size_t & -{ - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_int64: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_BOOL) bool, const bool & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_bool: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_FLOAT) float, const float & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_float: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) double, const double & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_double: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_string: $1 = 1; break; - case C_ptr: { - swig_type_info *typeinfo = - (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field($input,1)); - $1 = SWIG_TypeCheck("char *",typeinfo) || - SWIG_TypeCheck("signed char *",typeinfo) || - SWIG_TypeCheck("unsigned char *",typeinfo) || - SWIG_TypeCheck("const char *",typeinfo) || - SWIG_TypeCheck("const signed char *",typeinfo) || - SWIG_TypeCheck("const unsigned char *",typeinfo) || - SWIG_TypeCheck("std::string",typeinfo); - } break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - if (!Is_block($input) || !(SWIG_Tag_val($input) == C_obj || SWIG_Tag_val($input) == C_ptr)) { - $1 = 0; - } else { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, $descriptor); - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - swig_type_info *typeinfo; - if (!Is_block($input)) { - $1 = 0; - } else { - switch (SWIG_Tag_val($input)) { - case C_obj: { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, $&1_descriptor); - break; - } - case C_ptr: { - typeinfo = (swig_type_info *)SWIG_Int64_val(SWIG_Field($input, 1)); - $1 = SWIG_TypeCheck("$1_type", typeinfo) != NULL; - break; - } - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, 0); -} - -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) CAML_VALUE "$1 = 1;" - -/* ------------------------------------------------------------ - * Exception handling - * ------------------------------------------------------------ */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short { - char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, error_msg); -} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] { - (void)$1; - SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, "C++ $1_type exception thrown"); -} - -%typemap(throws) char * { - SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1); -} diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/typemaps.i b/mac/bin/swig/share/swig/4.1.0/ocaml/typemaps.i deleted file mode 100755 index 39231e22..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/typemaps.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ---------------------------------------------------------------------------- - * typemaps.i - * - * These typemaps provide support for input/output arguments for C/C++ pointers - * and C++ references. -* ---------------------------------------------------------------------------- */ - -%define INPUT_OUTPUT_INOUT_TYPEMAPS(type, c_to_ocaml, ocaml_to_c) -%typemap(in) type *INPUT(type temp), type &INPUT(type temp) { - temp = (type)ocaml_to_c($input); - $1 = &temp; -} -%typemap(typecheck) type *INPUT = type; -%typemap(typecheck) type &INPUT = type; - -%typemap(in, numinputs=0) type *OUTPUT($*1_ltype temp), type &OUTPUT($*1_ltype temp) "$1 = &temp;" -%typemap(argout) type *OUTPUT, type &OUTPUT { - swig_result = caml_list_append(swig_result, c_to_ocaml(*$1)); -} -%typemap(in) type *INOUT = type *INPUT; -%typemap(in) type &INOUT = type &INPUT; - -%typemap(argout) type *INOUT = type *OUTPUT; -%typemap(argout) type &INOUT = type &OUTPUT; - -%typemap(typecheck) type *INOUT = type; -%typemap(typecheck) type &INOUT = type; -%enddef - -INPUT_OUTPUT_INOUT_TYPEMAPS(bool, caml_val_bool, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(int, caml_val_int, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(long, caml_val_long, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(short, caml_val_int, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(char, caml_val_char, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(signed char, caml_val_char, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(float, caml_val_float, caml_double_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(double, caml_val_double, caml_double_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned int, caml_val_uint, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned long, caml_val_ulong, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned short, caml_val_ushort, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned char, caml_val_uchar, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(long long, caml_val_long, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned long long, caml_val_ulong, caml_long_val); -#undef INPUT_OUTPUT_INOUT_TYPEMAPS diff --git a/mac/bin/swig/share/swig/4.1.0/ocaml/typeregister.swg b/mac/bin/swig/share/swig/4.1.0/ocaml/typeregister.swg deleted file mode 100755 index c3ba904a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ocaml/typeregister.swg +++ /dev/null @@ -1,2 +0,0 @@ -SWIGEXT void SWIG_init() { - SWIG_InitializeModule(0); diff --git a/mac/bin/swig/share/swig/4.1.0/octave/argcargv.i b/mac/bin/swig/share/swig/4.1.0/octave/argcargv.i deleted file mode 100755 index 8d455e58..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/argcargv.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - if ($input.is_scalar_type()) { - $1 = 0; $2 = NULL; - %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' is not a list", $symname, $argnum); - } - octave_value_list list = $input.list_value(); - int i, len = list.length(); - $1 = ($1_ltype) len; - $2 = (char **) malloc((len+1)*sizeof(char *)); - for (i = 0; i < len; i++) { - if (!list(i).is_string()) { - $1 = 0; - %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' use a non-string", $symname, $argnum); - } - $2[i] = (char *)list(i).string_value().c_str(); - } - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = 0; - const octave_value& ov = $input; - if (!ov.is_scalar_type()) { - octave_value_list list = ov.list_value(); - int i, len = list.length(); - $1 = 1; - for (i = 0; i < len; i++) { - if (!list(i).is_string()) { - $1 = 0; - break; - } - } - } -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/mac/bin/swig/share/swig/4.1.0/octave/attribute.i b/mac/bin/swig/share/swig/4.1.0/octave/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/boost_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/octave/boost_shared_ptr.i deleted file mode 100755 index 87c89b5f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/boost_shared_ptr.i +++ /dev/null @@ -1,401 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/octave/carrays.i b/mac/bin/swig/share/swig/4.1.0/octave/carrays.i deleted file mode 100755 index 014de37f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/carrays.i +++ /dev/null @@ -1,5 +0,0 @@ -%define %array_class(TYPE,NAME) - %array_class_wrap(TYPE,NAME,__paren__,__paren_asgn__) -%enddef - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/cdata.i b/mac/bin/swig/share/swig/4.1.0/octave/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/cmalloc.i b/mac/bin/swig/share/swig/4.1.0/octave/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/director.swg b/mac/bin/swig/share/swig/4.1.0/octave/director.swg deleted file mode 100755 index 5b9cd86e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/director.swg +++ /dev/null @@ -1,146 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Octave proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -namespace Swig { - - class Director { - octave_swig_type *self; - bool swig_disowned; - - Director(const Director &x); - Director &operator=(const Director &rhs); - public: - - Director(void *vptr):self(0), swig_disowned(false) { - set_rtdir(vptr, this); - } - - ~Director() { - swig_director_destroyed(self, this); - if (swig_disowned) - self->decref(); - } - - void swig_set_self(octave_swig_type *new_self) { - assert(!swig_disowned); - self = new_self; - } - - octave_swig_type *swig_get_self() const { - return self; - } - - void swig_disown() { - if (swig_disowned) - return; - swig_disowned = true; - self->incref(); - } - }; - - // Base class for director exceptions. - class DirectorException : public std::exception { - public: - static void raise(const char *msg) { - // ... todo - throw DirectorException(); - } - - static void raise(const octave_value &ov, const char *msg) { - // ... todo - raise(msg); - } - }; - - class DirectorTypeMismatchException : public DirectorException { - public: - static void raise(const char *msg) { - // ... todo - throw DirectorTypeMismatchException(); - } - - static void raise(const octave_value &ov, const char *msg) { - // ... todo - raise(msg); - } - }; - - class DirectorPureVirtualException : public DirectorException { - public: - static void raise(const char *msg) { - // ... todo - throw DirectorPureVirtualException(); - } - - static void raise(const octave_value &ov, const char *msg) { - // ... todo - raise(msg); - } - }; - - SWIGINTERN rtdir_map *get_rtdir_map() { - static swig_module_info *module = 0; - if (!module) - module = SWIG_GetModule(0); - if (!module) - return 0; - if (!module->clientdata) - module->clientdata = new rtdir_map; - return (rtdir_map *) module->clientdata; - } - - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *d) { - rtdir_map *rm = get_rtdir_map(); - if (rm) - (*rm)[vptr] = d; - } - - SWIGINTERNINLINE void erase_rtdir(void *vptr) { - rtdir_map *rm = get_rtdir_map(); - if (rm) - (*rm).erase(vptr); - } - - SWIGINTERNINLINE Director *get_rtdir(void *vptr) { - rtdir_map *rm = get_rtdir_map(); - if (!rm) - return 0; - rtdir_map::const_iterator pos = rm->find(vptr); - Director *rtdir = (pos != rm->end())? pos->second : 0; - return rtdir; - } - - SWIGRUNTIME void swig_director_destroyed(octave_swig_type *self, Director *d) { - self->director_destroyed(d); - } - - SWIGRUNTIME octave_swig_type *swig_director_get_self(Director *d) { - return d->swig_get_self(); - } - - SWIGRUNTIME void swig_director_set_self(Director *d, octave_swig_type *self) { - d->swig_set_self(self); - } - -} - -SWIGRUNTIME void swig_acquire_ownership(void *vptr) { - // assert(0); - // ... todo -} - -SWIGRUNTIME void swig_acquire_ownership_array(void *vptr) { - // assert(0); - // ... todo -} - -SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own) { - // assert(0); - // ... todo -} diff --git a/mac/bin/swig/share/swig/4.1.0/octave/exception.i b/mac/bin/swig/share/swig/4.1.0/octave/exception.i deleted file mode 100755 index 2f0f489a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/exception.i +++ /dev/null @@ -1,14 +0,0 @@ -%include - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) -} - -%define SWIG_RETHROW_OCTAVE_EXCEPTIONS - /* rethrow any exceptions thrown by Octave */ -%#if SWIG_OCTAVE_PREREQ(4,2,0) - catch (octave::execution_exception& _e) { throw; } - catch (octave::exit_exception& _e) { throw; } - catch (octave::interrupt_exception& _e) { throw; } -%#endif -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/octave/extra-install.list b/mac/bin/swig/share/swig/4.1.0/octave/extra-install.list deleted file mode 100755 index 41ef9477..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/extra-install.list +++ /dev/null @@ -1,2 +0,0 @@ -# see top-level Makefile.in -octheaders.hpp diff --git a/mac/bin/swig/share/swig/4.1.0/octave/factory.i b/mac/bin/swig/share/swig/4.1.0/octave/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/implicit.i b/mac/bin/swig/share/swig/4.1.0/octave/implicit.i deleted file mode 100755 index 152c2b05..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/implicit.i +++ /dev/null @@ -1,7 +0,0 @@ -%include -%include - -#warning "This file provides the %implicit directive, which is an old and fragile" -#warning "way to implement the C++ implicit conversion mechanism." -#warning "Try using the more robust '%implicitconv Type;' directive instead." - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octave.swg b/mac/bin/swig/share/swig/4.1.0/octave/octave.swg deleted file mode 100755 index 872054d8..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octave.swg +++ /dev/null @@ -1,8 +0,0 @@ -%include -%include -%include -%include -%include -%include - -%define %docstring %feature("docstring") %enddef diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octcomplex.swg b/mac/bin/swig/share/swig/4.1.0/octave/octcomplex.swg deleted file mode 100755 index 553c25a3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octcomplex.swg +++ /dev/null @@ -1,92 +0,0 @@ -/* - Defines the As/From conversors for double/float complex, you need to - provide complex Type, the Name you want to use in the conversors, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from conversor */ -%define %swig_fromcplx_conv(Type, OctConstructor, Real, Imag) - %fragment(SWIG_From_frag(Type),"header") -{ - SWIGINTERNINLINE octave_value - SWIG_From(Type)(const Type& c) - { - return octave_value(OctConstructor(Real(c), Imag(c))); - } -} -%enddef - -// the double case -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) - %fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ - SWIGINTERN int - SWIG_AsVal(Type) (const octave_value& ov, Type* val) - { - if (ov.is_complex_scalar()) { - if (val) { - Complex c(ov.complex_value()); - *val=Constructor(c.real(),c.imag()); - } - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(ov, &d)); - if (SWIG_IsOK(res)) { - if (val) - *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; - } -} -%swig_fromcplx_conv(Type, Complex, Real, Imag); -%enddef - -// the float case -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) - %fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { - SWIGINTERN int - SWIG_AsVal(Type) (const octave_value& ov, Type* val) - { - if (ov.is_complex_scalar()) { - if (val) { - Complex c(ov.complex_value()); - double re = c.real(); - double im = c.imag(); - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) - *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else - return SWIG_OverflowError; - } - } else { - float d; - int res = SWIG_AddCast(SWIG_AsVal(float)(ov, &d)); - if (SWIG_IsOK(res)) { - if (val) - *val = Constructor(d, 0.0f); - return res; - } - } - return SWIG_TypeError; - } -} - -%swig_fromcplx_conv(Type, FloatComplex, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octcontainer.swg b/mac/bin/swig/share/swig/4.1.0/octave/octcontainer.swg deleted file mode 100755 index 394c90ba..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octcontainer.swg +++ /dev/null @@ -1,623 +0,0 @@ -/* ----------------------------------------------------------------------------- - * octcontainer.swg - * - * Octave cell <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Octave, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - -%include - -// The Octave C++ Wrap - -%fragment(""); - -%include - -%fragment(SWIG_Traits_frag(octave_value),"header",fragment="StdTraits") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "octave_value"; } - }; - - template <> struct traits_from { - typedef octave_value value_type; - static octave_value from(const value_type& val) { - return val; - } - }; - - template <> - struct traits_check { - static bool check(const octave_value&) { - return true; - } - }; - - template <> struct traits_asval { - typedef octave_value value_type; - static int asval(const octave_value& obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} -} - -%fragment("OctSequence_Base","header",fragment="") -{ - -namespace std { - template <> - struct less - { - bool - operator()(const octave_value& v, const octave_value& w) const - { - octave_value res = do_binary_op(octave_value::op_le,v,w); - return res.is_true(); - } - }; -} - -namespace swig { - inline size_t - check_index(ptrdiff_t i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - - throw std::out_of_range("index out of range"); - } - - inline size_t - slice_index(ptrdiff_t i, size_t size) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) { - return (size_t) (i + size); - } else { - throw std::out_of_range("index out of range"); - } - } else { - return ( (size_t) i < size ) ? ((size_t) i) : size; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (jj > ii) { - typename Sequence::const_iterator vb = self->begin(); - typename Sequence::const_iterator ve = self->begin(); - std::advance(vb,ii); - std::advance(ve,jj); - return new Sequence(vb, ve); - } else { - return new Sequence(); - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj < ii) jj = ii; - size_t ssize = jj - ii; - if (ssize <= v.size()) { - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); - std::advance(sb,ii); - std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); - } else { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj > ii) { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - } - } -} -} - -%fragment("OctSequence_Cont","header", - fragment="StdTraits", - fragment="OctSequence_Base", - fragment="OctSwigIterator_T") -{ -namespace swig -{ - template - struct OctSequence_Ref // * octave can't support these, because of how assignment works - { - OctSequence_Ref(const octave_value& seq, int index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - // swig::SwigVar_PyObject item = OctSequence_GetItem(_seq, _index); - octave_value item; // * todo - try { - return swig::as(item); - } catch (const std::exception& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", _index); - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - SWIG_Octave_AddErrorMsg(msg); - SWIG_Octave_AddErrorMsg(e.what()); - throw; - } - } - - OctSequence_Ref& operator=(const T& v) - { - // OctSequence_SetItem(_seq, _index, swig::from(v)); - // * todo - return *this; - } - - private: - octave_value _seq; - int _index; - }; - - template - struct OctSequence_ArrowProxy - { - OctSequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct OctSequence_InputIterator - { - typedef OctSequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - - OctSequence_InputIterator() - { - } - - OctSequence_InputIterator(const octave_value& seq, int index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - OctSequence_ArrowProxy - operator->() const { - return OctSequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - octave_value _seq; - difference_type _index; - }; - - template - struct OctSequence_Cont - { - typedef OctSequence_Ref reference; - typedef const OctSequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - typedef int size_type; - typedef const pointer const_pointer; - typedef OctSequence_InputIterator iterator; - typedef OctSequence_InputIterator const_iterator; - - OctSequence_Cont(const octave_value& seq) : _seq(seq) - { - // * assert that we have map type etc. - /* - if (!OctSequence_Check(seq)) { - throw std::invalid_argument("a sequence is expected"); - } - _seq = seq; - Py_INCREF(_seq); - */ - } - - ~OctSequence_Cont() - { - } - - size_type size() const - { - // return static_cast(OctSequence_Size(_seq)); - return 0; // * todo - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - int s = size(); - for (int i = 0; i < s; ++i) { - // swig::SwigVar_PyObject item = OctSequence_GetItem(_seq, i); - octave_value item; // * todo - if (!swig::check(item)) - return false; - } - return true; - } - - private: - octave_value _seq; - }; - -} -} - -%define %swig_sequence_iterator(Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - class iterator; - class reverse_iterator; - class const_iterator; - class const_reverse_iterator; - - %typemap(out,noblock=1,fragment="OctSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - $result = SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &)), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN); - } - %typemap(out,fragment="OctSequence_Cont") - std::pair, std::pair { - octave_value_list tmpc; - tmpc.append(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &).first), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN)); - tmpc.append(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &).second), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN)); - $result = Cell(tmpc); - } - - %fragment("SwigPyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="OctSequence_Cont") {} - - %typemap(out,fragment="OctPairBoolOutputIterator") - std::pair, std::pair { - octave_value_list tmpc; - tmpc.append(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &).first), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN)); - tmpc.append(SWIG_From(bool)(%static_cast($1,const $type &).second)); - $result = Cell(tmpc); - } - - %typemap(in,noblock=1,fragment="OctSequence_Cont") - iterator(swig::OctSwigIterator *iter = 0, int res), - reverse_iterator(swig::OctSwigIterator *iter = 0, int res), - const_iterator(swig::OctSwigIterator *iter = 0, int res), - const_reverse_iterator(swig::OctSwigIterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::OctSwigIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::OctSwigIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="OctSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - swig::OctSwigIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::OctSwigIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("OctSequence_Cont"); -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - -// The octave container methods - -%define %swig_container_methods(Container...) -%enddef - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - - %fragment("OctSequence_Base"); - - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - value_type __paren__(difference_type i) throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __paren_asgn__(difference_type i, value_type x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - - void append(value_type x) { - self->push_back(x); - } - } - -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="OctSequence_Cont") -{ -namespace swig { - template - inline void - assign(const OctSeq& octseq, Seq* seq) { -%#ifdef SWIG_STD_NOASSIGN_STL - typedef typename OctSeq::value_type value_type; - typename OctSeq::const_iterator it = octseq.begin(); - for (;it != octseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } -%#else - seq->assign(octseq.begin(), octseq.end()); -%#endif - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(const octave_value& obj, sequence **seq) { - if (!obj.is_defined() || Swig::swig_value_deref(obj)) { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } -%#if SWIG_OCTAVE_PREREQ(4,4,0) - } else if (obj.iscell()) { -%#else - } else if (obj.is_cell()) { -%#endif - try { - OctSequence_Cont octseq(obj); - if (seq) { - sequence *pseq = new sequence(); - assign(octseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return octseq.check() ? SWIG_OK : SWIG_ERROR; - } - } -%#if SWIG_OCTAVE_PREREQ(6,0,0) - catch (octave::execution_exception& exec) { - } -%#endif - catch (std::exception& e) { -%#if SWIG_OCTAVE_PREREQ(6,0,0) - if (seq) // Know that octave is not in an error state -%#else - if (seq&&!error_state) -%#endif - error("swig type error: %s",e.what()); - return SWIG_ERROR; - } - } - return SWIG_ERROR; - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static octave_value from(const sequence& seq) { -#ifdef SWIG_OCTAVE_EXTRA_NATIVE_CONTAINERS - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); - } -#endif - size_type size = seq.size(); - if (size <= (size_type)INT_MAX) { - Cell c(size,1); - int i = 0; - for (const_iterator it = seq.begin(); - it != seq.end(); ++it, ++i) { - c(i) = swig::from(*it); - } - return c; - } else { - error("swig overflow error: sequence size not valid in octave"); - return octave_value(); - } - return octave_value(); - } - }; -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octfragments.swg b/mac/bin/swig/share/swig/4.1.0/octave/octfragments.swg deleted file mode 100755 index 8b137891..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octfragments.swg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octheaders.hpp b/mac/bin/swig/share/swig/4.1.0/octave/octheaders.hpp deleted file mode 100755 index 26e5564d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octheaders.hpp +++ /dev/null @@ -1,130 +0,0 @@ -// -// This header includes all C++ headers required for generated Octave wrapper code. -// Using a single header file allows pre-compilation of Octave headers, as follows: -// * Check out this header file: -// swig -octave -co octheaders.hpp -// * Pre-compile header file into octheaders.hpp.gch: -// g++ -c ... octheaders.hpp -// * Use pre-compiled header file: -// g++ -c -include octheaders.hpp ... -// - -#if !defined(SWIG_OCTAVE_OCTHEADERS_HPP) -#define SWIG_OCTAVE_OCTHEADERS_HPP - -// Required C++ headers -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Minimal headers to define Octave version -#include -#include - -// Macro for enabling features which require Octave version >= major.minor.patch -// - Use (OCTAVE_PATCH_VERSION + 0) to handle both '' (released) and '+' (in development) patch numbers -#define SWIG_OCTAVE_PREREQ(major, minor, patch) \ - ( (OCTAVE_MAJOR_VERSION<<16) + (OCTAVE_MINOR_VERSION<<8) + (OCTAVE_PATCH_VERSION + 0) >= ((major)<<16) + ((minor)<<8) + (patch) ) - -// Reconstruct Octave major, minor, and patch versions for releases prior to 3.8.1 -#if !defined(OCTAVE_MAJOR_VERSION) - -# if !defined(OCTAVE_API_VERSION_NUMBER) - -// Hack to distinguish between Octave 3.8.0, which removed OCTAVE_API_VERSION_NUMBER but did not yet -// introduce OCTAVE_MAJOR_VERSION, and Octave <= 3.2, which did not define OCTAVE_API_VERSION_NUMBER -# include -# if defined(octave_ov_h) -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 8 -# define OCTAVE_PATCH_VERSION 0 -# else - -// Hack to distinguish between Octave 3.2 and earlier versions, before OCTAVE_API_VERSION_NUMBER existed -# define ComplexLU __ignore -# include -# undef ComplexLU -# if defined(octave_Complex_LU_h) - -// We know only that this version is prior to Octave 3.2, i.e. OCTAVE_API_VERSION_NUMBER < 37 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 1 -# define OCTAVE_PATCH_VERSION 99 - -# else - -// OCTAVE_API_VERSION_NUMBER == 37 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 2 -# define OCTAVE_PATCH_VERSION 0 - -# endif // defined(octave_Complex_LU_h) - -# endif // defined(octave_ov_h) - -// Correlation between Octave API and version numbers extracted from Octave's -// ChangeLogs; version is the *earliest* released Octave with that API number -# elif OCTAVE_API_VERSION_NUMBER >= 48 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 6 -# define OCTAVE_PATCH_VERSION 0 - -# elif OCTAVE_API_VERSION_NUMBER >= 45 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 4 -# define OCTAVE_PATCH_VERSION 1 - -# elif OCTAVE_API_VERSION_NUMBER >= 42 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 54 - -# elif OCTAVE_API_VERSION_NUMBER >= 41 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 53 - -# elif OCTAVE_API_VERSION_NUMBER >= 40 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 52 - -# elif OCTAVE_API_VERSION_NUMBER >= 39 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 51 - -# else // OCTAVE_API_VERSION_NUMBER == 38 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 50 - -# endif // !defined(OCTAVE_API_VERSION_NUMBER) - -#endif // !defined(OCTAVE_MAJOR_VERSION) - -// Required Octave headers -#include -#include -#include -#include -#include -#include -#include -#if SWIG_OCTAVE_PREREQ(4,2,0) -#include -#else -#include -#endif -#include -#if SWIG_OCTAVE_PREREQ(4,2,0) -#include -#endif - -#endif // !defined(SWIG_OCTAVE_OCTHEADERS_HPP) diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octiterators.swg b/mac/bin/swig/share/swig/4.1.0/octave/octiterators.swg deleted file mode 100755 index e186c94a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octiterators.swg +++ /dev/null @@ -1,357 +0,0 @@ -/* ----------------------------------------------------------------------------- - * octiterators.swg - * - * Users can derive form the OctSwigIterator to implement their - * own iterators. As an example (real one since we use it for STL/STD - * containers), the template OctSwigIterator_T does the - * implementation for generic C++ iterators. - * ----------------------------------------------------------------------------- */ - -%include - -%fragment("OctSwigIterator","header",fragment="") { -namespace swig { - struct stop_iteration { - }; - - struct OctSwigIterator { - private: - octave_value _seq; - - protected: - OctSwigIterator(octave_value seq) : _seq(seq) - { - } - - public: - virtual ~OctSwigIterator() {} - - virtual octave_value value() const = 0; - - virtual OctSwigIterator *incr(size_t n = 1) = 0; - - virtual OctSwigIterator *decr(size_t n = 1) - { - throw stop_iteration(); - } - - virtual ptrdiff_t distance(const OctSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual bool equal (const OctSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual OctSwigIterator *copy() const = 0; - - octave_value next() - { - octave_value obj = value(); - incr(); - return obj; - } - - octave_value previous() - { - decr(); - return value(); - } - - OctSwigIterator *advance(ptrdiff_t n) - { - return (n > 0) ? incr(n) : decr(-n); - } - - bool operator == (const OctSwigIterator& x) const - { - return equal(x); - } - - bool operator != (const OctSwigIterator& x) const - { - return ! operator==(x); - } - - OctSwigIterator* operator ++ () { - incr(); - return this; - } - - OctSwigIterator* operator -- () { - decr(); - return this; - } - - OctSwigIterator* operator + (ptrdiff_t n) const - { - return copy()->advance(n); - } - - OctSwigIterator* operator - (ptrdiff_t n) const - { - return copy()->advance(-n); - } - - ptrdiff_t operator - (const OctSwigIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::OctSwigIterator *"); - init = 1; - } - return desc; - } - }; -} -} - -%fragment("OctSwigIterator_T","header",fragment="",fragment="OctSwigIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - template - class OctSwigIterator_T : public OctSwigIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef OctSwigIterator_T self_type; - - OctSwigIterator_T(out_iterator curr, octave_value seq) - : OctSwigIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const OctSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const OctSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef octave_value result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - template::value_type, - typename FromOper = from_oper > - class OctSwigIteratorOpen_T : public OctSwigIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef OctSwigIterator_T base; - typedef OctSwigIteratorOpen_T self_type; - - OctSwigIteratorOpen_T(out_iterator curr, octave_value seq) - : OctSwigIterator_T(curr, seq) - { - } - - octave_value value() const { - return from(static_cast(*(base::current))); - } - - OctSwigIterator *copy() const - { - return new self_type(*this); - } - - OctSwigIterator *incr(size_t n = 1) - { - while (n--) { - ++base::current; - } - return this; - } - - OctSwigIterator *decr(size_t n = 1) - { - while (n--) { - --base::current; - } - return this; - } - }; - - template::value_type, - typename FromOper = from_oper > - class OctSwigIteratorClosed_T : public OctSwigIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef OctSwigIterator_T base; - typedef OctSwigIteratorClosed_T self_type; - - OctSwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, octave_value seq) - : OctSwigIterator_T(curr, seq), begin(first), end(last) - { - } - - octave_value value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - OctSwigIterator *copy() const - { - return new self_type(*this); - } - - OctSwigIterator *incr(size_t n = 1) - { - while (n--) { - if (base::current == end) { - throw stop_iteration(); - } else { - ++base::current; - } - } - return this; - } - - OctSwigIterator *decr(size_t n = 1) - { - while (n--) { - if (base::current == begin) { - throw stop_iteration(); - } else { - --base::current; - } - } - return this; - } - - private: - out_iterator begin; - out_iterator end; - }; - - template - inline OctSwigIterator* - make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, octave_value seq = octave_value()) - { - return new OctSwigIteratorClosed_T(current, begin, end, seq); - } - - template - inline OctSwigIterator* - make_output_iterator(const OutIter& current, octave_value seq = octave_value()) - { - return new OctSwigIteratorOpen_T(current, seq); - } -} -} - - -%fragment("OctSwigIterator"); -namespace swig -{ -// Throw a StopIteration exception - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws) stop_iteration { - error("stop_iteration exception"); - SWIG_fail; - } - -// Mark methods that return new objects - %newobject OctSwigIterator::copy; - %newobject OctSwigIterator::operator + (ptrdiff_t n) const; - %newobject OctSwigIterator::operator - (ptrdiff_t n) const; - - %nodirector OctSwigIterator; - - %catches(swig::stop_iteration) OctSwigIterator::value() const; - %catches(swig::stop_iteration) OctSwigIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) OctSwigIterator::decr(size_t n = 1); - %catches(std::invalid_argument) OctSwigIterator::distance(const OctSwigIterator &x) const; - %catches(std::invalid_argument) OctSwigIterator::equal (const OctSwigIterator &x) const; - %catches(swig::stop_iteration) OctSwigIterator::next(); - %catches(swig::stop_iteration) OctSwigIterator::previous(); - %catches(swig::stop_iteration) OctSwigIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) OctSwigIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) OctSwigIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) OctSwigIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) OctSwigIterator::operator - (ptrdiff_t n) const; - - - struct OctSwigIterator - { - protected: - OctSwigIterator(octave_value seq); - - public: - virtual ~OctSwigIterator(); - - virtual octave_value value() const = 0; - - virtual OctSwigIterator *incr(size_t n = 1) = 0; - - virtual OctSwigIterator *decr(size_t n = 1); - - virtual ptrdiff_t distance(const OctSwigIterator &x) const; - - virtual bool equal (const OctSwigIterator &x) const; - - virtual OctSwigIterator *copy() const = 0; - - octave_value next(); - octave_value previous(); - OctSwigIterator *advance(ptrdiff_t n); - - bool operator == (const OctSwigIterator& x) const; - bool operator != (const OctSwigIterator& x) const; - OctSwigIterator* operator ++ (); - OctSwigIterator* operator -- (); - OctSwigIterator* operator + (ptrdiff_t n) const; - OctSwigIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const OctSwigIterator& x) const; - }; -} - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octopers.swg b/mac/bin/swig/share/swig/4.1.0/octave/octopers.swg deleted file mode 100755 index 665b7033..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octopers.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus - -// operators supported in Octave, and the methods they are routed to - -// __brace__ a{args} -// __brace_asgn__ a{args} = rhs -// __paren__ a(args) -// __paren_asgn__ a(args) = rhs -// __str__ generates string rep - -// __not__ !a -// __uplus__ +a -// __uminus__ -a -// __transpose__ a.' -// __hermitian__ a' -// __incr__ a++ -// __decr__ a-- -// __add__ a + b -// __sub__ a - b -// __mul__ a * b -// __div__ a / b -// __pow__ a ^ b -// __ldiv__ a \ b -// __lt__ a < b -// __le__ a <= b -// __eq__ a == b -// __ge__ a >= b -// __gt__ a > b -// __ne__ a != b -// __el_mul__ a .* b -// __el_div__ a ./ b -// __el_pow__ a .^ b -// __el_ldiv__ a .\ b -// __el_and__ a & b -// __el_or__ a | b - -// operators supported in C++, and the methods that route to them - -%rename(__add__) *::operator+; -%rename(__add__) *::operator+(); -%rename(__add__) *::operator+() const; -%rename(__sub__) *::operator-; -%rename(__uminus__) *::operator-(); -%rename(__uminus__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__mod__) *::operator%; -%rename(__el_and__) *::operator&&; -%rename(__el_or__) *::operator||; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__lt__) *::operator<; -%rename(__le__) *::operator<=; -%rename(__gt__) *::operator>; -%rename(__ge__) *::operator>=; -%rename(__eq__) *::operator==; -%rename(__ne__) *::operator!=; -%rename(__not__) *::operator!; -%rename(__incr__) *::operator++; -%rename(__decr__) *::operator--; -%rename(__paren__) *::operator(); -%rename(__brace__) *::operator[]; - -// Ignored inplace operators -%ignoreoperator(PLUSEQ) operator+=; -%ignoreoperator(MINUSEQ) operator-=; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; - -// Ignored operators -%ignoreoperator(EQ) operator=; -%ignoreoperator(ARROWSTAR) operator->*; -%ignoreoperator(LSHIFT) operator<<; -%ignoreoperator(RSHIFT) operator>>; - -#endif /* __cplusplus */ diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octprimtypes.swg b/mac/bin/swig/share/swig/4.1.0/octave/octprimtypes.swg deleted file mode 100755 index 1c9aa908..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octprimtypes.swg +++ /dev/null @@ -1,254 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - - -// boolean - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE octave_value - SWIG_From_dec(bool)(bool value) -{ - return octave_value(value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(const octave_value& ov, bool *val) -{ -%#if SWIG_OCTAVE_PREREQ(4,4,0) - if (!ov.islogical()) -%#else - if (!ov.is_bool_type()) -%#endif - return SWIG_ERROR; - if (val) - *val = ov.bool_value(); - return SWIG_OK; -} -} - -// long - -%fragment(SWIG_From_frag(long),"header") { - SWIGINTERNINLINE octave_value SWIG_From_dec(long) (long value) - { - return octave_value(value); - } -} - - -%fragment(SWIG_AsVal_frag(long),"header") { - SWIGINTERN int SWIG_AsVal_dec(long)(const octave_value& ov, long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v!=floor(v)) - return SWIG_TypeError; - } - if (val) - *val = ov.long_value(); - return SWIG_OK; - } -} - -// unsigned long - -%fragment(SWIG_From_frag(unsigned long),"header") { - SWIGINTERNINLINE octave_value SWIG_From_dec(unsigned long) (unsigned long value) - { - return octave_value(value); - } -} - - -%fragment(SWIG_AsVal_frag(unsigned long),"header") { - SWIGINTERN int SWIG_AsVal_dec(unsigned long)(const octave_value& ov, unsigned long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v<0) - return SWIG_OverflowError; - if (v!=floor(v)) - return SWIG_TypeError; - } - if (ov.is_int8_type()||ov.is_int16_type()|| - ov.is_int32_type()) { - long v=ov.long_value(); - if (v<0) - return SWIG_OverflowError; - } - if (ov.is_int64_type()) { - long long v=ov.int64_scalar_value().value(); - if (v<0) - return SWIG_OverflowError; - } - if (val) - *val = ov.ulong_value(); - return SWIG_OK; - } -} - -// long long - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERNINLINE octave_value SWIG_From_dec(long long) (long long value) - { - return octave_int64(value); - } -%#endif -} - - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERN int SWIG_AsVal_dec(long long)(const octave_value& ov, long long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v!=floor(v)) - return SWIG_TypeError; - } - if (val) { - if (ov.is_int64_type()) - *val = ov.int64_scalar_value().value(); - else if (ov.is_uint64_type()) - *val = ov.uint64_scalar_value().value(); - else - *val = ov.long_value(); - } - return SWIG_OK; - } -%#endif -} - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERNINLINE octave_value SWIG_From_dec(unsigned long long) (unsigned long long value) - { - return octave_uint64(value); - } -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERN int SWIG_AsVal_dec(unsigned long long)(const octave_value& ov, unsigned long long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v<0) - return SWIG_OverflowError; - if (v!=floor(v)) - return SWIG_TypeError; - } - if (ov.is_int8_type()||ov.is_int16_type()|| - ov.is_int32_type()) { - long v=ov.long_value(); - if (v<0) - return SWIG_OverflowError; - } - if (ov.is_int64_type()) { - long long v=ov.int64_scalar_value().value(); - if (v<0) - return SWIG_OverflowError; - } - if (val) { - if (ov.is_int64_type()) - *val = ov.int64_scalar_value().value(); - else if (ov.is_uint64_type()) - *val = ov.uint64_scalar_value().value(); - else - *val = ov.long_value(); - } - return SWIG_OK; - } -%#endif -} - -// double - -%fragment(SWIG_From_frag(double),"header") { - SWIGINTERNINLINE octave_value SWIG_From_dec(double) (double value) - { - return octave_value(value); - } -} - - -%fragment(SWIG_AsVal_frag(double),"header") { - SWIGINTERN int SWIG_AsVal_dec(double)(const octave_value& ov, double* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (val) - *val = ov.double_value(); - return SWIG_OK; - } -} - -// const char* (strings) - -%fragment("SWIG_AsCharPtrAndSize","header") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(octave_value ov, char** cptr, size_t* psize, int *alloc) -{ - if ( -%#if SWIG_OCTAVE_PREREQ(4,4,0) - ov.iscell() -%#else - ov.is_cell() -%#endif - && ov.rows() == 1 && ov.columns() == 1) - ov = ov.cell_value()(0); - if (!ov.is_string()) - return SWIG_TypeError; - - std::string str=ov.string_value(); - size_t len=str.size(); - char* cstr=(char*)str.c_str(); - if (alloc) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else if (cptr) - *cptr = cstr; - if (psize) - *psize = len + 1; - return SWIG_OK; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE octave_value -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - return std::string(carray,carray+size); -} -} - - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octrun.swg b/mac/bin/swig/share/swig/4.1.0/octave/octrun.swg deleted file mode 100755 index 2973318c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octrun.swg +++ /dev/null @@ -1,1669 +0,0 @@ -#if !SWIG_OCTAVE_PREREQ(3,2,0) -#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, FS ## cname, args, nargout, doc) -#else -#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, G ## cname, args, nargout, doc) -#endif - -SWIGRUNTIME bool SWIG_check_num_args(const char *func_name, int num_args, int max_args, int min_args, int varargs) { - if (num_args > max_args && !varargs) - error("function %s takes at most %i arguments", func_name, max_args); - else if (num_args < min_args) - error("function %s requires at least %i arguments", func_name, min_args); - else - return true; - return false; -} - -SWIGRUNTIME octave_value_list *SWIG_Octave_AppendOutput(octave_value_list *ovl, const octave_value &ov) { - ovl->append(ov); - return ovl; -} - -SWIGRUNTIME octave_value SWIG_ErrorType(int code) { - switch (code) { - case SWIG_MemoryError: - return "SWIG_MemoryError"; - case SWIG_IOError: - return "SWIG_IOError"; - case SWIG_RuntimeError: - return "SWIG_RuntimeError"; - case SWIG_IndexError: - return "SWIG_IndexError"; - case SWIG_TypeError: - return "SWIG_TypeError"; - case SWIG_DivisionByZero: - return "SWIG_DivisionByZero"; - case SWIG_OverflowError: - return "SWIG_OverflowError"; - case SWIG_SyntaxError: - return "SWIG_SyntaxError"; - case SWIG_ValueError: - return "SWIG_ValueError"; - case SWIG_SystemError: - return "SWIG_SystemError"; - case SWIG_AttributeError: - return "SWIG_AttributeError"; - } - return "SWIG unknown error"; -} - -SWIGRUNTIME octave_value SWIG_Error(int code, const char *msg) { - octave_value type(SWIG_ErrorType(code)); - std::string r = msg; - r += " (" + type.string_value() + ")"; - error("%s", r.c_str()); - return octave_value(r); -} - -#define SWIG_fail goto fail - -#define SWIG_Octave_ConvertPtr(obj, pptr, type, flags) SWIG_Octave_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Octave_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Octave_ConvertPtrAndOwn(obj, pptr, type, flags, own) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Octave_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Octave_NewPointerObj(ptr, type, flags) -#define swig_owntype int - -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Octave_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Octave_NewPackedObj(ptr, sz, type) - -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Octave_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Octave_NewPackedObj(ptr, sz, type) - -#define SWIG_GetModule(clientdata) SWIG_Octave_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Octave_SetModule(clientdata,pointer); -#define SWIG_MODULE_CLIENTDATA_TYPE void* - -#define Octave_Error_Occurred() 0 -#define SWIG_Octave_AddErrorMsg(msg) {;} - -SWIGRUNTIME swig_module_info *SWIG_Octave_GetModule(void *clientdata); -SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info *pointer); - -// For backward compatibility only -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) 0 - -// Runtime API implementation - -typedef octave_value_list(*octave_func) (const octave_value_list &, int); -class octave_swig_type; - -namespace Swig { - -#ifdef SWIG_DIRECTORS - - class Director; - - typedef std::map < void *, Director * > rtdir_map; - SWIGINTERN rtdir_map* get_rtdir_map(); - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *d); - SWIGINTERNINLINE void erase_rtdir(void *vptr); - SWIGINTERNINLINE Director *get_rtdir(void *vptr); - - SWIGRUNTIME void swig_director_destroyed(octave_swig_type *self, Director *d); - SWIGRUNTIME octave_swig_type *swig_director_get_self(Director *d); - SWIGRUNTIME void swig_director_set_self(Director *d, octave_swig_type *self); - -#endif - - SWIGRUNTIME octave_base_value *swig_value_ref(octave_swig_type *ost); - SWIGRUNTIME octave_swig_type *swig_value_deref(octave_value ov); - SWIGRUNTIME octave_swig_type *swig_value_deref(const octave_base_value &ov); -} - -#ifdef SWIG_DIRECTORS -SWIGRUNTIME void swig_acquire_ownership(void *vptr); -SWIGRUNTIME void swig_acquire_ownership_array(void *vptr); -SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); -#endif - - struct swig_octave_member { - const char *name; - octave_func method; - octave_func get_method; - octave_func set_method; - int flags; // 1 static, 2 global - const char *doc; - bool is_static() const { - return flags &1; - } bool is_global() const { - return flags &2; - } - }; - - struct swig_octave_class { - const char *name; - swig_type_info **type; - int director; - octave_func constructor; - const char *constructor_doc; - octave_func destructor; - const swig_octave_member *members; - const char **base_names; - const swig_type_info **base; - }; - -#if SWIG_OCTAVE_PREREQ(4,4,0) - // in Octave 4.4 behaviour of octave_builtin() appears to have changed and 'self' argument is no longer passed - // to function (maybe because this is now a 'method'??) so need to create our own octave_function subclass -#define SWIG_OCTAVE_BOUND_FUNC(func, args) octave_value(new octave_swig_bound_func(func, args)) - class octave_swig_bound_func : public octave_function { - public: - - octave_swig_bound_func(void) : octave_function(), method(0), first_args() - { } - - octave_swig_bound_func(octave_function* _method, octave_value_list _first_args) - : octave_function("", ""), method(_method), first_args(_first_args) - { } - - octave_swig_bound_func(const octave_swig_bound_func& f) = delete; - - octave_swig_bound_func& operator= (const octave_swig_bound_func& f) = delete; - - ~octave_swig_bound_func(void) = default; - - bool is_function(void) const { return true; } - - octave_function* function_value(bool = false) { return this; } - -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave_value_list call(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { - return execute(tw,nargout,args); - } -#endif -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave_value_list execute(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { -#else - octave_value_list call(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { -#endif - octave_value_list all_args; - all_args.append(first_args); - all_args.append(args); - return method->call(tw, nargout, all_args); - } - - octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) { - octave_value_list ovl = subsref(ops, idx, 1); - return ovl.length() ? ovl(0) : octave_value(); - } - - octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) { - assert(ops.size() > 0); - assert(ops.size() == idx.size()); - if (ops != "(") - error("invalid function call"); - octave::tree_evaluator& tw = octave::interpreter::the_interpreter()->get_evaluator(); - return call(tw, nargout, *idx.begin()); - } - - protected: - - octave_function* method; - octave_value_list first_args; - - std::set dispatch_classes; - - }; -#else -#define SWIG_OCTAVE_BOUND_FUNC(func, args) octave_value(func) -#endif - - // octave_swig_type plays the role of both the shadow class and the class - // representation within Octave, since there is no support for classes. - // - // These should really be decoupled, with the class support added to Octave - // and the shadow class given by an m-file script. That would dramatically - // reduce the runtime complexity, and be more in line w/ other modules. - - class octave_swig_type:public octave_base_value { - struct cpp_ptr { - void *ptr; - bool destroyed; - cpp_ptr(void *_ptr):ptr(_ptr), destroyed(false) { - }}; - typedef std::pair < const swig_type_info *, cpp_ptr > type_ptr_pair; - - mutable swig_module_info *module; - - const swig_type_info *construct_type; // type of special type object - std::vector < type_ptr_pair > types; // our c++ base classes - int thisown; // whether we call c++ destructors when we die - - typedef std::pair < const swig_octave_member *, octave_value > member_value_pair; - typedef std::map < std::string, member_value_pair > member_map; - member_map members; - bool always_static; - - const swig_octave_member *find_member(const swig_type_info *type, const std::string &name) { - if (!type->clientdata) - return 0; - swig_octave_class *c = (swig_octave_class *) type->clientdata; - const swig_octave_member *m; - for (m = c->members; m->name; ++m) - if (m->name == name) - return m; - for (int j = 0; c->base_names[j]; ++j) { - if (!c->base[j]) { - if (!module) - module = SWIG_GetModule(0); - assert(module); - c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]); - } - if (!c->base[j]) - return 0; - if ((m = find_member(c->base[j], name))) - return m; - } - return 0; - } - - member_value_pair *find_member(const std::string &name, bool insert_if_not_found) { - member_map::iterator it = members.find(name); - if (it != members.end()) - return &it->second; - const swig_octave_member *m; - for (unsigned int j = 0; j < types.size(); ++j) - if ((m = find_member(types[j].first, name))) - return &members.insert(std::make_pair(name, std::make_pair(m, octave_value()))).first->second; - if (!insert_if_not_found) - return 0; - return &members[name]; - } - - const swig_type_info *find_base(const std::string &name, const swig_type_info *base) { - if (!base) { - for (unsigned int j = 0; j < types.size(); ++j) { - assert(types[j].first->clientdata); - swig_octave_class *cj = (swig_octave_class *) types[j].first->clientdata; - if (cj->name == name) - return types[j].first; - } - return 0; - } - assert(base->clientdata); - swig_octave_class *c = (swig_octave_class *) base->clientdata; - for (int j = 0; c->base_names[j]; ++j) { - if (!c->base[j]) { - if (!module) - module = SWIG_GetModule(0); - assert(module); - c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]); - } - if (!c->base[j]) - return 0; - assert(c->base[j]->clientdata); - swig_octave_class *cj = (swig_octave_class *) c->base[j]->clientdata; - if (cj->name == name) - return c->base[j]; - } - return 0; - } - - void load_members(const swig_octave_class* c,member_map& out) const { - for (const swig_octave_member *m = c->members; m->name; ++m) { - if (out.find(m->name) == out.end()) - out.insert(std::make_pair(m->name, std::make_pair(m, octave_value()))); - } - for (int j = 0; c->base_names[j]; ++j) { - if (!c->base[j]) { - if (!module) - module = SWIG_GetModule(0); - assert(module); - c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]); - } - if (!c->base[j]) - continue; - assert(c->base[j]->clientdata); - const swig_octave_class *cj = - (const swig_octave_class *) c->base[j]->clientdata; - load_members(cj,out); - } - } - - void load_members(member_map& out) const { - out=members; - for (unsigned int j = 0; j < types.size(); ++j) - if (types[j].first->clientdata) - load_members((const swig_octave_class *) types[j].first->clientdata, out); - } - - octave_value_list member_invoke(member_value_pair *m, const octave_value_list &args, int nargout) { - if (m->second.is_defined()) - return m->second.subsref("(", std::list < octave_value_list > (1, args), nargout); - else if (m->first && m->first->method) - return m->first->method(args, nargout); - error("member not defined or not invocable"); - return octave_value_list(); - } - - bool dispatch_unary_op(const std::string &symbol, octave_value &ret) const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - member_value_pair *m = nc_this->find_member(symbol, false); - if (!m || m->first->is_static() || m->first->is_global()) - return false; - octave_value_list args; - args.append(nc_this->as_value()); - octave_value_list argout(nc_this->member_invoke(m, args, 1)); - if (argout.length() < 1) - return false; - ret = argout(0); - return true; - } - - bool dispatch_binary_op(const std::string &symbol, const octave_base_value &rhs, octave_value &ret) const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - member_value_pair *m = nc_this->find_member(symbol, false); - if (!m || m->first->is_static() || m->first->is_global()) - return false; - octave_value_list args; - args.append(nc_this->as_value()); - args.append(make_value_hack(rhs)); - octave_value_list argout(nc_this->member_invoke(m, args, 1)); - if (argout.length() < 1) - return false; - ret = argout(0); - return true; - } - - bool dispatch_index_op(const std::string &symbol, const octave_value_list &rhs, octave_value_list &ret) const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - member_value_pair *m = nc_this->find_member(symbol, false); - if (!m || m->first->is_static() || m->first->is_global()) - return false; - octave_value_list args; - args.append(nc_this->as_value()); - args.append(rhs); - octave_value_list argout(nc_this->member_invoke(m, args, 1)); - if (argout.length() >= 1) - ret = argout(0); - return true; - } - - octave_value_list member_deref(member_value_pair *m, const octave_value_list &args) { - if (m->second.is_defined()) { - if (m->second.is_function() || m->second.is_function_handle()) { - return SWIG_OCTAVE_BOUND_FUNC(m->second.function_value(), args); - } else { - return m->second; - } - } else if (m->first) { - if (m->first->get_method) - return m->first->get_method(args, 1); - else if (m->first->method) - return SWIG_OCTAVE_BOUND_FUNC(new octave_builtin(m->first->method), args); - } - error("undefined member"); - return octave_value_list(); - } - - static octave_value make_value_hack(const octave_base_value &x) { - ((octave_swig_type &) x).count++; - return octave_value((octave_base_value *) &x); - } - - octave_swig_type(const octave_swig_type &x); - octave_swig_type &operator=(const octave_swig_type &rhs); - public: - - octave_swig_type(void *_ptr = 0, const swig_type_info *_type = 0, int _own = 0, - bool _always_static = false) - : module(0), construct_type(_ptr ? 0 : _type), thisown(_own), - always_static(_always_static) { - if (_type || _ptr) - types.push_back(std::make_pair(_type, _ptr)); -#ifdef SWIG_DIRECTORS - if (_ptr) { - Swig::Director *d = Swig::get_rtdir(_ptr); - if (d) - Swig::swig_director_set_self(d, this); - } -#endif - } - - ~octave_swig_type() { - if (thisown) { - ++count; - for (unsigned int j = 0; j < types.size(); ++j) { - if (!types[j].first || !types[j].first->clientdata) - continue; - swig_octave_class *c = (swig_octave_class *) types[j].first->clientdata; - if (c->destructor && !types[j].second.destroyed && types[j].second.ptr) { - c->destructor(as_value(), 0); - } - } - } -#ifdef SWIG_DIRECTORS - for (unsigned int j = 0; j < types.size(); ++j) - Swig::erase_rtdir(types[j].second.ptr); -#endif - } - - dim_vector dims(void) const { - octave_value out; - if (!dispatch_unary_op("__dims__", out)) - return dim_vector(1,1); - - // Return value should be cell or matrix of integers -#if SWIG_OCTAVE_PREREQ(4,4,0) - if (out.iscell()) { -#else - if (out.is_cell()) { -#endif - const Cell & c=out.cell_value(); - int ndim = c.rows(); - if (ndim==1 && c.columns()!=1) ndim = c.columns(); - - dim_vector d; - d.resize(ndim < 2 ? 2 : ndim); - d(0) = d(1) = 1; - - // Fill in dim_vector - for (int k=0;k a; - try { - a = out.int_vector_value(); - } - catch (octave::execution_exception& oee) { - return dim_vector(1,1); - } -#else - Array a = out.int_vector_value(); - if (error_state) return dim_vector(1,1); -#endif - dim_vector d; - d.resize(a.numel() < 2 ? 2 : a.numel()); - d(0) = d(1) = 1; - for (int k=0;kclientdata) - return 0; - swig_octave_class *c = (swig_octave_class *) types[0].first->clientdata; - return c->constructor_doc; - } - - std::string swig_type_name() const { - // * need some way to manually name subclasses. - // * eg optional first arg to subclass(), or named_subclass() - std::string ret; - for (unsigned int j = 0; j < types.size(); ++j) { - if (j) - ret += "_"; - if (types[j].first->clientdata) { - swig_octave_class *c = (swig_octave_class *) types[j].first->clientdata; - ret += c->name; - } else - ret += types[j].first->name; - } - return ret; - } - - void merge(octave_swig_type &rhs) { - rhs.thisown = 0; - for (unsigned int j = 0; j < rhs.types.size(); ++j) { - assert(!rhs.types[j].second.destroyed); -#ifdef SWIG_DIRECTORS - Swig::Director *d = Swig::get_rtdir(rhs.types[j].second.ptr); - if (d) - Swig::swig_director_set_self(d, this); -#endif - } - types.insert(types.end(), rhs.types.begin(), rhs.types.end()); - members.insert(rhs.members.begin(), rhs.members.end()); -#if SWIG_OCTAVE_PREREQ(4,4,0) - assign(rhs.swig_type_name(), rhs.as_value()); -#else - rhs.types.clear(); - rhs.members.clear(); -#endif - } - - typedef member_map::const_iterator swig_member_const_iterator; - swig_member_const_iterator swig_members_begin() { return members.begin(); } - swig_member_const_iterator swig_members_end() { return members.end(); } - - int cast(void **vptr, swig_type_info *type, int *own, int flags) { - int res = SWIG_ERROR; - int clear_pointer = 0; - - if (own) - *own = 0; - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !thisown) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (own) - *own = *own | thisown; - if (flags & SWIG_POINTER_DISOWN) { - thisown = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - clear_pointer = 1; - } - } - - if (!type && types.size()) { - if (vptr) { - *vptr = types[0].second.ptr; - if (clear_pointer) - types[0].second.ptr = 0; - } - return SWIG_OK; - } - for (unsigned int j = 0; j < types.size(); ++j) - if (type == types[j].first) { - if (vptr) { - *vptr = types[j].second.ptr; - if (clear_pointer) - types[j].second.ptr = 0; - } - return SWIG_OK; - } - for (unsigned int j = 0; j < types.size(); ++j) { - swig_cast_info *tc = SWIG_TypeCheck(types[j].first->name, type); - if (!tc) - continue; - if (vptr) { - int newmemory = 0; - *vptr = SWIG_TypeCast(tc, types[j].second.ptr, &newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - if (clear_pointer) - types[j].second.ptr = 0; - } - res = SWIG_OK; - break; - } - return res; - } - - bool is_owned() const { - return thisown; - } - -#ifdef SWIG_DIRECTORS - void director_destroyed(Swig::Director *d) { - bool found = false; - for (unsigned int j = 0; j < types.size(); ++j) { - Swig::Director *dj = Swig::get_rtdir(types[j].second.ptr); - if (dj == d) { - types[j].second.destroyed = true; - found = true; - } - } - assert(found); - } -#endif - - void assign(const std::string &name, const octave_value &ov) { - members[name] = std::make_pair((const swig_octave_member *) 0, ov); - } - - void assign(const std::string &name, const swig_octave_member *m) { - members[name] = std::make_pair(m, octave_value()); - } - - octave_base_value *clone() const { - // pass-by-value is probably not desired, and is harder; - // requires calling copy constructors of contained types etc. - assert(0); - *(int *) 0 = 0; - return 0; - } - - octave_base_value *empty_clone() const { - return new octave_swig_type(); - } - - bool is_defined() const { - return true; - } - -#if SWIG_OCTAVE_PREREQ(6,0,0) - virtual bool isstruct() const { -#else - virtual bool is_map() const { -#endif - return true; - } - - virtual octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) { - octave_value_list ovl = subsref(ops, idx, 1); - return ovl.length()? ovl(0) : octave_value(); - } - - virtual octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) { - assert(ops.size() > 0); - assert(ops.size() == idx.size()); - - std::list < octave_value_list >::const_iterator idx_it = idx.begin(); - int skip = 0; - octave_value_list sub_ovl; - - // constructor invocation - if (ops[skip] == '(' && construct_type) { - assert(construct_type->clientdata); - swig_octave_class *c = (swig_octave_class *) construct_type->clientdata; - if (!c->constructor) { - error("cannot create instance"); - return octave_value_list(); - } - octave_value_list args; - if (c->director) - args.append(Swig::swig_value_ref(new octave_swig_type(this, 0, 0))); - args.append(*idx_it++); - ++skip; - sub_ovl = c->constructor(args, nargout); - } - // member dereference or invocation - else if (ops[skip] == '.') { - std::string subname; - const swig_type_info *base = 0; // eg, a.base.base_cpp_mem - for (;;) { - octave_value_list subname_ovl(*idx_it++); - ++skip; - assert(subname_ovl.length() == 1 && subname_ovl(0).is_string()); - subname = subname_ovl(0).string_value(); - - const swig_type_info *next_base = find_base(subname, base); - if (!next_base || skip >= (int) ops.size() || ops[skip] != '.') - break; - base = next_base; - } - - member_value_pair tmp, *m = &tmp; - if (!base || !(m->first = find_member(base, subname))) - m = find_member(subname, false); - if (!m) { - error("member not found"); - return octave_value_list(); - } - - octave_value_list args; - if (!always_static && - (!m->first || (!m->first->is_static() && !m->first->is_global()))) - args.append(as_value()); - if (skip < (int) ops.size() && ops[skip] == '(' && - ((m->first && m->first->method) || m->second.is_function() || - m->second.is_function_handle())) { - args.append(*idx_it++); - ++skip; - sub_ovl = member_invoke(m, args, nargout); - } else { - sub_ovl = member_deref(m, args); - } - } - // index operator - else { - if (ops[skip] == '(' || ops[skip] == '{') { - const char *op_name = ops[skip] == '(' ? "__paren__" : "__brace__"; - octave_value_list args; - args.append(*idx_it++); - ++skip; - if (!dispatch_index_op(op_name, args, sub_ovl)) { - error("error evaluating index operator"); - return octave_value_list(); - } - } else { - error("unsupported subsref"); - return octave_value_list(); - } - } - - if (skip >= (int) ops.size()) - return sub_ovl; - if (sub_ovl.length() < 1) { - error("bad subs ref"); - return octave_value_list(); - } - return sub_ovl(0).next_subsref(nargout, ops, idx, skip); - } - - octave_value subsasgn(const std::string &ops, const std::list < octave_value_list > &idx, const octave_value &rhs) { - assert(ops.size() > 0); - assert(ops.size() == idx.size()); - - std::list < octave_value_list >::const_iterator idx_it = idx.begin(); - int skip = 0; - - if (ops.size() > 1) { - std::list < octave_value_list >::const_iterator last = idx.end(); - --last; - std::list < octave_value_list > next_idx(idx.begin(), last); - octave_value next_ov = subsref(ops.substr(0, ops.size() - 1), next_idx); - next_ov.subsasgn(ops.substr(ops.size() - 1), std::list < octave_value_list > (1, *last), rhs); - } - - else if (ops[skip] == '(' || ops[skip] == '{') { - const char *op_name = ops[skip] == '(' ? "__paren_asgn__" : "__brace_asgn__"; - member_value_pair *m = find_member(op_name, false); - if (m) { - octave_value_list args; - args.append(as_value()); - args.append(*idx_it); - args.append(rhs); - member_invoke(m, args, 1); - } else - error("%s member not found", op_name); - } - - else if (ops[skip] == '.') { - octave_value_list subname_ovl(*idx_it++); - ++skip; - assert(subname_ovl.length() == 1 &&subname_ovl(0).is_string()); - std::string subname = subname_ovl(0).string_value(); - - member_value_pair *m = find_member(subname, true); - if (!m->first || !m->first->set_method) { - m->first = 0; - m->second = rhs; - } else if (m->first->set_method) { - octave_value_list args; - if (!m->first->is_static() && !m->first->is_global()) - args.append(as_value()); - args.append(rhs); - m->first->set_method(args, 1); - } else - error("member not assignable"); - } else - error("unsupported subsasgn"); - - return as_value(); - } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - virtual bool isobject() const { -#else - virtual bool is_object() const { -#endif - return true; - } - - virtual bool is_string() const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - return !!nc_this->find_member("__str__", false); - } - - virtual std::string string_value(bool force = false) const { - octave_value ret; - if (!dispatch_unary_op("__str__", ret)) { - error("__str__ method not defined"); - return std::string(); - } - if (!ret.is_string()) { - error("__str__ method did not return a string"); - return std::string(); - } - return ret.string_value(); - } - - virtual double scalar_value(bool frc_str_conv = false) const { - octave_value ret; - if (!dispatch_unary_op("__float__", ret)) { - error("__float__ method not defined"); - } - return ret.scalar_value(); - } - -#if SWIG_OCTAVE_PREREQ(4,2,0) - virtual octave_value as_double(void) const { - octave_value ret; - if (!dispatch_unary_op("__float__", ret)) { - error("__float__ method not defined"); - } - return ret.as_double(); - } - - virtual octave_value as_single(void) const { - octave_value ret; - if (!dispatch_unary_op("__float__", ret)) { - error("__float__ method not defined"); - } - return ret.as_single(); - } -#endif - -#if SWIG_OCTAVE_PREREQ(3,8,0) - virtual octave_value map(octave_base_value::unary_mapper_t umap) const { - const std::string opname = std::string("__") + octave_base_value::get_umap_name(umap) + std::string("__"); - octave_value ret; - if (!dispatch_unary_op(opname, ret)) { - error("%s", (opname + std::string(" method not found")).c_str()); - return octave_value(); - } - return ret; - } -#endif - -#if SWIG_OCTAVE_PREREQ(3,3,52) - virtual octave_map map_value() const { - return octave_map(); - } -#else - virtual Octave_map map_value() const { - return Octave_map(); - } -#endif - - virtual string_vector map_keys() const { - member_map tmp; - load_members(tmp); - - string_vector keys(tmp.size()); - int k = 0; - for (member_map::iterator it = tmp.begin(); it != tmp.end(); ++it) - keys(k++) = it->first; - - return keys; - } - - virtual bool save_ascii (std::ostream& os) { - return true; - } - - virtual bool load_ascii (std::istream& is) { - return true; - } - - virtual bool save_binary (std::ostream& os, bool& save_as_floats) { - return true; - } - - virtual bool load_binary (std::istream& is, bool swap, -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::mach_info::float_format fmt) { -#else - oct_mach_info::float_format fmt) { -#endif - return true; - } - -#if defined (HAVE_HDF5) -# if SWIG_OCTAVE_PREREQ(4,0,0) - virtual bool - save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# else - virtual bool - save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# endif -#endif - - virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const { - return string_value(); - } - - virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const { - return string_value(); - } - - static bool dispatch_global_op(const std::string &symbol, const octave_value_list &args, octave_value &ret) { - // we assume that SWIG_op_prefix-prefixed functions are installed in global namespace - // (rather than any module namespace). - - octave_function *fcn = is_valid_function(symbol, std::string(), false); - if (!fcn) - return false; -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::tree_evaluator& tw = octave::interpreter::the_interpreter()->get_evaluator(); - octave_value_list retval = fcn->call(tw, 1, args); - if (retval.length() == 1) - ret = retval(0); -#else - ret = fcn->do_multi_index_op(1, args)(0); -#endif - return true; - } - - static octave_value dispatch_unary_op(const octave_base_value &x, const char *op_name) { - octave_swig_type *ost = Swig::swig_value_deref(x); - assert(ost); - - octave_value ret; - if (ost->dispatch_unary_op(std::string("__") + op_name + std::string("__"), ret)) - return ret; - std::string symbol = SWIG_op_prefix + ost->swig_type_name() + "_" + op_name; - octave_value_list args; - args.append(make_value_hack(x)); - if (dispatch_global_op(symbol, args, ret)) - return ret; - - error("could not dispatch unary operator"); - return octave_value(); - } - - static octave_value dispatch_binary_op(const octave_base_value &lhs, const octave_base_value &rhs, const char *op_name) { - octave_swig_type *lhs_ost = Swig::swig_value_deref(lhs); - octave_swig_type *rhs_ost = Swig::swig_value_deref(rhs); - - octave_value ret; - if (lhs_ost && lhs_ost->dispatch_binary_op(std::string("__") + op_name + std::string("__"), rhs, ret)) - return ret; - if (rhs_ost) { - if (strlen(op_name) == 2 && (op_name[1] == 't' || op_name[1] == 'e')) { - if (op_name[0] == 'l' && rhs_ost->dispatch_binary_op(std::string("__g") + op_name[1] + std::string("__"), lhs, ret)) - return ret; - if (op_name[0] == 'g' && rhs_ost->dispatch_binary_op(std::string("__l") + op_name[1] + std::string("__"), lhs, ret)) - return ret; - } - if (rhs_ost->dispatch_binary_op(std::string("__r") + op_name + std::string("__"), lhs, ret)) - return ret; - } - - std::string symbol; - octave_value_list args; - args.append(make_value_hack(lhs)); - args.append(make_value_hack(rhs)); - - symbol = SWIG_op_prefix; - symbol += lhs_ost ? lhs_ost->swig_type_name() : lhs.type_name(); - symbol += "_"; - symbol += op_name; - symbol += "_"; - symbol += rhs_ost ? rhs_ost->swig_type_name() : rhs.type_name(); - if (dispatch_global_op(symbol, args, ret)) - return ret; - - symbol = SWIG_op_prefix; - symbol += lhs_ost ? lhs_ost->swig_type_name() : lhs.type_name(); - symbol += "_"; - symbol += op_name; - symbol += "_"; - symbol += "any"; - if (dispatch_global_op(symbol, args, ret)) - return ret; - - symbol = SWIG_op_prefix; - symbol += "any"; - symbol += "_"; - symbol += op_name; - symbol += "_"; - symbol += rhs_ost ? rhs_ost->swig_type_name() : rhs.type_name(); - if (dispatch_global_op(symbol, args, ret)) - return ret; - - error("could not dispatch binary operator"); - return octave_value(); - } - -#if SWIG_OCTAVE_PREREQ(4,0,0) - void print(std::ostream &os, bool pr_as_read_syntax = false) -#else - void print(std::ostream &os, bool pr_as_read_syntax = false) const -#endif - { - if (is_string()) { - os << string_value(); - return; - } - - member_map tmp; - load_members(tmp); - - indent(os); - os << "{"; newline(os); - increment_indent_level(); - for (unsigned int j = 0; j < types.size(); ++j) { - indent(os); - if (types[j].first->clientdata) { - const swig_octave_class *c = (const swig_octave_class *) types[j].first->clientdata; - os << c->name << ", ptr = " << types[j].second.ptr; newline(os); - } else { - os << types[j].first->name << ", ptr = " << types[j].second.ptr; newline(os); - } - } - for (member_map::const_iterator it = tmp.begin(); it != tmp.end(); ++it) { - indent(os); - if (it->second.first) { - const char *objtype = it->second.first->method ? "method" : "variable"; - const char *modifier = (it->second.first->flags &1) ? "static " : (it->second.first->flags &2) ? "global " : ""; - os << it->second.first->name << " (" << modifier << objtype << ")"; newline(os); - assert(it->second.first->name == it->first); - } else { - os << it->first; newline(os); - } - } - decrement_indent_level(); - indent(os); - os << "}"; newline(os); - } - }; - - // Octave tries hard to preserve pass-by-value semantics. Eg, assignments - // will call clone() via make_unique() if there is more than one outstanding - // reference to the lhs, and forces the clone's reference count to 1 - // (so you can't just increment your own count and return this). - // - // One way to fix this (without modifying Octave) is to add a level of - // indirection such that clone copies ref-counted pointer and we keep - // pass-by-ref semantics (which are more natural/expected for C++ bindings). - // - // Supporting both pass-by-{ref,value} and toggling via %feature/option - // might be nice. - - class octave_swig_ref:public octave_base_value { - octave_swig_type *ptr; - public: - octave_swig_ref(octave_swig_type *_ptr = 0) - :ptr(_ptr) - { - // Ensure type_id() is set correctly - if (t_id == -1) { - t_id = octave_swig_ref::static_type_id(); - } - } - - ~octave_swig_ref() - { if (ptr) ptr->decref(); } - - octave_swig_type *get_ptr() const - { return ptr; } - - octave_base_value *clone() const - { if (ptr) ptr->incref(); return new octave_swig_ref(ptr); } - - octave_base_value *empty_clone() const - { return new octave_swig_ref(0); } - - dim_vector dims(void) const - { return ptr->dims(); } - - bool is_defined() const - { return ptr->is_defined(); } - -#if SWIG_OCTAVE_PREREQ(6,0,0) - virtual bool isstruct() const - { return ptr->isstruct(); } -#else - virtual bool is_map() const - { return ptr->is_map(); } -#endif - - virtual octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) - { return ptr->subsref(ops, idx); } - - virtual octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) - { return ptr->subsref(ops, idx, nargout); } - - octave_value subsasgn(const std::string &ops, const std::list < octave_value_list > &idx, const octave_value &rhs) - { return ptr->subsasgn(ops, idx, rhs); } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - virtual bool isobject() const - { return ptr->isobject(); } -#else - virtual bool is_object() const - { return ptr->is_object(); } -#endif - - virtual bool is_string() const - { return ptr->is_string(); } - - virtual std::string string_value(bool force = false) const - { return ptr->string_value(force); } - - virtual double scalar_value(bool frc_str_conv = false) const - { return ptr->scalar_value(frc_str_conv); } - -#if SWIG_OCTAVE_PREREQ(4,2,0) - virtual octave_value as_double(void) const - { return ptr->as_double(); } - - virtual octave_value as_single(void) const - { return ptr->as_single(); } -#endif - -#if SWIG_OCTAVE_PREREQ(3,8,0) - virtual octave_value map(octave_base_value::unary_mapper_t umap) const - { return ptr->map(umap); } -#endif - -#if SWIG_OCTAVE_PREREQ(3,3,52) - virtual octave_map map_value() const - { return ptr->map_value(); } -#else - virtual Octave_map map_value() const - { return ptr->map_value(); } -#endif - - virtual string_vector map_keys() const - { return ptr->map_keys(); } - - virtual bool save_ascii (std::ostream& os) - { return ptr->save_ascii(os); } - - virtual bool load_ascii (std::istream& is) - { return ptr->load_ascii(is); } - - virtual bool save_binary (std::ostream& os, bool& save_as_floats) - { return ptr->save_binary(os, save_as_floats); } - - virtual bool load_binary (std::istream& is, bool swap, -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::mach_info::float_format fmt) -#else - oct_mach_info::float_format fmt) -#endif - { return ptr->load_binary(is, swap, fmt); } - -#if defined (HAVE_HDF5) -# if SWIG_OCTAVE_PREREQ(4,0,0) - virtual bool - save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) - { return ptr->save_hdf5(loc_id, name, save_as_floats); } - - virtual bool - load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) - { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); } -# else - virtual bool - save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) - { return ptr->save_hdf5(loc_id, name, save_as_floats); } - - virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) - { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); } -# endif -#endif - - virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const - { return ptr->convert_to_str(pad, force, type); } - - virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const - { return ptr->convert_to_str_internal(pad, force, type); } - -#if SWIG_OCTAVE_PREREQ(4,0,0) - void print(std::ostream &os, bool pr_as_read_syntax = false) -#else - void print(std::ostream &os, bool pr_as_read_syntax = false) const -#endif - { return ptr->print(os, pr_as_read_syntax); } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - static void set_type_id(int type_id) { t_id=type_id; } -#endif - - virtual type_conv_info numeric_conversion_function(void) const { - return octave_base_value::type_conv_info (default_numeric_conversion_function, - octave_scalar::static_type_id ()); - } - - private: - static octave_base_value *default_numeric_conversion_function (const octave_base_value& a) { - const octave_swig_ref& v = dynamic_cast(a); - return new octave_scalar(v.scalar_value()); - } - -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DECLARE_OCTAVE_ALLOCATOR; -#endif - DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; - }; -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DEFINE_OCTAVE_ALLOCATOR(octave_swig_ref); -#endif - DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_ref, "swig_ref", "swig_ref"); - - class octave_swig_packed:public octave_base_value { - swig_type_info *type; - std::vector < char > buf; - public: - - octave_swig_packed(swig_type_info *_type = 0, const void *_buf = 0, size_t _buf_len = 0) - : type(_type), buf((const char*)_buf, (const char*)_buf + _buf_len) - { - // Ensure type_id() is set correctly - if (t_id == -1) { - t_id = octave_swig_packed::static_type_id(); - } - } - - bool copy(swig_type_info *outtype, void *ptr, size_t sz) const { - if (outtype && outtype != type) - return false; - assert(sz <= buf.size()); - std::copy(buf.begin(), buf.begin()+sz, (char*)ptr); - return true; - } - - octave_base_value *clone() const { - return new octave_swig_packed(*this); - } - - octave_base_value *empty_clone() const { - return new octave_swig_packed(); - } - - bool is_defined() const { - return true; - } - -#if SWIG_OCTAVE_PREREQ(4,0,0) - void print(std::ostream &os, bool pr_as_read_syntax = false) -#else - void print(std::ostream &os, bool pr_as_read_syntax = false) const -#endif - { - indent(os); - os << "swig packed type: name = " << (type ? type->name : std::string()) << ", len = " << buf.size(); newline(os); - } - - - virtual bool save_ascii (std::ostream& os) { - return true; - } - - virtual bool load_ascii (std::istream& is) { - return true; - } - - virtual bool save_binary (std::ostream& os, bool& save_as_floats) { - return true; - } - - virtual bool load_binary (std::istream& is, bool swap, -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::mach_info::float_format fmt) { -#else - oct_mach_info::float_format fmt) { -#endif - return true; - } - -#if defined (HAVE_HDF5) -# if SWIG_OCTAVE_PREREQ(4,0,0) - virtual bool - save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# else - virtual bool - save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# endif -#endif - -#if SWIG_OCTAVE_PREREQ(4,4,0) - static void set_type_id(int type_id) { t_id=type_id; } -#endif - - private: -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DECLARE_OCTAVE_ALLOCATOR; -#endif - DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; - }; -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DEFINE_OCTAVE_ALLOCATOR(octave_swig_packed); -#endif - DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_packed, "swig_packed", "swig_packed"); - - SWIGRUNTIME octave_value_list octave_set_immutable(const octave_value_list &args, int nargout) { - error("attempt to set immutable member variable"); - return octave_value_list(); - } - - struct octave_value_ref { - const octave_value_list &ovl; - int j; - - octave_value_ref(const octave_value_list &_ovl, int _j) - :ovl(_ovl), j(_j) { } - - operator octave_value() const { - return ovl(j); - } - - octave_value operator*() const { - return ovl(j); - } - }; - - -namespace Swig { - - SWIGRUNTIME octave_base_value *swig_value_ref(octave_swig_type *ost) { - return new octave_swig_ref(ost); - } - - SWIGRUNTIME octave_swig_type *swig_value_deref(octave_value ov) { - if ( -#if SWIG_OCTAVE_PREREQ(4,4,0) - ov.iscell() -#else - ov.is_cell() -#endif - && ov.rows() == 1 && ov.columns() == 1) - ov = ov.cell_value()(0); - return swig_value_deref(*ov.internal_rep()); - } - - SWIGRUNTIME octave_swig_type *swig_value_deref(const octave_base_value &ov) { - if (ov.type_id() != octave_swig_ref::static_type_id()) - return 0; - const octave_swig_ref *osr = static_cast < const octave_swig_ref *>(&ov); - return osr->get_ptr(); - } - -} - - -#define swig_unary_op(name) \ -SWIGRUNTIME octave_value swig_unary_op_##name(const octave_base_value &x) { \ - return octave_swig_type::dispatch_unary_op(x,#name); \ -} -#define swig_binary_op(name) \ -SWIGRUNTIME octave_value swig_binary_op_##name(const octave_base_value&lhs,const octave_base_value &rhs) { \ - return octave_swig_type::dispatch_binary_op(lhs,rhs,#name); \ -} -#if SWIG_OCTAVE_PREREQ(4,4,0) -#define swigreg_unary_op(name) \ -if (!octave_value_typeinfo::lookup_unary_op(octave_value::op_##name,tid)) \ -typeinfo.register_unary_op(octave_value::op_##name,tid,swig_unary_op_##name); -#else -#define swigreg_unary_op(name) \ -if (!octave_value_typeinfo::lookup_unary_op(octave_value::op_##name,tid)) \ -octave_value_typeinfo::register_unary_op(octave_value::op_##name,tid,swig_unary_op_##name); -#endif -#if SWIG_OCTAVE_PREREQ(4,4,0) -#define swigreg_binary_op(name) \ -if (!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2)) \ -typeinfo.register_binary_op(octave_value::op_##name,tid1,tid2,swig_binary_op_##name); -#else -#define swigreg_binary_op(name) \ -if (!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2)) \ -octave_value_typeinfo::register_binary_op(octave_value::op_##name,tid1,tid2,swig_binary_op_##name); -#endif - - swig_unary_op(not); - swig_unary_op(uplus); - swig_unary_op(uminus); - swig_unary_op(transpose); - swig_unary_op(hermitian); - swig_unary_op(incr); - swig_unary_op(decr); - - swig_binary_op(add); - swig_binary_op(sub); - swig_binary_op(mul); - swig_binary_op(div); - swig_binary_op(pow); - swig_binary_op(ldiv); -#if !SWIG_OCTAVE_PREREQ(4,2,0) - swig_binary_op(lshift); - swig_binary_op(rshift); -#endif - swig_binary_op(lt); - swig_binary_op(le); - swig_binary_op(eq); - swig_binary_op(ge); - swig_binary_op(gt); - swig_binary_op(ne); - swig_binary_op(el_mul); - swig_binary_op(el_div); - swig_binary_op(el_pow); - swig_binary_op(el_ldiv); - swig_binary_op(el_and); - swig_binary_op(el_or); - - SWIGRUNTIME void SWIG_InstallUnaryOps(int tid) { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::type_info& typeinfo = octave::interpreter::the_interpreter()->get_type_info(); -#endif - swigreg_unary_op(not); - swigreg_unary_op(uplus); - swigreg_unary_op(uminus); - swigreg_unary_op(transpose); - swigreg_unary_op(hermitian); - swigreg_unary_op(incr); - swigreg_unary_op(decr); - } - SWIGRUNTIME void SWIG_InstallBinaryOps(int tid1, int tid2) { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::type_info& typeinfo = octave::interpreter::the_interpreter()->get_type_info(); -#endif - swigreg_binary_op(add); - swigreg_binary_op(sub); - swigreg_binary_op(mul); - swigreg_binary_op(div); - swigreg_binary_op(pow); - swigreg_binary_op(ldiv); -#if !SWIG_OCTAVE_PREREQ(4,2,0) - swigreg_binary_op(lshift); - swigreg_binary_op(rshift); -#endif - swigreg_binary_op(lt); - swigreg_binary_op(le); - swigreg_binary_op(eq); - swigreg_binary_op(ge); - swigreg_binary_op(gt); - swigreg_binary_op(ne); - swigreg_binary_op(el_mul); - swigreg_binary_op(el_div); - swigreg_binary_op(el_pow); - swigreg_binary_op(el_ldiv); - swigreg_binary_op(el_and); - swigreg_binary_op(el_or); - } - SWIGRUNTIME void SWIG_InstallOps(int tid) { - // here we assume that tid are conseq integers increasing from zero, and - // that our tid is the last one. might be better to have explicit string - // list of types we should bind to, and use lookup_type to resolve their tid. - - SWIG_InstallUnaryOps(tid); - SWIG_InstallBinaryOps(tid, tid); - for (int j = 0; j < tid; ++j) { - SWIG_InstallBinaryOps(j, tid); - SWIG_InstallBinaryOps(tid, j); - } - } - -SWIGRUNTIME octave_value SWIG_Octave_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - int own = (flags &SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - - if (ptr) { -#ifdef SWIG_DIRECTORS - Swig::Director *d = Swig::get_rtdir(ptr); - if (d && Swig::swig_director_get_self(d)) - return Swig::swig_director_get_self(d)->as_value(); -#endif - return Swig::swig_value_ref(new octave_swig_type(ptr, type, own)); - } - return octave_value(Matrix()); // null matrix -} - -SWIGRUNTIME int SWIG_Octave_ConvertPtrAndOwn(octave_value ov, void **ptr, swig_type_info *type, int flags, int *own) { - if ( -#if SWIG_OCTAVE_PREREQ(4,4,0) - ov.iscell() -#else - ov.is_cell() -#endif - && ov.rows() == 1 && ov.columns() == 1) - ov = ov.cell_value()(0); - if (!ov.is_defined() || - (ov.is_matrix_type() && ov.rows() == 0 && ov.columns() == 0) ) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - if (ov.type_id() != octave_swig_ref::static_type_id()) - return SWIG_ERROR; - octave_swig_ref *osr = static_cast < octave_swig_ref *>(ov.internal_rep()); - octave_swig_type *ost = osr->get_ptr(); - return ost->cast(ptr, type, own, flags); -} - -SWIGRUNTIME octave_value SWIG_Octave_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return new octave_swig_packed(type, (char *) ptr, sz); -} - -SWIGRUNTIME int SWIG_Octave_ConvertPacked(const octave_value &ov, void *ptr, size_t sz, swig_type_info *type) { - if (!ov.is_defined()) - return SWIG_ERROR; - if (ov.type_id() != octave_swig_packed::static_type_id()) - return SWIG_ERROR; - octave_swig_packed *ost = static_cast < octave_swig_packed *>(ov.internal_rep()); - return ost->copy(type, (char *) ptr, sz) ? SWIG_OK : SWIG_ERROR; -} - -SWIGRUNTIMEINLINE void SWIG_Octave_SetConstant(octave_swig_type *module_ns, const std::string &name, const octave_value &ov) { - module_ns->assign(name, ov); -} - -SWIGRUNTIMEINLINE octave_value SWIG_Octave_GetGlobalValue(std::string name) { -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::interpreter *interp = octave::interpreter::the_interpreter (); - return interp->global_varval(name); -#else -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - return symtab.global_varval(name); -#else - return get_global_value(name, true); -#endif -#endif -} - -SWIGRUNTIME void SWIG_Octave_SetGlobalValue(std::string name, const octave_value& value) { -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::interpreter *interp = octave::interpreter::the_interpreter (); - interp->global_assign(name, value); -#elif SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - symtab.global_assign(name, value); -#else - set_global_value(name, value); -#endif -} - -SWIGRUNTIME void SWIG_Octave_LinkGlobalValue(std::string name) { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_scope symscope = octave::interpreter::the_interpreter()->get_current_scope(); -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::interpreter *interp = octave::interpreter::the_interpreter (); - interp->assign(name, interp->global_varval(name)); - octave::tree_evaluator& tree_eval = interp->get_evaluator(); - octave::call_stack& callStack = tree_eval.get_call_stack(); - std::shared_ptr stackFrame = callStack.get_current_stack_frame(); - octave::symbol_record sym=symscope.lookup_symbol(name); - stackFrame->mark_global(sym); -#else - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - symscope.assign(name, symtab.global_varval(name)); - symscope.mark_global(name); -#endif -#else -#if !SWIG_OCTAVE_PREREQ(3,2,0) - link_to_global_variable(curr_sym_tab->lookup(name, true)); -#else -#if !SWIG_OCTAVE_PREREQ(3,8,0) - symbol_table::varref(name); -#endif - symbol_table::mark_global(name); -#endif -#endif -} - -SWIGRUNTIME swig_module_info *SWIG_Octave_GetModule(void *clientdata) { - octave_value ov = SWIG_Octave_GetGlobalValue("__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME SWIG_RUNTIME_VERSION); - if (!ov.is_defined() || - ov.type_id() != octave_swig_packed::static_type_id()) - return 0; - const octave_swig_packed* osp = - static_cast < const octave_swig_packed *> (ov.internal_rep()); - swig_module_info *pointer = 0; - osp->copy(0, &pointer, sizeof(swig_module_info *)); - return pointer; -} - -SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info *pointer) { - octave_value ov = new octave_swig_packed(0, &pointer, sizeof(swig_module_info *)); - SWIG_Octave_SetGlobalValue("__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME SWIG_RUNTIME_VERSION, ov); -} diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octruntime.swg b/mac/bin/swig/share/swig/4.1.0/octave/octruntime.swg deleted file mode 100755 index e76151f1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octruntime.swg +++ /dev/null @@ -1,425 +0,0 @@ -#ifdef SWIG_OCTAVE_EXTERNAL_OCTHEADERS -%insert(runtime) %{ -#include "octheaders.hpp" -%} -#else -%insert(runtime) "octheaders.hpp"; -#endif - -%insert(runtime) "swigrun.swg"; -%insert(runtime) "swigerrors.swg"; -%insert(runtime) "octrun.swg"; - -%insert(initbeforefunc) "swiginit.swg" - -%insert(initbeforefunc) %{ - -static bool SWIG_init_user(octave_swig_type* module_ns); - -SWIGINTERN bool SWIG_Octave_LoadModule(std::string name) { - bool retn = false; - { -#if SWIG_OCTAVE_PREREQ(6,0,0) -#elif SWIG_OCTAVE_PREREQ(4,2,0) - octave::unwind_protect frame; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#elif SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect frame; - frame.protect_var(error_state); error_state = 0; - frame.protect_var(warning_state); warning_state = 0; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#else - unwind_protect::begin_frame("SWIG_Octave_LoadModule"); - unwind_protect_int(error_state); error_state = 0; - unwind_protect_int(warning_state); warning_state = 0; - unwind_protect_bool(discard_error_messages); discard_error_messages = true; - unwind_protect_bool(discard_warning_messages); discard_warning_messages = true; -#endif -#if SWIG_OCTAVE_PREREQ(4,2,0) - try { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::feval(name, octave_value_list(), 0); -#else - feval(name, octave_value_list(), 0); -#endif - retn = true; - } catch (octave::execution_exception&) { } -#else - feval(name, octave_value_list(), 0); - retn = (error_state == 0); -#endif -#if !SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect::run_frame("SWIG_Octave_LoadModule"); -#endif - } - if (!retn) { - error(SWIG_name_d ": could not load module `%s'", name.c_str()); - } - return retn; -} - -SWIGINTERN bool SWIG_Octave_InstallFunction(octave_function *octloadfcn, std::string name) { - bool retn = false; - { -#if SWIG_OCTAVE_PREREQ(6,0,0) -#elif SWIG_OCTAVE_PREREQ(4,2,0) - octave::unwind_protect frame; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#elif SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect frame; - frame.protect_var(error_state); error_state = 0; - frame.protect_var(warning_state); warning_state = 0; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#else - unwind_protect::begin_frame("SWIG_Octave_InstallFunction"); - unwind_protect_int(error_state); error_state = 0; - unwind_protect_int(warning_state); warning_state = 0; - unwind_protect_bool(discard_error_messages); discard_error_messages = true; - unwind_protect_bool(discard_warning_messages); discard_warning_messages = true; -#endif - octave_value_list args; - args.append(name); - args.append(octloadfcn->fcn_file_name()); -#if SWIG_OCTAVE_PREREQ(4,2,0) - try { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::feval("autoload", args, 0); -#else - feval("autoload", args, 0); -#endif - retn = true; - } catch (octave::execution_exception&) { } -#else - feval("autoload", args, 0); - retn = (error_state == 0); -#endif -#if !SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect::run_frame("SWIG_Octave_InstallFunction"); -#endif - } - if (!retn) { - error(SWIG_name_d ": could not load function `%s'", name.c_str()); - } - return retn; -} - -static const char *const subclass_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} subclass()\n\ -@deftypefnx{Loadable Function} {} subclass(@var{swigclass}, @var{name}, @var{fcn}, @dots{})\n\ -Subclass a C++ class from within Octave, and provide implementations of its virtual methods.\n\ -\n\ -See the SWIG manual for usage examples.\n\ -@end deftypefn"; - -DEFUN_DLD( subclass, args, nargout, subclass_usage ) { - octave_swig_type *top = new octave_swig_type; - for (int j = 0; j < args.length(); ++j) { - if (args(j).type_id() == octave_swig_ref::static_type_id()) { - octave_swig_ref *osr = static_cast < octave_swig_ref *>(args(j).internal_rep()); - octave_swig_type *ost = osr->get_ptr(); - if (!ost->is_owned()) { - error("subclass: cannot subclass object not constructed on octave side"); - return octave_value_list(); - } - top->merge(*ost); - } else if (args(j).is_function_handle()) { - top->assign(args(j).fcn_handle_value()->fcn_name(), args(j)); - } else if (args(j).is_string()) { - if (j + 1 >= args.length()) { - error("subclass: member assignments must be of string,value form"); - return octave_value_list(); - } - top->assign(args(j).string_value(), args(j + 1)); - ++j; - } else { - error("subclass: invalid arguments to subclass()"); - return octave_value_list(); - } - } - return octave_value(Swig::swig_value_ref(top)); -} - -static const char *const swig_type_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_type(@var{swigref})\n\ -Return the underlying C/C++ type name of a SWIG-wrapped object.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_type, args, nargout, swig_type_usage ) { - if (args.length() != 1) { - error("swig_type: must be called with only a single object"); - return octave_value_list(); - } - octave_swig_type *ost = Swig::swig_value_deref(args(0)); - if (!ost) { - error("swig_type: object is not a swig_ref"); - return octave_value_list(); - } - return octave_value(ost->swig_type_name()); -} - -static const char *const swig_typequery_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_typequery(@var{string})\n\ -Return @var{string} if it is a recognised SWIG-wrapped C/C++ type name;\n\ -otherwise return `'.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_typequery, args, nargout, swig_typequery_usage ) { - if (args.length() != 1 || !args(0).is_string()) { - error("swig_typequery: must be called with single string argument"); - return octave_value_list(); - } - swig_module_info *module = SWIG_GetModule(0); - swig_type_info *type = SWIG_TypeQueryModule(module, module, args(0).string_value().c_str()); - if (!type) - return octave_value(""); - return octave_value(type->name); -} - -static const char *const swig_this_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_this(@var{swigref})\n\ -Return the underlying C/C++ pointer of a SWIG-wrapped object.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_this, args, nargout, swig_this_usage ) { - if (args.length() != 1) { - error("swig_this: must be called with only a single object"); - return octave_value_list(); - } - if (args(0).is_matrix_type() && args(0).rows() == 0 && args(0).columns() == 0) - return octave_value(octave_uint64(0)); - octave_swig_type *ost = Swig::swig_value_deref(args(0)); - if (!ost) { - error("swig_this: object is not a swig_ref"); - return octave_value_list(); - } - return octave_value(octave_uint64((unsigned long long) ost->swig_this())); -} - -static const char *const swig_octave_prereq_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_octave_prereq(@var{major}, @var{minor}, @var{patch})\n\ -Return true if the version of Octave is at least @var{major}.@var{minor}.@var{patch}.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_octave_prereq, args, nargout, swig_octave_prereq_usage ) { - if (args.length() != 3) { - error("swig_octave_prereq: must be called with 3 arguments"); - return octave_value_list(); - } - const int major = args(0).int_value(); - const int minor = args(1).int_value(); - const int patch = args(2).int_value(); - const bool prereq = SWIG_OCTAVE_PREREQ(major, minor, patch); - return octave_value(prereq); -} - -static const char *const swig_exit_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_exit([@var{exit_status}])\n\ -Exit Octave without performing any memory cleanup.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_exit, args, nargout, swig_exit_usage ) { - if (args.length() > 1) { - error("swig_exit: must be called with at most one arguments"); - return octave_value_list(); - } - int exit_status = 0; - if (args.length() == 1) { - exit_status = args(0).int_value(); - } - ::_Exit(exit_status); - return octave_value(); -} - -static const char *const SWIG_name_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Module} {} " SWIG_name_d "\n\ -Loads the SWIG-generated module `" SWIG_name_d "'.\n\ -@end deftypefn"; - -DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) { - - static octave_swig_type* module_ns = 0; - - // workaround to prevent octave seg-faulting on exit: set Octave exit function - // octave_exit to _Exit, which exits immediately without trying to cleanup memory. - // definitely affected version 3.2.*, not sure about 3.3.*, seems to be fixed in - // version 3.4.*, reappeared in 4.2.*, hack not possible in 4.4.* or later due to - // removal of octave_exit, so turn on for all versions between 3.2.*. and 4.4.*. - // can be turned off with macro definition. -#ifndef SWIG_OCTAVE_NO_SEGFAULT_HACK -#if !SWIG_OCTAVE_PREREQ(4,4,0) -#if SWIG_OCTAVE_PREREQ(3,2,0) - octave_exit = ::_Exit; -#endif -#endif -#endif - - // check for no input and output args - if (args.length() != 0 || nargout != 0) { - print_usage(); - return octave_value_list(); - } - - // create module on first function call - if (!module_ns) { - - // workaround bug in octave where installing global variable of custom type and then - // exiting without explicitly clearing the variable causes octave to segfault. -#if SWIG_OCTAVE_PREREQ(3,2,0) - octave_value_list eval_args; - eval_args.append("base"); - eval_args.append("function __swig_atexit__; " - " if mislocked() " - " clear -all; " - " else " - " mlock(); " - " endif; " - "endfunction; " - "__swig_atexit__; " - "atexit(\"__swig_atexit__\", false); " - "atexit(\"__swig_atexit__\")"); -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::feval("evalin", eval_args, 0); -#else - feval("evalin", eval_args, 0); -#endif -#endif - -#if SWIG_OCTAVE_PREREQ(4,4,0) - { - octave::type_info& typeinfo = octave::interpreter::the_interpreter()->get_type_info(); - string_vector types = typeinfo.installed_type_names(); - bool register_octave_swig_ref = true; - bool register_octave_swig_packed = true; - for (int i = 0; i < types.numel(); ++i) { - if (types(i) == octave_swig_ref::static_type_name()) { - register_octave_swig_ref = false; - octave_swig_ref::set_type_id(i); - } - if (types(i) == octave_swig_packed::static_type_name()) { - register_octave_swig_packed = false; - octave_swig_packed::set_type_id(i); - } - } - if (register_octave_swig_ref) { - octave_swig_ref::register_type(); - } - if (register_octave_swig_packed) { - octave_swig_packed::register_type(); - } - } -#else - octave_swig_ref::register_type(); - octave_swig_packed::register_type(); -#endif - SWIG_InitializeModule(0); - SWIG_PropagateClientData(); - -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::tree_evaluator& tree_eval = octave::interpreter::the_interpreter()->get_evaluator(); - octave::call_stack& stack = tree_eval.get_call_stack(); - octave_function *me = stack.current_function(); -#elif SWIG_OCTAVE_PREREQ(4,4,0) - octave::call_stack& stack = octave::interpreter::the_interpreter()->get_call_stack(); - octave_function *me = stack.current(); -#else - octave_function *me = octave_call_stack::current(); -#endif - - if (!SWIG_Octave_InstallFunction(me, "subclass")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_type")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_typequery")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_this")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_octave_prereq")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_exit")) { - return octave_value_list(); - } - - octave_swig_type* cvar_ns=0; - if (std::string(SWIG_global_name) != ".") { - cvar_ns=new octave_swig_type; - for (int j=0;swig_globals[j].name;++j) - if (swig_globals[j].get_method) - cvar_ns->assign(swig_globals[j].name,&swig_globals[j]); - } - - module_ns=new octave_swig_type(0, 0, 0, true); - if (std::string(SWIG_global_name) != ".") { - module_ns->assign(SWIG_global_name,Swig::swig_value_ref(cvar_ns)); - } - else { - for (int j=0;swig_globals[j].name;++j) - if (swig_globals[j].get_method) - module_ns->assign(swig_globals[j].name,&swig_globals[j]); - } - for (int j=0;swig_globals[j].name;++j) - if (swig_globals[j].method) - module_ns->assign(swig_globals[j].name,&swig_globals[j]); - - // * need better solution here; swig_type -> octave_class mapping is - // * really n-to-1, in some cases such as template partial spec, etc. - // * see failing tests. - for (int j=0;swig_types[j];++j) - if (swig_types[j]->clientdata) { - swig_octave_class* c=(swig_octave_class*)swig_types[j]->clientdata; - module_ns->assign(c->name, - Swig::swig_value_ref - (new octave_swig_type(0,swig_types[j]))); - } - - if (!SWIG_init_user(module_ns)) { - delete module_ns; - module_ns=0; - return octave_value_list(); - } - - SWIG_InstallOps(octave_swig_ref::static_type_id()); - - octave_swig_type::swig_member_const_iterator mb; - for (mb = module_ns->swig_members_begin(); mb != module_ns->swig_members_end(); ++mb) { - if (mb->second.first && mb->second.first->method) { - if (!SWIG_Octave_InstallFunction(me, mb->first)) { - return octave_value_list(); - } - } - } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::interpreter::the_interpreter()->mlock(); -#elif SWIG_OCTAVE_PREREQ(3,2,0) - mlock(); -#else - mlock(me->name()); -#endif - - } - - octave_swig_type::swig_member_const_iterator mb; - for (mb = module_ns->swig_members_begin(); mb != module_ns->swig_members_end(); ++mb) { - if (mb->second.second.is_defined()) { - SWIG_Octave_SetGlobalValue(mb->first, mb->second.second); - SWIG_Octave_LinkGlobalValue(mb->first); - } - } - - SWIG_Octave_SetGlobalValue(SWIG_name_d, module_ns->as_value()); - SWIG_Octave_LinkGlobalValue(SWIG_name_d); - - return octave_value_list(); - -} - -%} diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octstdcommon.swg b/mac/bin/swig/share/swig/4.1.0/octave/octstdcommon.swg deleted file mode 100755 index 80b2154d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octstdcommon.swg +++ /dev/null @@ -1,222 +0,0 @@ -%fragment("StdTraits","header",fragment="StdTraitsCommon") -{ -namespace swig { -// Traits that provides the from method - template struct traits_from_ptr { - static octave_value from(Type *val, int owner = 0) { - return SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static octave_value from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static octave_value from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static octave_value from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline octave_value from(const Type& val) { - return traits_from::from(val); - } - - template - inline octave_value from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - // Traits that provides the asval/as/check method - template - struct traits_asptr { - static int asptr(const octave_value& obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(const octave_value& obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(const octave_value& obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(const octave_value& obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(const octave_value& obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(const octave_value& obj) { - Type v; - int res = asval(obj, &v); - if (!obj.is_defined() || !SWIG_IsOK(res)) { - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(const octave_value& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(const octave_value& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(const octave_value& obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(const octave_value& obj) { - int res = asval(obj, (Type *)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(const octave_value& obj) { - int res = asptr(obj, (Type **)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(const octave_value& obj) { - return traits_check::category>::check(obj); - } -} -} - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(const octave_value& obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static octave_value from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(const octave_value& obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef - - -#define specialize_std_vector(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_list(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_deque(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octtypemaps.swg b/mac/bin/swig/share/swig/4.1.0/octave/octtypemaps.swg deleted file mode 100755 index 4984fddf..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octtypemaps.swg +++ /dev/null @@ -1,99 +0,0 @@ - -// Include fundamental fragment definitions -%include - -// Look for user fragments file. -%include - -// Octave fragments for primitive types -%include - -// Octave fragments for char* strings -//%include - - -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - -// Octave types -#define SWIG_Object octave_value -#define VOID_Object octave_value() - -/* -// Octave allows implicit conversion -#define %implicitconv_flag $implicitconv -*/ - -// append output -#define SWIG_AppendOutput(result, obj) SWIG_Octave_AppendOutput(result, obj) - -// set constant -#define SWIG_SetConstant(name, obj) SWIG_Octave_SetConstant(module_ns,name,obj) - -// raise -%runtime %{ -SWIGINTERN void SWIG_Octave_Raise(const octave_value &obj, const char *type) { - if (obj.is_string()) - error("%s", obj.string_value().c_str()); - else - error("C++ side threw an exception of type %s", type); -} -%} -#define SWIG_Raise(obj, type, desc) SWIG_Octave_Raise(obj, type) - -// Include the unified typemap library -%include - -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) SWIG_Object "$1 = (*$input).is_defined();"; -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) octave_value_list "$1 = true;"; - -%typemap(in) (octave_value_list varargs,...) { - for (int j=$argnum-1;jappend($1); -} -%typemap(out,noblock=1) octave_map, Octave_map { - $result=$1; -} -%typemap(out,noblock=1) NDArray { - $result=$1; -} -%typemap(out,noblock=1) Cell { - $result=$1; -} - -/* -// Smart Pointers -%typemap(out,noblock=1) const SWIGTYPE & SMARTPOINTER { - $result = SWIG_NewPointerObj(%new_copy(*$1, $*ltype), $descriptor, SWIG_POINTER_OWN | %newpointer_flags); -} - -%typemap(ret) const SWIGTYPE & SMARTPOINTER, SWIGTYPE SMARTPOINTER { - octave_swig_type* lobj=Swig::swig_value_deref($result); - if (lobj) { - std::list idx; - idx.push_back(octave_value("__deref__")); - idx.push_back(octave_value_list()); - octave_value_list ovl(lobj->subsref(".(",idx)); - octave_swig_type* robj=ovl.length()>=1?Swig::swig_value_deref(ovl(0)):0; - if (robj && !error_state) - lobj->append(robj); - } -} -*/ diff --git a/mac/bin/swig/share/swig/4.1.0/octave/octuserdir.swg b/mac/bin/swig/share/swig/4.1.0/octave/octuserdir.swg deleted file mode 100755 index ebb11b3a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/octuserdir.swg +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------------------------------------- - * Special user directives - * ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ -/* - Implicit Conversion using the C++ constructor mechanism -*/ - -#define %implicitconv %feature("implicitconv") -#define %noimplicitconv %feature("implicitconv", "0") -#define %clearimplicitconv %feature("implicitconv", "") - - -/* ------------------------------------------------------------------------- */ -/* - %extend_smart_pointer extend the smart pointer support. - - For example, if you have a smart pointer as: - - template class RCPtr { - public: - ... - RCPtr(Type *p); - Type * operator->() const; - ... - }; - - you use the %extend_smart_pointer directive as: - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - - then, if you have something like: - - RCPtr make_ptr(); - int foo(A *); - - you can do the following: - - a = make_ptr(); - b = foo(a); - - ie, swig will accept a RCPtr object where a 'A *' is - expected. - - Also, when using vectors - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - %template(vector_A) std::vector >; - - you can type - - a = A(); - v = vector_A(2) - v[0] = a - - ie, an 'A *' object is accepted, via implicit conversion, - where a RCPtr object is expected. Additionally - - x = v[0] - - returns (and sets 'x' as) a copy of v[0], making reference - counting possible and consistent. -*/ - -%define %extend_smart_pointer(Type...) -%implicitconv Type; -%apply const SWIGTYPE& SMARTPOINTER { const Type& }; -%apply SWIGTYPE SMARTPOINTER { Type }; -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_alloc.i b/mac/bin/swig/share/swig/4.1.0/octave/std_alloc.i deleted file mode 100755 index 35dc051b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/octave/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_basic_string.i b/mac/bin/swig/share/swig/4.1.0/octave/std_basic_string.i deleted file mode 100755 index 01a2c34a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_basic_string.i +++ /dev/null @@ -1,64 +0,0 @@ -#if !defined(SWIG_STD_STRING) -#define SWIG_STD_BASIC_STRING -#define SWIG_STD_MODERN_STL - -%include - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(octave_value obj, std::string **val) { - if (obj.is_string()) { - if (val) - *val = new std::string(obj.string_value()); - return SWIG_NEWOBJ; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromCharPtrAndSize") { -SWIGINTERNINLINE octave_value - SWIG_From(std::basic_string)(const std::string& s) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } -} - -%ignore std::basic_string::operator +=; - -%include -%typemaps_asptrfromn(%checkcode(STRING), std::basic_string); - -#endif - - -#if !defined(SWIG_STD_WSTRING) - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsWCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(octave_value obj, std::wstring **val) { - if (obj.is_string()) { - if (val) - *val = new std::wstring(obj.string_value()); - return SWIG_NEWOBJ; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromWCharPtrAndSize") { -SWIGINTERNINLINE PyObject* - SWIG_From(std::basic_string)(const std::wstring& s) { - return SWIG_FromWCharPtrAndSize(s.data(), s.size()); - } -} - -%typemaps_asptrfromn(%checkcode(UNISTRING), std::basic_string); - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_carray.i b/mac/bin/swig/share/swig/4.1.0/octave/std_carray.i deleted file mode 100755 index e69de29b..00000000 diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_char_traits.i b/mac/bin/swig/share/swig/4.1.0/octave/std_char_traits.i deleted file mode 100755 index bf4e6c47..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_common.i b/mac/bin/swig/share/swig/4.1.0/octave/std_common.i deleted file mode 100755 index c8f17ba7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_common.i +++ /dev/null @@ -1,72 +0,0 @@ -%include -%include - - -// Generate the traits for a 'primitive' type, such as 'double', -// for which the SWIG_AsVal and SWIG_From methods are already defined. - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(octave_value obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static octave_value from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(octave_value obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static octave_value from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_complex.i b/mac/bin/swig/share/swig/4.1.0/octave/std_complex.i deleted file mode 100755 index 461e2fdf..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_complex.i +++ /dev/null @@ -1,25 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); - - - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_container.i b/mac/bin/swig/share/swig/4.1.0/octave/std_container.i deleted file mode 100755 index cab76452..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_deque.i b/mac/bin/swig/share/swig/4.1.0/octave/std_deque.i deleted file mode 100755 index c40cfee1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_deque.i +++ /dev/null @@ -1,25 +0,0 @@ -// Deques - -%fragment("StdDequeTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(octave_value obj, std::deque **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static octave_value from(const std::deque& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_except.i b/mac/bin/swig/share/swig/4.1.0/octave/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_list.i b/mac/bin/swig/share/swig/4.1.0/octave/std_list.i deleted file mode 100755 index 35f6c132..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_list.i +++ /dev/null @@ -1,26 +0,0 @@ -// Lists - -%fragment("StdListTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const octave_value& obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static octave_value *from(const std::list& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_map.i b/mac/bin/swig/share/swig/4.1.0/octave/std_map.i deleted file mode 100755 index fd15661c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_map.i +++ /dev/null @@ -1,157 +0,0 @@ -// Maps - -%include - -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") -{ - namespace swig { - template - struct from_key_oper - { - typedef const ValueType& argument_type; - typedef octave_value result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.first); - } - }; - - template - struct from_value_oper - { - typedef const ValueType& argument_type; - typedef octave_value result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.second); - } - }; - - template - struct OctMapIterator_T : OctSwigIteratorClosed_T - { - OctMapIterator_T(OutIterator curr, OutIterator first, OutIterator last, octave_value seq) - : OctSwigIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct OctMapKeyIterator_T : OctMapIterator_T - { - OctMapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, octave_value seq) - : OctMapIterator_T(curr, first, last, seq) - { - } - }; - - template - inline OctSwigIterator* - make_output_key_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, octave_value seq = octave_value()) - { - return new OctMapKeyIterator_T(current, begin, end, seq); - } - - template > - struct OctMapValueIterator_T : OctMapIterator_T - { - OctMapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, octave_value seq) - : OctMapIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline OctSwigIterator* - make_output_value_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, octave_value seq = 0) - { - return new OctMapValueIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const OctSeq& octseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename OctSeq::const_iterator it = octseq.begin(); - for (;it != octseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::map map_type; - static int asptr(octave_value obj, map_type **val) { - /* - int res = SWIG_ERROR; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - map_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - */ - return SWIG_ERROR; - } - }; - - template - struct traits_from > { - typedef std::map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static octave_value from(const map_type& map) { - /* - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - size_type size = map.size(); - int pysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (pysize < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_OverflowError, - "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - return obj; - } - */ - return octave_value(); - } - }; - } -} - -%define %swig_map_common(Map...) - %swig_sequence_iterator(Map); - %swig_container_methods(Map); -%enddef - -%define %swig_map_methods(Map...) - %swig_map_common(Map) -%enddef - - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_pair.i b/mac/bin/swig/share/swig/4.1.0/octave/std_pair.i deleted file mode 100755 index 2f307380..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_pair.i +++ /dev/null @@ -1,147 +0,0 @@ -// Pairs - -%include - -//#define SWIG_STD_PAIR_ASVAL - -%fragment("StdPairTraits","header",fragment="StdTraits") { - namespace swig { -#ifdef SWIG_STD_PAIR_ASVAL - template - struct traits_asval > { - typedef std::pair value_type; - - static int get_pair(const octave_value& first, octave_value second, - std::pair *val) - { - if (val) { - T *pfirst = &(val->first); - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) - return res1; - U *psecond = &(val->second); - int res2 = swig::asval(second, psecond); - if (!SWIG_IsOK(res2)) - return res2; - return res1 > res2 ? res1 : res2; - } else { - T *pfirst = 0; - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) - return res1; - U *psecond = 0; - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) - return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asval(const octave_value& obj, std::pair *val) { - if ( -%#if SWIG_OCTAVE_PREREQ(4,4,0) - obj.iscell() -%#else - obj.is_cell() -%#endif - ) { - Cell c=obj.cell_value(); - if (c.numel()<2) { - error("pair from Cell array requires at least two elements"); - return SWIG_ERROR; - } - return get_pair(c(0),c(1),val); - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) - *val = *p; - return res; - } - return SWIG_ERROR; - } - }; - -#else - template - struct traits_asptr > { - typedef std::pair value_type; - - static int get_pair(const octave_value& first, octave_value second, - std::pair **val) - { - if (val) { - value_type *vp = %new_instance(std::pair); - T *pfirst = &(vp->first); - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) { - %delete(vp); - return res1; - } - U *psecond = &(vp->second); - int res2 = swig::asval(second, psecond); - if (!SWIG_IsOK(res2)) { - %delete(vp); - return res2; - } - *val = vp; - return SWIG_AddNewMask(res1 > res2 ? res1 : res2); - } else { - T *pfirst = 0; - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) - return res1; - U *psecond = 0; - int res2 = swig::asval(second, psecond); - if (!SWIG_IsOK(res2)) - return res2; - return res1 > res2 ? res1 : res2; - } - return SWIG_ERROR; - } - - static int asptr(const octave_value& obj, std::pair **val) { - if ( -%#if SWIG_OCTAVE_PREREQ(4,4,0) - obj.iscell() -%#else - obj.is_cell() -%#endif - ) { - Cell c=obj.cell_value(); - if (c.numel()<2) { - error("pair from Cell array requires at least two elements"); - return SWIG_ERROR; - } - return get_pair(c(0),c(1),val); - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) - *val = p; - return res; - } - return SWIG_ERROR; - } - }; - -#endif - template - struct traits_from > { - static octave_value from(const std::pair& val) { - Cell c(1,2); - c(0)=swig::from(val.first); - c(1)=swig::from(val.second); - return c; - } - }; - } -} - -%define %swig_pair_methods(pair...) -%enddef - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/octave/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_string.i b/mac/bin/swig/share/swig/4.1.0/octave/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/octave/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_vector.i b/mac/bin/swig/share/swig/4.1.0/octave/std_vector.i deleted file mode 100755 index 2862b5e7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_vector.i +++ /dev/null @@ -1,26 +0,0 @@ -// Vectors - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const octave_value& obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static octave_value from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/std_wstring.i b/mac/bin/swig/share/swig/4.1.0/octave/std_wstring.i deleted file mode 100755 index dc1378ae..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/std_wstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/stl.i b/mac/bin/swig/share/swig/4.1.0/octave/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/octave/swigmove.i b/mac/bin/swig/share/swig/4.1.0/octave/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/octave/typemaps.i b/mac/bin/swig/share/swig/4.1.0/octave/typemaps.i deleted file mode 100755 index 1f9b9c43..00000000 --- a/mac/bin/swig/share/swig/4.1.0/octave/typemaps.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/Makefile.in b/mac/bin/swig/share/swig/4.1.0/perl5/Makefile.in deleted file mode 100755 index e0b3b74b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/Makefile.in +++ /dev/null @@ -1,120 +0,0 @@ -# --------------------------------------------------------------- -# SWIG Perl5 Makefile -# -# This file can be used to build various Perl5 extensions with SWIG. -# By default this file is set up for dynamic loading, but it can -# be easily customized for static extensions by modifying various -# portions of the file. -# -# SRCS = C source files -# CXXSRCS = C++ source files -# OBJCSRCS = Objective-C source files -# OBJS = Additional .o files (compiled previously) -# INTERFACE = SWIG interface file -# TARGET = Name of target module or executable -# -# Many portions of this file were created by the SWIG configure -# script and should already reflect your machine. -#---------------------------------------------------------------- - -SRCS = -CXXSRCS = -OBJCSRCS = -OBJS = -INTERFACE = -WRAPFILE = $(INTERFACE:.i=_wrap.c) -WRAPOBJ = $(INTERFACE:.i=_wrap.o) -TARGET = module@SO@ # Use this kind of target for dynamic loading -#TARGET = myperl # Use this target for static linking - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -CC = @CC@ -CXX = @CXX@ -OBJC = @CC@ -Wno-import # -Wno-import needed for gcc -CFLAGS = -INCLUDES = -LIBS = - -# SWIG Options -# SWIG = location of the SWIG executable -# SWIGOPT = SWIG compiler options -# SWIGCC = Compiler used to compile the wrapper file - -SWIG = $(exec_prefix)/bin/swig -SWIGOPT = -perl5 -SWIGCC = $(CC) - -# SWIG Library files. Uncomment this to statically rebuild Perl -#SWIGLIBS = -static -lperlmain.i - -# Rules for creating .o files from source. - -COBJS = $(SRCS:.c=.o) -CXXOBJS = $(CXXSRCS:.cxx=.o) -OBJCOBJS = $(OBJCSRCS:.m=.o) -ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) - -# Command that will be used to build the final extension. -BUILD = $(SWIGCC) - -# Uncomment the following if you are using dynamic loading -CCSHARED = @CCSHARED@ -BUILD = @LDSHARED@ - -# Uncomment the following if you are using dynamic loading with C++ and -# need to provide additional link libraries (this is not always required). - -#DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ - -L/usr/local/lib -lg++ -lstdc++ -lgcc - -# Perl installation - -PERL_INCLUDE = -I@PERL5EXT@ -PERL_LIB = -L@PERL5EXT@ -lperl -PERL_FLAGS = -Dbool=char -Dexplicit= - -# Build libraries (needed for static builds) - -LIBM = @LIBM@ -LIBC = @LIBC@ -SYSLIBS = $(LIBM) $(LIBC) @LIBS@ - -# Build options - -BUILD_LIBS = $(LIBS) # Dynamic loading - -# Compilation rules for non-SWIG components - -.SUFFIXES: .c .cxx .m - -.c.o: - $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - -.cxx.o: - $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< - -.m.o: - $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - - -# ---------------------------------------------------------------------- -# Rules for building the extension -# ---------------------------------------------------------------------- - -all: $(TARGET) - -# Convert the wrapper file into an object file - -$(WRAPOBJ) : $(WRAPFILE) - $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(PERL_INCLUDE) $(PERL_FLAGS) $(WRAPFILE) - -$(WRAPFILE) : $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIBS) $(INTERFACE) - -$(TARGET): $(WRAPOBJ) $(ALLOBJS) - $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) - -clean: - rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/Makefile.pl b/mac/bin/swig/share/swig/4.1.0/perl5/Makefile.pl deleted file mode 100755 index cffdc8e7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/Makefile.pl +++ /dev/null @@ -1,19 +0,0 @@ -# File : Makefile.pl -# MakeMaker file for a SWIG module. Use this file if you are -# producing a module for general use or distribution. -# -# 1. Modify the file as appropriate. Replace $module with the -# real name of your module and wrapper file. -# 2. Run perl as 'perl Makefile.pl' -# 3. Type 'make' to build your module -# 4. Type 'make install' to install your module. -# -# See "Programming Perl", 2nd. Ed, for more gory details than -# you ever wanted to know. - -use ExtUtils::MakeMaker; -WriteMakefile( - 'NAME' => '$module', # Name of your module - 'LIBS' => [''], # Custom libraries (if any) - 'OBJECT' => '$module_wrap.o' # Object files -); diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/argcargv.i b/mac/bin/swig/share/swig/4.1.0/perl5/argcargv.i deleted file mode 100755 index 48a6047b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/argcargv.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - int i; - I32 len; - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) { - SWIG_croak("in method '$symname', Expecting reference to argv array"); - goto fail; - } - len = av_len(av) + 1; - $1 = ($1_ltype) len; - $2 = (char **) malloc((len+1)*sizeof(char *)); - for (i = 0; i < len; i++) { - SV **tv = av_fetch(av, i, 0); - $2[i] = SvPV_nolen(*tv); - } - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - AV *av = (AV *)SvRV($input); - $1 = SvTYPE(av) == SVt_PVAV; -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/attribute.i b/mac/bin/swig/share/swig/4.1.0/perl5/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/carrays.i b/mac/bin/swig/share/swig/4.1.0/perl5/carrays.i deleted file mode 100755 index 8be67abc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/carrays.i +++ /dev/null @@ -1,2 +0,0 @@ -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/cdata.i b/mac/bin/swig/share/swig/4.1.0/perl5/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/cmalloc.i b/mac/bin/swig/share/swig/4.1.0/perl5/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/cpointer.i b/mac/bin/swig/share/swig/4.1.0/perl5/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/cstring.i b/mac/bin/swig/share/swig/4.1.0/perl5/cstring.i deleted file mode 100755 index ede9c596..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/director.swg b/mac/bin/swig/share/swig/4.1.0/perl5/director.swg deleted file mode 100755 index f0a6614f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/director.swg +++ /dev/null @@ -1,317 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Perl proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DIRECTOR_PERL_HEADER_ -#define SWIG_DIRECTOR_PERL_HEADER_ - -#include -#include -#include -#include -#include - - -/* - Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the - native C++ RTTI and dynamic_cast<>. But be aware that directors - could stop working when using this option. -*/ -#ifdef SWIG_DIRECTOR_NORTTI -/* - When we don't use the native C++ RTTI, we implement a minimal one - only for Directors. -*/ -# ifndef SWIG_DIRECTOR_RTDIR -# define SWIG_DIRECTOR_RTDIR - -namespace Swig { - class Director; - SWIGINTERN std::map& get_rtdir_map() { - static std::map rtdir_map; - return rtdir_map; - } - - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *rtdir) { - get_rtdir_map()[vptr] = rtdir; - } - - SWIGINTERNINLINE Director *get_rtdir(void *vptr) { - std::map::const_iterator pos = get_rtdir_map().find(vptr); - Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0; - return rtdir; - } -} -# endif /* SWIG_DIRECTOR_RTDIR */ - -# define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast(ARG)) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast(ARG1), ARG2) - -#else - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) - -#endif /* SWIG_DIRECTOR_NORTTI */ - -extern "C" { - struct swig_type_info; -} - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() {} - - virtual int get_own() const { - return 0; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem *operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(int own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - int get_own() const { - return _own; - } - - private: - int _own; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - template - struct GCArray_T : GCItem { - GCArray_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCArray_T() { - delete[] _ptr; - } - - private: - Type *_ptr; - }; - - /* base class for director exceptions */ - class DirectorException : public std::exception { - public: - virtual SV *getNative() const = 0; - }; - - /* exceptions emitted by Perl */ - class DirectorMethodException : public DirectorException { - protected: - SV *err; - public: - DirectorMethodException(SV *sv = sv_mortalcopy(ERRSV)) : err(sv) { - SvREFCNT_inc(err); - } - - const char *what() const throw() { - return SvPV_nolen(err); - } - - SV *getNative() const { - return sv_2mortal(newSVsv(err)); - } - - static void raise(SV *sv) { - throw DirectorMethodException(sv); - } - }; - - /* exceptions emitted by wrap code */ - class DirectorWrapException : public DirectorException { - protected: - std::string msg; - DirectorWrapException(const char *str) : msg(str) { - } - - public: - virtual ~DirectorWrapException() throw() { - } - - const char *what() const throw() { - return msg.c_str(); - } - - virtual SV *getNative() const { - return sv_2mortal(newSVpvn(msg.data(), msg.size())); - } - }; - - class DirectorTypeMismatchException : public DirectorWrapException { - public: - DirectorTypeMismatchException(const char *str) : DirectorWrapException(str) { - } - - static void raise(const char *type, const char *msg) { - std::string err = std::string(type); - err += ": "; - err += msg; - throw DirectorTypeMismatchException(err.c_str()); - } - }; - - class DirectorPureVirtualException : public DirectorWrapException { - public: - DirectorPureVirtualException(const char *name) - : DirectorWrapException("SWIG director pure virtual method called: ") { - msg += name; - } - - static void raise(const char *name) { - throw DirectorPureVirtualException(name); - } - }; - - /* director base class */ - class Director { - private: - /* pointer to the wrapped perl object */ - SV *swig_self; - /* class of wrapped perl object */ - std::string swig_class; - /* flag indicating whether the object is owned by perl or c++ */ - mutable bool swig_disown_flag; - - /* decrement the reference count of the wrapped perl object */ - void swig_decref() const { - if (swig_disown_flag) { - SvREFCNT_dec(swig_self); - } - } - - public: - /* wrap a Perl object. */ - Director(SV *pkg) : swig_disown_flag(false) { - STRLEN len; - char *str = SvPV(pkg, len); - swig_class = std::string(str, len); - swig_self = newRV_inc((SV *)newHV()); - } - - /* discard our reference at destruction */ - virtual ~Director() { - swig_decref(); - } - - /* return a pointer to the wrapped Perl object */ - SV *swig_get_self() const { - return swig_self; - } - - const char *swig_get_class() const { - return swig_class.c_str(); - } - - /* acquire ownership of the wrapped Perl object (the sense of "disown" is from perl) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag=true; - swig_incref(); - } - } - - /* increase the reference count of the wrapped Perl object */ - void swig_incref() const { - if (swig_disown_flag) { - SvREFCNT_inc(swig_self); - } - } - - /* methods to implement pseudo protected director members */ - virtual bool swig_get_inner(const char * /* swig_protected_method_name */) const { - return true; - } - - virtual void swig_set_inner(const char * /* swig_protected_method_name */, bool /* swig_val */) const { - } - - /* ownership management */ - private: - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; - - public: - template - void swig_acquire_ownership_array(Type *vptr) const { - if (vptr) { - swig_owner[vptr] = new GCArray_T(vptr); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, int own) const { - if (vptr && own) { - swig_owner[vptr] = new GCItem_Object(own); - } - } - - int swig_release_ownership(void *vptr) const { - int own = 0; - if (vptr) { - swig_ownership_map::iterator iter = swig_owner.find(vptr); - if (iter != swig_owner.end()) { - own = iter->second->get_own(); - swig_owner.erase(iter); - } - } - return own; - } - }; - -} - -#endif - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/exception.i b/mac/bin/swig/share/swig/4.1.0/perl5/exception.i deleted file mode 100755 index b786f25e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/exception.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) -} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/extra-install.list b/mac/bin/swig/share/swig/4.1.0/perl5/extra-install.list deleted file mode 100755 index db93830a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/extra-install.list +++ /dev/null @@ -1,2 +0,0 @@ -# see top-level Makefile.in -Makefile.pl noembed.h diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/factory.i b/mac/bin/swig/share/swig/4.1.0/perl5/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/noembed.h b/mac/bin/swig/share/swig/4.1.0/perl5/noembed.h deleted file mode 100755 index 4e30f111..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/noembed.h +++ /dev/null @@ -1,116 +0,0 @@ -/* Workaround perl5 global namespace pollution. Note that undefining library - * functions like fopen will not solve the problem on all platforms as fopen - * might be a macro on Windows but not necessarily on other operating systems. */ -#ifdef do_open - #undef do_open -#endif -#ifdef do_close - #undef do_close -#endif -#ifdef do_exec - #undef do_exec -#endif -#ifdef scalar - #undef scalar -#endif -#ifdef list - #undef list -#endif -#ifdef apply - #undef apply -#endif -#ifdef convert - #undef convert -#endif -#ifdef Error - #undef Error -#endif -#ifdef form - #undef form -#endif -#ifdef vform - #undef vform -#endif -#ifdef LABEL - #undef LABEL -#endif -#ifdef METHOD - #undef METHOD -#endif -#ifdef Move - #undef Move -#endif -#ifdef yylex - #undef yylex -#endif -#ifdef yyparse - #undef yyparse -#endif -#ifdef yyerror - #undef yyerror -#endif -#ifdef invert - #undef invert -#endif -#ifdef ref - #undef ref -#endif -#ifdef read - #undef read -#endif -#ifdef write - #undef write -#endif -#ifdef eof - #undef eof -#endif -#ifdef close - #undef close -#endif -#ifdef rewind - #undef rewind -#endif -#ifdef free - #undef free -#endif -#ifdef malloc - #undef malloc -#endif -#ifdef calloc - #undef calloc -#endif -#ifdef Stat - #undef Stat -#endif -#ifdef check - #undef check -#endif -#ifdef seekdir - #undef seekdir -#endif -#ifdef open - #undef open -#endif -#ifdef readdir - #undef readdir -#endif -#ifdef bind - #undef bind -#endif -#ifdef access - #undef access -#endif -#ifdef stat - #undef stat -#endif -#ifdef seed - #undef seed -#endif - -#ifdef bool - /* Leave if macro is from C99 stdbool.h */ - #ifndef __bool_true_false_are_defined - #undef bool - #endif -#endif - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perl5.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perl5.swg deleted file mode 100755 index 693c2b94..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perl5.swg +++ /dev/null @@ -1,42 +0,0 @@ -/* ------------------------------------------------------------ - * perl.swg - * - * Perl configuration module. - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Perl keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Perl initialization function - * ------------------------------------------------------------ */ -%include - - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlerrors.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlerrors.swg deleted file mode 100755 index 57296c67..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlerrors.swg +++ /dev/null @@ -1,34 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGINTERN const char* -SWIG_Perl_ErrorType(int code) { - switch(code) { - case SWIG_MemoryError: - return "MemoryError"; - case SWIG_IOError: - return "IOError"; - case SWIG_RuntimeError: - return "RuntimeError"; - case SWIG_IndexError: - return "IndexError"; - case SWIG_TypeError: - return "TypeError"; - case SWIG_DivisionByZero: - return "ZeroDivisionError"; - case SWIG_OverflowError: - return "OverflowError"; - case SWIG_SyntaxError: - return "SyntaxError"; - case SWIG_ValueError: - return "ValueError"; - case SWIG_SystemError: - return "SystemError"; - case SWIG_AttributeError: - return "AttributeError"; - default: - return "RuntimeError"; - } -} - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlfragments.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlfragments.swg deleted file mode 100755 index 45d25d1f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'perlfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the ones defined by default by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlhead.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlhead.swg deleted file mode 100755 index 773adee9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlhead.swg +++ /dev/null @@ -1,91 +0,0 @@ -#ifdef __cplusplus -/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ -#include -#include -extern "C" { -#endif - -#if __GNUC__ >= 10 -#if defined(__cplusplus) -#pragma GCC diagnostic ignored "-Wvolatile" -#endif -#endif - -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#if __GNUC__ >= 10 -#pragma GCC diagnostic pop -#endif - -/* PERL_REVISION was added in Perl 5.6. */ -#if !defined PERL_REVISION || (PERL_REVISION-0 == 5 && PERL_VERSION-0 < 8) -# error SWIG requires Perl >= 5.8.0 -#endif - -#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) -#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) -#endif - -#ifndef SvIOK_UV -# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv))) -#endif - -#ifndef SvUOK -# define SvUOK(sv) SvIOK_UV(sv) -#endif - -#ifndef IVSIZE -# ifdef LONGSIZE -# define IVSIZE LONGSIZE -# else -# define IVSIZE 4 /* A bold guess, but the best we can make. */ -# endif -#endif - -#ifndef INT2PTR -# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) -# define PTRV UV -# define INT2PTR(any,d) (any)(d) -# else -# if PTRSIZE == LONGSIZE -# define PTRV unsigned long -# else -# define PTRV unsigned -# endif -# define INT2PTR(any,d) (any)(PTRV)(d) -# endif - -# define NUM2PTR(any,d) (any)(PTRV)(d) -# define PTR2IV(p) INT2PTR(IV,p) -# define PTR2UV(p) INT2PTR(UV,p) -# define PTR2NV(p) NUM2PTR(NV,p) - -# if PTRSIZE == LONGSIZE -# define PTR2ul(p) (unsigned long)(p) -# else -# define PTR2ul(p) INT2PTR(unsigned long,p) -# endif -#endif /* !INT2PTR */ - -#ifndef SvPV_nolen -# define SvPV_nolen(x) SvPV(x,PL_na) -#endif - -#ifndef get_sv -# define get_sv perl_get_sv -#endif - -#ifndef ERRSV -# define ERRSV get_sv("@",FALSE) -#endif - -#ifndef pTHX_ -#define pTHX_ -#endif - -#include -#ifdef __cplusplus -} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlinit.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlinit.swg deleted file mode 100755 index c26b93fa..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlinit.swg +++ /dev/null @@ -1,78 +0,0 @@ - -/* Export the SWIG initialization function */ -%header %{ -#ifdef __cplusplus -extern "C" -#endif -#ifndef MULTIPLICITY -SWIGEXPORT void SWIG_init (CV* cv); -#else -SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); -#endif -%} - -/* Module initialization function */ - -%insert(init) "swiginit.swg" - -%init %{ - -#if defined(__cplusplus) && ! defined(XSPROTO) -extern "C" -#endif - -XS(SWIG_init) { - dXSARGS; - int i; - (void)items; - - SWIG_InitializeModule(0); - - /* Install commands */ - for (i = 0; swig_commands[i].name; i++) { - /* Casts only needed for Perl < 5.10. */ -#ifdef __cplusplus - newXS(const_cast(swig_commands[i].name), swig_commands[i].wrapper, const_cast(__FILE__)); -#else - newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__); -#endif - } - - /* Install variables */ - for (i = 0; swig_variables[i].name; i++) { - SV *sv; - sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); - if (swig_variables[i].type) { - SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); - } else { - sv_setiv(sv,(IV) 0); - } - swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); - } - - /* Install constant */ - for (i = 0; swig_constants[i].type; i++) { - SV *sv; - sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); - switch(swig_constants[i].type) { - case SWIG_INT: - sv_setiv(sv, (IV) swig_constants[i].lvalue); - break; - case SWIG_FLOAT: - sv_setnv(sv, (double) swig_constants[i].dvalue); - break; - case SWIG_STRING: - sv_setpv(sv, (const char *) swig_constants[i].pvalue); - break; - case SWIG_POINTER: - SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); - break; - case SWIG_BINARY: - SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); - break; - default: - break; - } - SvREADONLY_on(sv); - } -%} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlkw.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlkw.swg deleted file mode 100755 index 00648e0b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlkw.swg +++ /dev/null @@ -1,251 +0,0 @@ -/* Warnings for Perl keywords */ -#define PERLKW(x) %keywordwarn("'" `x` "' is a perl keyword") `x` -#define PERLBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in perl") "::" `x` - - -/* - - From http://www.rocketaware.com/perl/perlfunc/ - -*/ - -/* Functions for SCALARs or strings*/ -PERLBN(chomp); -PERLBN(chop); -PERLBN(chr); -PERLBN(crypt); -PERLBN(hex); -PERLBN(index); -PERLBN(lc); -PERLBN(lcfirst); -PERLBN(length); -PERLBN(oct); -PERLBN(ord); -PERLBN(pack); -PERLBN(reverse); -PERLBN(rindex); -PERLBN(sprintf); -PERLBN(substr); -PERLBN(uc); -PERLBN(ucfirst); - -/* Regular expressions and pattern matching */ -PERLBN(m); -PERLBN(pos); -PERLBN(quotemeta); -PERLBN(split); -PERLBN(study); - -/* Numeric functions */ -PERLBN(abs); -PERLBN(atan2); -PERLBN(cos); -PERLBN(exp); -PERLBN(hex); -PERLBN(int); -PERLBN(log); -PERLBN(oct); -PERLBN(rand); -PERLBN(sin); -PERLBN(sqrt); -PERLBN(srand); - - -/* Functions for real @ARRAYs*/ -PERLBN(pop); -PERLBN(push); -PERLBN(shift); -PERLBN(splice); -PERLBN(unshift); - -/* Functions for list data*/ -PERLBN(grep); -PERLBN(join); -PERLBN(map); -PERLBN(qw); -PERLBN(reverse); -PERLBN(sort); -PERLBN(unpack); - - -/* Functions for real %HASHes*/ -PERLBN(delete); -PERLBN(each); -PERLBN(exists); -PERLBN(keys); -PERLBN(values); - - -/* Input and output functions*/ - -PERLBN(binmode); -PERLBN(close); -PERLBN(closedir); -PERLBN(dbmclose); -PERLBN(dbmopen); -PERLBN(die); -PERLBN(eof); -PERLBN(fileno); -PERLBN(flock); -PERLBN(format); -PERLBN(getc); -PERLBN(print); -PERLBN(printf); -PERLBN(read); -PERLBN(readdir); -PERLBN(rewinddir); -PERLBN(seek); -PERLBN(seekdir); -PERLBN(select); -PERLBN(syscall); -PERLBN(sysread); -PERLBN(sysseek); -PERLBN(syswrite); -PERLBN(tell); -PERLBN(telldir); -PERLBN(truncate); -PERLBN(warn); -PERLBN(write); - - -/* Functions for fixed length data or records*/ -PERLBN(pack); -PERLBN(read); -PERLBN(syscall); -PERLBN(sysread); -PERLBN(syswrite); -PERLBN(unpack); -PERLBN(vec); - - -/* Functions for filehandles, files, or directories */ -PERLBN(chdir); -PERLBN(chmod); -PERLBN(chown); -PERLBN(chroot); -PERLBN(fcntl); -PERLBN(glob); -PERLBN(ioctl); -PERLBN(link); -PERLBN(lstat); -PERLBN(mkdir); -PERLBN(open); -PERLBN(opendir); -PERLBN(readlink); -PERLBN(rename); -PERLBN(rmdir); -PERLBN(stat); -PERLBN(symlink); -PERLBN(umask); -PERLBN(unlink); -PERLBN(utime); - - -/* Keywords related to the control flow of your perl program */ -PERLKW(caller); -PERLKW(continue); -PERLKW(die); -PERLKW(do); -PERLKW(dump); -PERLKW(eval); -PERLKW(exit); -PERLKW(goto); -PERLKW(last); -PERLKW(next); -PERLKW(redo); -PERLKW(return); -PERLKW(sub); -PERLKW(wantarray); - - -/* Keywords related to scoping */ -PERLKW(caller); -PERLKW(import); -PERLKW(local); -PERLKW(my); -PERLKW(package); -PERLKW(use); - - -/* Miscellaneous functions */ -PERLBN("defined"); -PERLBN(dump); -PERLBN(eval); -PERLBN(formline); -PERLBN(local); -PERLBN(my); -PERLBN(reset); -PERLBN(scalar); -PERLBN(undef); -PERLBN(wantarray); - - -/* Functions for processes and process groups */ -PERLBN(alarm); -PERLBN(exec); -PERLBN(fork); -PERLBN(getpgrp); -PERLBN(getppid); -PERLBN(getpriority); -PERLBN(kill); -PERLBN(pipe); -PERLBN(setpgrp); -PERLBN(setpriority); -PERLBN(sleep); -PERLBN(system); -PERLBN(times); -PERLBN(wait); -PERLBN(waitpid); - - -/* Keywords related to perl modules */ -PERLKW(do); -PERLKW(import); -PERLKW(no); -PERLKW(package); -PERLKW(require); -PERLKW(use); - - -/* Keywords related to classes and object-orientedness */ -PERLKW(bless); -PERLKW(dbmclose); -PERLKW(dbmopen); -PERLKW(package); -PERLKW(ref); -PERLKW(tie); -PERLKW(tied); -PERLKW(untie); -PERLKW(use); - -/* Functions new in perl5 */ -PERLBN(abs); -PERLBN(bless); -PERLBN(chomp); -PERLBN(chr); -PERLBN(exists); -PERLBN(formline); -PERLBN(glob); -PERLBN(import); -PERLBN(lc); -PERLBN(lcfirst); -PERLBN(map); -PERLBN(my); -PERLBN(no); -PERLBN(prototype); -PERLBN(qx); -PERLBN(qw); -PERLBN(readline); -PERLBN(readpipe); -PERLBN(ref); -PERLBN(sub); -PERLBN(sysopen); -PERLBN(tie); -PERLBN(tied); -PERLBN(uc); -PERLBN(ucfirst); -PERLBN(untie); -PERLBN(use); - -#undef PERLKW -#undef PERLBN diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlmacros.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlmacros.swg deleted file mode 100755 index 4917f6ef..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlmacros.swg +++ /dev/null @@ -1,2 +0,0 @@ -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlmain.i b/mac/bin/swig/share/swig/4.1.0/perl5/perlmain.i deleted file mode 100755 index 18ecb7eb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlmain.i +++ /dev/null @@ -1,82 +0,0 @@ -/* ----------------------------------------------------------------------------- - * perlmain.i - * - * Code to statically rebuild perl5. - * ----------------------------------------------------------------------------- */ - -#ifdef AUTODOC -%subsection "perlmain.i" -%text %{ -This module provides support for building a new version of the -Perl executable. This will be necessary on systems that do -not support shared libraries and may be necessary with C++ -extensions. - -This module may only build a stripped down version of the -Perl executable. Thus, it may be necessary (or desirable) -to hand-edit this file for your particular application. To -do this, simply copy this file from swig_lib/perl5/perlmain.i -to your working directory and make the appropriate modifications. - -This library file works with Perl 5.003. It may work with earlier -versions, but it hasn't been tested. As far as I know, this -library is C++ safe. -%} -#endif - -%{ - -static void xs_init _((pTHX)); -static PerlInterpreter *my_perl; - -int perl_eval(char *string) { - char *argv[2]; - argv[0] = string; - argv[1] = (char *) 0; - return perl_call_argv("eval",0,argv); -} - -int -main(int argc, char **argv, char **env) -{ - int exitstatus; - - my_perl = perl_alloc(); - if (!my_perl) - exit(1); - perl_construct( my_perl ); - - exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL ); - if (exitstatus) - exit( exitstatus ); - - /* Initialize all of the module variables */ - - exitstatus = perl_run( my_perl ); - - perl_destruct( my_perl ); - perl_free( my_perl ); - - exit( exitstatus ); -} - -/* Register any extra external extensions */ - -/* Do not delete this line--writemain depends on it */ -/* EXTERN_C void boot_DynaLoader _((CV* cv)); */ - -static void -xs_init(pTHX) -{ -/* dXSUB_SYS; */ - char *file = __FILE__; - { - /* newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); */ - newXS(SWIG_name, SWIG_init, file); -#ifdef SWIGMODINIT - SWIGMODINIT -#endif - } -} - -%} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlopers.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlopers.swg deleted file mode 100755 index e7d13b67..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlopers.swg +++ /dev/null @@ -1,54 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus - -// These are auto-supported by the Perl-module -%rename(__plusplus__) *::operator++; -%rename(__minmin__) *::operator--; -%rename(__add__) *::operator+; -%rename(__sub__) *::operator-; -%rename(__neg__) *::operator-(); -%rename(__neg__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__eq__) *::operator==; -%rename(__ne__) *::operator!=; -%rename(__mod__) *::operator%; -%rename(__gt__) *::operator>; -%rename(__lt__) *::operator<; -%rename(__not__) *::operator!; -%rename(__le__) *::operator<=; -%rename(__ge__) *::operator>=; -%rename(__and__) *::operator&; -%rename(__or__) *::operator|; -%rename(__iadd__) *::operator+=; -%rename(__isub__) *::operator-=; - -// These are renamed, but no test exists in operator_overload_runme.pl -%ignoreoperator(EQ) operator=; - -// These are renamed, but no 'use overload...' is added -%rename(__lshift__) *::operator<<; -%rename(__rshift__) *::operator>>; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__call__) *::operator(); - -/* Ignored operators */ -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; -%ignoreoperator(ARROWSTAR) operator->*; -%ignoreoperator(INDEX) operator[]; - - -#endif /* __cplusplus */ diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlprimtypes.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlprimtypes.swg deleted file mode 100755 index 4cb67567..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlprimtypes.swg +++ /dev/null @@ -1,364 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* bool */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(bool)(bool value) -{ - return boolSV(value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header") { -SWIGINTERN int -SWIG_AsVal_dec(bool)(SV *obj, bool* val) -{ - if (obj == &PL_sv_yes) { - if (val) *val = true; - return SWIG_OK; - } else if (obj == &PL_sv_no) { - if (val) *val = false; - return SWIG_OK; - } else { - if (val) *val = SvTRUE(obj) ? true : false; - return SWIG_AddCast(SWIG_OK); - } -} -} - - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(long)(long value) -{ - SV *sv; - if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX)) - sv = newSViv(value); - else - sv = newSVpvf("%ld", value); - return sv_2mortal(sv); -} -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="", - fragment="", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(long)(SV *obj, long* val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - if (UVSIZE < sizeof(*val) || v <= LONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) { - if(val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - long v; - errno = 0; - v = strtol(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(unsigned long)(unsigned long value) -{ - SV *sv; - if (UVSIZE >= sizeof(value) || value <= UV_MAX) - sv = newSVuv(value); - else - sv = newSVpvf("%lu", value); - return sv_2mortal(sv); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="", - fragment="", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(SV *obj, unsigned long *val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - if (UVSIZE <= sizeof(*val) || v <= ULONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - unsigned long v; - errno = 0; - v = strtoul(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SV * -SWIG_From_dec(long long)(long long value) -{ - SV *sv; - if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX)) - sv = newSViv((IV)(value)); - else { - //sv = newSVpvf("%lld", value); doesn't work in non 64bit Perl - char temp[256]; - sprintf(temp, "%lld", value); - sv = newSVpv(temp, 0); - } - return sv_2mortal(sv); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="", - fragment="SWIG_CanCastAsInteger") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(SV *obj, long long *val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - /* pretty sure this could allow v == LLONG MAX */ - if (UVSIZE < sizeof(*val) || v < LLONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (IVSIZE <= sizeof(*val) || (v >= LLONG_MIN && v <= LLONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - long long v; - errno = 0; - v = strtoll(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - const double mant_max = 1LL << DBL_MANT_DIG; - const double mant_min = -mant_max; - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { - if (val) *val = (long long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SV * -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - SV *sv; - if (UVSIZE >= sizeof(value) || value <= UV_MAX) - sv = newSVuv((UV)(value)); - else { - //sv = newSVpvf("%llu", value); doesn't work in non 64bit Perl - char temp[256]; - sprintf(temp, "%llu", value); - sv = newSVpv(temp, 0); - } - return sv_2mortal(sv); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="", - fragment="SWIG_CanCastAsInteger") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(SV *obj, unsigned long long *val) -{ - if (SvUOK(obj)) { - /* pretty sure this should be conditional on - * (UVSIZE <= sizeof(*val) || v <= ULLONG_MAX) */ - if (val) *val = SvUV(obj); - return SWIG_OK; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULLONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - unsigned long long v; - errno = 0; - v = strtoull(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(double)(double value) -{ - return sv_2mortal(newSVnv(value)); -} -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(SV *obj, double *val) -{ - if (SvNIOK(obj)) { - if (val) *val = SvNV(obj); - return SWIG_OK; - } else if (SvIOK(obj)) { - if (val) *val = (double) SvIV(obj); - return SWIG_AddCast(SWIG_OK); - } else { - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - double v; - errno = 0; - v = strtod(nptr, &endptr); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - } - return SWIG_TypeError; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlrun.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlrun.swg deleted file mode 100755 index 71f19cbf..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlrun.swg +++ /dev/null @@ -1,493 +0,0 @@ -/* ----------------------------------------------------------------------------- - * perlrun.swg - * - * This file contains the runtime support for Perl modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -#define SWIG_PERL_OBJECT_DECL -#define SWIG_PERL_OBJECT_CALL - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) -#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own) -#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) -#define SWIG_AcquirePtr(ptr, src) SWIG_Perl_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) -#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) -#define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - -/* Perl-specific SWIG API */ - -#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags) -#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type) -#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str) - - -#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1) -#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1) -#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2) -#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2) - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 - -#ifdef __cplusplus -extern "C" { -#endif - -#define SWIG_OWNER SWIG_POINTER_OWN -#define SWIG_SHADOW SWIG_OWNER << 1 - -#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL - -/* SWIG Perl macros */ - -/* Macro to declare an XS function */ -#ifndef XSPROTO -# define XSPROTO(name) void name(pTHX_ CV* cv) -#endif - -/* Macro to call an XS function */ -#ifndef MULTIPLICITY -# define SWIG_CALLXS(_name) _name(cv) -#else -# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) -#endif - -#define MAGIC_PPERL -#define SWIGCLASS_STATIC static SWIGUNUSED - -#ifndef MULTIPLICITY -#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFunc)(SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#else /* MULTIPLICITY */ - -#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#endif /* MULTIPLICITY */ - -static void SWIGUNUSED SWIG_croak_null() -{ - SV *err = get_sv("@", GV_ADD); - if (sv_isobject(err)) - croak(0); - else - croak("%s", SvPV_nolen(err)); -} - - -/* - Define how strict is the cast between strings and integers/doubles - when overloading between these types occurs. - - The default is making it as strict as possible by using SWIG_AddCast - when needed. - - You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to - disable the SWIG_AddCast, making the casting between string and - numbers less strict. - - In the end, we try to solve the overloading between strings and - numerical types in the more natural way, but if you can avoid it, - well, avoid it using %rename, for example. -*/ -#ifndef SWIG_PERL_NO_STRICT_STR2NUM -# ifndef SWIG_PERL_STRICT_STR2NUM -# define SWIG_PERL_STRICT_STR2NUM -# endif -#endif -#ifdef SWIG_PERL_STRICT_STR2NUM -/* string takes precedence */ -#define SWIG_Str2NumCast(x) SWIG_AddCast(x) -#else -/* number takes precedence */ -#define SWIG_Str2NumCast(x) x -#endif - - - -#include - -SWIGRUNTIME const char * -SWIG_Perl_TypeProxyName(const swig_type_info *type) { - if (!type) return NULL; - if (type->clientdata != NULL) { - return (const char*) type->clientdata; - } - else { - return type->name; - } -} - -/* Identical to SWIG_TypeCheck, except for strcmp comparison */ -SWIGRUNTIME swig_cast_info * -SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, int own) { - /* TODO */ - return 0; -} - -/* Function for getting a pointer value */ - -SWIGRUNTIME int -SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) { - swig_cast_info *tc; - void *voidptr = (void *)0; - SV *tsv = 0; - int check_owned_pointer_release = (flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE; - - if (own) - *own = 0; - - /* If magical, apply more magic */ - if (SvGMAGICAL(sv)) - mg_get(sv); - - /* Check to see if this is an object */ - if (sv_isobject(sv)) { - IV tmp = 0; - tsv = (SV*) SvRV(sv); - if ((SvTYPE(tsv) == SVt_PVHV)) { - MAGIC *mg; - if (SvMAGICAL(tsv)) { - mg = mg_find(tsv,'P'); - if (mg) { - sv = mg->mg_obj; - if (sv_isobject(sv)) { - tsv = (SV*)SvRV(sv); - tmp = SvIV(tsv); - } - } - } else { - return SWIG_ERROR; - } - } else { - tmp = SvIV(tsv); - } - voidptr = INT2PTR(void *,tmp); - } else if (! SvOK(sv)) { /* Check for undef */ - *(ptr) = (void *) 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ - if (!SvROK(sv)) { - /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */ - if (SvIOK(sv)) { - return SWIG_ERROR; - } else { - /* NULL pointer (reference to undef). */ - *(ptr) = (void *) 0; - return SWIG_OK; - } - } else { - return SWIG_ERROR; - } - } else { /* Don't know what it is */ - return SWIG_ERROR; - } - if (_t) { - /* Now see if the types match */ - char *_c = HvNAME(SvSTASH(SvRV(sv))); - tc = SWIG_TypeProxyCheck(_c,_t); -#ifdef SWIG_DIRECTORS - if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) { -#else - if (!tc) { -#endif - return SWIG_ERROR; - } - { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - } else { - *ptr = voidptr; - } - - /* - * DISOWN implementation: we need a perl guru to check this one. - */ - if (tsv && ((flags & SWIG_POINTER_DISOWN) || check_owned_pointer_release)) { - /* - * almost copy paste code from below SWIG_POINTER_OWN setting - */ - SV *obj = sv; - HV *stash = SvSTASH(SvRV(obj)); - GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); - int owned = 0; - if (isGV(gv)) { - HV *hv = GvHVn(gv); - /* - * To set ownership (see below), a newSViv(1) entry is added. - * Hence, to remove ownership, we delete the entry. - */ - if (hv_exists_ent(hv, obj, 0)) { - owned = 1; - if (flags & SWIG_POINTER_DISOWN) { - hv_delete_ent(hv, obj, 0, 0); - } - } - } - if (check_owned_pointer_release && !owned) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - } - - if (tsv && (flags & SWIG_POINTER_CLEAR)) { - SvIV_set(tsv, 0); - } - - return SWIG_OK; -} - -SWIGRUNTIME int -SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { - return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0); -} - -SWIGRUNTIME void -SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { - if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) { - SV *self; - SV *obj=newSV(0); - HV *hash=newHV(); - HV *stash; - sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr); - stash=SvSTASH(SvRV(obj)); - if (flags & SWIG_POINTER_OWN) { - HV *hv; - GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); - if (!isGV(gv)) - gv_init(gv, stash, "OWNER", 5, FALSE); - hv=GvHVn(gv); - hv_store_ent(hv, obj, newSViv(1), 0); - } - sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); - SvREFCNT_dec(obj); - self=newRV_noinc((SV *)hash); - sv_setsv(sv, self); - SvREFCNT_dec((SV *)self); - sv_bless(sv, stash); - } - else { - sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr); - } -} - -SWIGRUNTIMEINLINE SV * -SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { - SV *result = sv_newmortal(); - SWIG_MakePtr(result, ptr, t, flags); - return result; -} - -SWIGRUNTIME void -SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - strcpy(r,SWIG_Perl_TypeProxyName(type)); - sv_setpv(sv, result); -} - -SWIGRUNTIME SV * -SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) { - SV *result = sv_newmortal(); - SWIG_Perl_MakePackedObj(result, ptr, sz, type); - return result; -} - -/* Convert a packed pointer value */ -SWIGRUNTIME int -SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c = 0; - - if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; - c = SvPV_nolen(obj); - /* Pointer values must start with leading underscore */ - if (*c != '_') return SWIG_ERROR; - c++; - c = SWIG_UnpackData(c,ptr,sz); - if (ty) { - tc = SWIG_TypeCheck(c,ty); - if (!tc) return SWIG_ERROR; - } - return SWIG_OK; -} - - -/* Macros for low-level exception handling */ -#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; } - - -typedef XSPROTO(SwigPerlWrapper); -typedef SwigPerlWrapper *SwigPerlWrapperPtr; - -/* Structure for command table */ -typedef struct { - const char *name; - SwigPerlWrapperPtr wrapper; -} swig_command_info; - -/* Information for constant table */ - -#define SWIG_INT 1 -#define SWIG_FLOAT 2 -#define SWIG_STRING 3 -#define SWIG_POINTER 4 -#define SWIG_BINARY 5 - -/* Constant information structure */ -typedef struct swig_constant_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_constant_info; - - -/* Structure for variable table */ -typedef struct { - const char *name; - SwigMagicFunc set; - SwigMagicFunc get; - swig_type_info **type; -} swig_variable_info; - -/* Magic variable code */ -#ifdef __cplusplus -# define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast(a),b,c) -#else -# define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c) -#endif -#ifndef MULTIPLICITY -SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) -#else -SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) -#endif -{ - MAGIC *mg; - sv_magic(sv,sv,'U',name,strlen(name)); - mg = mg_find(sv,'U'); - mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); - mg->mg_virtual->svt_get = (SwigMagicFunc) get; - mg->mg_virtual->svt_set = (SwigMagicFunc) set; - mg->mg_virtual->svt_len = 0; - mg->mg_virtual->svt_clear = 0; - mg->mg_virtual->svt_free = 0; -} - - -SWIGRUNTIME swig_module_info * -SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - static void *type_pointer = (void *)0; - SV *pointer; - - /* first check if pointer already created */ - if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); - if (pointer && SvOK(pointer)) { - type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); - } - } - - return (swig_module_info *) type_pointer; -} - -SWIGRUNTIME void -SWIG_Perl_SetModule(swig_module_info *module) { - SV *pointer; - - /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); - sv_setiv(pointer, PTR2IV(module)); -} - -#ifdef __cplusplus -} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlruntime.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlruntime.swg deleted file mode 100755 index f948023d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlruntime.swg +++ /dev/null @@ -1,8 +0,0 @@ - -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors -%runtime "perlhead.swg" // Perl includes and fixes -%runtime "perlerrors.swg" // Perl errors -%runtime "perlrun.swg" // Perl runtime functions -%runtime "noembed.h" // undefine Perl5 macros - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perlstrings.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perlstrings.swg deleted file mode 100755 index 242a9c96..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perlstrings.swg +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) -{ - if (SvMAGICAL(obj)) { - SV *tmp = sv_newmortal(); - SvSetSV(tmp, obj); - obj = tmp; - } - if (SvPOK(obj)) { - STRLEN len = 0; - char *cstr = SvPV(obj, len); - size_t size = len + 1; - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, size, char); - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } - } - if (psize) *psize = size; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - char* vptr = 0; - if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = vptr; - if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header") { -SWIGINTERNINLINE SV * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - SV *obj = sv_newmortal(); - if (carray) { - sv_setpvn(obj, carray, size); - } else { - sv_setsv(obj, &PL_sv_undef); - } - return obj; -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perltypemaps.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perltypemaps.swg deleted file mode 100755 index 42f8887b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perltypemaps.swg +++ /dev/null @@ -1,104 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Perl - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ - -/* - in Perl we need to pass the CPerlObj value, sometimes, so, we define - the decl/call macros as needed. -*/ - -#define SWIG_AS_DECL_ARGS SWIG_PERL_DECL_ARGS_2 -#define SWIG_AS_CALL_ARGS SWIG_PERL_CALL_ARGS_2 - -#define SWIG_FROM_DECL_ARGS SWIG_PERL_DECL_ARGS_1 -#define SWIG_FROM_CALL_ARGS SWIG_PERL_CALL_ARGS_1 - - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Perl fragments for primitive types */ -%include - -/* Perl fragments for char* strings */ -%include - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* director support in Perl is experimental */ -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Perl types */ -#define SWIG_Object SV * -#define VOID_Object &PL_sv_undef - -/* Perl $shadow flag */ -#define %newpointer_flags $shadow -#define %newinstance_flags $shadow - - -/* Complete overload of the output/constant/exception macros */ - -/* output */ -%define %set_output(obj) $result = obj; argvi++ %enddef - -/* append output */ -%define %append_output(obj) -if (argvi >= items) EXTEND(sp, argvi+1); -%set_output(obj) %enddef - -/* variable output */ -%define %set_varoutput(obj) sv_setsv($result,obj) %enddef - -/* constant */ -%define %set_constant(name, obj) %begin_block - SV *sv = get_sv((char*) SWIG_prefix name, TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, obj); - SvREADONLY_on(sv); -%end_block %enddef - -/* raise exception */ -%define %raise(obj, type, desc) sv_setsv(get_sv("@", GV_ADD), obj); SWIG_fail %enddef - -/* For directors to raise/throw the original exception */ -%typemap(throws) Swig::DirectorException -%{ sv_setsv(ERRSV, $1.getNative()); SWIG_fail; %} - -/* Include the unified typemap library */ -%include - -/* ------------------------------------------------------------ - * Perl extra typemaps / typemap overrides - * ------------------------------------------------------------ */ - -%typemap(varout,type="$1_descriptor") SWIGTYPE *, SWIGTYPE [] - "sv_setiv(SvRV($result),PTR2IV($1));"; - -%typemap(varout,type="$1_descriptor") SWIGTYPE & - "sv_setiv(SvRV($result),PTR2IV(&$1));"; - -%typemap(varout,type="$1_descriptor") SWIGTYPE && - "sv_setiv(SvRV($result),PTR2IV(&$1));"; - -%typemap(varout,type="$&1_descriptor") SWIGTYPE - "sv_setiv(SvRV($result), PTR2IV(&$1));"; - -%typemap(varout,type="$1_descriptor") SWIGTYPE (CLASS::*) { - SWIG_MakePackedObj($result, (void *) &$1, sizeof($1), $1_descriptor); -} - -%typemap(varout) SWIGTYPE *const = SWIGTYPE *; - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/perluserdir.swg b/mac/bin/swig/share/swig/4.1.0/perl5/perluserdir.swg deleted file mode 100755 index 718440e8..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/perluserdir.swg +++ /dev/null @@ -1,2 +0,0 @@ -#define %perlcode %insert("perl") - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/reference.i b/mac/bin/swig/share/swig/4.1.0/perl5/reference.i deleted file mode 100755 index b424c533..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/reference.i +++ /dev/null @@ -1,261 +0,0 @@ -/* ----------------------------------------------------------------------------- - * reference.i - * - * Accept Perl references as pointers - * ----------------------------------------------------------------------------- */ - -/* -The following methods make Perl references work like simple C -pointers. References can only be used for simple input/output -values, not C arrays however. It should also be noted that -REFERENCES are specific to Perl and not supported in other -scripting languages at this time. - - int *REFERENCE - short *REFERENCE - long *REFERENCE - unsigned int *REFERENCE - unsigned short *REFERENCE - unsigned long *REFERENCE - unsigned char *REFERENCE - float *REFERENCE - double *REFERENCE - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include reference.i - void neg(double *REFERENCE); - -or you can use the %apply directive : - - %include reference.i - %apply double *REFERENCE { double *x }; - void neg(double *x); - -Unlike the INOUT mapping described in typemaps.i, this approach directly -modifies the value of a Perl reference. Thus, you could use it -as follows : - - $x = 3; - neg(\$x); - print "$x\n"; # Should print out -3. - -*/ - -%typemap(in) double *REFERENCE (double dvalue), double &REFERENCE(double dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { - printf("Received %d\n", SvTYPE(tempsv)); - SWIG_croak("Expected a double reference."); - } - dvalue = SvNV(tempsv); - $1 = &dvalue; -} - -%typemap(in) float *REFERENCE (float dvalue), float &REFERENCE(float dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { - SWIG_croak("expected a double reference"); - } - dvalue = (float) SvNV(tempsv); - $1 = &dvalue; -} - -%typemap(in) int *REFERENCE (int dvalue), int &REFERENCE (int dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = SvIV(tempsv); - $1 = &dvalue; -} - -%typemap(in) short *REFERENCE (short dvalue), short &REFERENCE(short dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (short) SvIV(tempsv); - $1 = &dvalue; -} -%typemap(in) long *REFERENCE (long dvalue), long &REFERENCE(long dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (long) SvIV(tempsv); - $1 = &dvalue; -} -%typemap(in) unsigned int *REFERENCE (unsigned int dvalue), unsigned int &REFERENCE(unsigned int dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned int) SvUV(tempsv); - $1 = &dvalue; -} -%typemap(in) unsigned short *REFERENCE (unsigned short dvalue), unsigned short &REFERENCE(unsigned short dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned short) SvUV(tempsv); - $1 = &dvalue; -} -%typemap(in) unsigned long *REFERENCE (unsigned long dvalue), unsigned long &REFERENCE(unsigned long dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned long) SvUV(tempsv); - $1 = &dvalue; -} - -%typemap(in) unsigned char *REFERENCE (unsigned char dvalue), unsigned char &REFERENCE(unsigned char dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned char) SvUV(tempsv); - $1 = &dvalue; -} - -%typemap(in) signed char *REFERENCE (signed char dvalue), signed char &REFERENCE(signed char dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (signed char) SvIV(tempsv); - $1 = &dvalue; -} - -%typemap(in) bool *REFERENCE (bool dvalue), bool &REFERENCE(bool dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = SvIV(tempsv) ? true : false; - $1 = &dvalue; -} - -%typemap(typecheck) int *REFERENCE, int &REFERENCE, - short *REFERENCE, short &REFERENCE, - long *REFERENCE, long &REFERENCE, - signed char *REFERENCE, signed char &REFERENCE, - bool *REFERENCE, bool &REFERENCE -{ - $1 = SvROK($input) && SvIOK(SvRV($input)); -} -%typemap(typecheck) double *REFERENCE, double &REFERENCE, - float *REFERENCE, float &REFERENCE -{ - $1 = SvROK($input); - if($1) { - SV *tmpsv = SvRV($input); - $1 = SvNOK(tmpsv) || SvIOK(tmpsv); - } -} -%typemap(typecheck) unsigned int *REFERENCE, unsigned int &REFERENCE, - unsigned short *REFERENCE, unsigned short &REFERENCE, - unsigned long *REFERENCE, unsigned long &REFERENCE, - unsigned char *REFERENCE, unsigned char &REFERENCE -{ - $1 = SvROK($input); - if($1) { - SV *tmpsv = SvRV($input); - $1 = SvUOK(tmpsv) || SvIOK(tmpsv); - } -} - -%typemap(argout) double *REFERENCE, double &REFERENCE, - float *REFERENCE, float &REFERENCE -{ - SV *tempsv; - tempsv = SvRV($arg); - if (!$1) SWIG_croak("expected a reference"); - sv_setnv(tempsv, (double) *$1); -} - -%typemap(argout) int *REFERENCE, int &REFERENCE, - short *REFERENCE, short &REFERENCE, - long *REFERENCE, long &REFERENCE, - signed char *REFERENCE, signed char &REFERENCE, - bool *REFERENCE, bool &REFERENCE -{ - SV *tempsv; - tempsv = SvRV($input); - if (!$1) SWIG_croak("expected a reference"); - sv_setiv(tempsv, (IV) *$1); -} - -%typemap(argout) unsigned int *REFERENCE, unsigned int &REFERENCE, - unsigned short *REFERENCE, unsigned short &REFERENCE, - unsigned long *REFERENCE, unsigned long &REFERENCE, - unsigned char *REFERENCE, unsigned char &REFERENCE -{ - SV *tempsv; - tempsv = SvRV($input); - if (!$1) SWIG_croak("expected a reference"); - sv_setuv(tempsv, (UV) *$1); -} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_common.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_common.i deleted file mode 100755 index 7c1ff232..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_common.i +++ /dev/null @@ -1,28 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; - -%fragment(""); -%{ -SWIGINTERN -double SwigSvToNumber(SV* sv) { - return SvIOK(sv) ? double(SvIVX(sv)) : SvNVX(sv); -} -SWIGINTERN -std::string SwigSvToString(SV* sv) { - STRLEN len; - char *ptr = SvPV(sv, len); - return std::string(ptr, len); -} -SWIGINTERN -void SwigSvFromString(SV* sv, const std::string& s) { - sv_setpvn(sv,s.data(),s.size()); -} -%} - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_deque.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_except.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_list.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_list.i deleted file mode 100755 index 36678add..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_list.i +++ /dev/null @@ -1,377 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list types - * ----------------------------------------------------------------------------- */ - -%include -%include - -// containers - - -// ------------------------------------------------------------------------ -// std::list -// -// The aim of all that follows would be to integrate std::list with -// Perl as much as possible, namely, to allow the user to pass and -// be returned Perl arrays. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::list), f(const std::list&), f(const std::list*): -// the parameter being read-only, either a Perl sequence or a -// previously wrapped std::list can be passed. -// -- f(std::list&), f(std::list*): -// the parameter must be modified; therefore, only a wrapped std::list -// can be passed. -// -- std::list f(): -// the list is returned by copy; therefore, a Perl sequence of T:s -// is returned which is most easily used in other Perl functions -// -- std::list& f(), std::list* f(), const std::list& f(), -// const std::list* f(): -// the list is returned by reference; therefore, a wrapped std::list -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template class list { - %typemap(in) list (std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1) { - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i& (std::list temp, - std::list* v), - const list* (std::list temp, - std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i { - std::list< T >::const_iterator i; - unsigned int j; - int len = $1.size(); - SV **svs = new SV*[len]; - for (i=$1.begin(), j=0; i!=$1.end(); i++, j++) { - T* ptr = new T(*i); - svs[j] = sv_newmortal(); - SWIG_MakePtr(svs[j], (void*) ptr, - $descriptor(T *), $shadow|$owner); - } - AV *myav = av_make(len, svs); - delete[] svs; - $result = newRV_noinc((SV*) myav); - sv_2mortal($result); - argvi++; - } - %typecheck(SWIG_TYPECHECK_LIST) list { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_&descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_LIST) const list&, - const list* { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - list(); - list(const list& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(const T& x); - }; - - - // specializations for built-ins - - %define specialize_std_list(T,CHECK_T,TO_T,FROM_T) - template<> class list { - %typemap(in) list (std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1){ - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - for (int i=0; i& (std::list temp, - std::list* v), - const list* (std::list temp, - std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i { - std::list< T >::const_iterator i; - unsigned int j; - int len = $1.size(); - SV **svs = new SV*[len]; - for (i=$1.begin(), j=0; i!=$1.end(); i++, j++) { - svs[j] = sv_newmortal(); - FROM_T(svs[j], *i); - } - AV *myav = av_make(len, svs); - delete[] svs; - $result = newRV_noinc((SV*) myav); - sv_2mortal($result); - argvi++; - } - %typecheck(SWIG_TYPECHECK_LIST) list { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_&descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_LIST) const list&, - const list* { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef T value_type; - typedef const value_type& const_reference; - - list(); - list(const list& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T x); - }; - %enddef - - specialize_std_list(bool,SvIOK,SvIVX,sv_setiv); - specialize_std_list(char,SvIOK,SvIVX,sv_setiv); - specialize_std_list(int,SvIOK,SvIVX,sv_setiv); - specialize_std_list(short,SvIOK,SvIVX,sv_setiv); - specialize_std_list(long,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned char,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned int,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned short,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned long,SvIOK,SvIVX,sv_setiv); - specialize_std_list(float,SvNIOK,SwigSvToNumber,sv_setnv); - specialize_std_list(double,SvNIOK,SwigSvToNumber,sv_setnv); - specialize_std_list(std::string,SvPOK,SvPVX,SwigSvFromString); - -} - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_map.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_map.i deleted file mode 100755 index 1b373183..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_map.i +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_pair.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_string.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_string.i deleted file mode 100755 index 6f34f184..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_string.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/std_vector.i b/mac/bin/swig/share/swig/4.1.0/perl5/std_vector.i deleted file mode 100755 index 5bfd2c5a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/std_vector.i +++ /dev/null @@ -1,592 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector types - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Perl as much as possible, namely, to allow the user to pass and -// be returned Perl arrays. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a Perl sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a Perl sequence of T:s -// is returned which is most easily used in other Perl functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector (std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1) { - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i& (std::vector temp, - std::vector* v), - const vector* (std::vector temp, - std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i { - size_t len = $1.size(); - SV **svs = new SV*[len]; - for (size_t i=0; i { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - SV **tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - SV **tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T& get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector (std::vector* v) { - int res = SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0); - if (SWIG_IsOK(res)){ - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - I32 len = av_len(av) + 1; - for (int i=0; i& (std::vector temp,std::vector* v), - const vector* (std::vector temp,std::vector* v) { - int res = SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,0); - if (SWIG_IsOK(res)) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - I32 len = av_len(av) + 1; - for (int i=0; i { - size_t len = $1.size(); - SV **svs = new SV*[len]; - for (size_t i=0; i { - { - /* wrapped vector? */ - std::vector< T *>* v; - int res = SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0); - if (SWIG_IsOK(res)) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - void *v; - SV **tv = av_fetch(av, 0, 0); - int res = SWIG_ConvertPtr(*tv, &v, $descriptor(T *),0); - if (SWIG_IsOK(res)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&,const vector* { - { - /* wrapped vector? */ - std::vector< T *> *v; - int res = SWIG_ConvertPtr($input,%as_voidptrptr(&v), $1_descriptor,0); - if (SWIG_IsOK(res)) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - void *v; - SV **tv = av_fetch(av, 0, 0); - int res = SWIG_ConvertPtr(*tv, &v, $descriptor(T *),0); - if (SWIG_IsOK(res)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T* value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, T *value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T *x); - %extend { - T *pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T *x = self->back(); - self->pop_back(); - return x; - } - T *get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector (std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1){ - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - for (int i=0; i& (std::vector temp, - std::vector* v), - const vector* (std::vector temp, - std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - for (int i=0; i { - size_t len = $1.size(); - SV **svs = new SV*[len]; - for (size_t i=0; i { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SV **tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SV **tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, T value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/swigmove.i b/mac/bin/swig/share/swig/4.1.0/perl5/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/perl5/typemaps.i b/mac/bin/swig/share/swig/4.1.0/perl5/typemaps.i deleted file mode 100755 index 3e1f60d9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/perl5/typemaps.i +++ /dev/null @@ -1,371 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * The SWIG typemap library provides a language independent mechanism for - * supporting output arguments, input values, and other C function - * calling mechanisms. The primary use of the library is to provide a - * better interface to certain C function--especially those involving - * pointers. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_USE_OLD_TYPEMAPS) -%include -#else - - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -%define INPUT_TYPEMAP(type, converter) -%typemap(in) type *INPUT(type temp), type &INPUT(type temp) { - temp = (type) converter($input); - $1 = &temp; -} -%typemap(typecheck) type *INPUT = type; -%typemap(typecheck) type &INPUT = type; -%enddef - -INPUT_TYPEMAP(float, SvNV); -INPUT_TYPEMAP(double, SvNV); -INPUT_TYPEMAP(int, SvIV); -INPUT_TYPEMAP(long, SvIV); -INPUT_TYPEMAP(short, SvIV); -INPUT_TYPEMAP(signed char, SvIV); -INPUT_TYPEMAP(unsigned int, SvUV); -INPUT_TYPEMAP(unsigned long, SvUV); -INPUT_TYPEMAP(unsigned short, SvUV); -INPUT_TYPEMAP(unsigned char, SvUV); - -%typemap(in) bool *INPUT(bool temp), bool &INPUT(bool temp) { - temp = SvIV($input) ? true : false; - $1 = &temp; -} -%typemap(typecheck) bool *INPUT = bool; -%typemap(typecheck) bool &INPUT = bool; - -%typemap(in) long long *INPUT($*1_ltype temp), long long &INPUT($*1_ltype temp) { - temp = strtoll(SvPV_nolen($input), 0, 0); - $1 = &temp; -} -%typemap(typecheck) long long *INPUT = long long; -%typemap(typecheck) long long &INPUT = long long; - -%typemap(in) unsigned long long *INPUT($*1_ltype temp), unsigned long long &INPUT($*1_ltype temp) { - temp = strtoull(SvPV_nolen($input), 0, 0); - $1 = &temp; -} -%typemap(typecheck) unsigned long long *INPUT = unsigned long long; -%typemap(typecheck) unsigned long long &INPUT = unsigned long long; - - -#undef INPUT_TYPEMAP - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, functions will return a Perl array. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters).: - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include typemaps.i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Perl output of the function would be an array containing both -output values. - -*/ - -// Force the argument to be ignored. - -%typemap(in,numinputs=0) int *OUTPUT(int temp), int &OUTPUT(int temp), - short *OUTPUT(short temp), short &OUTPUT(short temp), - long *OUTPUT(long temp), long &OUTPUT(long temp), - unsigned int *OUTPUT(unsigned int temp), unsigned int &OUTPUT(unsigned int temp), - unsigned short *OUTPUT(unsigned short temp), unsigned short &OUTPUT(unsigned short temp), - unsigned long *OUTPUT(unsigned long temp), unsigned long &OUTPUT(unsigned long temp), - unsigned char *OUTPUT(unsigned char temp), unsigned char &OUTPUT(unsigned char temp), - signed char *OUTPUT(signed char temp), signed char &OUTPUT(signed char temp), - bool *OUTPUT(bool temp), bool &OUTPUT(bool temp), - float *OUTPUT(float temp), float &OUTPUT(float temp), - double *OUTPUT(double temp), double &OUTPUT(double temp), - long long *OUTPUT($*1_ltype temp), long long &OUTPUT($*1_ltype temp), - unsigned long long *OUTPUT($*1_ltype temp), unsigned long long &OUTPUT($*1_ltype temp) -"$1 = &temp;"; - -%typemap(argout) int *OUTPUT, int &OUTPUT, - short *OUTPUT, short &OUTPUT, - long *OUTPUT, long &OUTPUT, - signed char *OUTPUT, signed char &OUTPUT, - bool *OUTPUT, bool &OUTPUT -{ - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - $result = sv_newmortal(); - sv_setiv($result,(IV) *($1)); - argvi++; -} - -%typemap(argout) unsigned int *OUTPUT, unsigned int &OUTPUT, - unsigned short *OUTPUT, unsigned short &OUTPUT, - unsigned long *OUTPUT, unsigned long &OUTPUT, - unsigned char *OUTPUT, unsigned char &OUTPUT -{ - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - $result = sv_newmortal(); - sv_setuv($result,(UV) *($1)); - argvi++; -} - - - -%typemap(argout) float *OUTPUT, float &OUTPUT, - double *OUTPUT, double &OUTPUT -{ - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - $result = sv_newmortal(); - sv_setnv($result,(double) *($1)); - argvi++; -} - -%typemap(argout) long long *OUTPUT, long long &OUTPUT { - char temp[256]; - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - sprintf(temp,"%lld", (long long)*($1)); - $result = sv_newmortal(); - sv_setpv($result,temp); - argvi++; -} - -%typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT { - char temp[256]; - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - sprintf(temp,"%llu", (unsigned long long)*($1)); - $result = sv_newmortal(); - sv_setpv($result,temp); - argvi++; -} - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Perl array. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - void neg(double *INOUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value. -Rather, the modified input value shows up as the return value of the -function. Thus, to apply this function to a Perl variable you might -do this : - - $x = neg($x); - -*/ - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) unsigned &INOUT = unsigned &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) signed char &INOUT = signed char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; - - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) unsigned *INOUT = unsigned *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; - - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) unsigned &INOUT = unsigned &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) signed char &INOUT = signed char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; - - -/* Overloading information */ - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) bool *INOUT = bool; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) float *INOUT = float; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) bool &INOUT = bool; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) float &INOUT = float; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; - -#endif - -// -------------------------------------------------------------------- -// Special types -// -------------------------------------------------------------------- - - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/php/argcargv.i b/mac/bin/swig/share/swig/4.1.0/php/argcargv.i deleted file mode 100755 index e0093c21..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/argcargv.i +++ /dev/null @@ -1,40 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - int len, i; - zval *val; - zend_array *ar; - if (Z_TYPE($input) != IS_ARRAY) { - SWIG_PHP_Error(E_ERROR, "Type error in '$symname'. Expected array"); - goto fail; - } - ar = Z_ARR($input); - len = zend_array_count(ar); - $1 = ($1_ltype) len; - $2 = (char **) malloc((len+1)*sizeof(char *)); - i = 0; - ZEND_HASH_FOREACH_VAL(ar, val) { - if (Z_TYPE(*val) != IS_STRING) { - SWIG_PHP_Error(E_ERROR, "Array must use strings only, in '$symname'."); - goto fail; - } - if (i == len) { - SWIG_PHP_Error(E_ERROR, "Array is bigger than zend report in '$symname'."); - goto fail; - } - $2[i++] = Z_STRVAL(*val); - } ZEND_HASH_FOREACH_END(); - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = Z_TYPE($input) == IS_ARRAY; -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/mac/bin/swig/share/swig/4.1.0/php/const.i b/mac/bin/swig/share/swig/4.1.0/php/const.i deleted file mode 100755 index a74af0d7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/const.i +++ /dev/null @@ -1,103 +0,0 @@ -/* ----------------------------------------------------------------------------- - * const.i - * - * Typemaps for constants - * ----------------------------------------------------------------------------- */ -%typemap(classconsttab) int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - unsigned char, - signed char, - enum SWIGTYPE %{ - zend_declare_class_constant_long(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, ($1_type)($value)); -%} - -%typemap(classconsttab) bool %{ - zend_declare_class_constant_bool(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, ($1_type)($value)); -%} - -%typemap(classconsttab) float, - double %{ - zend_declare_class_constant_double(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, $value); -%} - -%typemap(classconsttab) char %{ -{ - char swig_char = $value; - zend_declare_class_constant_stringl(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, &swig_char, 1); -} -%} - -%typemap(classconsttab) char *, - const char *, - char [], - const char [] %{ - zend_declare_class_constant_string(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, $value); -%} - -// This creates a zend_object to wrap the pointer, and we can't do that -// before the Zend runtime has been initialised so we delay it until -// RINIT. The downside is it then happens for every request. -%typemap(classconsttab,rinit=1) SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [] %{ -{ - zval z; - ZVAL_UNDEF(&z); - SWIG_SetPointerZval(&z, (void*)($value), $1_descriptor, 0); - zval_copy_ctor(&z); - zend_declare_class_constant(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, &z); -} -%} - -%typemap(classconsttab) SWIGTYPE (CLASS::*) "" - -%typemap(consttab) int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - unsigned char, - signed char, - enum SWIGTYPE - "SWIG_LONG_CONSTANT($symname, ($1_type)($value));"; - -%typemap(consttab) bool - "SWIG_BOOL_CONSTANT($symname, ($1_type)($value));"; - -%typemap(consttab) float, - double - "SWIG_DOUBLE_CONSTANT($symname, $value);"; - -%typemap(consttab) char - "SWIG_CHAR_CONSTANT($symname, $value);"; - -%typemap(consttab) char *, - const char *, - char [], - const char [] - "SWIG_STRING_CONSTANT($symname, $value);"; - -// This creates a zend_object to wrap the pointer, and we can't do that -// before the Zend runtime has been initialised so we delay it until -// RINIT. The downside is it then happens for every request. -%typemap(consttab,rinit=1) SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [] { - zend_constant c; - ZVAL_UNDEF(&c.value); - SWIG_SetPointerZval(&c.value, (void*)($value), $1_descriptor, 0); - zval_copy_ctor(&c.value); - c.name = zend_string_init("$symname", sizeof("$symname") - 1, 0); - SWIG_ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, module_number); - zend_register_constant(&c); -} - -/* Handled as a global variable. */ -%typemap(consttab) SWIGTYPE (CLASS::*) "" diff --git a/mac/bin/swig/share/swig/4.1.0/php/director.swg b/mac/bin/swig/share/swig/4.1.0/php/director.swg deleted file mode 100755 index 55ffff51..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/director.swg +++ /dev/null @@ -1,180 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that PHP proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DIRECTOR_PHP_HEADER_ -#define SWIG_DIRECTOR_PHP_HEADER_ - -#define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -#include -#include -#include - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() { - } - - virtual int get_own() const { - return 0; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem * operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(int own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - int get_own() const { - return _own; - } - - private: - int _own; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - class Director { - private: - /* flag indicating whether the object is owned by PHP or C++ */ - mutable bool swig_disown_flag; - - protected: - // "mutable" so we can get a non-const pointer to it in const methods. - mutable zval swig_self; - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; - - public: - Director(zval *self) : swig_disown_flag(false) { - ZVAL_COPY_VALUE(&swig_self, self); - } - - ~Director() { - if (swig_disown_flag) { - Z_DELREF(swig_self); - } - } - - zend_object *swig_get_self() const { return Z_OBJ(swig_self); } - - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag = true; - Z_ADDREF(swig_self); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, int own) const { - if (vptr && own) { - swig_owner[vptr] = new GCItem_Object(own); - } - } - }; - - /* base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - public: - DirectorException(int code, const char *hdr, const char *msg) : swig_msg(hdr) { - if (msg && msg[0]) { - swig_msg += " "; - swig_msg += msg; - } - // Don't replace an already active PHP exception. - if (!EG(exception)) zend_throw_exception(NULL, swig_msg.c_str(), code); - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - - static void raise(int code, const char *hdr, const char *msg) { - throw DirectorException(code, hdr, msg); - } - }; - - /* attempt to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg) - : DirectorException(E_ERROR, "SWIG director pure virtual method called", msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - /* any php exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException { - public: - DirectorMethodException() - : DirectorException(E_ERROR, "SWIG director method error", NULL) { - } - - DirectorMethodException(const char *msg) - : DirectorException(E_ERROR, "SWIG director method error", msg) { - } - - static void raise(const char *msg) { - throw DirectorMethodException(msg); - } - }; -} - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/php/factory.i b/mac/bin/swig/share/swig/4.1.0/php/factory.i deleted file mode 100755 index 5f2b397e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/factory.i +++ /dev/null @@ -1,109 +0,0 @@ -/* - Implement a more natural wrap for factory methods, for example, if - you have: - - ---- geometry.h -------- - struct Geometry { - enum GeomType{ - POINT, - CIRCLE - }; - - virtual ~Geometry() {} - virtual int draw() = 0; - - // - // Factory method for all the Geometry objects - // - static Geometry *create(GeomType i); - }; - - struct Point : Geometry { - int draw() { return 1; } - double width() { return 1.0; } - }; - - struct Circle : Geometry { - int draw() { return 2; } - double radius() { return 1.5; } - }; - - // - // Factory method for all the Geometry objects - // - Geometry *Geometry::create(GeomType type) { - switch (type) { - case POINT: return new Point(); - case CIRCLE: return new Circle(); - default: return 0; - } - } - ---- geometry.h -------- - - - You can use the %factory with the Geometry::create method as follows: - - %newobject Geometry::create; - %factory(Geometry *Geometry::create, Point, Circle); - %include "geometry.h" - - and Geometry::create will return a 'Point' or 'Circle' instance - instead of the plain 'Geometry' type. For example, in python: - - circle = Geometry.create(Geometry.CIRCLE) - r = circle.radius() - - where circle is a Circle proxy instance. - - NOTES: remember to fully qualify all the type names and don't - use %factory inside a namespace declaration, ie, instead of - - namespace Foo { - %factory(Geometry *Geometry::create, Point, Circle); - } - - use - - %factory(Foo::Geometry *Foo::Geometry::create, Foo::Point, Foo::Circle); - - -*/ - -/* for loop for macro with one argument */ -%define %_formacro_1(macro, arg1,...)macro(arg1) -#if #__VA_ARGS__ != "__fordone__" -%_formacro_1(macro, __VA_ARGS__) -#endif -%enddef - -/* for loop for macro with one argument */ -%define %formacro_1(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef -%define %formacro(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef - -/* for loop for macro with two arguments */ -%define %_formacro_2(macro, arg1, arg2, ...)macro(arg1, arg2) -#if #__VA_ARGS__ != "__fordone__" -%_formacro_2(macro, __VA_ARGS__) -#endif -%enddef - -/* for loop for macro with two arguments */ -%define %formacro_2(macro,...)%_formacro_2(macro, __VA_ARGS__, __fordone__)%enddef - -%define %_factory_dispatch(Type) -if (!dcast) { - Type *dobj = dynamic_cast($1); - if (dobj) { - dcast = 1; - SWIG_SetPointerZval(return_value, SWIG_as_voidptr(dobj), $descriptor(Type *), $owner); - } -}%enddef - -%define %factory(Method,Types...) -%typemap(out, phptype="?SWIGTYPE") Method { - int dcast = 0; - %formacro(%_factory_dispatch, Types) - if (!dcast) { - SWIG_SetPointerZval(return_value, SWIG_as_voidptr($1), $descriptor, $owner); - } -}%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/php/php.swg b/mac/bin/swig/share/swig/4.1.0/php/php.swg deleted file mode 100755 index fd092807..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/php.swg +++ /dev/null @@ -1,594 +0,0 @@ -/* ----------------------------------------------------------------------------- - * php.swg - * - * PHP configuration file - * ----------------------------------------------------------------------------- */ - -// Default to generating PHP type declarations (for PHP >= 8) except for -// cases which are liable to cause compatibility issues with existing -// bindings. -%feature("php:type", "compat"); - -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors -%runtime "phprun.swg" // PHP runtime functions - -%include // PHP initialization routine. - -%include - -// use %init %{ "/*code goes here*/ " %} -// or %minit %{ "/* code goes here*/ " %} to -// insert code in the PHP_MINIT_FUNCTION -#define %minit %insert("init") - -// use %rinit %{ "/* code goes here*/ " %} to -// insert code in the PHP_RINIT_FUNCTION -#define %rinit %insert("rinit") - -// use %shutdown %{ " /*code goes here*/ " %} to -// insert code in the PHP_MSHUTDOWN_FUNCTION -#define %shutdown %insert("shutdown") -#define %mshutdown %insert("shutdown") - -// use %rshutdown %{ " /*code goes here*/" %} to -// insert code in the PHP_RSHUTDOWN_FUNCTION -#define %rshutdown %insert("rshutdown") - -/* Typemaps for input parameters by value */ - -%include - -%pass_by_val(bool, "bool", CONVERT_BOOL_IN); - -%pass_by_val(size_t, "int", CONVERT_INT_IN); - -%pass_by_val(enum SWIGTYPE, "int", CONVERT_INT_IN); - -%pass_by_val(signed int, "int", CONVERT_INT_IN); -%pass_by_val(int,"int", CONVERT_INT_IN); -%pass_by_val(unsigned int,"int", CONVERT_INT_IN); - -%pass_by_val(signed short, "int", CONVERT_INT_IN); -%pass_by_val(short,"int", CONVERT_INT_IN); -%pass_by_val(unsigned short, "int", CONVERT_INT_IN); - -%pass_by_val(signed long, "int", CONVERT_INT_IN); -%pass_by_val(long, "int", CONVERT_INT_IN); -%pass_by_val(unsigned long, "int", CONVERT_INT_IN); - -%pass_by_val(signed long long, "int|string", CONVERT_LONG_LONG_IN); -%pass_by_val(long long, "int|string", CONVERT_LONG_LONG_IN); -%pass_by_val(unsigned long long, "int|string", CONVERT_UNSIGNED_LONG_LONG_IN); - -%pass_by_val(signed char, "int", CONVERT_INT_IN); -%pass_by_val(char, "string", CONVERT_CHAR_IN); -%pass_by_val(unsigned char, "int", CONVERT_INT_IN); - -%pass_by_val(float, "float", CONVERT_FLOAT_IN); - -%pass_by_val(double, "float", CONVERT_FLOAT_IN); - -%pass_by_val(char *, "string", CONVERT_STRING_IN); -%typemap(in) char *& = const char *&; -%typemap(directorout) char *& = const char *&; - -// char array can be in/out, though the passed string may not be big enough... -// so we have to size it -%typemap(in, phptype="string") char[ANY] -%{ - convert_to_string(&$input); - $1 = ($1_ltype) Z_STRVAL($input); -%} - -%typemap(in, phptype="string") (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) %{ - convert_to_string(&$input); - $1 = ($1_ltype) Z_STRVAL($input); - $2 = ($2_ltype) Z_STRLEN($input); -%} - -/* Object passed by value. Convert to a pointer */ -%typemap(in, phptype="SWIGTYPE") SWIGTYPE ($&1_ltype tmp) -%{ - if (SWIG_ConvertPtr(&$input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { - zend_type_error("Expected $&1_descriptor for argument $argnum of $symname"); - return; - } - $1 = *tmp; -%} - -%typemap(directorout) SWIGTYPE ($&1_ltype tmp) -%{ - if (SWIG_ConvertPtr($input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { - zend_type_error("Expected $&1_descriptor for argument $argnum of $symname"); - SWIG_fail; - } - $result = *tmp; -%} - -%typemap(in, phptype="?SWIGTYPE") SWIGTYPE *, - SWIGTYPE [] -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } -%} - -%typemap(directorout) SWIGTYPE * (swig_owntype own), - SWIGTYPE [] (swig_owntype own) -%{ - if (SWIG_ConvertPtrAndOwn($input, (void **)&$result, $1_descriptor, SWIG_POINTER_DISOWN, &own) < 0) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - SWIG_fail; - } - swig_acquire_ownership_obj((void*)$result, own); -%} - -%typemap(in, phptype="SWIGTYPE") SWIGTYPE & -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0 || $1 == NULL) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } -%} -%typemap(in, fragment="") SWIGTYPE && (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) %{ - res = SWIG_ConvertPtr(&$input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $1_descriptor of $symname"); - return; - } else { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } - } - if (!argp) { - zend_type_error("Invalid null reference for argument $argnum of $1_descriptor of $symname"); - return; - } - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -%} - -%typemap(directorout) SWIGTYPE & ($1_ltype tmp), - SWIGTYPE && ($1_ltype tmp) -%{ - if (SWIG_ConvertPtr($input, (void **) &tmp, $1_descriptor, 0) < 0 || tmp == NULL) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - SWIG_fail; - } - $result = tmp; -%} - -%typemap(in, phptype="?SWIGTYPE") SWIGTYPE *const& ($*ltype temp) -%{ - if (SWIG_ConvertPtr(&$input, (void **) &temp, $*1_descriptor, 0) < 0) { - zend_type_error("Expected $*1_descriptor for argument $argnum of $symname"); - return; - } - $1 = ($1_ltype)&temp; -%} - -%typemap(in, phptype="?SWIGTYPE") SWIGTYPE *DISOWN -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, SWIG_POINTER_DISOWN) < 0) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } -%} - -%typemap(argout) SWIGTYPE *, - SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE &&; - -%typemap(in, phptype="?SWIGTYPE") void * -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, 0, 0) < 0) { - /* Allow NULL from php for void* */ - if (Z_ISNULL($input)) { - $1=0; - } else { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } - } -%} - -/* Special case when void* is passed by reference so it can be made to point - to opaque api structs */ -%typemap(in, phptype="?SWIG\\_p_void", byref=1) void ** ($*1_ltype ptr, int force), - void *& ($*1_ltype ptr, int force) -{ - /* If they pass NULL by reference, make it into a void* - This bit should go in arginit if arginit support init-ing scripting args */ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ - if (!(Z_ISREF($input) && Z_ISNULL_P(Z_REFVAL($input)))) { - /* wasn't a pre/ref/thing, OR anything like an int thing */ - zend_throw_exception(zend_ce_type_error, "Type error in argument $arg of $symname", 0); - goto fail; - } - } - force=0; - if (arg1==NULL) { -#ifdef __cplusplus - ptr=new $*1_ltype(); -#else - ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); -#endif - $1=&ptr; - /* have to passback arg$arg too */ - force=1; - } -} -%typemap(argout) void **, - void *& -%{ - if (force$argnum && Z_ISREF($input)) { - SWIG_SetPointerZval(Z_REFVAL($input), (void*) ptr$argnum, $*1_descriptor, 1); - } -%} - -/* Typemap for output values */ - -%typemap(out, phptype="int") - int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - signed char, - unsigned char, - size_t -%{ - RETVAL_LONG($1); -%} - -%typemap(out, phptype="int") enum SWIGTYPE -%{ - RETVAL_LONG((long)$1); -%} - -%typemap(out, phptype="int|string") long long -%{ - if ((long long)LONG_MIN <= $1 && $1 <= (long long)LONG_MAX) { - RETVAL_LONG((long)($1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%lld", (long long)$1)); - } -%} -%typemap(out, phptype="int|string") unsigned long long -%{ - if ($1 <= (unsigned long long)LONG_MAX) { - RETVAL_LONG((long)($1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%llu", (unsigned long long)$1)); - } -%} - -%typemap(out, phptype="int") - const int &, - const unsigned int &, - const short &, - const unsigned short &, - const long &, - const unsigned long &, - const signed char &, - const unsigned char &, - const bool &, - const size_t & -%{ - RETVAL_LONG(*$1); -%} - -%typemap(out, phptype="int") const enum SWIGTYPE & -%{ - RETVAL_LONG((long)*$1); -%} - -%typemap(out, phptype="int") const enum SWIGTYPE && -%{ - RETVAL_LONG((long)*$1); -%} - -%typemap(out, phptype="int|string") const long long & -%{ - if ((long long)LONG_MIN <= *$1 && *$1 <= (long long)LONG_MAX) { - RETVAL_LONG((long)(*$1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%lld", (long long)(*$1))); - } -%} -%typemap(out, phptype="int|string") const unsigned long long & -%{ - if (*$1 <= (unsigned long long)LONG_MAX) { - RETVAL_LONG((long)(*$1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%llu", (unsigned long long)(*$1))); - } -%} - -%typemap(directorin) int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - signed char, - unsigned char, - size_t, - enum SWIGTYPE -%{ - ZVAL_LONG($input,$1); -%} - -%typemap(directorin) enum SWIGTYPE -%{ - ZVAL_LONG($input, (long)$1_name); -%} - -%typemap(directorin) char *, char [] -%{ - if(!$1) { - ZVAL_NULL($input); - } else { - ZVAL_STRING($input, (const char*)$1); - } -%} - -%typemap(out, phptype="bool") bool -%{ - RETVAL_BOOL(($1) ? 1 : 0); -%} - -%typemap(out, phptype="bool") const bool & -%{ - RETVAL_BOOL((*$1) ? 1 : 0); -%} - -%typemap(directorin) bool -%{ - ZVAL_BOOL($input, ($1) ? 1 : 0); -%} - -%typemap(out, phptype="float") float, - double -%{ - RETVAL_DOUBLE($1); -%} - -%typemap(out, phptype="float") const float &, - const double & -%{ - RETVAL_DOUBLE(*$1); -%} - -%typemap(directorin) float, - double -%{ - ZVAL_DOUBLE($input, $1); -%} - -%typemap(out, phptype="string") char -%{ - RETVAL_STRINGL(&$1, 1); -%} - -%typemap(out, phptype="string") const char & -%{ - RETVAL_STRINGL(&*$1, 1); -%} - -%typemap(out, phptype="string") char [] -%{ - RETVAL_STRING((const char *)$1); -%} - -%typemap(out, phptype="?string") char * -%{ - if (!$1) { - RETVAL_NULL(); - } else { - RETVAL_STRING((const char *)$1); - } -%} - -%typemap(out, phptype="?string") char *& -%{ - if (!*$1) { - RETVAL_NULL(); - } else { - RETVAL_STRING((const char *)*$1); - } -%} - -%typemap(out, phptype="?SWIGTYPE") SWIGTYPE * -%{ - SWIG_SetPointerZval($result, (void *)$1, $1_descriptor, $owner); -%} - -%typemap(out, phptype="SWIGTYPE") - SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE && -%{ - SWIG_SetPointerZval($result, (void *)$1, $1_descriptor, $owner); -%} - -%typemap(out, phptype="?SWIGTYPE") SWIGTYPE *const& -%{ - SWIG_SetPointerZval($result, (void *)*$1, $*1_descriptor, $owner); -%} - -%typemap(directorin) SWIGTYPE *, - SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE && -%{ - ZVAL_UNDEF($input); - SWIG_SetPointerZval($input, (void *)&$1, $1_descriptor, $owner); -%} - -%typemap(out, phptype="SWIGTYPE") SWIGTYPE (CLASS::*) -{ - void * p = emalloc(sizeof($1)); - memcpy(p, &$1, sizeof($1)); - SWIG_SetPointerZval($result, (void *)p, $&1_descriptor, 1); -} - -%typemap(in, phptype="SWIGTYPE") SWIGTYPE (CLASS::*) -{ - void * p = SWIG_Z_FETCH_OBJ_P(&$input)->ptr; - memcpy(&$1, p, sizeof($1)); -} - -%typemap(out, phptype="?SWIGTYPE") SWIGTYPE *DYNAMIC -{ - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_SetPointerZval($result, (void *)$1, ty, $owner); -} - -%typemap(out, phptype="SWIGTYPE") SWIGTYPE &DYNAMIC -{ - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_SetPointerZval($result, (void *)$1, ty, $owner); -} - -%typemap(out, phptype="SWIGTYPE") SWIGTYPE -{ -#ifdef __cplusplus - $&1_ltype resultobj = new $1_ltype($1); -#else - $&1_ltype resultobj = ($&1_ltype) malloc(sizeof($1_type)); - memcpy(resultobj, &$1, sizeof($1_type)); -#endif - SWIG_SetPointerZval($result, (void *)resultobj, $&1_descriptor, 1); -} - -%typemap(directorin) SWIGTYPE -%{ - ZVAL_UNDEF($input); - SWIG_SetPointerZval($input, (new $1_ltype(SWIG_STD_MOVE($1))), $&1_descriptor, 1); -%} - -%typemap(out, phptype="void") void "" - -%typemap(out, phptype="string") char [ANY] -{ - size_t len = 0; - while (len < $1_dim0 && $1[len]) ++len; - RETVAL_STRINGL($1, len); -} - -// This typecheck does hard checking for proper argument type. If you want -// an argument to be converted from a different PHP type, you must convert -// it yourself before passing it (e.g. (string)4.7 or (int)"6"). -%define %php_typecheck(_type,_prec,is) -%typemap(typecheck,precedence=_prec) _type, const _type & - " $1 = (Z_TYPE($input) == is);" -%enddef - -// Like %php_typecheck but allows either of two values. -%define %php_typecheck2(_type,_prec,is1,is2) -%typemap(typecheck,precedence=_prec) _type, const _type & - " $1 = (Z_TYPE($input) == is1 || Z_TYPE($input) == is2);" -%enddef - -%php_typecheck(int,SWIG_TYPECHECK_INTEGER,IS_LONG) -%php_typecheck(unsigned int,SWIG_TYPECHECK_UINT32,IS_LONG) -%php_typecheck(short,SWIG_TYPECHECK_INT16,IS_LONG) -%php_typecheck(unsigned short,SWIG_TYPECHECK_UINT16,IS_LONG) -%php_typecheck(long,SWIG_TYPECHECK_INT32,IS_LONG) -%php_typecheck(unsigned long,SWIG_TYPECHECK_UINT32,IS_LONG) -%php_typecheck(long long,SWIG_TYPECHECK_INT64,IS_LONG) -%php_typecheck(unsigned long long,SWIG_TYPECHECK_UINT64,IS_LONG) -%php_typecheck(signed char,SWIG_TYPECHECK_INT8,IS_LONG) -%php_typecheck(unsigned char,SWIG_TYPECHECK_UINT8,IS_LONG) -%php_typecheck(size_t,SWIG_TYPECHECK_SIZE,IS_LONG) -%php_typecheck(enum SWIGTYPE,SWIG_TYPECHECK_INTEGER,IS_LONG) -%php_typecheck2(bool,SWIG_TYPECHECK_BOOL,IS_TRUE,IS_FALSE) -%php_typecheck(float,SWIG_TYPECHECK_FLOAT,IS_DOUBLE) -%php_typecheck(double,SWIG_TYPECHECK_DOUBLE,IS_DOUBLE) -%php_typecheck(char,SWIG_TYPECHECK_CHAR,IS_STRING) - -%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char *, char *& - " $1 = (Z_TYPE($input) == IS_STRING || Z_TYPE($input) == IS_NULL); " - -%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char [] - " $1 = (Z_TYPE($input) == IS_STRING); " - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, SWIG_POINTER_NO_NULL) >= 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE *, - SWIGTYPE [], - SWIGTYPE *const& -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, 0) >= 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE &, - SWIGTYPE && -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, SWIG_POINTER_NO_NULL) >= 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $*1_descriptor, 0) >= 0); -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, 0, 0) >= 0); -} - -/* Exception handling */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short %{ - zend_throw_exception(NULL, "C++ $1_type exception thrown", $1); - goto fail; -%} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] %{ - (void)$1; - zend_throw_exception(NULL, "C++ $1_type exception thrown", 0); - goto fail; -%} - -%typemap(throws) char * %{ - zend_throw_exception(NULL, $1, 0); - goto fail; -%} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* php keywords */ -%include - -/* PHP known interfaces */ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/php/phpinit.swg b/mac/bin/swig/share/swig/4.1.0/php/phpinit.swg deleted file mode 100755 index ae72a10a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/phpinit.swg +++ /dev/null @@ -1,16 +0,0 @@ - -/* ------------------------------------------------------------ - * The start of the PHP initialization function - * ------------------------------------------------------------ */ - -%insert(init) "swiginit.swg" - -%init %{ -SWIG_php_minit { - zend_class_entry SWIGUNUSED internal_ce; - SWIG_InitializeModule((void*)&module_number); -#if PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION == 0 - /* This hack is needed to avoid segfaults. */ - EG(class_table) = CG(class_table); -#endif -%} diff --git a/mac/bin/swig/share/swig/4.1.0/php/phpinterfaces.i b/mac/bin/swig/share/swig/4.1.0/php/phpinterfaces.i deleted file mode 100755 index 5b1da8b7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/phpinterfaces.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * phpinterfaces.i - * - * Define "known" PHP interfaces. - * - * These can be added at MINIT time (which is when PHP loads the extension - * module). - * - * Any interface can be added via phpinterfaces, but looking up the - * zend_class_entry by name has to wait until RINIT time, which means it - * happens for every request. - * ----------------------------------------------------------------------------- */ - -// Note: Abstract interfaces such as "Traversable" can't be used in -// "implements" so are not relevant here. - -%insert(header) %{ - -#define SWIG_PHP_INTERFACE_Iterator_CE zend_ce_iterator -#define SWIG_PHP_INTERFACE_Iterator_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_IteratorAggregate_CE zend_ce_aggregate -#define SWIG_PHP_INTERFACE_IteratorAggregate_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_ArrayAccess_CE zend_ce_arrayaccess -#define SWIG_PHP_INTERFACE_ArrayAccess_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_Serializable_CE zend_ce_serializable -#define SWIG_PHP_INTERFACE_Serializable_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_Countable_CE zend_ce_countable -#define SWIG_PHP_INTERFACE_Countable_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_OuterIterator_CE spl_ce_OuterIterator -#define SWIG_PHP_INTERFACE_OuterIterator_HEADER "ext/spl/spl_iterators.h" - -#define SWIG_PHP_INTERFACE_RecursiveIterator_CE spl_ce_RecursiveIterator -#define SWIG_PHP_INTERFACE_RecursiveIterator_HEADER "ext/spl/spl_iterators.h" - -#define SWIG_PHP_INTERFACE_SeekableIterator_CE spl_ce_SeekableIterator -#define SWIG_PHP_INTERFACE_SeekableIterator_HEADER "ext/spl/spl_iterators.h" - -#define SWIG_PHP_INTERFACE_SplObserver_CE spl_ce_SplObserver -#define SWIG_PHP_INTERFACE_SplObserver_HEADER "ext/spl/spl_observer.h" - -#define SWIG_PHP_INTERFACE_SplSubject_CE spl_ce_SplSubject -#define SWIG_PHP_INTERFACE_SplSubject_HEADER "ext/spl/spl_observer.h" - -#define SWIG_PHP_INTERFACE_DateTimeInterface_CE php_date_get_interface_ce() -#define SWIG_PHP_INTERFACE_DateTimeInterface_HEADER "ext/date/php_date.h" - -// The "json" extension needs to be loaded earlier that us for this to work. -#define SWIG_PHP_INTERFACE_JsonSerializable_CE php_json_serializable_ce -#define SWIG_PHP_INTERFACE_JsonSerializable_HEADER "ext/json/php_json.h" - -// New in PHP 8.0. -#if PHP_MAJOR_VERSION >= 8 -# define SWIG_PHP_INTERFACE_Stringable_CE zend_ce_stringable -# define SWIG_PHP_INTERFACE_Stringable_HEADER "zend_interfaces.h" -#endif - -%} diff --git a/mac/bin/swig/share/swig/4.1.0/php/phpkw.swg b/mac/bin/swig/share/swig/4.1.0/php/phpkw.swg deleted file mode 100755 index 443ac8bf..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/phpkw.swg +++ /dev/null @@ -1,888 +0,0 @@ -/* ----------------------------------------------------------------------------- - * phpkw.swg - * ----------------------------------------------------------------------------- */ - -/* Keyword (case insensitive) */ -#define PHPKW(x) %keywordwarn("'" `x` "' is a PHP keyword",sourcefmt="%(lower)s",rename="c_%s") `x` - -/* Keyword, except ok as a function */ -#define PHPKW_ok_as_function(x) %keywordwarn("'" `x` "' is a PHP keyword, renaming to 'c_" `x` "'",%$not %$isfunction,sourcefmt="%(lower)s",rename="c_%s") `x` - -/* Class (case insensitive) */ -#define PHPCN(x) %keywordwarn("'" `x` "' is a PHP reserved class name",%$isclass,sourcefmt="%(lower)s",rename="c_%s") `x` - -/* Constant (case insensitive) */ -#define PHPBN1a(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "enum conflicts with a built-in constant '"`x`"' in PHP"),%$isenumitem,sourcefmt="%(lower)s") `x` -#define PHPBN1b(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "constant conflicts with a built-in constant '"`x`"' in PHP"),%$isconstant,sourcefmt="%(lower)s") `x` -%define PHPBN1(X) - PHPBN1a(X); PHPBN1b(X) -%enddef - -/* Constant (case sensitive) */ -#define PHPBN2a(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "enum conflicts with a built-in constant '"`x`"' in PHP"),%$isenumitem) `x` -#define PHPBN2b(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "constant conflicts with a built-in constant '"`x`"' in PHP"),%$isconstant) `x` -%define PHPBN2(X) - PHPBN2a(X); PHPBN2b(X) -%enddef - -#define PHPFN(x) %keywordwarn("'" `x` "' is a PHP built-in function",sourcefmt="%(lower)s",%$isfunction,%$not %$ismember,rename="c_%s") `x` - -/* From: http://php.net/manual/en/reserved.keywords.php - * "You cannot use any of the following words as constants, class names, - * function or method names. Using them as variable names is generally OK, but - * could lead to confusion." - */ -/* Check is case insensitive - these *MUST* be listed in lower case here */ -PHPKW(abstract); -PHPKW(and); -PHPKW(as); -PHPKW(break); -PHPKW(callable); -PHPKW(case); -PHPKW(catch); -PHPKW(class); -PHPKW(clone); -PHPKW(const); -PHPKW(continue); -PHPKW(declare); -PHPKW(default); -PHPKW(do); -PHPKW(else); -PHPKW(elseif); -PHPKW(enddeclare); -PHPKW(endfor); -PHPKW(endforeach); -PHPKW(endif); -PHPKW(endswitch); -PHPKW(endwhile); -PHPKW(extends); -PHPKW(final); -PHPKW(finally); -PHPKW(fn); // as of PHP 7.4 -PHPKW(for); -PHPKW(foreach); -PHPKW(function); -PHPKW(global); -PHPKW(goto); -PHPKW(if); -PHPKW(implements); -PHPKW(instanceof); -PHPKW(insteadof); -PHPKW(interface); -PHPKW(match); // as of PHP 8.0 -PHPKW(namespace); -PHPKW(new); -PHPKW(or); -PHPKW(private); -PHPKW(protected); -PHPKW(public); -PHPKW(static); -PHPKW(switch); -PHPKW(throw); -PHPKW(trait); -PHPKW(try); -PHPKW(use); -PHPKW(var); -PHPKW(while); -PHPKW(xor); -PHPKW(yield); - -/* PHP 8.1 made `readonly` a keyword, but (unlike any other keyword it seems) - * it may still be used as a function name. - */ -PHPKW_ok_as_function(readonly); - -// Compile-time "magic" constants -// From: http://php.net/manual/en/reserved.keywords.php -// also at: http://php.net/manual/en/language.constants.predefined.php -/* These *MUST* be listed in lower case here */ -PHPKW(__class__); -PHPKW(__dir__); -PHPKW(__file__); -PHPKW(__function__); -PHPKW(__line__); -PHPKW(__method__); -PHPKW(__namespace__); -PHPKW(__trait__); - -/* We classify these as built-in names since they conflict, but PHP still runs */ - -/* Predefined case-insensitive constants */ -/* These *MUST* be listed in lower case here */ -PHPBN1(null); -PHPBN1(true); -PHPBN1(false); - -/* "Core Predefined Constants" from http://php.net/manual/en/reserved.constants.php */ -/* These are case sensitive */ -PHPBN2(PHP_VERSION); -PHPBN2(PHP_MAJOR_VERSION); -PHPBN2(PHP_MINOR_VERSION); -PHPBN2(PHP_RELEASE_VERSION); -PHPBN2(PHP_VERSION_ID); -PHPBN2(PHP_EXTRA_VERSION); -PHPBN2(PHP_ZTS); -PHPBN2(PHP_DEBUG); -PHPBN2(PHP_MAXPATHLEN); -PHPBN2(PHP_OS); -PHPBN2(PHP_SAPI); -PHPBN2(PHP_EOL); -PHPBN2(PHP_INT_MAX); -PHPBN2(PHP_INT_SIZE); -PHPBN2(PHP_FLOAT_DIG); // Since 7.2.0 -PHPBN2(PHP_FLOAT_EPSILON); // Since 7.2.0 -PHPBN2(PHP_FLOAT_MIN); // Since 7.2.0 -PHPBN2(PHP_FLOAT_MAX); // Since 7.2.0 -PHPBN2(DEFAULT_INCLUDE_PATH); -PHPBN2(PEAR_INSTALL_DIR); -PHPBN2(PEAR_EXTENSION_DIR); -PHPBN2(PHP_EXTENSION_DIR); -PHPBN2(PHP_PREFIX); -PHPBN2(PHP_BINDIR); -PHPBN2(PHP_BINARY); -PHPBN2(PHP_MANDIR); -PHPBN2(PHP_LIBDIR); -PHPBN2(PHP_DATADIR); -PHPBN2(PHP_SYSCONFDIR); -PHPBN2(PHP_LOCALSTATEDIR); -PHPBN2(PHP_CONFIG_FILE_PATH); -PHPBN2(PHP_CONFIG_FILE_SCAN_DIR); -PHPBN2(PHP_SHLIB_SUFFIX); -PHPBN2(PHP_FD_SETSIZE); // Since 7.1.0 -PHPBN2(E_ERROR); -PHPBN2(E_WARNING); -PHPBN2(E_PARSE); -PHPBN2(E_NOTICE); -PHPBN2(E_CORE_ERROR); -PHPBN2(E_CORE_WARNING); -PHPBN2(E_COMPILE_ERROR); -PHPBN2(E_COMPILE_WARNING); -PHPBN2(E_USER_ERROR); -PHPBN2(E_USER_WARNING); -PHPBN2(E_USER_NOTICE); -PHPBN2(E_RECOVERABLE_ERROR); -PHPBN2(E_DEPRECATED); -PHPBN2(E_USER_DEPRECATED); -PHPBN2(E_ALL); -PHPBN2(E_STRICT); -PHPBN2(__COMPILER_HALT_OFFSET__); -// TRUE, FALSE, NULL are listed on the same page, but are actually -// case-insensitive, whereas all the other constants listed there seem to be -// case-sensitive, so we handle TRUE, FALSE, NULL in PHPBN1. -PHPBN2(PHP_OUTPUT_HANDLER_START); -PHPBN2(PHP_OUTPUT_HANDLER_CONT); -PHPBN2(PHP_OUTPUT_HANDLER_END); -/* Since 7.4.0 (Microsoft Windows only) */ -PHPBN2(PHP_WINDOWS_EVENT_CTRL_C); -PHPBN2(PHP_WINDOWS_EVENT_CTRL_BREAK); -/* These don't actually seem to be set (tested on Linux, I guess they're - * Windows only?) */ -PHPBN2(PHP_WINDOWS_NT_DOMAIN_CONTROLLER); -PHPBN2(PHP_WINDOWS_NT_SERVER); -PHPBN2(PHP_WINDOWS_NT_WORKSTATION); -PHPBN2(PHP_WINDOWS_VERSION_BUILD); -PHPBN2(PHP_WINDOWS_VERSION_MAJOR); -PHPBN2(PHP_WINDOWS_VERSION_MINOR); -PHPBN2(PHP_WINDOWS_VERSION_PLATFORM); -PHPBN2(PHP_WINDOWS_VERSION_PRODUCTTYPE); -PHPBN2(PHP_WINDOWS_VERSION_SP_MAJOR); -PHPBN2(PHP_WINDOWS_VERSION_SP_MINOR); -PHPBN2(PHP_WINDOWS_VERSION_SUITEMASK); -/* "Standard Predefined Constants" from http://php.net/manual/en/reserved.constants.php */ -PHPBN2(EXTR_OVERWRITE); -PHPBN2(EXTR_SKIP); -PHPBN2(EXTR_PREFIX_SAME); -PHPBN2(EXTR_PREFIX_ALL); -PHPBN2(EXTR_PREFIX_INVALID); -PHPBN2(EXTR_PREFIX_IF_EXISTS); -PHPBN2(EXTR_IF_EXISTS); -PHPBN2(SORT_ASC); -PHPBN2(SORT_DESC); -PHPBN2(SORT_REGULAR); -PHPBN2(SORT_NUMERIC); -PHPBN2(SORT_STRING); -PHPBN2(CASE_LOWER); -PHPBN2(CASE_UPPER); -PHPBN2(COUNT_NORMAL); -PHPBN2(COUNT_RECURSIVE); -PHPBN2(ASSERT_ACTIVE); -PHPBN2(ASSERT_CALLBACK); -PHPBN2(ASSERT_BAIL); -PHPBN2(ASSERT_WARNING); -PHPBN2(ASSERT_QUIET_EVAL); -PHPBN2(CONNECTION_ABORTED); -PHPBN2(CONNECTION_NORMAL); -PHPBN2(CONNECTION_TIMEOUT); -PHPBN2(INI_USER); -PHPBN2(INI_PERDIR); -PHPBN2(INI_SYSTEM); -PHPBN2(INI_ALL); -PHPBN2(INI_SCANNER_NORMAL); -PHPBN2(INI_SCANNER_RAW); -PHPBN2(M_E); -PHPBN2(M_LOG2E); -PHPBN2(M_LOG10E); -PHPBN2(M_LN2); -PHPBN2(M_LN10); -PHPBN2(M_PI); -PHPBN2(M_PI_2); -PHPBN2(M_PI_4); -PHPBN2(M_1_PI); -PHPBN2(M_2_PI); -PHPBN2(M_2_SQRTPI); -PHPBN2(M_SQRT2); -PHPBN2(M_SQRT1_2); -PHPBN2(M_EULER); -PHPBN2(M_LNPI); -PHPBN2(M_SQRT3); -PHPBN2(M_SQRTPI); -PHPBN2(CRYPT_SALT_LENGTH); -PHPBN2(CRYPT_STD_DES); -PHPBN2(CRYPT_EXT_DES); -PHPBN2(CRYPT_MD5); -PHPBN2(CRYPT_BLOWFISH); -PHPBN2(DIRECTORY_SEPARATOR); -PHPBN2(SEEK_SET); -PHPBN2(SEEK_CUR); -PHPBN2(SEEK_END); -PHPBN2(LOCK_SH); -PHPBN2(LOCK_EX); -PHPBN2(LOCK_UN); -PHPBN2(LOCK_NB); -PHPBN2(HTML_SPECIALCHARS); -PHPBN2(HTML_ENTITIES); -PHPBN2(ENT_COMPAT); -PHPBN2(ENT_QUOTES); -PHPBN2(ENT_NOQUOTES); -PHPBN2(INFO_GENERAL); -PHPBN2(INFO_CREDITS); -PHPBN2(INFO_CONFIGURATION); -PHPBN2(INFO_MODULES); -PHPBN2(INFO_ENVIRONMENT); -PHPBN2(INFO_VARIABLES); -PHPBN2(INFO_LICENSE); -PHPBN2(INFO_ALL); -PHPBN2(CREDITS_GROUP); -PHPBN2(CREDITS_GENERAL); -PHPBN2(CREDITS_SAPI); -PHPBN2(CREDITS_MODULES); -PHPBN2(CREDITS_DOCS); -PHPBN2(CREDITS_FULLPAGE); -PHPBN2(CREDITS_QA); -PHPBN2(CREDITS_ALL); -PHPBN2(STR_PAD_LEFT); -PHPBN2(STR_PAD_RIGHT); -PHPBN2(STR_PAD_BOTH); -PHPBN2(PATHINFO_DIRNAME); -PHPBN2(PATHINFO_BASENAME); -PHPBN2(PATHINFO_EXTENSION); -PHPBN2(PATHINFO_FILENAME); -PHPBN2(PATH_SEPARATOR); -PHPBN2(CHAR_MAX); -PHPBN2(LC_CTYPE); -PHPBN2(LC_NUMERIC); -PHPBN2(LC_TIME); -PHPBN2(LC_COLLATE); -PHPBN2(LC_MONETARY); -PHPBN2(LC_ALL); -PHPBN2(LC_MESSAGES); -PHPBN2(ABDAY_1); -PHPBN2(ABDAY_2); -PHPBN2(ABDAY_3); -PHPBN2(ABDAY_4); -PHPBN2(ABDAY_5); -PHPBN2(ABDAY_6); -PHPBN2(ABDAY_7); -PHPBN2(DAY_1); -PHPBN2(DAY_2); -PHPBN2(DAY_3); -PHPBN2(DAY_4); -PHPBN2(DAY_5); -PHPBN2(DAY_6); -PHPBN2(DAY_7); -PHPBN2(ABMON_1); -PHPBN2(ABMON_2); -PHPBN2(ABMON_3); -PHPBN2(ABMON_4); -PHPBN2(ABMON_5); -PHPBN2(ABMON_6); -PHPBN2(ABMON_7); -PHPBN2(ABMON_8); -PHPBN2(ABMON_9); -PHPBN2(ABMON_10); -PHPBN2(ABMON_11); -PHPBN2(ABMON_12); -PHPBN2(MON_1); -PHPBN2(MON_2); -PHPBN2(MON_3); -PHPBN2(MON_4); -PHPBN2(MON_5); -PHPBN2(MON_6); -PHPBN2(MON_7); -PHPBN2(MON_8); -PHPBN2(MON_9); -PHPBN2(MON_10); -PHPBN2(MON_11); -PHPBN2(MON_12); -PHPBN2(AM_STR); -PHPBN2(PM_STR); -PHPBN2(D_T_FMT); -PHPBN2(D_FMT); -PHPBN2(T_FMT); -PHPBN2(T_FMT_AMPM); -PHPBN2(ERA); -PHPBN2(ERA_YEAR); -PHPBN2(ERA_D_T_FMT); -PHPBN2(ERA_D_FMT); -PHPBN2(ERA_T_FMT); -PHPBN2(ALT_DIGITS); -PHPBN2(INT_CURR_SYMBOL); -PHPBN2(CURRENCY_SYMBOL); -PHPBN2(CRNCYSTR); -PHPBN2(MON_DECIMAL_POINT); -PHPBN2(MON_THOUSANDS_SEP); -PHPBN2(MON_GROUPING); -PHPBN2(POSITIVE_SIGN); -PHPBN2(NEGATIVE_SIGN); -PHPBN2(INT_FRAC_DIGITS); -PHPBN2(FRAC_DIGITS); -PHPBN2(P_CS_PRECEDES); -PHPBN2(P_SEP_BY_SPACE); -PHPBN2(N_CS_PRECEDES); -PHPBN2(N_SEP_BY_SPACE); -PHPBN2(P_SIGN_POSN); -PHPBN2(N_SIGN_POSN); -PHPBN2(DECIMAL_POINT); -PHPBN2(RADIXCHAR); -PHPBN2(THOUSANDS_SEP); -PHPBN2(THOUSEP); -PHPBN2(GROUPING); -PHPBN2(YESEXPR); -PHPBN2(NOEXPR); -PHPBN2(YESSTR); -PHPBN2(NOSTR); -PHPBN2(CODESET); -PHPBN2(LOG_EMERG); -PHPBN2(LOG_ALERT); -PHPBN2(LOG_CRIT); -PHPBN2(LOG_ERR); -PHPBN2(LOG_WARNING); -PHPBN2(LOG_NOTICE); -PHPBN2(LOG_INFO); -PHPBN2(LOG_DEBUG); -PHPBN2(LOG_KERN); -PHPBN2(LOG_USER); -PHPBN2(LOG_MAIL); -PHPBN2(LOG_DAEMON); -PHPBN2(LOG_AUTH); -PHPBN2(LOG_SYSLOG); -PHPBN2(LOG_LPR); -PHPBN2(LOG_NEWS); -PHPBN2(LOG_UUCP); -PHPBN2(LOG_CRON); -PHPBN2(LOG_AUTHPRIV); -PHPBN2(LOG_LOCAL0); -PHPBN2(LOG_LOCAL1); -PHPBN2(LOG_LOCAL2); -PHPBN2(LOG_LOCAL3); -PHPBN2(LOG_LOCAL4); -PHPBN2(LOG_LOCAL5); -PHPBN2(LOG_LOCAL6); -PHPBN2(LOG_LOCAL7); -PHPBN2(LOG_PID); -PHPBN2(LOG_CONS); -PHPBN2(LOG_ODELAY); -PHPBN2(LOG_NDELAY); -PHPBN2(LOG_NOWAIT); -PHPBN2(LOG_PERROR); - -PHPBN2(PREG_BACKTRACK_LIMIT_ERROR); -PHPBN2(PREG_BAD_UTF8_ERROR); -PHPBN2(PREG_INTERNAL_ERROR); -PHPBN2(PREG_NO_ERROR); -PHPBN2(PREG_RECURSION_LIMIT_ERROR); -PHPBN2(UPLOAD_ERR_EXTENSION); -PHPBN2(STREAM_SHUT_RD); -PHPBN2(STREAM_SHUT_WR); -PHPBN2(STREAM_SHUT_RDWR); -PHPBN2(CURLE_FILESIZE_EXCEEDED); -PHPBN2(CURLE_FTP_SSL_FAILED); -PHPBN2(CURLE_LDAP_INVALID_URL); -PHPBN2(CURLFTPAUTH_DEFAULT); -PHPBN2(CURLFTPAUTH_SSL); -PHPBN2(CURLFTPAUTH_TLS); -PHPBN2(CURLFTPSSL_ALL); -PHPBN2(CURLFTPSSL_CONTROL); -PHPBN2(CURLFTPSSL_NONE); -PHPBN2(CURLFTPSSL_TRY); -PHPBN2(CURLOPT_FTP_SSL); -PHPBN2(CURLOPT_FTPSSLAUTH); -PHPBN2(CURLOPT_TCP_NODELAY); -PHPBN2(CURLOPT_TIMEOUT_MS); -PHPBN2(CURLOPT_CONNECTTIMEOUT_MS); -PHPBN2(GMP_VERSION); -PHPBN2(OPENSSL_VERSION_NUMBER); -PHPBN2(SNMP_OID_OUTPUT_FULL); -PHPBN2(SNMP_OID_OUTPUT_NUMERIC); -PHPBN2(MSG_EAGAIN); -PHPBN2(MSG_ENOMSG); - -PHPBN2(CURLOPT_PROGRESSFUNCTION); -PHPBN2(IMG_FILTER_PIXELATE); -PHPBN2(JSON_ERROR_CTRL_CHAR); -PHPBN2(JSON_ERROR_DEPTH); -PHPBN2(JSON_ERROR_NONE); -PHPBN2(JSON_ERROR_STATE_MISMATCH); -PHPBN2(JSON_ERROR_SYNTAX); -PHPBN2(JSON_FORCE_OBJECT); -PHPBN2(JSON_HEX_TAG); -PHPBN2(JSON_HEX_AMP); -PHPBN2(JSON_HEX_APOS); -PHPBN2(JSON_HEX_QUOT); -PHPBN2(LDAP_OPT_NETWORK_TIMEOUT); -PHPBN2(LIBXML_LOADED_VERSION); -PHPBN2(PREG_BAD_UTF8_OFFSET_ERROR); -PHPBN2(BUS_ADRALN); -PHPBN2(BUS_ADRERR); -PHPBN2(BUS_OBJERR); -PHPBN2(CLD_CONTIUNED); -PHPBN2(CLD_DUMPED); -PHPBN2(CLD_EXITED); -PHPBN2(CLD_KILLED); -PHPBN2(CLD_STOPPED); -PHPBN2(CLD_TRAPPED); -PHPBN2(FPE_FLTDIV); -PHPBN2(FPE_FLTINV); -PHPBN2(FPE_FLTOVF); -PHPBN2(FPE_FLTRES); -PHPBN2(FPE_FLTSUB); -PHPBN2(FPE_FLTUND); -PHPBN2(FPE_INTDIV); -PHPBN2(FPE_INTOVF); -PHPBN2(ILL_BADSTK); -PHPBN2(ILL_COPROC); -PHPBN2(ILL_ILLADR); -PHPBN2(ILL_ILLOPC); -PHPBN2(ILL_ILLOPN); -PHPBN2(ILL_ILLTRP); -PHPBN2(ILL_PRVOPC); -PHPBN2(ILL_PRVREG); -PHPBN2(POLL_ERR); -PHPBN2(POLL_HUP); -PHPBN2(POLL_IN); -PHPBN2(POLL_MSG); -PHPBN2(POLL_OUT); -PHPBN2(POLL_PRI); -PHPBN2(SEGV_ACCERR); -PHPBN2(SEGV_MAPERR); -PHPBN2(SI_ASYNCIO); -PHPBN2(SI_KERNEL); -PHPBN2(SI_MESGQ); -PHPBN2(SI_NOINFO); -PHPBN2(SI_QUEUE); -PHPBN2(SI_SIGIO); -PHPBN2(SI_TIMER); -PHPBN2(SI_TKILL); -PHPBN2(SI_USER); -PHPBN2(SIG_BLOCK); -PHPBN2(SIG_SETMASK); -PHPBN2(SIG_UNBLOCK); -PHPBN2(TRAP_BRKPT); -PHPBN2(TRAP_TRACE); - -PHPBN2(ENT_DISALLOWED); -PHPBN2(ENT_HTML401); -PHPBN2(ENT_HTML5); -PHPBN2(ENT_SUBSTITUTE); -PHPBN2(ENT_XML1); -PHPBN2(ENT_XHTML); -PHPBN2(IPPROTO_IP); -PHPBN2(IPPROTO_IPV6); -PHPBN2(IPV6_MULTICAST_HOPS); -PHPBN2(IPV6_MULTICAST_IF); -PHPBN2(IPV6_MULTICAST_LOOP); -PHPBN2(IP_MULTICAST_IF); -PHPBN2(IP_MULTICAST_LOOP); -PHPBN2(IP_MULTICAST_TTL); -PHPBN2(MCAST_JOIN_GROUP); -PHPBN2(MCAST_LEAVE_GROUP); -PHPBN2(MCAST_BLOCK_SOURCE); -PHPBN2(MCAST_UNBLOCK_SOURCE); -PHPBN2(MCAST_JOIN_SOURCE_GROUP); -PHPBN2(MCAST_LEAVE_SOURCE_GROUP); -PHPBN2(CURLOPT_MAX_RECV_SPEED_LARGE); -PHPBN2(CURLOPT_MAX_SEND_SPEED_LARGE); -PHPBN2(LIBXML_HTML_NODEFDTD); -PHPBN2(LIBXML_HTML_NOIMPLIED); -PHPBN2(LIBXML_PEDANTIC); -PHPBN2(OPENSSL_CIPHER_AES_128_CBC); -PHPBN2(OPENSSL_CIPHER_AES_192_CBC); -PHPBN2(OPENSSL_CIPHER_AES_256_CBC); -PHPBN2(OPENSSL_RAW_DATA); -PHPBN2(OPENSSL_ZERO_PADDING); -PHPBN2(PHP_OUTPUT_HANDLER_CLEAN); -PHPBN2(PHP_OUTPUT_HANDLER_CLEANABLE); -PHPBN2(PHP_OUTPUT_HANDLER_DISABLED); -PHPBN2(PHP_OUTPUT_HANDLER_FINAL); -PHPBN2(PHP_OUTPUT_HANDLER_FLUSH); -PHPBN2(PHP_OUTPUT_HANDLER_FLUSHABLE); -PHPBN2(PHP_OUTPUT_HANDLER_REMOVABLE); -PHPBN2(PHP_OUTPUT_HANDLER_STARTED); -PHPBN2(PHP_OUTPUT_HANDLER_STDFLAGS); -PHPBN2(PHP_OUTPUT_HANDLER_WRITE); -PHPBN2(PHP_SESSION_ACTIVE); -PHPBN2(PHP_SESSION_DISABLED); -PHPBN2(PHP_SESSION_NONE); -PHPBN2(STREAM_META_ACCESS); -PHPBN2(STREAM_META_GROUP); -PHPBN2(STREAM_META_GROUP_NAME); -PHPBN2(STREAM_META_OWNER); -PHPBN2(STREAM_META_OWNER_NAME); -PHPBN2(STREAM_META_TOUCH); -PHPBN2(ZLIB_ENCODING_DEFLATE); -PHPBN2(ZLIB_ENCODING_GZIP); -PHPBN2(ZLIB_ENCODING_RAW); -PHPBN2(U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR); -PHPBN2(IDNA_CHECK_BIDI); -PHPBN2(IDNA_CHECK_CONTEXTJ); -PHPBN2(IDNA_NONTRANSITIONAL_TO_ASCII); -PHPBN2(IDNA_NONTRANSITIONAL_TO_UNICODE); -PHPBN2(INTL_IDNA_VARIANT_2003); -PHPBN2(INTL_IDNA_VARIANT_UTS46); -PHPBN2(IDNA_ERROR_EMPTY_LABEL); -PHPBN2(IDNA_ERROR_LABEL_TOO_LONG); -PHPBN2(IDNA_ERROR_DOMAIN_NAME_TOO_LONG); -PHPBN2(IDNA_ERROR_LEADING_HYPHEN); -PHPBN2(IDNA_ERROR_TRAILING_HYPHEN); -PHPBN2(IDNA_ERROR_HYPHEN_3_4); -PHPBN2(IDNA_ERROR_LEADING_COMBINING_MARK); -PHPBN2(IDNA_ERROR_DISALLOWED); -PHPBN2(IDNA_ERROR_PUNYCODE); -PHPBN2(IDNA_ERROR_LABEL_HAS_DOT); -PHPBN2(IDNA_ERROR_INVALID_ACE_LABEL); -PHPBN2(IDNA_ERROR_BIDI); -PHPBN2(IDNA_ERROR_CONTEXTJ); -PHPBN2(JSON_PRETTY_PRINT); -PHPBN2(JSON_UNESCAPED_SLASHES); -PHPBN2(JSON_NUMERIC_CHECK); -PHPBN2(JSON_UNESCAPED_UNICODE); -PHPBN2(JSON_BIGINT_AS_STRING); - -PHPBN2(IMG_AFFINE_TRANSLATE); -PHPBN2(IMG_AFFINE_SCALE); -PHPBN2(IMG_AFFINE_ROTATE); -PHPBN2(IMG_AFFINE_SHEAR_HORIZONTAL); -PHPBN2(IMG_AFFINE_SHEAR_VERTICAL); -PHPBN2(IMG_CROP_DEFAULT); -PHPBN2(IMG_CROP_TRANSPARENT); -PHPBN2(IMG_CROP_BLACK); -PHPBN2(IMG_CROP_WHITE); -PHPBN2(IMG_CROP_SIDES); -PHPBN2(IMG_FLIP_BOTH); -PHPBN2(IMG_FLIP_HORIZONTAL); -PHPBN2(IMG_FLIP_VERTICAL); -PHPBN2(IMG_BELL); -PHPBN2(IMG_BESSEL); -PHPBN2(IMG_BICUBIC); -PHPBN2(IMG_BICUBIC_FIXED); -PHPBN2(IMG_BLACKMAN); -PHPBN2(IMG_BOX); -PHPBN2(IMG_BSPLINE); -PHPBN2(IMG_CATMULLROM); -PHPBN2(IMG_GAUSSIAN); -PHPBN2(IMG_GENERALIZED_CUBIC); -PHPBN2(IMG_HERMITE); -PHPBN2(IMG_HAMMING); -PHPBN2(IMG_HANNING); -PHPBN2(IMG_MITCHELL); -PHPBN2(IMG_POWER); -PHPBN2(IMG_QUADRATIC); -PHPBN2(IMG_SINC); -PHPBN2(IMG_NEAREST_NEIGHBOUR); -PHPBN2(IMG_WEIGHTED4); -PHPBN2(IMG_TRIANGLE); -PHPBN2(JSON_ERROR_RECURSION); -PHPBN2(JSON_ERROR_INF_OR_NAN); -PHPBN2(JSON_ERROR_UNSUPPORTED_TYPE); -PHPBN2(MYSQLI_SERVER_PUBLIC_KEY); - -PHPBN2(LDAP_ESCAPE_DN); -PHPBN2(LDAP_ESCAPE_FILTER); -PHPBN2(OPENSSL_DEFAULT_STREAM_CIPHERS); -PHPBN2(STREAM_CRYPTO_METHOD_ANY_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_ANY_SERVER); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_0_SERVER); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_1_SERVER); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_2_SERVER); -PHPBN2(PGSQL_CONNECT_ASYNC); -PHPBN2(PGSQL_CONNECTION_AUTH_OK); -PHPBN2(PGSQL_CONNECTION_AWAITING_RESPONSE); -PHPBN2(PGSQL_CONNECTION_MADE); -PHPBN2(PGSQL_CONNECTION_SETENV); -PHPBN2(PGSQL_CONNECTION_SSL_STARTUP); -PHPBN2(PGSQL_CONNECTION_STARTED); -PHPBN2(PGSQL_DML_ESCAPE); -PHPBN2(PGSQL_POLLING_ACTIVE); -PHPBN2(PGSQL_POLLING_FAILED); -PHPBN2(PGSQL_POLLING_OK); -PHPBN2(PGSQL_POLLING_READING); -PHPBN2(PGSQL_POLLING_WRITING); - -/* Class names reserved by PHP. */ -/* Check is case insensitive - these *MUST* be listed in lower case here. */ -PHPCN(directory); -PHPCN(stdclass); -PHPCN(__php_incomplete_class); -PHPCN(exception); -PHPCN(errorexception); -PHPCN(php_user_filter); -PHPCN(closure); -PHPCN(generator); -PHPCN(self); -PHPCN(parent); -/* http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.other.classes */ -PHPCN(bool); // As of PHP 7.0 -PHPCN(int); // As of PHP 7.0 -PHPCN(float); // As of PHP 7.0 -PHPCN(string); // As of PHP 7.0 -PHPCN(null); // As of PHP 7.0 -PHPCN(true); // As of PHP 7.0 -PHPCN(false); // As of PHP 7.0 -PHPCN(resource); // As of PHP 7.0 (currently works but reserved) -PHPCN(object); // As of PHP 7.0 (currently works but reserved) -PHPCN(mixed); // As of PHP 7.0 (currently works but reserved) -PHPCN(numeric); // As of PHP 7.0 (currently works but reserved) -/* http://php.net/manual/en/migration71.incompatible.php#migration71.incompatible.invalid-class-names */ -PHPCN(iterable); // As of PHP 7.1 -PHPCN(void); // As of PHP 7.1 -/* Predefined interfaces and classes, introduced in PHP 7.0.0 */ -PHPCN(arithmeticerror); -PHPCN(assertionerror); -PHPCN(divisionbyzeroerror); -PHPCN(error); -PHPCN(throwable); -PHPCN(parseerror); -PHPCN(typeerror); -/* From extensions (which of these are actually predefined depends which - * extensions are loaded by default). */ -PHPCN(xmlwriter); -PHPCN(libxmlerror); -PHPCN(simplexmlelement); -PHPCN(soapclient); -PHPCN(soapvar); -PHPCN(soapserver); -PHPCN(soapfault); -PHPCN(soapparam); -PHPCN(soapheader); -PHPCN(recursiveiteratoriterator); -PHPCN(filteriterator); -PHPCN(recursivefilteriterator); -PHPCN(parentiterator); -PHPCN(limititerator); -PHPCN(cachingiterator); -PHPCN(recursivecachingiterator); -PHPCN(iteratoriterator); -PHPCN(norewinditerator); -PHPCN(appenditerator); -PHPCN(infiniteiterator); -PHPCN(emptyiterator); -PHPCN(arrayobject); -PHPCN(arrayiterator); -PHPCN(recursivearrayiterator); -PHPCN(splfileinfo); -PHPCN(directoryiterator); -PHPCN(recursivedirectoryiterator); -PHPCN(splfileobject); -PHPCN(spltempfileobject); -PHPCN(simplexmliterator); -PHPCN(logicexception); -PHPCN(badfunctioncallexception); -PHPCN(badmethodcallexception); -PHPCN(domainexception); -PHPCN(invalidargumentexception); -PHPCN(lengthexception); -PHPCN(outofrangeexception); -PHPCN(runtimeexception); -PHPCN(outofboundsexception); -PHPCN(overflowexception); -PHPCN(rangeexception); -PHPCN(underflowexception); -PHPCN(unexpectedvalueexception); -PHPCN(splobjectstorage); -PHPCN(reflectionexception); -PHPCN(reflection); -PHPCN(reflectionfunction); -PHPCN(reflectionparameter); -PHPCN(reflectionmethod); -PHPCN(reflectionclass); -PHPCN(reflectionobject); -PHPCN(reflectionproperty); -PHPCN(reflectionextension); -PHPCN(domexception); -PHPCN(domstringlist); -PHPCN(domnamelist); -PHPCN(domimplementationlist); -PHPCN(domimplementationsource); -PHPCN(domimplementation); -PHPCN(domnode); -PHPCN(domnamespacenode); -PHPCN(domdocumentfragment); -PHPCN(domdocument); -PHPCN(domnodelist); -PHPCN(domnamednodemap); -PHPCN(domcharacterdata); -PHPCN(domattr); -PHPCN(domelement); -PHPCN(domtext); -PHPCN(domcomment); -PHPCN(domtypeinfo); -PHPCN(domuserdatahandler); -PHPCN(domdomerror); -PHPCN(domerrorhandler); -PHPCN(domlocator); -PHPCN(domconfiguration); -PHPCN(domcdatasection); -PHPCN(domdocumenttype); -PHPCN(domnotation); -PHPCN(domentity); -PHPCN(domentityreference); -PHPCN(domprocessinginstruction); -PHPCN(domstringextend); -PHPCN(domxpath); -PHPCN(xmlreader); -PHPCN(sqlitedatabase); -PHPCN(sqliteresult); -PHPCN(sqliteunbuffered); -PHPCN(sqliteexception); -PHPCN(datetime); - -/* Built-in PHP functions (incomplete). */ -/* Includes Array Functions - http://php.net/manual/en/ref.array.php */ -/* Check is case insensitive - these *MUST* be listed in lower case here */ -PHPFN(__halt_compiler); -PHPFN(acos); -PHPFN(array); -PHPFN(array_change_key_case); -PHPFN(array_chunk); -PHPFN(array_column); -PHPFN(array_combine); -PHPFN(array_count_values); -PHPFN(array_diff); -PHPFN(array_diff_assoc); -PHPFN(array_diff_key); -PHPFN(array_diff_uassoc); -PHPFN(array_diff_ukey); -PHPFN(array_fill); -PHPFN(array_fill_keys); -PHPFN(array_filter); -PHPFN(array_flip); -PHPFN(array_intersect); -PHPFN(array_intersect_assoc); -PHPFN(array_intersect_key); -PHPFN(array_intersect_uassoc); -PHPFN(array_intersect_ukey); -PHPFN(array_key_exists); -PHPFN(array_keys); -PHPFN(array_map); -PHPFN(array_merge); -PHPFN(array_merge_recursive); -PHPFN(array_multisort); -PHPFN(array_pad); -PHPFN(array_pop); -PHPFN(array_product); -PHPFN(array_push); -PHPFN(array_rand); -PHPFN(array_reduce); -PHPFN(array_replace); -PHPFN(array_replace_recursive); -PHPFN(array_reverse); -PHPFN(array_search); -PHPFN(array_shift); -PHPFN(array_slice); -PHPFN(array_splice); -PHPFN(array_sum); -PHPFN(array_udiff); -PHPFN(array_udiff_assoc); -PHPFN(array_udiff_uassoc); -PHPFN(array_uintersect); -PHPFN(array_uintersect_assoc); -PHPFN(array_uintersect_uassoc); -PHPFN(array_unique); -PHPFN(array_unshift); -PHPFN(array_values); -PHPFN(array_walk); -PHPFN(array_walk_recursive); -PHPFN(arsort); -PHPFN(asin); -PHPFN(asort); -PHPFN(atan); -PHPFN(atan2); -PHPFN(ceil); -PHPFN(compact); -PHPFN(cos); -PHPFN(cosh); -PHPFN(count); -PHPFN(current); -PHPFN(die); // "Language construct" -PHPFN(each); -PHPFN(echo); // "Language construct" -PHPFN(empty); -PHPFN(end); -PHPFN(eval); // "Language construct" -PHPFN(exit); // "Language construct" -PHPFN(exp); -PHPFN(extract); -PHPFN(floor); -PHPFN(fmod); -PHPFN(in_array); -PHPFN(include); // "Language construct" -PHPFN(include_once); // "Language construct" -PHPFN(isset); // "Language construct" -PHPFN(key); -PHPFN(key_exists); -PHPFN(krsort); -PHPFN(ksort); -PHPFN(list); // "Language construct" -PHPFN(log); -PHPFN(log10); -PHPFN(max); -PHPFN(min); -PHPFN(natcasesort); -PHPFN(natsort); -PHPFN(next); -PHPFN(pos); -PHPFN(pow); -PHPFN(prev); -PHPFN(print); // "Language construct" -PHPFN(range); -PHPFN(reset); -PHPFN(rsort); -PHPFN(require); // "Language construct" -PHPFN(require_once); // "Language construct" -PHPFN(return); // "Language construct" -PHPFN(shuffle); -PHPFN(sin); -PHPFN(sinh); -PHPFN(sizeof); -PHPFN(sort); -PHPFN(sqrt); -PHPFN(tan); -PHPFN(tanh); -PHPFN(uasort); -PHPFN(uksort); -PHPFN(unset); // "Language construct" -PHPFN(usort); - -#undef PHPKW -#undef PHPKW_ok_as_function -#undef PHPBN1a -#undef PHPBN1b -#undef PHPBN1 -#undef PHPBN2a -#undef PHPBN2b -#undef PHPBN2 -#undef PHPCN -#undef PHPFN diff --git a/mac/bin/swig/share/swig/4.1.0/php/phppointers.i b/mac/bin/swig/share/swig/4.1.0/php/phppointers.i deleted file mode 100755 index a4ff3c0b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/phppointers.i +++ /dev/null @@ -1,42 +0,0 @@ -%define %pass_by_ref( TYPE, PHP_TYPE, CONVERT_IN, CONVERT_OUT ) -%typemap(in,byref=1,phptype=PHP_TYPE) TYPE *REF ($*1_ltype tmp), - TYPE &REF ($*1_ltype tmp) -%{ - if (Z_ISREF($input)) { - CONVERT_IN(tmp, $*1_ltype, $input); - $1 = &tmp; - } else { - zend_type_error(SWIG_PHP_Arg_Error_Msg($argnum, Expected a reference)); - } -%} -%typemap(argout) TYPE *REF, - TYPE &REF -%{ - if (Z_ISREF($input)) { - CONVERT_OUT(Z_REFVAL($input), tmp$argnum); - } -%} -%enddef - -%pass_by_ref( size_t, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed int, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( int, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( unsigned int, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed short, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( short, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( unsigned short, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed long, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( long, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( unsigned long, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed char, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( char, "string", CONVERT_CHAR_IN, ZVAL_STRING ); -%pass_by_ref( unsigned char, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( float, "float", CONVERT_FLOAT_IN, ZVAL_DOUBLE ); -%pass_by_ref( double, "float", CONVERT_FLOAT_IN, ZVAL_DOUBLE ); - -%pass_by_ref( char *, "string", CONVERT_CHAR_IN, ZVAL_STRING ); diff --git a/mac/bin/swig/share/swig/4.1.0/php/phprun.swg b/mac/bin/swig/share/swig/4.1.0/php/phprun.swg deleted file mode 100755 index d3ad0d26..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/phprun.swg +++ /dev/null @@ -1,272 +0,0 @@ -/* ----------------------------------------------------------------------------- - * phprun.swg - * - * PHP runtime library - * ----------------------------------------------------------------------------- */ - -#define swig_owntype int - -#ifdef __cplusplus -extern "C" { -#endif - -#if PHP_MAJOR_VERSION < 7 -# error These bindings need PHP 7 or later - to generate PHP5 bindings use: SWIG < 4.0.0 and swig -php5 -#endif - -#include "zend_inheritance.h" -#include "zend_exceptions.h" -#include "zend_inheritance.h" - -#if PHP_MAJOR_VERSION == 7 -/* These macros were new in PHP 8.0. For PHP 7.x we define them to give the - * same result except without any type declarations. PHP 7.x supports type - * declarations, but not for the return type, and alternate types aren't - * supported, so we don't try to support these. - */ -# define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(name, byref, num_req, classes, types) \ - ZEND_BEGIN_ARG_INFO_EX(name, 0, byref, num_req) -# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, byref, num_req, types) \ - ZEND_BEGIN_ARG_INFO_EX(name, 0, byref, num_req) - -/* NB We can just ignore `default` here we currently always pass NULL for it - * (this mechanism for specifying default parameter values was new in PHP 8.0 - * so it's not useful while we still want to support PHP7 too). - */ -# define ZEND_ARG_OBJ_TYPE_MASK(byref, name, classes, types, default) \ - ZEND_ARG_INFO(byref, name) -# define ZEND_ARG_TYPE_MASK(byref, name, types, default) \ - ZEND_ARG_INFO(byref, name) -#endif - -#include /* for abort(), used in generated code. */ - -#define SWIG_BOOL_CONSTANT(N, V) REGISTER_BOOL_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) -#define SWIG_LONG_CONSTANT(N, V) REGISTER_LONG_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) -#define SWIG_DOUBLE_CONSTANT(N, V) REGISTER_DOUBLE_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) -#define SWIG_STRING_CONSTANT(N, V) REGISTER_STRING_CONSTANT(#N, (char*)V, CONST_CS | CONST_PERSISTENT) -#define SWIG_CHAR_CONSTANT(N, V) do {\ - char swig_char = (V);\ - REGISTER_STRINGL_CONSTANT(#N, &swig_char, 1, CONST_CS | CONST_PERSISTENT);\ -} while (0) - -/* ZEND_CONSTANT_SET_FLAGS was new in PHP 7.3. */ -#ifdef ZEND_CONSTANT_SET_FLAGS -# define SWIG_ZEND_CONSTANT_SET_FLAGS ZEND_CONSTANT_SET_FLAGS -#else -# define SWIG_ZEND_CONSTANT_SET_FLAGS(C, F, N) do { (C)->flags = (F); (C)->module_number = (N); } while (0) -#endif - -/* zend_object_alloc was new in PHP 7.3. */ -#if PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION < 3 -static zend_always_inline void *zend_object_alloc(size_t obj_size, zend_class_entry *ce) { - void *obj = emalloc(obj_size + zend_object_properties_size(ce)); - memset(obj, 0, obj_size - sizeof(zval)); - return obj; -} -#endif - -/* ZEND_THIS was new in PHP 7.4. */ -#ifndef ZEND_THIS -# define ZEND_THIS &EX(This) -#endif - -#ifdef __cplusplus -} -#endif - -#define SWIG_fail goto fail - -static const char *default_error_msg = "Unknown error occurred"; -static int default_error_code = E_ERROR; - -#define SWIG_PHP_Arg_Error_Msg(argnum,extramsg) "Error in argument " #argnum " "#extramsg - -#define SWIG_PHP_Error(code,msg) do { zend_throw_exception(NULL, msg, code); SWIG_fail; } while (0) - -#define SWIG_contract_assert(expr,msg) \ - do { if (!(expr)) zend_printf("Contract Assert Failed %s\n", msg); } while (0) - -/* Standard SWIG API */ -#define SWIG_GetModule(clientdata) SWIG_Php_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer, *(int*)clientdata) - -static zend_class_entry SWIG_Php_swig_wrapped_interface_ce; - -#if PHP_MAJOR_VERSION == 7 -/* zend_class_implements_interface() was new in PHP 8.0. - * - * We could use instanceof_function_ex(C, I, 1) here for 7.4, but for 7.3 - * and earlier that doesn't work, so instead we just provide a compatibility - * implementation which does what zend_class_implements_interface() does in 8.x - * and use that for all 7.x so there are fewer variants to worry about testing. - */ -static int zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) { - uint32_t i; - if (class_ce->num_interfaces) { - for (i = 0; i < class_ce->num_interfaces; i++) { - if (class_ce->interfaces[i] == interface_ce) { - return 1; - } - } - } - return 0; -} -#endif - -/* used to wrap returned objects in so we know whether they are newobject - and need freeing, or not */ -typedef struct { - void * ptr; - int newobject; - const swig_type_info * type; - zend_object std; -} swig_object_wrapper; - -#define SWIG_Z_FETCH_OBJ_P(zv) swig_php_fetch_object(Z_OBJ_P(zv)) - -static inline -swig_object_wrapper * swig_php_fetch_object(zend_object *obj) { - return (swig_object_wrapper *)((char *)obj - XtOffsetOf(swig_object_wrapper, std)); -} - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) - -static void -SWIG_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject) { - // Return PHP NULL for a C/C++ NULL pointer. - if (!ptr) { - ZVAL_NULL(z); - return; - } - - if (!type->clientdata) { - zend_type_error("Type: %s not registered with zend", type->name); - return; - } - - { - zend_object *obj; - swig_object_wrapper *value; - if (Z_TYPE_P(z) == IS_OBJECT) { - /* The PHP object is already initialised - this is the case when wrapping - * the return value from a PHP constructor. */ - obj = Z_OBJ_P(z); - } else { - zend_class_entry *ce = (zend_class_entry*)(type->clientdata); - obj = ce->create_object(ce); - ZVAL_OBJ(z, obj); - } - value = swig_php_fetch_object(obj); - value->ptr = ptr; - value->newobject = (newobject & 1); - value->type = type; - } -} - -/* We wrap C/C++ pointers as PHP objects. */ -static int -SWIG_ConvertPtrAndOwn(zval *z, void **ptr, swig_type_info *ty, int flags, swig_owntype *own) { - if (own) - *own = 0; - - if (z == NULL) { - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - switch (Z_TYPE_P(z)) { - case IS_OBJECT: { - zend_object *obj = Z_OBJ_P(z); - swig_object_wrapper *value; - if (ty && ty->clientdata == (void*)obj->ce) { - // Object is exactly the class asked for - this handles common cases cheaply, - // and in particular the PHP classes we use to wrap a pointer to a non-class. - } else if (!zend_class_implements_interface(obj->ce, &SWIG_Php_swig_wrapped_interface_ce)) { - // Not an object we've wrapped. - return -1; - } - - /* convert and cast value->ptr from value->type to ptr as ty. */ - value = swig_php_fetch_object(obj); - if (!ty) { - /* They don't care about the target type, so just pass on the pointer! */ - *ptr = value->ptr; - } else { - swig_cast_info *tc = SWIG_TypeCheck(value->type->name, ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, value->ptr, &newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own |= SWIG_CAST_NEW_MEMORY; - } - } else { - *ptr = NULL; - } - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !value->newobject) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (*ptr == NULL) - return SWIG_ERROR; /* should be SWIG_NullReferenceError?? */ - if (flags & SWIG_POINTER_DISOWN) { - value->newobject = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - value->ptr = 0; - } - } - - return SWIG_OK; - } - case IS_NULL: - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - return -1; -} - -static int -SWIG_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags) { - return SWIG_ConvertPtrAndOwn(z, ptr, ty, flags, 0); -} - -static const char const_name[] = "swig_runtime_data_type_pointer"; -static swig_module_info *SWIG_Php_GetModule(void) { - zval *pointer = zend_get_constant_str(const_name, sizeof(const_name) - 1); - if (pointer) { - if (Z_TYPE_P(pointer) == IS_LONG) { - return (swig_module_info *) pointer->value.lval; - } - } - return NULL; -} - -static void SWIG_Php_SetModule(swig_module_info *pointer, int module_number) { - REGISTER_LONG_CONSTANT(const_name, (long) pointer, CONST_CS | CONST_PERSISTENT); -} - -/* Common parts of the "create_object" object handler. */ -static zend_object *SWIG_Php_do_create_object(zend_class_entry *ce, zend_object_handlers *handlers) { - swig_object_wrapper *obj = (swig_object_wrapper*)zend_object_alloc(sizeof(swig_object_wrapper), ce); - zend_object_std_init(&obj->std, ce); - object_properties_init(&obj->std, ce); - obj->std.handlers = handlers; - obj->newobject = 1; - return &obj->std; -} - -/* Common parts of the "free_obj" object handler. - Returns void* pointer if the C/C++ object should be destroyed. */ -static void* SWIG_Php_free_obj(zend_object *object) { - if (object) { - swig_object_wrapper *obj = swig_php_fetch_object(object); - zend_object_std_dtor(&obj->std); - if (obj->newobject) return obj->ptr; - } - return NULL; -} diff --git a/mac/bin/swig/share/swig/4.1.0/php/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/php/std_auto_ptr.i deleted file mode 100755 index 28409165..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/std_auto_ptr.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(&$input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $descriptor(TYPE *) of $symname"); - return; - } else { - zend_type_error("Expected $descriptor(TYPE *) for argument $argnum of $symname"); - return; - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/php/std_common.i b/mac/bin/swig/share/swig/4.1.0/php/std_common.i deleted file mode 100755 index 1b69fc77..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/std_common.i +++ /dev/null @@ -1,9 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; diff --git a/mac/bin/swig/share/swig/4.1.0/php/std_deque.i b/mac/bin/swig/share/swig/4.1.0/php/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/php/std_map.i b/mac/bin/swig/share/swig/4.1.0/php/std_map.i deleted file mode 100755 index fed3cf0b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/std_map.i +++ /dev/null @@ -1,82 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - bool is_empty() const { - return self->empty(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/mac/bin/swig/share/swig/4.1.0/php/std_pair.i b/mac/bin/swig/share/swig/4.1.0/php/std_pair.i deleted file mode 100755 index 732347db..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/php/std_string.i b/mac/bin/swig/share/swig/4.1.0/php/std_string.i deleted file mode 100755 index b2039786..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/std_string.i +++ /dev/null @@ -1,90 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string types - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - %typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) string, const string& %{ - $1 = (Z_TYPE($input) == IS_STRING) ? 1 : 0; - %} - - %typemap(in, phptype="string") string %{ - convert_to_string(&$input); - $1.assign(Z_STRVAL($input), Z_STRLEN($input)); - %} - - %typemap(directorout) string %{ - convert_to_string($input); - $result.assign(Z_STRVAL_P($input), Z_STRLEN_P($input)); - %} - - %typemap(out, phptype="string") string %{ - ZVAL_STRINGL($result, $1.data(), $1.size()); - %} - - %typemap(directorin) string, const string& %{ - ZVAL_STRINGL($input, $1.data(), $1.size()); - %} - - %typemap(out, phptype="string") const string & %{ - ZVAL_STRINGL($result, $1->data(), $1->size()); - %} - - %typemap(throws) string, const string& %{ - zend_throw_exception(NULL, $1.c_str(), 0); - goto fail; - %} - - %typemap(in, phptype="string") const string & ($*1_ltype temp) %{ - convert_to_string(&$input); - temp.assign(Z_STRVAL($input), Z_STRLEN($input)); - $1 = &temp; - %} - - /* These next two handle a function which takes a non-const reference to - * a std::string and modifies the string. */ - %typemap(in,byref=1, phptype="string") string & ($*1_ltype temp) %{ - { - zval * p = Z_ISREF($input) ? Z_REFVAL($input) : &$input; - convert_to_string(p); - temp.assign(Z_STRVAL_P(p), Z_STRLEN_P(p)); - $1 = &temp; - } - %} - - %typemap(directorout) string & ($*1_ltype *temp) %{ - convert_to_string($input); - temp = new $*1_ltype(Z_STRVAL_P($input), Z_STRLEN_P($input)); - swig_acquire_ownership(temp); - $result = temp; - %} - - %typemap(argout) string & %{ - if (Z_ISREF($input)) { - ZVAL_STRINGL(Z_REFVAL($input), $1->data(), $1->size()); - } - %} - - /* SWIG will apply the non-const typemap above to const string& without - * this more specific typemap. */ - %typemap(argout) const string & "" -} diff --git a/mac/bin/swig/share/swig/4.1.0/php/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/php/std_unique_ptr.i deleted file mode 100755 index 1bf31595..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/std_unique_ptr.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(&$input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $descriptor(TYPE *) of $symname"); - return; - } else { - zend_type_error("Expected $descriptor(TYPE *) for argument $argnum of $symname"); - return; - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/php/std_vector.i b/mac/bin/swig/share/swig/4.1.0/php/std_vector.i deleted file mode 100755 index 382b37ca..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/std_vector.i +++ /dev/null @@ -1,114 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - void clear(); - %rename(push) push_back; - void push_back(const value_type& x); - %extend { - bool is_empty() const { - return $self->empty(); - } - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - void clear(); - %rename(push) push_back; - void push_back(const value_type& x); - %extend { - bool is_empty() const { - return $self->empty(); - } - bool pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - bool x = self->back(); - self->pop_back(); - return x; - } - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/php/swigmove.i b/mac/bin/swig/share/swig/4.1.0/php/swigmove.i deleted file mode 100755 index b16a3c54..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/swigmove.i +++ /dev/null @@ -1,24 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(&$input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $&1_descriptor of $symname"); - return; - } else { - zend_type_error("Expected $&1_descriptor for argument $argnum of $symname"); - return; - } - } - if (!argp) { - zend_type_error("Invalid null reference for argument $argnum of $&1_descriptor of $symname"); - return; - } - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/mac/bin/swig/share/swig/4.1.0/php/typemaps.i b/mac/bin/swig/share/swig/4.1.0/php/typemaps.i deleted file mode 100755 index 718469ed..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/typemaps.i +++ /dev/null @@ -1,295 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i. - * - * SWIG Typemap library for PHP. - * - * This library provides standard typemaps for modifying SWIG's behavior. - * With enough entries in this file, I hope that very few people actually - * ever need to write a typemap. - * - * Define macros to define the following typemaps: - * - * TYPE *INPUT. Argument is passed in as native variable by value. - * TYPE *OUTPUT. Argument is returned as an array from the function call. - * TYPE *INOUT. Argument is passed in by value, and out as part of returned list - * TYPE *REFERENCE. Argument is passed in as native variable with value - * semantics. Variable value is changed with result. - * Use like this: - * int foo(int *REFERENCE); - * - * $a = 0; - * $rc = foo($a); - * - * Even though $a looks like it's passed by value, - * its value can be changed by foo(). - * ----------------------------------------------------------------------------- */ - -%define BOOL_TYPEMAP(TYPE) -%typemap(in, phptype="bool") TYPE *INPUT(TYPE temp), TYPE &INPUT(TYPE temp) -%{ - convert_to_boolean(&$input); - temp = (Z_TYPE($input) == IS_TRUE); - $1 = &temp; -%} -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" -%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;" -%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT -{ - zval o; - ZVAL_BOOL(&o, temp$argnum); - t_output_helper($result, &o); -} -%typemap(in, phptype="float") TYPE *REFERENCE (TYPE lvalue), TYPE &REFERENCE (TYPE lvalue) -%{ - convert_to_boolean($input); - lvalue = (Z_TYPE_P($input) == IS_TRUE); - $1 = &lvalue; -%} -%typemap(argout) TYPE *REFERENCE, TYPE &REFERENCE -%{ - ZVAL_BOOL(&$arg, lvalue$argnum ? true : false); -%} -%enddef - -%define DOUBLE_TYPEMAP(TYPE) -%typemap(in, phptype="float") TYPE *INPUT(TYPE temp), TYPE &INPUT(TYPE temp) -%{ - temp = (TYPE) zval_get_double(&$input); - $1 = &temp; -%} -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" -%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;" -%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT -{ - zval o; - ZVAL_DOUBLE(&o, temp$argnum); - t_output_helper($result, &o); -} -%typemap(in, phptype="float") TYPE *REFERENCE (TYPE dvalue), TYPE &REFERENCE (TYPE dvalue) -%{ - dvalue = (TYPE) zval_get_double(&$input); - $1 = &dvalue; -%} -%typemap(argout) TYPE *REFERENCE, TYPE &REFERENCE -%{ - ZVAL_DOUBLE(&$arg, (double)(lvalue$argnum)); -%} -%enddef - -%define INT_TYPEMAP(TYPE) -%typemap(in, phptype="int") TYPE *INPUT(TYPE temp), TYPE &INPUT(TYPE temp) -%{ - temp = (TYPE) zval_get_long(&$input); - $1 = &temp; -%} -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" -%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;" -%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT -{ - zval o; - ZVAL_LONG(&o, temp$argnum); - t_output_helper($result, &o); -} -%typemap(in, phptype="int") TYPE *REFERENCE (TYPE lvalue), TYPE &REFERENCE (TYPE lvalue) -%{ - lvalue = (TYPE) zval_get_long(&$input); - $1 = &lvalue; -%} -%typemap(argout) TYPE *REFERENCE, TYPE &REFERENCE -%{ - ZVAL_LONG(&$arg, (long)(lvalue$argnum)); -%} -%enddef - -BOOL_TYPEMAP(bool); - -DOUBLE_TYPEMAP(float); -DOUBLE_TYPEMAP(double); - -INT_TYPEMAP(int); -INT_TYPEMAP(short); -INT_TYPEMAP(long); -INT_TYPEMAP(unsigned int); -INT_TYPEMAP(unsigned short); -INT_TYPEMAP(unsigned long); -INT_TYPEMAP(unsigned char); -INT_TYPEMAP(signed char); - -INT_TYPEMAP(long long); -%typemap(argout,fragment="t_output_helper") long long *OUTPUT -{ - zval o; - if ((long long)LONG_MIN <= temp$argnum && temp$argnum <= (long long)LONG_MAX) { - ZVAL_LONG(&o, (long)temp$argnum); - } else { - ZVAL_NEW_STR(&o, zend_strpprintf(0, "%lld", (long long)temp$argnum)); - } - t_output_helper($result, &o); -} -%typemap(in, phptype="int|string") TYPE *REFERENCE (long long lvalue) -%{ - CONVERT_LONG_LONG_IN(lvalue, long long, $input) - $1 = &lvalue; -%} -%typemap(argout) long long *REFERENCE -%{ - if ((long long)LONG_MIN <= lvalue$argnum && lvalue$argnum <= (long long)LONG_MAX) { - ZVAL_LONG(&$arg, (long)temp$argnum); - } else { - ZVAL_NEW_STR(&$arg, zend_strpprintf(0, "%lld", (long long)lvalue$argnum)); - } -%} -%typemap(argout) long long &OUTPUT -%{ - if ((long long)LONG_MIN <= *arg$argnum && *arg$argnum <= (long long)LONG_MAX) { - ZVAL_LONG($result, (long)(*arg$argnum)); - } else { - ZVAL_NEW_STR($result, zend_strpprintf(0, "%lld", (long long)(*arg$argnum))); - } -%} - -INT_TYPEMAP(unsigned long long); -%typemap(argout,fragment="t_output_helper") unsigned long long *OUTPUT -{ - zval o; - if (temp$argnum <= (unsigned long long)LONG_MAX) { - ZVAL_LONG(&o, temp$argnum); - } else { - ZVAL_NEW_STR(&o, zend_strpprintf(0, "%llu", (unsigned long long)temp$argnum)); - } - t_output_helper($result, &o); -} -%typemap(in, phptype="int|string") TYPE *REFERENCE (unsigned long long lvalue) -%{ - CONVERT_UNSIGNED_LONG_LONG_IN(lvalue, unsigned long long, $input) - $1 = &lvalue; -%} -%typemap(argout) unsigned long long *REFERENCE -%{ - if (lvalue$argnum <= (unsigned long long)LONG_MAX) { - ZVAL_LONG($arg, (long)(lvalue$argnum)); - } else { - ZVAL_NEW_STR((*$arg), zend_strpprintf(0, "%llu", (unsigned long long)lvalue$argnum)); - } -%} -%typemap(argout) unsigned long long &OUTPUT -%{ - if (*arg$argnum <= (unsigned long long)LONG_MAX) { - ZVAL_LONG($result, (long)(*arg$argnum)); - } else { - ZVAL_NEW_STR($result, zend_strpprintf(0, "%llu", (unsigned long long)(*arg$argnum))); - } -%} - -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; - -%typemap(in) bool &INOUT = bool *INPUT; -%typemap(in) float &INOUT = float *INPUT; -%typemap(in) double &INOUT = double *INPUT; - -%typemap(in) int &INOUT = int *INPUT; -%typemap(in) short &INOUT = short *INPUT; -%typemap(in) long &INOUT = long *INPUT; -%typemap(in) long long &INOUT = long long *INPUT; -%typemap(in) long long &INPUT = long long *INPUT; -%typemap(in) unsigned &INOUT = unsigned *INPUT; -%typemap(in) unsigned short &INOUT = unsigned short *INPUT; -%typemap(in) unsigned long &INOUT = unsigned long *INPUT; -%typemap(in) unsigned char &INOUT = unsigned char *INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long *INPUT; -%typemap(in) unsigned long long &INPUT = unsigned long long *INPUT; -%typemap(in) signed char &INOUT = signed char *INPUT; - -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT= double *OUTPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT= long *OUTPUT; -%typemap(argout) long long *INOUT= long long *OUTPUT; -%typemap(argout) unsigned short *INOUT= unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; - -%typemap(argout) bool &INOUT = bool *OUTPUT; -%typemap(argout) float &INOUT = float *OUTPUT; -%typemap(argout) double &INOUT= double *OUTPUT; - -%typemap(argout) int &INOUT = int *OUTPUT; -%typemap(argout) short &INOUT = short *OUTPUT; -%typemap(argout) long &INOUT= long *OUTPUT; -%typemap(argout) long long &INOUT= long long *OUTPUT; -%typemap(argout) unsigned short &INOUT= unsigned short *OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char *OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long *OUTPUT; -%typemap(argout) signed char &INOUT = signed char *OUTPUT; - -%typemap(in, phptype="string") char INPUT[ANY] ( char temp[$1_dim0] ) -%{ - convert_to_string(&$input); - strncpy(temp, Z_STRVAL($input), $1_dim0); - $1 = temp; -%} -%typemap(in,numinputs=0) char OUTPUT[ANY] ( char temp[$1_dim0] ) - "$1 = temp;"; -%typemap(argout,fragment="t_output_helper") char OUTPUT[ANY] -{ - zval o; - ZVAL_STRINGL(&o, temp$argnum, $1_dim0); - t_output_helper($result, &o); -} - -%typemap(in,numinputs=0,phptype="?SWIGTYPE") void **OUTPUT (int force), - void *&OUTPUT (int force) -%{ - /* If they pass NULL by reference, make it into a void* - This bit should go in arginit if arginit support init-ing scripting args */ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ - if (!(Z_ISREF($input) && Z_ISNULL_P(Z_REFVAL($input)))) { - /* wasn't a pre/ref/thing, OR anything like an int thing */ - zend_type_error("Expected reference or NULL for argument $arg of $symname"); - return; - } - } - force=0; - if (arg1==NULL) { -#ifdef __cplusplus - ptr=new $*1_ltype(); -#else - ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); -#endif - $1=&ptr; - /* have to passback arg$arg too */ - force=1; - } -%} - -%typemap(argout) void **OUTPUT, - void *&OUTPUT -%{ - if (force$argnum) { /* pass back arg$argnum through params ($arg) if we can */ - if (!Z_ISREF($arg)) { - SWIG_PHP_Error(E_WARNING, "Parameter $argnum of $symname wasn't passed by reference"); - } else { - SWIG_SetPointerZval(*$arg, (void *) ptr$argnum, $*1_descriptor, 1); - } - } -%} diff --git a/mac/bin/swig/share/swig/4.1.0/php/utils.i b/mac/bin/swig/share/swig/4.1.0/php/utils.i deleted file mode 100755 index 33db942a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/php/utils.i +++ /dev/null @@ -1,115 +0,0 @@ - -%define CONVERT_BOOL_IN(lvar,t,invar) - lvar = (t) zval_is_true(&invar); -%enddef - -%define CONVERT_INT_IN(lvar,t,invar) - lvar = (t) zval_get_long(&invar); -%enddef - -%define CONVERT_LONG_LONG_IN(lvar,t,invar) - switch (Z_TYPE(invar)) { - case IS_DOUBLE: - lvar = (t) Z_DVAL(invar); - break; - case IS_STRING: { - char * endptr; - errno = 0; - lvar = (t) strtoll(Z_STRVAL(invar), &endptr, 10); - if (*endptr == '\0' && !errno) break; - } - /* FALL THRU */ - default: - lvar = (t) zval_get_long(&invar); - } -%enddef - -%define CONVERT_UNSIGNED_LONG_LONG_IN(lvar,t,invar) - switch (Z_TYPE(invar)) { - case IS_DOUBLE: - lvar = (t) Z_DVAL(invar); - break; - case IS_STRING: { - char * endptr; - errno = 0; - lvar = (t) strtoull(Z_STRVAL(invar), &endptr, 10); - if (*endptr == '\0' && !errno) break; - } - /* FALL THRU */ - default: - lvar = (t) zval_get_long(&invar); - } -%enddef - -%define CONVERT_INT_OUT(lvar,invar) - lvar = (t) zval_get_long(&invar); -%enddef - -%define CONVERT_FLOAT_IN(lvar,t,invar) - lvar = (t) zval_get_double(&invar); -%enddef - -%define CONVERT_CHAR_IN(lvar,t,invar) - convert_to_string(&invar); - lvar = (t) Z_STRVAL(invar)[0]; -%enddef - -%define CONVERT_STRING_IN(lvar,t,invar) - if (Z_ISNULL(invar)) { - lvar = (t) 0; - } else { - convert_to_string(&invar); - lvar = (t) Z_STRVAL(invar); - } -%enddef - -%define %pass_by_val( TYPE, PHP_TYPE, CONVERT_IN ) -%typemap(in, phptype=PHP_TYPE) TYPE -%{ - CONVERT_IN($1,$1_ltype,$input); -%} -%typemap(in, phptype=PHP_TYPE) const TYPE & ($*1_ltype temp) -%{ - CONVERT_IN(temp,$*1_ltype,$input); - $1 = &temp; -%} -%typemap(directorout) TYPE -%{ - CONVERT_IN($result, $1_ltype, *$input); -%} -%typemap(directorout) const TYPE & -%{ - $*1_ltype swig_val; - CONVERT_IN(swig_val, $*1_ltype, *$input); - $1_ltype temp = new $*1_ltype(swig_val); - swig_acquire_ownership(temp); - $result = temp; -%} -%typemap(directorfree) const TYPE & -%{ - if (director) { - director->swig_release_ownership(%as_voidptr($input)); - } -%} -%enddef - -%fragment("t_output_helper","header") %{ -static void -t_output_helper(zval *target, zval *o) { - zval tmp; - if (Z_TYPE_P(target) == IS_ARRAY) { - /* it's already an array, just append */ - add_next_index_zval(target, o); - return; - } - if (Z_TYPE_P(target) == IS_NULL) { - /* NULL isn't refcounted */ - ZVAL_COPY_VALUE(target, o); - return; - } - ZVAL_DUP(&tmp, target); - array_init(target); - add_next_index_zval(target, &tmp); - add_next_index_zval(target, o); -} -%} diff --git a/mac/bin/swig/share/swig/4.1.0/pointer.i b/mac/bin/swig/share/swig/4.1.0/pointer.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/python/Makefile.in b/mac/bin/swig/share/swig/4.1.0/python/Makefile.in deleted file mode 100755 index 27c38444..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/Makefile.in +++ /dev/null @@ -1,119 +0,0 @@ -# --------------------------------------------------------------- -# SWIG Python Makefile -# -# This file can be used to build various Python extensions with SWIG. -# By default this file is set up for dynamic loading, but it can -# be easily customized for static extensions by modifying various -# portions of the file. -# -# SRCS = C source files -# CXXSRCS = C++ source files -# OBJCSRCS = Objective-C source files -# OBJS = Additional .o files (compiled previously) -# INTERFACE = SWIG interface file -# TARGET = Name of target module or executable -# -# Many portions of this file were created by the SWIG configure -# script and should already reflect your machine. -#---------------------------------------------------------------- - -SRCS = -CXXSRCS = -OBJCSRCS = -OBJS = -INTERFACE = -WRAPFILE = $(INTERFACE:.i=_wrap.c) -WRAPOBJ = $(INTERFACE:.i=_wrap.o) -TARGET = module@SO@ # Use this kind of target for dynamic loading -#TARGET = mypython # Use this target for static linking - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -CC = @CC@ -CXX = @CXX@ -OBJC = @CC@ -Wno-import # -Wno-import needed for gcc -CFLAGS = -INCLUDES = -LIBS = - -# SWIG Options -# SWIG = location of the SWIG executable -# SWIGOPT = SWIG compiler options -# SWIGCC = Compiler used to compile the wrapper file - -SWIG = $(exec_prefix)/bin/swig -SWIGOPT = -python -SWIGCC = $(CC) - -# SWIG Library files. Uncomment if rebuilding the Python interpreter -#SWIGLIBS = -lembed.i - -# Rules for creating .o files from source. - -COBJS = $(SRCS:.c=.o) -CXXOBJS = $(CXXSRCS:.cxx=.o) -OBJCOBJS = $(OBJCSRCS:.m=.o) -ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) - -# Command that will be used to build the final extension. -BUILD = $(SWIGCC) - -# Uncomment the following if you are using dynamic loading -CCSHARED = @CCSHARED@ -BUILD = @LDSHARED@ - -# Uncomment the following if you are using dynamic loading with C++ and -# need to provide additional link libraries (this is not always required). - -#DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ - -L/usr/local/lib -lg++ -lstdc++ -lgcc - -# Python installation - -PY_INCLUDE = -DHAVE_CONFIG_H @PYINCLUDE@ -PY_LIB = @PYLIB@ - -# Build libraries (needed for static builds) - -LIBM = @LIBM@ -LIBC = @LIBC@ -SYSLIBS = $(LIBM) $(LIBC) @LIBS@ - -# Build options - -BUILD_LIBS = $(LIBS) # Dynamic loading - -# Compilation rules for non-SWIG components - -.SUFFIXES: .c .cxx .m - -.c.o: - $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - -.cxx.o: - $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< - -.m.o: - $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - - -# ---------------------------------------------------------------------- -# Rules for building the extension -# ---------------------------------------------------------------------- - -all: $(TARGET) - -# Convert the wrapper file into an object file - -$(WRAPOBJ) : $(WRAPFILE) - $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDES) $(PY_INCLUDE) - -$(WRAPFILE) : $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIBS) $(INTERFACE) - -$(TARGET): $(WRAPOBJ) $(ALLOBJS) - $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) - -clean: - rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) diff --git a/mac/bin/swig/share/swig/4.1.0/python/README b/mac/bin/swig/share/swig/4.1.0/python/README deleted file mode 100755 index 70968e7d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/README +++ /dev/null @@ -1,103 +0,0 @@ -/* ----------------------------------------------------------------------------- - * - * User interfaces: include these ones as needed - * - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Special types and user helpers - * ----------------------------------------------------------------------------- */ - -argcargv.i Handler for (int argc, char **argv) -attribute.i Convert a pair of set/get methods into a "native" python attribute -ccomplex.i C99 complex type -complex.i C99 or C++ complex type -cstring.i Various forms of C character string handling -cwstring.i Various forms of C wchar_t string handling -embed.i embedding the Python interpreter in something else -file.i FILE C type -implicit.i Allow the use of implicit C++ constructors -wchar.i wchar_t C type - -/* ----------------------------------------------------------------------------- - * C++ STD + STL - * ----------------------------------------------------------------------------- */ - -std_alloc.i allocator -std_basic_string.i basic string -std_char_traits.i char traits -std_complex.i complex -std_deque.i deque -std_except.i exceptions -std_ios.i ios -std_iostream.i istream/ostream -std_list.i list -std_map.i map -std_multimap.i multimap -std_multiset.i multiset -std_pair.i pair -std_set.i set -std_sstream.i string stream -std_streambuf.i streambuf -std_string.i string -std_vector.i vector -std_wios.i wios -std_wiostream.i wistream/wostream -std_wsstream.i wstring stream -std_wstreambuf.i wstreambuf -std_wstring.i wstring - - - -/* ----------------------------------------------------------------------------- -/* - * Implementation files: don't look at them unless you are really drunk - * - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Basic files - * ----------------------------------------------------------------------------- */ - -python.swg Main language file, it just includes what is needed. -pyuserdir.swg User visible directives (%pythonnondynamic, etc) -pymacros.swg Internal macros used for typemaps -pyfragments.swg Allow the user to overload the default fragments -pyopers.swg Python operations (+=, *=, etc) -pythonkw.swg Python keywords and special names -pyinit.swg Python Init method - -/* ----------------------------------------------------------------------------- - * The runtime part - * ----------------------------------------------------------------------------- */ - -pyruntime.swg Main runtime file definition -pyapi.swg SWIG/Python API declarations -pyrun.swg Python run-time code - -/* ----------------------------------------------------------------------------- - * Internal typemap specializations - * ----------------------------------------------------------------------------- */ - -pyswigtype.swg SWIGTYPE -pystrings.swg Char strings (char *) -pywstrings.swg Wchar Strings (wchar_t *) -pyprimtypes.swg Primitive types (shot,int,double,etc) -pycomplex.swg PyComplex and helper for C/C++ complex types -pydocs.swg Typemaps documentation - -/* ----------------------------------------------------------------------------- - * C++ STD + STL - * ----------------------------------------------------------------------------- */ - -pycontainer.swg python container iterators -std_common.i general common code for the STD/STL implementation -std_container.i general common code for the STD/STL containers - - -/*----------------------------------------------------------------------------- - * Backward compatibility and deprecated - * ----------------------------------------------------------------------------- */ - -std_vectora.i vector + allocator (allocators are now supported in STD/STL) -typemaps.i old in/out typemaps (doesn't need to be included) diff --git a/mac/bin/swig/share/swig/4.1.0/python/argcargv.i b/mac/bin/swig/share/swig/4.1.0/python/argcargv.i deleted file mode 100755 index 419803a8..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/argcargv.i +++ /dev/null @@ -1,89 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsArgcArgv","header",fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsArgcArgv(PyObject *input, swig_type_info *ppchar_info, size_t *argc, char ***argv, int *owner) { - void *vptr; - int res = SWIG_ConvertPtr(input, &vptr, ppchar_info, 0); - if (!SWIG_IsOK(res)) { - int list = 0; - PyErr_Clear(); - list = PyList_Check(input); - if (list || PyTuple_Check(input)) { - size_t i = 0; - size_t size = list ? PyList_Size(input) : PyTuple_Size(input); - if (argc) *argc = size; - if (argv) { - *argv = %new_array(size + 1, char*); - for (; i < size; ++i) { - PyObject *obj = list ? PyList_GetItem(input,i) : PyTuple_GetItem(input,i); - char *cptr = 0; size_t sz = 0; int alloc = 0; - res = SWIG_AsCharPtrAndSize(obj, &cptr, &sz, &alloc); - if (SWIG_IsOK(res)) { - if (cptr && sz) { - (*argv)[i] = (alloc == SWIG_NEWOBJ) ? cptr : %new_copy_array(cptr, sz, char); - } else { - (*argv)[i] = 0; - } - } else { - return SWIG_TypeError; - } - } - (*argv)[i] = 0; - if (owner) *owner = 1; - } else { - for (; i < size; ++i) { - PyObject *obj = list ? PyList_GetItem(input,i) : PyTuple_GetItem(input,i); - res = SWIG_AsCharPtrAndSize(obj, 0, 0, 0); - if (!SWIG_IsOK(res)) return SWIG_TypeError; - } - if (owner) *owner = 0; - } - return SWIG_OK; - } else { - return SWIG_TypeError; - } - } else { - /* seems dangerous, but the user asked for it... */ - size_t i = 0; - if (argv) { while (*argv[i] != 0) ++i;} - if (argc) *argc = i; - if (owner) *owner = 0; - return SWIG_OK; - } -} -} - -/* - This typemap works with either a char **, a python list or a python - tuple - */ - -%typemap(in,noblock=0,fragment="SWIG_AsArgcArgv") (int ARGC, char **ARGV) (int res,char **argv = 0, size_t argc = 0, int owner= 0) { - res = SWIG_AsArgcArgv($input, $descriptor(char**), &argc, &argv, &owner); - if (!SWIG_IsOK(res)) { - $1 = 0; $2 = 0; - %argument_fail(SWIG_TypeError, "int ARGC, char **ARGV", $symname, $argnum); - } else { - $1 = %static_cast(argc,$1_ltype); - $2 = %static_cast(argv, $2_ltype); - } -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - int res = SWIG_AsArgcArgv($input, $descriptor(char**), 0, 0, 0); - $1 = SWIG_IsOK(res); -} - -%typemap(freearg,noblock=1) (int ARGC, char **ARGV) { - if (owner$argnum) { - size_t i = argc$argnum; - while (i) { - %delete_array(argv$argnum[--i]); - } - %delete_array(argv$argnum); - } -} - diff --git a/mac/bin/swig/share/swig/4.1.0/python/attribute.i b/mac/bin/swig/share/swig/4.1.0/python/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/boost_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/python/boost_shared_ptr.i deleted file mode 100755 index bfd8787c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/boost_shared_ptr.i +++ /dev/null @@ -1,411 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -%fragment("SWIG_null_deleter_python", "header", fragment="SWIG_null_deleter") { -%#define SWIG_NO_NULL_DELETER_SWIG_BUILTIN_INIT -} - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter_python") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter_python") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter_python") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter_python") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter_python") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter_python") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter_python") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter_python") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - -%typemap(doctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - %{TYPE%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/python/builtin.swg b/mac/bin/swig/share/swig/4.1.0/python/builtin.swg deleted file mode 100755 index 5cff6835..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/builtin.swg +++ /dev/null @@ -1,764 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -SWIGINTERN Py_hash_t -SwigPyObject_hash(PyObject *obj) { - SwigPyObject *sobj = (SwigPyObject *)obj; - void *ptr = sobj->ptr; -#if PY_VERSION_HEX < 0x03020000 - return (Py_hash_t)(Py_ssize_t)ptr; -#else - return (Py_hash_t)ptr; -#endif -} - -SWIGINTERN Py_hash_t -SWIG_PyNumber_AsPyHash(PyObject *obj) { - Py_hash_t result = -1; -#if PY_VERSION_HEX < 0x03020000 - if (PyInt_Check(obj)) - result = PyInt_AsLong(obj); - else if (PyLong_Check(obj)) - result = PyLong_AsLong(obj); -#else - if (PyNumber_Check(obj)) - result = PyNumber_AsSsize_t(obj, NULL); -#endif - else - PyErr_Format(PyExc_TypeError, "Wrong type for hash function"); - return PyErr_Occurred() ? -1 : result; -} - -SWIGINTERN int -SwigPyBuiltin_BadInit(PyObject *self, PyObject *SWIGUNUSEDPARM(args), PyObject *SWIGUNUSEDPARM(kwds)) { - PyErr_Format(PyExc_TypeError, "Cannot create new instances of type '%.300s'", self->ob_type->tp_name); - return -1; -} - -SWIGINTERN void -SwigPyBuiltin_BadDealloc(PyObject *obj) { - SwigPyObject *sobj = (SwigPyObject *)obj; - if (sobj->own) { - PyErr_Format(PyExc_TypeError, "Swig detected a memory leak in type '%.300s': no callable destructor found.", obj->ob_type->tp_name); - } -} - -typedef struct { - PyCFunction get; - PyCFunction set; -} SwigPyGetSet; - -SWIGINTERN PyObject * -SwigPyBuiltin_GetterClosure (PyObject *obj, void *closure) { - SwigPyGetSet *getset; - PyObject *tuple, *result; - if (!closure) - return SWIG_Py_Void(); - getset = (SwigPyGetSet *)closure; - if (!getset->get) - return SWIG_Py_Void(); - tuple = PyTuple_New(0); - assert(tuple); - result = (*getset->get)(obj, tuple); - Py_DECREF(tuple); - return result; -} - -SWIGINTERN PyObject * -SwigPyBuiltin_FunpackGetterClosure (PyObject *obj, void *closure) { - SwigPyGetSet *getset; - PyObject *result; - if (!closure) - return SWIG_Py_Void(); - getset = (SwigPyGetSet *)closure; - if (!getset->get) - return SWIG_Py_Void(); - result = (*getset->get)(obj, NULL); - return result; -} - -SWIGINTERN int -SwigPyBuiltin_SetterClosure (PyObject *obj, PyObject *val, void *closure) { - SwigPyGetSet *getset; - PyObject *tuple, *result; - if (!closure) { - PyErr_Format(PyExc_TypeError, "Missing getset closure"); - return -1; - } - getset = (SwigPyGetSet *)closure; - if (!getset->set) { - PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name); - return -1; - } - tuple = PyTuple_New(1); - assert(tuple); - Py_INCREF(val); - PyTuple_SET_ITEM(tuple, 0, val); - result = (*getset->set)(obj, tuple); - Py_DECREF(tuple); - Py_XDECREF(result); - return result ? 0 : -1; -} - -SWIGINTERN int -SwigPyBuiltin_FunpackSetterClosure (PyObject *obj, PyObject *val, void *closure) { - SwigPyGetSet *getset; - PyObject *result; - if (!closure) { - PyErr_Format(PyExc_TypeError, "Missing getset closure"); - return -1; - } - getset = (SwigPyGetSet *)closure; - if (!getset->set) { - PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name); - return -1; - } - result = (*getset->set)(obj, val); - Py_XDECREF(result); - return result ? 0 : -1; -} - -SWIGINTERN void -SwigPyStaticVar_dealloc(PyDescrObject *descr) { - PyObject_GC_UnTrack(descr); - Py_XDECREF(PyDescr_TYPE(descr)); - Py_XDECREF(PyDescr_NAME(descr)); - PyObject_GC_Del(descr); -} - -SWIGINTERN PyObject * -SwigPyStaticVar_repr(PyGetSetDescrObject *descr) { -#if PY_VERSION_HEX >= 0x03000000 - - return PyUnicode_FromFormat("", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); -#else - return PyString_FromFormat("", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); -#endif -} - -SWIGINTERN int -SwigPyStaticVar_traverse(PyObject *self, visitproc visit, void *arg) { - PyDescrObject *descr; - descr = (PyDescrObject *)self; - Py_VISIT((PyObject*) PyDescr_TYPE(descr)); - return 0; -} - -SWIGINTERN PyObject * -SwigPyStaticVar_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *SWIGUNUSEDPARM(type)) { - if (descr->d_getset->get != NULL) - return descr->d_getset->get(obj, descr->d_getset->closure); -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not readable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); -#else - PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not readable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); -#endif - return NULL; -} - -SWIGINTERN int -SwigPyStaticVar_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value) { - if (descr->d_getset->set != NULL) - return descr->d_getset->set(obj, value, descr->d_getset->closure); -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not writable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); -#else - PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not writable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); -#endif - return -1; -} - -SWIGINTERN int -SwigPyObjectType_setattro(PyObject *typeobject, PyObject *name, PyObject *value) { - PyObject *attribute; - PyTypeObject *type; - descrsetfunc local_set; - - assert(PyType_Check(typeobject)); - type = (PyTypeObject *)typeobject; - attribute = _PyType_Lookup(type, name); - if (attribute != NULL) { - /* Implement descriptor functionality, if any */ - local_set = attribute->ob_type->tp_descr_set; - if (local_set != NULL) - return local_set(attribute, (PyObject *)type, value); -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400S'", type->tp_name, name); -#else - PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400s'", type->tp_name, PyString_AS_STRING(name)); -#endif - } else { -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400S'", type->tp_name, name); -#else - PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400s'", type->tp_name, PyString_AS_STRING(name)); -#endif - } - - return -1; -} - -SWIGINTERN PyTypeObject* -SwigPyStaticVar_Type(void) { - static PyTypeObject staticvar_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#else - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ -#endif - "swig_static_var_getset_descriptor", /* tp_name */ - sizeof(PyGetSetDescrObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyStaticVar_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /* tp_print */ -#else - (Py_ssize_t)0, /* tp_vectorcall_offset */ -#endif - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc)SwigPyStaticVar_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */ - 0, /* tp_doc */ - SwigPyStaticVar_traverse, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - (descrgetfunc)SwigPyStaticVar_get, /* tp_descr_get */ - (descrsetfunc)SwigPyStaticVar_set, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - staticvar_type = tmp; - type_init = 1; - if (PyType_Ready(&staticvar_type) < 0) - return NULL; - } - return &staticvar_type; -} - -SWIGINTERN PyTypeObject* -SwigPyObjectType(void) { - static char swigpyobjecttype_doc[] = "Metaclass for SWIG wrapped types"; - static PyTypeObject swigpyobjecttype_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#else - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ -#endif - "SwigPyObjectType", /* tp_name */ - PyType_Type.tp_basicsize, /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /* tp_print */ -#else - (Py_ssize_t)0, /* tp_vectorcall_offset */ -#endif - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - SwigPyObjectType_setattro, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */ - swigpyobjecttype_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - swigpyobjecttype_type = tmp; - type_init = 1; - swigpyobjecttype_type.tp_base = &PyType_Type; - if (PyType_Ready(&swigpyobjecttype_type) < 0) - return NULL; - } - return &swigpyobjecttype_type; -} - -SWIGINTERN PyGetSetDescrObject * -SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) { - - PyGetSetDescrObject *descr; - descr = (PyGetSetDescrObject *)PyType_GenericAlloc(SwigPyStaticVar_Type(), 0); - assert(descr); - Py_XINCREF(type); - PyDescr_TYPE(descr) = type; - PyDescr_NAME(descr) = PyString_InternFromString(getset->name); - descr->d_getset = getset; - if (PyDescr_NAME(descr) == NULL) { - Py_DECREF(descr); - descr = NULL; - } - return descr; -} - -SWIGINTERN void -SwigPyBuiltin_InitBases (PyTypeObject *type, PyTypeObject **bases) { - Py_ssize_t base_count = 0; - PyTypeObject **b; - PyObject *tuple; - Py_ssize_t i; - - if (!bases[0]) { - bases[0] = SwigPyObject_type(); - bases[1] = NULL; - } - type->tp_base = bases[0]; - Py_INCREF((PyObject *)bases[0]); - for (b = bases; *b != NULL; ++b) - ++base_count; - tuple = PyTuple_New(base_count); - for (i = 0; i < base_count; ++i) { - Py_INCREF((PyObject *)bases[i]); - PyTuple_SET_ITEM(tuple, i, (PyObject *)bases[i]); - } - type->tp_bases = tuple; -} - -SWIGINTERN PyObject * -SwigPyBuiltin_ThisClosure (PyObject *self, void *SWIGUNUSEDPARM(closure)) { - PyObject *result; - result = (PyObject *)SWIG_Python_GetSwigThis(self); - Py_XINCREF(result); - return result; -} - -SWIGINTERN void -SwigPyBuiltin_SetMetaType (PyTypeObject *type, PyTypeObject *metatype) -{ -#if PY_VERSION_HEX >= 0x030900a4 - Py_SET_TYPE(type, metatype); -#else - Py_TYPE(type) = metatype; -#endif -} - - -/* Start of callback function macros for use in PyTypeObject */ - -typedef PyObject *(*SwigPyWrapperFunction)(PyObject *, PyObject *); - -#define SWIGPY_UNARYFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_unaryfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_unaryfunc_closure(wrapper, a); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_unaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -#define SWIGPY_DESTRUCTOR_CLOSURE(wrapper) \ -SWIGINTERN void \ -wrapper##_destructor_closure(PyObject *a) { \ - SwigPyBuiltin_destructor_closure(wrapper, #wrapper, a); \ -} -SWIGINTERN void -SwigPyBuiltin_destructor_closure(SwigPyWrapperFunction wrapper, const char *wrappername, PyObject *a) { - SwigPyObject *sobj; - sobj = (SwigPyObject *)a; - Py_XDECREF(sobj->dict); - if (sobj->own) { - PyObject *o; - PyObject *type = 0, *value = 0, *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - o = wrapper(a, NULL); - if (!o) { - PyObject *deallocname = PyString_FromString(wrappername); - PyErr_WriteUnraisable(deallocname); - Py_DECREF(deallocname); - } - PyErr_Restore(type, value, traceback); - Py_XDECREF(o); - } - if (PyType_IS_GC(a->ob_type)) { - PyObject_GC_Del(a); - } else { - PyObject_Del(a); - } -} - -#define SWIGPY_INQUIRY_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_inquiry_closure(PyObject *a) { \ - return SwigPyBuiltin_inquiry_closure(wrapper, a); \ -} -SWIGINTERN int -SwigPyBuiltin_inquiry_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - PyObject *pyresult; - int result; - pyresult = wrapper(a, NULL); - result = pyresult && PyObject_IsTrue(pyresult) ? 1 : 0; - Py_XDECREF(pyresult); - return result; -} - -#define SWIGPY_GETITERFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_getiterfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_getiterfunc_closure(wrapper, a); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_getiterfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -#define SWIGPY_BINARYFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_binaryfunc_closure(PyObject *a, PyObject *b) { \ - return SwigPyBuiltin_binaryfunc_closure(wrapper, a, b); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_binaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { - PyObject *tuple, *result; - tuple = PyTuple_New(1); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -typedef ternaryfunc ternarycallfunc; - -#define SWIGPY_TERNARYFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ternaryfunc_closure(PyObject *a, PyObject *b, PyObject *c) { \ - return SwigPyBuiltin_ternaryfunc_closure(wrapper, a, b, c); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ternaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { - PyObject *tuple, *result; - tuple = PyTuple_New(2); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_TERNARYCALLFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ternarycallfunc_closure(PyObject *a, PyObject *b, PyObject *c) { \ - return SwigPyBuiltin_ternarycallfunc_closure(wrapper, a, b, c); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ternarycallfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { - (void) c; - return wrapper(a, b); -} - -#define SWIGPY_LENFUNC_CLOSURE(wrapper) \ -SWIGINTERN Py_ssize_t \ -wrapper##_lenfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_lenfunc_closure(wrapper, a); \ -} -SWIGINTERN Py_ssize_t -SwigPyBuiltin_lenfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - PyObject *resultobj; - Py_ssize_t result; - resultobj = wrapper(a, NULL); - result = PyNumber_AsSsize_t(resultobj, NULL); - Py_DECREF(resultobj); - return result; -} - -#define SWIGPY_SSIZESSIZEARGFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ssizessizeargfunc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c) { \ - return SwigPyBuiltin_ssizessizeargfunc_closure(wrapper, a, b, c); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ssizessizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c) { - PyObject *tuple, *result; - tuple = PyTuple_New(2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c)); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_SSIZESSIZEOBJARGPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_ssizessizeobjargproc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) { \ - return SwigPyBuiltin_ssizessizeobjargproc_closure(wrapper, a, b, c, d); \ -} -SWIGINTERN int -SwigPyBuiltin_ssizessizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) { - PyObject *tuple, *resultobj; - int result; - tuple = PyTuple_New(d ? 3 : 2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c)); - if (d) { - Py_INCREF(d); - PyTuple_SET_ITEM(tuple, 2, d); - } - resultobj = wrapper(a, tuple); - result = resultobj ? 0 : -1; - Py_DECREF(tuple); - Py_XDECREF(resultobj); - return result; -} - -#define SWIGPY_SSIZEARGFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) { \ - return SwigPyBuiltin_funpack_ssizeargfunc_closure(wrapper, a, b); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_funpack_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) { - PyObject *tuple, *result; - tuple = PyTuple_New(1); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_FUNPACK_SSIZEARGFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) { \ - return SwigPyBuiltin_ssizeargfunc_closure(wrapper, a, b); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) { - PyObject *arg, *result; - arg = _PyLong_FromSsize_t(b); - result = wrapper(a, arg); - Py_DECREF(arg); - return result; -} - -#define SWIGPY_SSIZEOBJARGPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_ssizeobjargproc_closure(PyObject *a, Py_ssize_t b, PyObject *c) { \ - return SwigPyBuiltin_ssizeobjargproc_closure(wrapper, a, b, c); \ -} -SWIGINTERN int -SwigPyBuiltin_ssizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, PyObject *c) { - PyObject *tuple, *resultobj; - int result; - tuple = PyTuple_New(2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); - resultobj = wrapper(a, tuple); - result = resultobj ? 0 : -1; - Py_XDECREF(resultobj); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_OBJOBJPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_objobjproc_closure(PyObject *a, PyObject *b) { \ - return SwigPyBuiltin_objobjproc_closure(wrapper, a, b); \ -} -SWIGINTERN int -SwigPyBuiltin_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { - int result; - PyObject *pyresult; - PyObject *tuple; - tuple = PyTuple_New(1); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - pyresult = wrapper(a, tuple); - result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1; - Py_XDECREF(pyresult); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_FUNPACK_OBJOBJPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_objobjproc_closure(PyObject *a, PyObject *b) { \ - return SwigPyBuiltin_funpack_objobjproc_closure(wrapper, a, b); \ -} -SWIGINTERN int -SwigPyBuiltin_funpack_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { - int result; - PyObject *pyresult; - pyresult = wrapper(a, b); - result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1; - Py_XDECREF(pyresult); - return result; -} - -#define SWIGPY_OBJOBJARGPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_objobjargproc_closure(PyObject *a, PyObject *b, PyObject *c) { \ - return SwigPyBuiltin_objobjargproc_closure(wrapper, a, b, c); \ -} -SWIGINTERN int -SwigPyBuiltin_objobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { - PyObject *tuple, *resultobj; - int result; - tuple = PyTuple_New(c ? 2 : 1); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - if (c) { - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); - } - resultobj = wrapper(a, tuple); - result = resultobj ? 0 : -1; - Py_XDECREF(resultobj); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_REPRFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_reprfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_reprfunc_closure(wrapper, a); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_reprfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -#define SWIGPY_HASHFUNC_CLOSURE(wrapper) \ -SWIGINTERN Py_hash_t \ -wrapper##_hashfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_hashfunc_closure(wrapper, a); \ -} -SWIGINTERN Py_hash_t -SwigPyBuiltin_hashfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - PyObject *pyresult; - Py_hash_t result; - pyresult = wrapper(a, NULL); - if (!pyresult) - return -1; - result = SWIG_PyNumber_AsPyHash(pyresult); - Py_DECREF(pyresult); - return result; -} - -#define SWIGPY_ITERNEXTFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_iternextfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_iternextfunc_closure(wrapper, a);\ -} -SWIGINTERN PyObject * -SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -/* End of callback function macros for use in PyTypeObject */ - -#ifdef __cplusplus -} -#endif - diff --git a/mac/bin/swig/share/swig/4.1.0/python/carrays.i b/mac/bin/swig/share/swig/4.1.0/python/carrays.i deleted file mode 100755 index 74b2be9c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/carrays.i +++ /dev/null @@ -1,13 +0,0 @@ -%define %array_class(TYPE,NAME) -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "sq_item", functype="ssizeargfunc") NAME::__getitem__; - %feature("python:slot", "sq_ass_item", functype="ssizeobjargproc") NAME::__setitem__; -#endif -%array_class_wrap(TYPE,NAME,__getitem__,__setitem__) -%enddef - -%include - - - - diff --git a/mac/bin/swig/share/swig/4.1.0/python/ccomplex.i b/mac/bin/swig/share/swig/4.1.0/python/ccomplex.i deleted file mode 100755 index b99f96a4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/ccomplex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ccomplex.i - * - * C complex typemaps - * ISO C99: 7.3 Complex arithmetic - * ----------------------------------------------------------------------------- */ - - -%include - -%{ -#include -%} - -#define complex _Complex - -/* C complex constructor */ -#define CCplxConst(r, i) ((r) + I*(i)) - -%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); - -/* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/mac/bin/swig/share/swig/4.1.0/python/cdata.i b/mac/bin/swig/share/swig/4.1.0/python/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/cmalloc.i b/mac/bin/swig/share/swig/4.1.0/python/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/complex.i b/mac/bin/swig/share/swig/4.1.0/python/complex.i deleted file mode 100755 index 4c3b3c5e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/complex.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __cplusplus -%include -#else -%include -#endif - diff --git a/mac/bin/swig/share/swig/4.1.0/python/cpointer.i b/mac/bin/swig/share/swig/4.1.0/python/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/cstring.i b/mac/bin/swig/share/swig/4.1.0/python/cstring.i deleted file mode 100755 index ede9c596..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/cwstring.i b/mac/bin/swig/share/swig/4.1.0/python/cwstring.i deleted file mode 100755 index 2824d9c7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/cwstring.i +++ /dev/null @@ -1,3 +0,0 @@ -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/python/director.swg b/mac/bin/swig/share/swig/4.1.0/python/director.swg deleted file mode 100755 index 9694c623..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/director.swg +++ /dev/null @@ -1,389 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Python proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DIRECTOR_PYTHON_HEADER_ -#define SWIG_DIRECTOR_PYTHON_HEADER_ - -#include -#include -#include -#include -#include - - -/* - Use -DSWIG_PYTHON_DIRECTOR_NO_VTABLE if you don't want to generate a 'virtual - table', and avoid multiple GetAttr calls to retrieve the python - methods. -*/ - -#ifndef SWIG_PYTHON_DIRECTOR_NO_VTABLE -#ifndef SWIG_PYTHON_DIRECTOR_VTABLE -#define SWIG_PYTHON_DIRECTOR_VTABLE -#endif -#endif - - - -/* - Use -DSWIG_DIRECTOR_NO_UEH if you prefer to avoid the use of the - Undefined Exception Handler provided by swig. -*/ -#ifndef SWIG_DIRECTOR_NO_UEH -#ifndef SWIG_DIRECTOR_UEH -#define SWIG_DIRECTOR_UEH -#endif -#endif - - -/* - Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the - native C++ RTTI and dynamic_cast<>. But be aware that directors - could stop working when using this option. -*/ -#ifdef SWIG_DIRECTOR_NORTTI -/* - When we don't use the native C++ RTTI, we implement a minimal one - only for Directors. -*/ -# ifndef SWIG_DIRECTOR_RTDIR -# define SWIG_DIRECTOR_RTDIR - -namespace Swig { - class Director; - SWIGINTERN std::map& get_rtdir_map() { - static std::map rtdir_map; - return rtdir_map; - } - - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *rtdir) { - get_rtdir_map()[vptr] = rtdir; - } - - SWIGINTERNINLINE Director *get_rtdir(void *vptr) { - std::map::const_iterator pos = get_rtdir_map().find(vptr); - Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0; - return rtdir; - } -} -# endif /* SWIG_DIRECTOR_RTDIR */ - -# define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast(ARG)) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast(ARG1), ARG2) - -#else - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) - -#endif /* SWIG_DIRECTOR_NORTTI */ - -extern "C" { - struct swig_type_info; -} - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() {} - - virtual int get_own() const { - return 0; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem * operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(int own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - int get_own() const { - return _own; - } - - private: - int _own; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - template - struct GCArray_T : GCItem { - GCArray_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCArray_T() { - delete[] _ptr; - } - - private: - Type *_ptr; - }; - - /* base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - public: - DirectorException(PyObject *error, const char *hdr ="", const char *msg ="") : swig_msg(hdr) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (msg[0]) { - swig_msg += " "; - swig_msg += msg; - } - if (!PyErr_Occurred()) { - PyErr_SetString(error, what()); - } - SWIG_PYTHON_THREAD_END_BLOCK; - } - - virtual ~DirectorException() throw() { - } - - /* Deprecated, use what() instead */ - const char *getMessage() const { - return what(); - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - - static void raise(PyObject *error, const char *msg) { - throw DirectorException(error, msg); - } - - static void raise(const char *msg) { - raise(PyExc_RuntimeError, msg); - } - }; - - /* type mismatch in the return value from a python method call */ - class DirectorTypeMismatchException : public DirectorException { - public: - DirectorTypeMismatchException(PyObject *error, const char *msg="") - : DirectorException(error, "SWIG director type mismatch", msg) { - } - - DirectorTypeMismatchException(const char *msg="") - : DirectorException(PyExc_TypeError, "SWIG director type mismatch", msg) { - } - - static void raise(PyObject *error, const char *msg) { - throw DirectorTypeMismatchException(error, msg); - } - - static void raise(const char *msg) { - throw DirectorTypeMismatchException(msg); - } - }; - - /* any python exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException { - public: - DirectorMethodException(const char *msg = "") - : DirectorException(PyExc_RuntimeError, "SWIG director method error.", msg) { - } - - static void raise(const char *msg) { - throw DirectorMethodException(msg); - } - }; - - /* attempt to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg = "") - : DirectorException(PyExc_RuntimeError, "SWIG director pure virtual method called", msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - -#if defined(SWIG_PYTHON_THREADS) -/* __THREAD__ is the old macro to activate some thread support */ -# if !defined(__THREAD__) -# define __THREAD__ 1 -# endif -#endif - -#ifdef __THREAD__ -# include "pythread.h" - class Guard { - PyThread_type_lock &mutex_; - - public: - Guard(PyThread_type_lock & mutex) : mutex_(mutex) { - PyThread_acquire_lock(mutex_, WAIT_LOCK); - } - - ~Guard() { - PyThread_release_lock(mutex_); - } - }; -# define SWIG_GUARD(mutex) Guard _guard(mutex) -#else -# define SWIG_GUARD(mutex) -#endif - - /* director base class */ - class Director { - private: - /* pointer to the wrapped python object */ - PyObject *swig_self; - /* flag indicating whether the object is owned by python or c++ */ - mutable bool swig_disown_flag; - - /* decrement the reference count of the wrapped python object */ - void swig_decref() const { - if (swig_disown_flag) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_DECREF(swig_self); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - public: - /* wrap a python object. */ - Director(PyObject *self) : swig_self(self), swig_disown_flag(false) { - } - - /* discard our reference at destruction */ - virtual ~Director() { - swig_decref(); - } - - /* return a pointer to the wrapped python object */ - PyObject *swig_get_self() const { - return swig_self; - } - - /* acquire ownership of the wrapped python object (the sense of "disown" is from python) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag=true; - swig_incref(); - } - } - - /* increase the reference count of the wrapped python object */ - void swig_incref() const { - if (swig_disown_flag) { - Py_INCREF(swig_self); - } - } - - /* methods to implement pseudo protected director members */ - virtual bool swig_get_inner(const char * /* swig_protected_method_name */) const { - return true; - } - - virtual void swig_set_inner(const char * /* swig_protected_method_name */, bool /* swig_val */) const { - } - - /* ownership management */ - private: - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; -#ifdef __THREAD__ - static PyThread_type_lock swig_mutex_own; -#endif - - public: - template - void swig_acquire_ownership_array(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCArray_T(vptr); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, int own) const { - if (vptr && own) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_Object(own); - } - } - - int swig_release_ownership(void *vptr) const { - int own = 0; - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_ownership_map::iterator iter = swig_owner.find(vptr); - if (iter != swig_owner.end()) { - own = iter->second->get_own(); - swig_owner.erase(iter); - } - } - return own; - } - - template - static PyObject *swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args)) { - SwigPyObject *sobj = (SwigPyObject *)pyobj; - sobj->own = 0; - Director *d = SWIG_DIRECTOR_CAST(reinterpret_cast(sobj->ptr)); - if (d) - d->swig_disown(); - return PyWeakref_NewProxy(pyobj, NULL); - } - }; - -#ifdef __THREAD__ - PyThread_type_lock Director::swig_mutex_own = PyThread_allocate_lock(); -#endif -} - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/python/embed.i b/mac/bin/swig/share/swig/4.1.0/python/embed.i deleted file mode 100755 index 3fc2d14e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/embed.i +++ /dev/null @@ -1,120 +0,0 @@ -// -// embed.i -// SWIG file embedding the Python interpreter in something else. -// This file is deprecated and no longer actively maintained, but it still -// seems to work with Python 2.7. Status with Python 3 is unknown. -// -// This file makes it possible to extend Python and all of its -// built-in functions without having to hack its setup script. -// - - -#ifdef AUTODOC -%subsection "embed.i" -%text %{ -This module provides support for building a new version of the -Python executable. This will be necessary on systems that do -not support shared libraries and may be necessary with C++ -extensions. This file contains everything you need to build -a new version of Python from include files and libraries normally -installed with the Python language. - -This module will automatically grab all of the Python modules -present in your current Python executable (including any special -purpose modules you have enabled such as Tkinter). Thus, you -may need to provide additional link libraries when compiling. - -As far as I know, this module is C++ safe. -%} -#endif - -%wrapper %{ -#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) -#define PY_SSIZE_T_CLEAN -#endif - -#if __GNUC__ >= 7 -#pragma GCC diagnostic push -#if defined(__cplusplus) && __cplusplus >=201703L -#pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */ -#endif -#endif - -#include - -#if __GNUC__ >= 7 -#pragma GCC diagnostic pop -#endif - -#ifdef __cplusplus -extern "C" -#endif -void SWIG_init(); /* Forward reference */ - -#define _PyImport_Inittab swig_inittab - -/* Grab Python's inittab[] structure */ - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#undef _PyImport_Inittab - -/* Now define our own version of it. - Hopefully someone does not have more than 1000 built-in modules */ - -struct _inittab SWIG_Import_Inittab[1000]; - -static int swig_num_modules = 0; - -/* Function for adding modules to Python */ - -static void swig_add_module(char *name, void (*initfunc)()) { - SWIG_Import_Inittab[swig_num_modules].name = name; - SWIG_Import_Inittab[swig_num_modules].initfunc = initfunc; - swig_num_modules++; - SWIG_Import_Inittab[swig_num_modules].name = (char *) 0; - SWIG_Import_Inittab[swig_num_modules].initfunc = 0; -} - -/* Function to add all of Python's built-in modules to our interpreter */ - -static void swig_add_builtin() { - int i = 0; - while (swig_inittab[i].name) { - swig_add_module(swig_inittab[i].name, swig_inittab[i].initfunc); - i++; - } -#ifdef SWIGMODINIT - SWIGMODINIT -#endif - /* Add SWIG builtin function */ - swig_add_module(SWIG_name, SWIG_init); -} - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -extern int Py_Main(int, char **); - -#ifdef __cplusplus -} -#endif - -extern struct _inittab *PyImport_Inittab; - -int -main(int argc, char **argv) { - swig_add_builtin(); - PyImport_Inittab = SWIG_Import_Inittab; - return Py_Main(argc,argv); -} - -%} diff --git a/mac/bin/swig/share/swig/4.1.0/python/exception.i b/mac/bin/swig/share/swig/4.1.0/python/exception.i deleted file mode 100755 index bb0b15c9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/exception.i +++ /dev/null @@ -1,6 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) -} diff --git a/mac/bin/swig/share/swig/4.1.0/python/factory.i b/mac/bin/swig/share/swig/4.1.0/python/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/file.i b/mac/bin/swig/share/swig/4.1.0/python/file.i deleted file mode 100755 index 359c34d2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/file.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * file.i - * - * Typemaps for FILE* - * ----------------------------------------------------------------------------- */ - -%types(FILE *); - -/* defining basic methods */ -%fragment("SWIG_AsValFilePtr","header") { -SWIGINTERN int -SWIG_AsValFilePtr(PyObject *obj, FILE **val) { - static swig_type_info* desc = 0; - void *vptr = 0; - if (!desc) desc = SWIG_TypeQuery("FILE *"); - if ((SWIG_ConvertPtr(obj, &vptr, desc, 0)) == SWIG_OK) { - if (val) *val = (FILE *)vptr; - return SWIG_OK; - } -%#if PY_VERSION_HEX < 0x03000000 - if (PyFile_Check(obj)) { - if (val) *val = PyFile_AsFile(obj); - return SWIG_OK; - } -%#endif - return SWIG_TypeError; -} -} - - -%fragment("SWIG_AsFilePtr","header",fragment="SWIG_AsValFilePtr") { -SWIGINTERNINLINE FILE* -SWIG_AsFilePtr(PyObject *obj) { - FILE *val = 0; - SWIG_AsValFilePtr(obj, &val); - return val; -} -} - -/* defining the typemaps */ -%typemaps_asval(%checkcode(POINTER), SWIG_AsValFilePtr, "SWIG_AsValFilePtr", FILE*); diff --git a/mac/bin/swig/share/swig/4.1.0/python/implicit.i b/mac/bin/swig/share/swig/4.1.0/python/implicit.i deleted file mode 100755 index 152c2b05..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/implicit.i +++ /dev/null @@ -1,7 +0,0 @@ -%include -%include - -#warning "This file provides the %implicit directive, which is an old and fragile" -#warning "way to implement the C++ implicit conversion mechanism." -#warning "Try using the more robust '%implicitconv Type;' directive instead." - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyabc.i b/mac/bin/swig/share/swig/4.1.0/python/pyabc.i deleted file mode 100755 index cae1e703..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyabc.i +++ /dev/null @@ -1,14 +0,0 @@ -%define %pythonabc(Type, Abc) - %feature("python:abc", Abc) Type; -%enddef -%pythoncode %{if _swig_python_version_info[0:2] >= (3, 3): - import collections.abc -else: - import collections -%} -%pythonabc(std::vector, "collections.abc.MutableSequence if _swig_python_version_info >= (3, 3) else collections.MutableSequence"); -%pythonabc(std::list, "collections.abc.MutableSequence if _swig_python_version_info >= (3, 3) else collections.MutableSequence"); -%pythonabc(std::map, "collections.abc.MutableMapping if _swig_python_version_info >= (3, 3) else collections.MutableMapping"); -%pythonabc(std::multimap, "collections.abc.MutableMapping if _swig_python_version_info >= (3, 3) else collections.MutableMapping"); -%pythonabc(std::set, "collections.abc.MutableSet if _swig_python_version_info >= (3, 3) else collections.MutableSet"); -%pythonabc(std::multiset, "collections.abc.MutableSet if _swig_python_version_info >= (3, 3) else collections.MutableSet"); diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyapi.swg b/mac/bin/swig/share/swig/4.1.0/python/pyapi.swg deleted file mode 100755 index 19e6979b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyapi.swg +++ /dev/null @@ -1,30 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -#ifdef __cplusplus -} -#endif - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pybackward.swg b/mac/bin/swig/share/swig/4.1.0/python/pybackward.swg deleted file mode 100755 index 8305fc78..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pybackward.swg +++ /dev/null @@ -1,45 +0,0 @@ -/* - adding backward compatibility macros -*/ - -#define SWIG_arg(x...) %arg(x) -#define SWIG_Mangle(x...) %mangle(x) - -#define SWIG_As_frag(Type...) %fragment_name(As, Type) -#define SWIG_As_name(Type...) %symbol_name(As, Type) -#define SWIG_As(Type...) SWIG_As_name(Type) SWIG_AS_CALL_ARGS - -#define SWIG_Check_frag(Type...) %fragment_name(Check, Type) -#define SWIG_Check_name(Type...) %symbol_name(Check, Type) -#define SWIG_Check(Type...) SWIG_Check_name(Type) SWIG_AS_CALL_ARGS - -%define %ascheck_methods(Code, Type...) -%fragment(SWIG_As_frag(Type),"header", fragment=SWIG_AsVal_frag(Type)) { -SWIGINTERNINLINE Type -SWIG_As(Type)(PyObject* obj) -{ - Type v; - int res = SWIG_AsVal(Type)(obj, &v); - if (!SWIG_IsOK(res)) { - /* - this is needed to make valgrind/purify happier. - */ - memset((void*)&v, 0, sizeof(Type)); - SWIG_Error(res, ""); - } - return v; -} -} - -%fragment(SWIG_Check_frag(Type),"header",fragment=SWIG_AsVal_frag(Type)) { -SWIGINTERNINLINE int -SWIG_Check(Type)(PyObject* obj) -{ - int res = SWIG_AsVal(Type)(obj, (Type*)0); - return SWIG_IsOK(res); -} -} -%enddef - -%apply_checkctypes(%ascheck_methods) - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pybuffer.i b/mac/bin/swig/share/swig/4.1.0/python/pybuffer.i deleted file mode 100755 index 2fdaa6d6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pybuffer.i +++ /dev/null @@ -1,119 +0,0 @@ -/* Implementing buffer protocol typemaps */ - -/* %pybuffer_mutable_binary(TYPEMAP, SIZE) - * - * Macro for functions accept mutable buffer pointer with a size. - * This can be used for both input and output. For example: - * - * %pybuffer_mutable_binary(char *buff, int size); - * void foo(char *buff, int size) { - * for(int i=0; i; - - or as a member variable: - - struct A { - SwigPtr_PyObject obj; - A(PyObject *o) : _obj(o) { - } - }; - - or as a input/output value - - SwigPtr_PyObject func(SwigPtr_PyObject obj) { - SwigPtr_PyObject out = PyString_FromFormat("hello %s", PyObject_AsString(obj)); - Py_DECREF(out); - return out; - } - - just remember to pair the object creation with the proper DECREF, - the same as with plain PyObject *ptr, since SwigPtr_PyObject always add - one reference at construction. - - SwigPtr_PyObject is 'visible' at the wrapped side, so you can do: - - - %template(pyvector) std::vector; - - and all the proper typemaps will be used. - -*/ - -namespace swig { - %ignore SwigPtr_PyObject; - struct SwigPtr_PyObject {}; - %apply PyObject * {SwigPtr_PyObject}; - %apply PyObject * const& {SwigPtr_PyObject const&}; - - %typemap(typecheck,precedence=SWIG_TYPECHECK_SWIGOBJECT,noblock=1) SwigPtr_PyObject const& "$1 = ($input != 0);" - - - /* For output */ - %typemap(out,noblock=1) SwigPtr_PyObject { - $result = (PyObject *)$1; - Py_INCREF($result); - } - - %typemap(out,noblock=1) SwigPtr_PyObject const & { - $result = (PyObject *)*$1; - Py_INCREF($result); - } - -} - -%{ -namespace swig { - class SwigPtr_PyObject { - protected: - PyObject *_obj; - - public: - SwigPtr_PyObject() :_obj(0) - { - } - - SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) - { - if (initial_ref) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(item._obj); - Py_XDECREF(_obj); - _obj = item._obj; - SWIG_PYTHON_THREAD_END_BLOCK; - return *this; - } - - ~SwigPtr_PyObject() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XDECREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - operator PyObject *() const - { - return _obj; - } - - PyObject *operator->() const - { - return _obj; - } - }; -} -%} - -/* - SwigVar_PyObject is used to manage 'in the scope' PyObject * variables, - as in - - int func () { - SwigVar_PyObject obj = PyString_FromString("hello"); - } - - ie, 'obj' is created and destructed in the same scope from - a python object that carries at least one reference value. - - SwigVar_PyObject just take care of applying the proper Py_DECREF. - - Hence, this class is purely internal and not visible at the wrapped side. - */ -namespace swig { - %ignore SwigVar_PyObject; - struct SwigVar_PyObject {}; - %apply PyObject * {SwigVar_PyObject}; - %apply PyObject * const& {SwigVar_PyObject const&}; -} - -%{ -namespace swig { - struct SwigVar_PyObject : SwigPtr_PyObject { - SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - - SwigVar_PyObject & operator = (PyObject* obj) - { - Py_XDECREF(_obj); - _obj = obj; - return *this; - } - }; -} -%} - - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/python/pycomplex.swg b/mac/bin/swig/share/swig/4.1.0/python/pycomplex.swg deleted file mode 100755 index 28c96361..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pycomplex.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* - Defines the As/From converters for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header") -{ -SWIGINTERNINLINE PyObject* -SWIG_From(Type)(%ifcplusplus(const Type&, Type) c) -{ - return PyComplex_FromDoubles(Real(c), Imag(c)); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ -SWIGINTERN int -SWIG_AsVal(Type) (PyObject *o, Type* val) -{ - if (PyComplex_Check(o)) { - if (val) *val = Constructor(PyComplex_RealAsDouble(o), PyComplex_ImagAsDouble(o)); - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { -SWIGINTERN int -SWIG_AsVal(Type)(PyObject *o, Type *val) -{ - if (PyComplex_Check(o)) { - double re = PyComplex_RealAsDouble(o); - double im = PyComplex_ImagAsDouble(o); - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0f); - return res; - } - } - return SWIG_TypeError; -} -} - -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) - - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pycontainer.swg b/mac/bin/swig/share/swig/4.1.0/python/pycontainer.swg deleted file mode 100755 index d6fdff08..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pycontainer.swg +++ /dev/null @@ -1,1082 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pycontainer.swg - * - * Python sequence <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Python, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -%{ -#include - -#if PY_VERSION_HEX >= 0x03020000 -# define SWIGPY_SLICEOBJECT PyObject -#else -# define SWIGPY_SLICEOBJECT PySliceObject -#endif -%} - - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - -%include - -/**** The PySequence C++ Wrap ***/ - -%fragment(""); - -%include - -%fragment("container_owner_attribute_init", "init") { - // thread safe initialization - swig::container_owner_attribute(); -} - -%fragment("reference_container_owner", "header", fragment="container_owner_attribute_init") { -namespace swig { - static PyObject* container_owner_attribute() { - static PyObject* attr = SWIG_Python_str_FromChar("__swig_container"); - return attr; - } - - template - struct container_owner { - // By default, do not add the back-reference (for value types) - // Specialization below will check the reference for pointer types. - static bool back_reference(PyObject* /*child*/, PyObject* /*owner*/) { - return false; - } - }; - - template <> - struct container_owner { - /* - * Call to add a back-reference to the owning object when returning a - * reference from a container. Will only set the reference if child - * is a SWIG wrapper object that does not own the pointer. - * - * returns whether the reference was set or not - */ - static bool back_reference(PyObject* child, PyObject* owner) { - SwigPyObject* swigThis = SWIG_Python_GetSwigThis(child); - if (swigThis && (swigThis->own & SWIG_POINTER_OWN) != SWIG_POINTER_OWN) { - return PyObject_SetAttr(child, container_owner_attribute(), owner) != -1; - } - return false; - } - }; -} -} - -%fragment(SWIG_Traits_frag(swig::SwigPtr_PyObject),"header",fragment="StdTraits") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "SwigPtr_PyObject"; } - }; - - template <> struct traits_from { - typedef SwigPtr_PyObject value_type; - static PyObject *from(const value_type& val) { - PyObject *obj = static_cast(val); - Py_XINCREF(obj); - return obj; - } - }; - - template <> - struct traits_check { - static bool check(SwigPtr_PyObject) { - return true; - } - }; - - template <> struct traits_asval { - typedef SwigPtr_PyObject value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} -} - -%fragment(SWIG_Traits_frag(swig::SwigVar_PyObject),"header",fragment="StdTraits") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "SwigVar_PyObject"; } - }; - - template <> struct traits_from { - typedef SwigVar_PyObject value_type; - static PyObject *from(const value_type& val) { - PyObject *obj = static_cast(val); - Py_XINCREF(obj); - return obj; - } - }; - - template <> - struct traits_check { - static bool check(SwigVar_PyObject) { - return true; - } - }; - - template <> struct traits_asval { - typedef SwigVar_PyObject value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} -} - -%fragment("SwigPySequence_Base","header",fragment="",fragment="StdTraits") -{ -%#include - -namespace std { - template <> - struct less - { - bool - operator()(PyObject * v, PyObject *w) const - { - bool res; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false; - /* This may fall into a case of inconsistent - eg. ObjA > ObjX > ObjB - but ObjA < ObjB - */ - if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) ) - { - /* Objects can't be compared, this mostly occurred in Python 3.0 */ - /* Compare their ptr directly for a workaround */ - res = (v < w); - PyErr_Clear(); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } - }; - - template <> - struct less - { - bool - operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const - { - return std::less()(v, w); - } - }; - - template <> - struct less - { - bool - operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const - { - return std::less()(v, w); - } - }; - -} - -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "PyObject *"; } - }; - - template <> struct traits_asval { - typedef PyObject * value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; - - template <> - struct traits_check { - static bool check(PyObject *) { - return true; - } - }; - - template <> struct traits_from { - typedef PyObject * value_type; - static PyObject *from(const value_type& val) { - Py_XINCREF(val); - return val; - } - }; - -} - -namespace swig { - template - inline size_t - check_index(Difference i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - throw std::out_of_range("index out of range"); - } - - template - void - slice_adjust(Difference i, Difference j, Py_ssize_t step, size_t size, Difference &ii, Difference &jj, bool insert = false) { - if (step == 0) { - throw std::invalid_argument("slice step cannot be zero"); - } else if (step > 0) { - // Required range: 0 <= i < size, 0 <= j < size, i <= j - if (i < 0) { - ii = 0; - } else if (i < (Difference)size) { - ii = i; - } else if (insert && (i >= (Difference)size)) { - ii = (Difference)size; - } - if (j < 0) { - jj = 0; - } else { - jj = (j < (Difference)size) ? j : (Difference)size; - } - if (jj < ii) - jj = ii; - } else { - // Required range: -1 <= i < size-1, -1 <= j < size-1, i >= j - if (i < -1) { - ii = -1; - } else if (i < (Difference) size) { - ii = i; - } else if (i >= (Difference)(size-1)) { - ii = (Difference)(size-1); - } - if (j < -1) { - jj = -1; - } else { - jj = (j < (Difference)size ) ? j : (Difference)(size-1); - } - if (ii < jj) - ii = jj; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline void - erase(Sequence* seq, const typename Sequence::iterator& position) { - seq->erase(position); - } - - template - struct traits_reserve { - static void reserve(Sequence & /*seq*/, typename Sequence::size_type /*n*/) { - // This should be specialized for types that support reserve - } - }; - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j, Py_ssize_t step) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj); - - if (step > 0) { - typename Sequence::const_iterator sb = self->begin(); - typename Sequence::const_iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - if (step == 1) { - return new Sequence(sb, se); - } else { - Sequence *sequence = new Sequence(); - swig::traits_reserve::reserve(*sequence, (jj - ii + step - 1) / step); - typename Sequence::const_iterator it = sb; - while (it!=se) { - sequence->push_back(*it); - for (Py_ssize_t c=0; c::reserve(*sequence, (ii - jj - step - 1) / -step); - typename Sequence::const_reverse_iterator sb = self->rbegin(); - typename Sequence::const_reverse_iterator se = self->rbegin(); - std::advance(sb,size-ii-1); - std::advance(se,size-jj-1); - typename Sequence::const_reverse_iterator it = sb; - while (it!=se) { - sequence->push_back(*it); - for (Py_ssize_t c=0; c<-step && it!=se; ++c) - it++; - } - return sequence; - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - if (step > 0) { - if (step == 1) { - size_t ssize = jj - ii; - if (ssize <= is.size()) { - // expanding/staying the same size - swig::traits_reserve::reserve(*self, self->size() - ssize + is.size()); - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator isit = is.begin(); - std::advance(sb,ii); - std::advance(isit, jj - ii); - self->insert(std::copy(is.begin(), isit, sb), isit, is.end()); - } else { - // shrinking - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - sb = self->begin(); - std::advance(sb,ii); - self->insert(sb, is.begin(), is.end()); - } - } else { - size_t replacecount = (jj - ii + step - 1) / step; - if (is.size() != replacecount) { - char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); - throw std::invalid_argument(msg); - } - typename Sequence::const_iterator isit = is.begin(); - typename Sequence::iterator it = self->begin(); - std::advance(it,ii); - for (size_t rc=0; rcend(); ++rc) { - *it++ = *isit++; - for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) - it++; - } - } - } else { - size_t replacecount = (ii - jj - step - 1) / -step; - if (is.size() != replacecount) { - char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); - throw std::invalid_argument(msg); - } - typename Sequence::const_iterator isit = is.begin(); - typename Sequence::reverse_iterator it = self->rbegin(); - std::advance(it,size-ii-1); - for (size_t rc=0; rcrend(); ++rc) { - *it++ = *isit++; - for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) - it++; - } - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j, Py_ssize_t step) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - if (step > 0) { - typename Sequence::iterator sb = self->begin(); - std::advance(sb,ii); - if (step == 1) { - typename Sequence::iterator se = self->begin(); - std::advance(se,jj); - self->erase(sb,se); - } else { - typename Sequence::iterator it = sb; - size_t delcount = (jj - ii + step - 1) / step; - while (delcount) { - it = self->erase(it); - for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) - it++; - delcount--; - } - } - } else { - typename Sequence::reverse_iterator sb = self->rbegin(); - std::advance(sb,size-ii-1); - typename Sequence::reverse_iterator it = sb; - size_t delcount = (ii - jj - step - 1) / -step; - while (delcount) { - it = typename Sequence::reverse_iterator(self->erase((++it).base())); - for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) - it++; - delcount--; - } - } - } -} -} - -%fragment("SwigPySequence_Cont","header", - fragment="StdTraits", - fragment="SwigPySequence_Base", - fragment="SwigPyIterator_T") -{ -namespace swig -{ - template - struct SwigPySequence_Ref - { - SwigPySequence_Ref(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index); - try { - return swig::as(item); - } catch (const std::invalid_argument& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", (int)_index); - if (!PyErr_Occurred()) { - ::%type_error(swig::type_name()); - } - SWIG_Python_AddErrorMsg(msg); - SWIG_Python_AddErrorMsg(e.what()); - throw; - } - } - - SwigPySequence_Ref& operator=(const T& v) - { - PySequence_SetItem(_seq, _index, swig::from(v)); - return *this; - } - - private: - PyObject* _seq; - Py_ssize_t _index; - }; - - template - struct SwigPySequence_ArrowProxy - { - SwigPySequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct SwigPySequence_InputIterator - { - typedef SwigPySequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - - SwigPySequence_InputIterator() - { - } - - SwigPySequence_InputIterator(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - SwigPySequence_ArrowProxy - operator->() const { - return SwigPySequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index) && (_seq == ri._seq); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - PyObject* _seq; - difference_type _index; - }; - - // STL container wrapper around a Python sequence - template - struct SwigPySequence_Cont - { - typedef SwigPySequence_Ref reference; - typedef const SwigPySequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - typedef size_t size_type; - typedef const pointer const_pointer; - typedef SwigPySequence_InputIterator iterator; - typedef SwigPySequence_InputIterator const_iterator; - - SwigPySequence_Cont(PyObject* seq) : _seq(0) - { - if (!PySequence_Check(seq)) { - throw std::invalid_argument("a sequence is expected"); - } - _seq = seq; - Py_INCREF(_seq); - } - - ~SwigPySequence_Cont() - { - Py_XDECREF(_seq); - } - - size_type size() const - { - return static_cast(PySequence_Size(_seq)); - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - Py_ssize_t s = size(); - for (Py_ssize_t i = 0; i < s; ++i) { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i); - if (!swig::check(item)) - return false; - } - return true; - } - - private: - PyObject* _seq; - }; - -} -} - -%define %swig_sequence_iterator(Sequence...) - %swig_sequence_iterator_with_making_function(swig::make_output_iterator,Sequence...) -%enddef - -%define %swig_sequence_forward_iterator(Sequence...) - %swig_sequence_iterator_with_making_function(swig::make_output_forward_iterator,Sequence...) -%enddef - -%define %swig_sequence_iterator_with_making_function(Make_output_iterator,Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - class iterator; - class reverse_iterator; - class const_iterator; - class const_reverse_iterator; - - %typemap(out,noblock=1,fragment="SwigPySequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - $result = SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &)), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); - } - %typemap(out,noblock=1,fragment="SwigPySequence_Cont") - std::pair, std::pair { - $result = PyTuple_New(2); - PyTuple_SetItem($result,0,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).first), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); - PyTuple_SetItem($result,1,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).second), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); - } - - %fragment("SwigPyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="SwigPySequence_Cont") {} - - %typemap(out,noblock=1,fragment="SwigPyPairBoolOutputIterator") - std::pair, std::pair { - $result = PyTuple_New(2); - PyTuple_SetItem($result,0,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).first), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); - PyTuple_SetItem($result,1,SWIG_From(bool)(%static_cast($1,const $type &).second)); - } - - %typemap(in,noblock=1,fragment="SwigPySequence_Cont") - iterator(swig::SwigPyIterator *iter = 0, int res), - reverse_iterator(swig::SwigPyIterator *iter = 0, int res), - const_iterator(swig::SwigPyIterator *iter = 0, int res), - const_reverse_iterator(swig::SwigPyIterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::SwigPyIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="SwigPySequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - swig::SwigPyIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("SwigPySequence_Cont"); - - %newobject iterator(PyObject **PYTHON_SELF); - %extend { - swig::SwigPyIterator* iterator(PyObject **PYTHON_SELF) { - return Make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "tp_iter", functype="getiterfunc") iterator; -#else - %pythoncode %{def __iter__(self): - return self.iterator()%} -#endif - } - -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - - -/**** The python container methods ****/ - -%define %swig_container_methods(Container...) - -/* deprecated in Python 2 */ -#if 1 - %newobject __getslice__; -#endif - %newobject __getitem__(SWIGPY_SLICEOBJECT *slice); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "nb_nonzero", functype="inquiry") __nonzero__; - %feature("python:slot", "sq_length", functype="lenfunc") __len__; -#endif // SWIGPYTHON_BUILTIN - - %extend { - bool __nonzero__() const { - return !(self->empty()); - } - - /* Alias for Python 3 compatibility */ - bool __bool__() const { - return !(self->empty()); - } - - size_type __len__() const { - return self->size(); - } - - // Although __getitem__, front, back actually use a const value_type& return type, the typemaps below - // use non-const so that they can be easily overridden by users if necessary. - %typemap(ret, fragment="reference_container_owner", noblock=1) value_type& __getitem__, value_type& front, value_type& back { - (void)swig::container_owner::category>::back_reference($result, $self); - } - } -%enddef - - - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - - %fragment("SwigPySequence_Base"); - -#if defined(SWIGPYTHON_BUILTIN) - //%feature("python:slot", "sq_item", functype="ssizeargfunc") __getitem__; - //%feature("python:slot", "sq_slice", functype="ssizessizeargfunc") __getslice__; - //%feature("python:slot", "sq_ass_item", functype="ssizeobjargproc") __setitem__; - //%feature("python:slot", "sq_ass_slice", functype="ssizessizeobjargproc") __setslice__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif // SWIGPYTHON_BUILTIN - - %extend { - /* typemap for slice object support */ - %typemap(in) SWIGPY_SLICEOBJECT* { - if (!PySlice_Check($input)) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - $1 = (SWIGPY_SLICEOBJECT *) $input; - } - %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) SWIGPY_SLICEOBJECT* { - $1 = PySlice_Check($input); - } - -/* deprecated in Python 2 */ -#if 1 - Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range, std::invalid_argument) { - return swig::getslice(self, i, j, 1); - } - - void __setslice__(difference_type i, difference_type j) throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, 1, Sequence()); - } - - void __setslice__(difference_type i, difference_type j, const Sequence& v) throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, 1, v); - } - - void __delslice__(difference_type i, difference_type j) throw (std::out_of_range, std::invalid_argument) { - swig::delslice(self, i, j, 1); - } -#endif - - void __delitem__(difference_type i) throw (std::out_of_range, std::invalid_argument) { - swig::erase(self, swig::getpos(self, i)); - } - - /* Overloaded methods for Python 3 compatibility - * (Also useful in Python 2.x) - */ - Sequence* __getitem__(SWIGPY_SLICEOBJECT *slice) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return NULL; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - return swig::getslice(self, id, jd, step); - } - - void __setitem__(SWIGPY_SLICEOBJECT *slice, const Sequence& v) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - swig::setslice(self, id, jd, step, v); - } - - void __setitem__(SWIGPY_SLICEOBJECT *slice) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - swig::delslice(self, id, jd, step); - } - - void __delitem__(SWIGPY_SLICEOBJECT *slice) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - swig::delslice(self, id, jd, step); - } - - } -%enddef - -%define %swig_sequence_methods_non_resizable(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - const value_type& __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, const value_type& x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - -#if defined(SWIGPYTHON_BUILTIN) - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(difference_type i) throw (std::out_of_range, std::invalid_argument) { - swig::erase(self, swig::getpos(self, i)); - } -#endif - - } -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_non_resizable(%arg(Sequence)) - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - void append(const value_type& x) { - self->push_back(x); - } - } -%enddef - -%define %swig_sequence_methods_non_resizable_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - value_type __getitem__(difference_type i) throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, value_type x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - -#if defined(SWIGPYTHON_BUILTIN) - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(difference_type i) throw (std::out_of_range, std::invalid_argument) { - swig::erase(self, swig::getpos(self, i)); - } -#endif - } -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_non_resizable_val(%arg(Sequence)) - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - void append(value_type x) { - self->push_back(x); - } - } -%enddef - - - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="SwigPySequence_Cont") -{ -namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, Seq* seq) { - // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(PyObject *obj, sequence **seq) { - if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(::SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } - } else if (PySequence_Check(obj)) { - try { - SwigPySequence_Cont swigpyseq(obj); - if (seq) { - sequence *pseq = new sequence(); - assign(swigpyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return swigpyseq.check() ? SWIG_OK : SWIG_ERROR; - } - } catch (std::exception& e) { - if (seq) { - if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, e.what()); - } - } - return SWIG_ERROR; - } - } - return SWIG_ERROR; - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static PyObject *from(const sequence& seq) { -%#ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); - } -%#endif - size_type size = seq.size(); - if (size <= (size_type)INT_MAX) { - PyObject *obj = PyTuple_New((Py_ssize_t)size); - Py_ssize_t i = 0; - for (const_iterator it = seq.begin(); it != seq.end(); ++it, ++i) { - PyTuple_SetItem(obj,i,swig::from(*it)); - } - return obj; - } else { - PyErr_SetString(PyExc_OverflowError,"sequence size not valid in python"); - return NULL; - } - } - }; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/python/pydocs.swg b/mac/bin/swig/share/swig/4.1.0/python/pydocs.swg deleted file mode 100755 index 5a25423d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pydocs.swg +++ /dev/null @@ -1,45 +0,0 @@ - -// Documentation for use with the autodoc feature. - -#ifdef SWIG_DOC_DOXYGEN_STYLE -%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) enum SWIGTYPE "@param $1_name enum $1_type" - -%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 *OUTPUT, SWIGTYPE &OUTPUT "@param $1_name $1_type (output)" -#else -%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) enum SWIGTYPE "$1_name: enum $1_type" - -%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 *OUTPUT, SWIGTYPE &OUTPUT "$1_name: $1_type (output)" -#endif - - -// Types to use in Python documentation for the parameters of the given C++ type. -%typemap(doctype) bool "boolean" - -%define int_doctype_for_cppint_type(cppint_type) - %typemap(doctype) cppint_type, unsigned cppint_type "int" -%enddef -%formacro(int_doctype_for_cppint_type, short, int, long, long long) - -%typemap(doctype) size_t "int" - -%typemap(doctype) enum SWIGTYPE "int" - -%typemap(doctype) float, double, long double "float" - -%typemap(doctype) char*, std::string "string" - -%typemap(doctype) SWIGTYPE "$1_basetype" -%typemap(doctype) SWIGTYPE * "$typemap(doctype, $*1_ltype)" -%typemap(doctype) SWIGTYPE & "$typemap(doctype, $*1_ltype)" diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyerrors.swg b/mac/bin/swig/share/swig/4.1.0/python/pyerrors.swg deleted file mode 100755 index 10b694cd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyerrors.swg +++ /dev/null @@ -1,107 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - PyErr_Clear(); - Py_XINCREF(type); - if (tmp) - PyErr_Format(type, "%s %s", tmp, mesg); - else - PyErr_Format(type, "%s", mesg); - Py_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -SWIGRUNTIME int -SWIG_Python_TypeErrorOccurred(PyObject *obj) -{ - PyObject *error; - if (obj) - return 0; - error = PyErr_Occurred(); - return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); -} - -SWIGRUNTIME void -SWIG_Python_RaiseOrModifyTypeError(const char *message) -{ - if (SWIG_Python_TypeErrorOccurred(NULL)) { - /* Use existing TypeError to preserve stacktrace and enhance with given message */ - PyObject *newvalue; - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); -#if PY_VERSION_HEX >= 0x03000000 - newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); -#else - newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); -#endif - if (newvalue) { - Py_XDECREF(value); - PyErr_Restore(type, newvalue, traceback); - } else { - PyErr_Restore(type, value, traceback); - } - } else { - /* Raise TypeError using given message */ - PyErr_SetString(PyExc_TypeError, message); - } -} diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyfragments.swg b/mac/bin/swig/share/swig/4.1.0/python/pyfragments.swg deleted file mode 100755 index 535a45bd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'pyfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the default ones defined by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyhead.swg b/mac/bin/swig/share/swig/4.1.0/python/pyhead.swg deleted file mode 100755 index 6f37160b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyhead.swg +++ /dev/null @@ -1,75 +0,0 @@ -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) -#define PyString_Check(name) PyBytes_Check(name) -#define PyString_FromString(x) PyUnicode_FromString(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -#define PyString_AsString(str) PyBytes_AsString(str) -#define PyString_Size(str) PyBytes_Size(str) -#define PyString_InternFromString(key) PyUnicode_InternFromString(key) -#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE -#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) - -#endif - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#endif - - -SWIGINTERN char* -SWIG_Python_str_AsChar(PyObject *str) -{ -#if PY_VERSION_HEX >= 0x03030000 - return (char *)PyUnicode_AsUTF8(str); -#else - return PyString_AsString(str); -#endif -} - -/* Was useful for Python 3.0.x-3.2.x - now provided only for compatibility - * with any uses in user interface files. */ -#define SWIG_Python_str_DelForPy3(x) - - -SWIGINTERN PyObject* -SWIG_Python_str_FromChar(const char *c) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -/* SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user interface files check for it. */ -# define SWIGPY_USE_CAPSULE -#ifdef SWIGPYTHON_BUILTIN -# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule_builtin" SWIG_TYPE_TABLE_NAME -#else -# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule" SWIG_TYPE_TABLE_NAME -#endif -# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION "." SWIGPY_CAPSULE_ATTR_NAME) - -#if PY_VERSION_HEX < 0x03020000 -#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) -#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyinit.swg b/mac/bin/swig/share/swig/4.1.0/python/pyinit.swg deleted file mode 100755 index 6833b455..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyinit.swg +++ /dev/null @@ -1,325 +0,0 @@ -/* ------------------------------------------------------------ - * The start of the Python initialization function - * ------------------------------------------------------------ */ - -%insert(init) "swiginit.swg" - -#if defined(SWIGPYTHON_BUILTIN) -%fragment(""); // For offsetof -#endif - -#if defined SWIGPYTHON_FASTPROXY && !defined SWIGPYTHON_BUILTIN - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" { -#endif - -/* Method creation and docstring support functions */ - -SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); -SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); -SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); - -#ifdef __cplusplus -} -#endif -%} - -#endif - -%init %{ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - -/* Install Constants */ -SWIGINTERN void -SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } -} - -/* ----------------------------------------------------------------------------- - * Patch %callback methods' docstrings to hold the callback ptrs - * -----------------------------------------------------------------------------*/ - -SWIGINTERN void -SWIG_Python_FixMethods(PyMethodDef *methods, const swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) { - size_t i; - for (i = 0; methods[i].ml_name; ++i) { - const char *c = methods[i].ml_doc; - if (!c) continue; - c = strstr(c, "swig_ptr: "); - if (c) { - int j; - const swig_const_info *ci = 0; - const char *name = c + 10; - for (j = 0; const_table[j].type; ++j) { - if (strncmp(const_table[j].name, name, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - memcpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - memcpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } -} - -#ifdef __cplusplus -} -#endif - -%} - -#if defined SWIGPYTHON_FASTPROXY && !defined SWIGPYTHON_BUILTIN - -%init %{ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Method creation and docstring support functions - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Function to find the method definition with the correct docstring for the - * proxy module as opposed to the low-level API - * ----------------------------------------------------------------------------- */ - -SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) { - /* Find the function in the modified method table */ - size_t offset = 0; - int found = 0; - while (SwigMethods_proxydocs[offset].ml_meth != NULL) { - if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) { - found = 1; - break; - } - offset++; - } - /* Use the copy with the modified docstring if available */ - return found ? &SwigMethods_proxydocs[offset] : NULL; -} - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - -SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } -#if PY_VERSION_HEX >= 0x03000000 - return PyInstanceMethod_New(func); -#else - return PyMethod_New(func, NULL, NULL); -#endif -} - -/* ----------------------------------------------------------------------------- - * Wrapper of PyStaticMethod_New() - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - -SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } - return PyStaticMethod_New(func); -} - -#ifdef __cplusplus -} -#endif - -%} - -#endif - -%init %{ - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 - PyObject* -#else - void -#endif -SWIG_init(void) { - PyObject *m, *d, *md, *globals; - -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { - PyModuleDef_HEAD_INIT, - SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - -#if defined(SWIGPYTHON_BUILTIN) - static SwigPyClientData SwigPyObject_clientdata = {0, 0, 0, 0, 0, 0, 0}; - static PyGetSetDef this_getset_def = { - (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL - }; - static SwigPyGetSet thisown_getset_closure = { - SwigPyObject_own, - SwigPyObject_own - }; - static PyGetSetDef thisown_getset_def = { - (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure - }; - PyTypeObject *builtin_pytype; - int builtin_base_count; - swig_type_info *builtin_basetype; - PyObject *tuple; - PyGetSetDescrObject *static_getset; - PyTypeObject *metatype; - PyTypeObject *swigpyobject; - SwigPyClientData *cd; - PyObject *public_interface, *public_symbol; - PyObject *this_descr; - PyObject *thisown_descr; - PyObject *self = 0; - int i; - - (void)builtin_pytype; - (void)builtin_base_count; - (void)builtin_basetype; - (void)tuple; - (void)static_getset; - (void)self; - - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); - assert(metatype); -#endif - - (void)globals; - - /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ - SWIG_This(); - SWIG_Python_TypeCache(); - SwigPyPacked_type(); -#ifndef SWIGPYTHON_BUILTIN - SwigPyObject_type(); -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule(SWIG_name, SwigMethods); -#endif - - md = d = PyModule_GetDict(m); - (void)md; - - SWIG_InitializeModule(0); - -#ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - if (!cd) { - SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { - PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); -# if PY_VERSION_HEX >= 0x03000000 - return NULL; -# else - return; -# endif - } - - /* All objects have a 'this' attribute */ - this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); - (void)this_descr; - - /* All objects have a 'thisown' attribute */ - thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); - (void)thisown_descr; - - public_interface = PyList_New(0); - public_symbol = 0; - (void)public_symbol; - - PyDict_SetItemString(md, "__all__", public_interface); - Py_DECREF(public_interface); - for (i = 0; SwigMethods[i].ml_name != NULL; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); - for (i = 0; swig_const_table[i].name != 0; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); -#endif - - SWIG_InstallConstants(d,swig_const_table); -%} - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyiterators.swg b/mac/bin/swig/share/swig/4.1.0/python/pyiterators.swg deleted file mode 100755 index cb15e35c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyiterators.swg +++ /dev/null @@ -1,458 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pyiterators.swg - * - * Implement a python 'output' iterator for Python 2.2 or higher. - * - * Users can derive form the SwigPyIterator to implement their - * own iterators. As an example (real one since we use it for STL/STD - * containers), the template SwigPyIterator_T does the - * implementation for generic C++ iterators. - * ----------------------------------------------------------------------------- */ - -%include - -%fragment("SwigPyIterator","header",fragment="") { -namespace swig { - struct stop_iteration { - }; - - struct SwigPyIterator { - private: - SwigPtr_PyObject _seq; - - protected: - SwigPyIterator(PyObject *seq) : _seq(seq) - { - } - - public: - virtual ~SwigPyIterator() {} - - // Access iterator method, required by Python - virtual PyObject *value() const = 0; - - // Forward iterator method, required by Python - virtual SwigPyIterator *incr(size_t n = 1) = 0; - - // Backward iterator method, very common in C++, but not required in Python - virtual SwigPyIterator *decr(size_t /*n*/ = 1) - { - throw stop_iteration(); - } - - // Random access iterator methods, but not required in Python - virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual bool equal (const SwigPyIterator &/*x*/) const - { - throw std::invalid_argument("operation not supported"); - } - - // C++ common/needed methods - virtual SwigPyIterator *copy() const = 0; - - PyObject *next() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads - PyObject *obj = value(); - incr(); - SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads - return obj; - } - - /* Make an alias for Python 3.x */ - PyObject *__next__() - { - return next(); - } - - PyObject *previous() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads - decr(); - PyObject *obj = value(); - SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads - return obj; - } - - SwigPyIterator *advance(ptrdiff_t n) - { - return (n > 0) ? incr(n) : decr(-n); - } - - bool operator == (const SwigPyIterator& x) const - { - return equal(x); - } - - bool operator != (const SwigPyIterator& x) const - { - return ! operator==(x); - } - - SwigPyIterator& operator += (ptrdiff_t n) - { - return *advance(n); - } - - SwigPyIterator& operator -= (ptrdiff_t n) - { - return *advance(-n); - } - - SwigPyIterator* operator + (ptrdiff_t n) const - { - return copy()->advance(n); - } - - SwigPyIterator* operator - (ptrdiff_t n) const - { - return copy()->advance(-n); - } - - ptrdiff_t operator - (const SwigPyIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::SwigPyIterator *"); - init = 1; - } - return desc; - } - }; - -%#if defined(SWIGPYTHON_BUILTIN) - inline PyObject* make_output_iterator_builtin (PyObject *pyself) - { - Py_INCREF(pyself); - return pyself; - } -%#endif -} -} - -%fragment("SwigPyIterator_T","header",fragment="",fragment="SwigPyIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - template - class SwigPyIterator_T : public SwigPyIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef SwigPyIterator_T self_type; - - SwigPyIterator_T(out_iterator curr, PyObject *seq) - : SwigPyIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const SwigPyIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const SwigPyIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyForwardIteratorOpen_T : public SwigPyIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyForwardIteratorOpen_T self_type; - - SwigPyForwardIteratorOpen_T(out_iterator curr, PyObject *seq) - : SwigPyIterator_T(curr, seq) - { - } - - PyObject *value() const { - return from(static_cast(*(base::current))); - } - - SwigPyIterator *copy() const - { - return new self_type(*this); - } - - SwigPyIterator *incr(size_t n = 1) - { - while (n--) { - ++base::current; - } - return this; - } - - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyIteratorOpen_T : public SwigPyForwardIteratorOpen_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyIteratorOpen_T self_type; - - SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq) - : SwigPyForwardIteratorOpen_T(curr, seq) - { - } - - SwigPyIterator *decr(size_t n = 1) - { - while (n--) { - --base::current; - } - return this; - } - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyForwardIteratorClosed_T : public SwigPyIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyForwardIteratorClosed_T self_type; - - SwigPyForwardIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) - : SwigPyIterator_T(curr, seq), begin(first), end(last) - { - } - - PyObject *value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - SwigPyIterator *copy() const - { - return new self_type(*this); - } - - SwigPyIterator *incr(size_t n = 1) - { - while (n--) { - if (base::current == end) { - throw stop_iteration(); - } else { - ++base::current; - } - } - return this; - } - - protected: - out_iterator begin; - out_iterator end; - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyIteratorClosed_T : public SwigPyForwardIteratorClosed_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyForwardIteratorClosed_T base0; - typedef SwigPyIteratorClosed_T self_type; - - SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) - : SwigPyForwardIteratorClosed_T(curr, first, last, seq) - { - } - - SwigPyIterator *decr(size_t n = 1) - { - while (n--) { - if (base::current == base0::begin) { - throw stop_iteration(); - } else { - --base::current; - } - } - return this; - } - }; - - - template - inline SwigPyIterator* - make_output_forward_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) - { - return new SwigPyForwardIteratorClosed_T(current, begin, end, seq); - } - - template - inline SwigPyIterator* - make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) - { - return new SwigPyIteratorClosed_T(current, begin, end, seq); - } - - template - inline SwigPyIterator* - make_output_forward_iterator(const OutIter& current, PyObject *seq = 0) - { - return new SwigPyForwardIteratorOpen_T(current, seq); - } - - template - inline SwigPyIterator* - make_output_iterator(const OutIter& current, PyObject *seq = 0) - { - return new SwigPyIteratorOpen_T(current, seq); - } - -} -} - - -%fragment("SwigPyIterator"); -namespace swig -{ - /* - Throw a StopIteration exception - */ - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws) stop_iteration { - (void)$1; - SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); - SWIG_fail; - } - - /* - Mark methods that return new objects - */ - %newobject SwigPyIterator::copy; - %newobject SwigPyIterator::operator + (ptrdiff_t n) const; - %newobject SwigPyIterator::operator - (ptrdiff_t n) const; - - %nodirector SwigPyIterator; - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:tp_iter") SwigPyIterator "&swig::make_output_iterator_builtin"; - %feature("python:slot", "tp_iternext", functype="iternextfunc") SwigPyIterator::__next__; -#else - %extend SwigPyIterator { - %pythoncode %{def __iter__(self): - return self%} - } -#endif - - %catches(swig::stop_iteration) SwigPyIterator::value() const; - %catches(swig::stop_iteration) SwigPyIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) SwigPyIterator::decr(size_t n = 1); - %catches(std::invalid_argument) SwigPyIterator::distance(const SwigPyIterator &x) const; - %catches(std::invalid_argument) SwigPyIterator::equal (const SwigPyIterator &x) const; - %catches(swig::stop_iteration) SwigPyIterator::__next__(); - %catches(swig::stop_iteration) SwigPyIterator::next(); - %catches(swig::stop_iteration) SwigPyIterator::previous(); - %catches(swig::stop_iteration) SwigPyIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) SwigPyIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) SwigPyIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) SwigPyIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) SwigPyIterator::operator - (ptrdiff_t n) const; - - struct SwigPyIterator - { - protected: - SwigPyIterator(PyObject *seq); - - public: - virtual ~SwigPyIterator(); - - // Access iterator method, required by Python - virtual PyObject *value() const = 0; - - // Forward iterator method, required by Python - virtual SwigPyIterator *incr(size_t n = 1) = 0; - - // Backward iterator method, very common in C++, but not required in Python - virtual SwigPyIterator *decr(size_t n = 1); - - // Random access iterator methods, but not required in Python - virtual ptrdiff_t distance(const SwigPyIterator &x) const; - - virtual bool equal (const SwigPyIterator &x) const; - - // C++ common/needed methods - virtual SwigPyIterator *copy() const = 0; - - PyObject *next(); - PyObject *__next__(); - PyObject *previous(); - SwigPyIterator *advance(ptrdiff_t n); - - bool operator == (const SwigPyIterator& x) const; - bool operator != (const SwigPyIterator& x) const; - SwigPyIterator& operator += (ptrdiff_t n); - SwigPyIterator& operator -= (ptrdiff_t n); - SwigPyIterator* operator + (ptrdiff_t n) const; - SwigPyIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const SwigPyIterator& x) const; - }; -} - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pymacros.swg b/mac/bin/swig/share/swig/4.1.0/python/pymacros.swg deleted file mode 100755 index ab7bace5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pymacros.swg +++ /dev/null @@ -1,4 +0,0 @@ -%include - - - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyname_compat.i b/mac/bin/swig/share/swig/4.1.0/python/pyname_compat.i deleted file mode 100755 index a9630dbe..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyname_compat.i +++ /dev/null @@ -1,85 +0,0 @@ -/* -* From SWIG 1.3.37 we deprecated all SWIG symbols that start with Py, -* since they are inappropriate and discouraged in Python documentation -* (from http://www.python.org/doc/2.5.2/api/includes.html): -* -* "All user visible names defined by Python.h (except those defined by the included -* standard headers) have one of the prefixes "Py" or "_Py". Names beginning with -* "_Py" are for internal use by the Python implementation and should not be used -* by extension writers. Structure member names do not have a reserved prefix. -* -* Important: user code should never define names that begin with "Py" or "_Py". -* This confuses the reader, and jeopardizes the portability of the user code to -* future Python versions, which may define additional names beginning with one -* of these prefixes." -* -* This file defined macros to provide backward compatibility for these deprecated -* symbols. In the case you have these symbols in your interface file, you can simply -* include this file at beginning of it. -* -* However, this file may be removed in future release of SWIG, so using this file to -* keep these inappropriate names in your SWIG interface file is also not recommended. -* Instead, we provide a simple tool for converting your interface files to -* the new naming convention. You can get the tool from the SWIG distribution: -* Tools/pyname_patch.py -*/ - -%fragment("PySequence_Base", "header", fragment="SwigPySequence_Base") {} -%fragment("PySequence_Cont", "header", fragment="SwigPySequence_Cont") {} -%fragment("PySwigIterator_T", "header", fragment="SwigPyIterator_T") {} -%fragment("PyPairBoolOutputIterator", "header", fragment="SwigPyPairBoolOutputIterator") {} -%fragment("PySwigIterator", "header", fragment="SwigPyIterator") {} -%fragment("PySwigIterator_T", "header", fragment="SwigPyIterator_T") {} - -%inline %{ -#define PyMapIterator_T SwigPyMapIterator_T -#define PyMapKeyIterator_T SwigPyMapKeyIterator_T -#define PyMapValueIterator_T SwigPyMapValueIterator_T -#define PyObject_ptr SwigPtr_PyObject -#define PyObject_var SwigVar_PyObject -#define PyOper SwigPyOper -#define PySeq SwigPySeq -#define PySequence_ArrowProxy SwigPySequence_ArrowProxy -#define PySequence_Cont SwigPySequence_Cont -#define PySequence_InputIterator SwigPySequence_InputIterator -#define PySequence_Ref SwigPySequence_Ref -#define PySwigClientData SwigPyClientData -#define PySwigClientData_Del SwigPyClientData_Del -#define PySwigClientData_New SwigPyClientData_New -#define PySwigIterator SwigPyIterator -#define PySwigIteratorClosed_T SwigPyIteratorClosed_T -#define PySwigIteratorOpen_T SwigPyIteratorOpen_T -#define PySwigIterator_T SwigPyIterator_T -#define PySwigObject SwigPyObject -#define PySwigObject_Check SwigPyObject_Check -#define PySwigObject_GetDesc SwigPyObject_GetDesc -#define PySwigObject_New SwigPyObject_New -#define PySwigObject_acquire SwigPyObject_acquire -#define PySwigObject_append SwigPyObject_append -#define PySwigObject_as_number SwigPyObject_as_number -#define PySwigObject_compare SwigPyObject_compare -#define PySwigObject_dealloc SwigPyObject_dealloc -#define PySwigObject_disown SwigPyObject_disown -#define PySwigObject_format SwigPyObject_format -#define PySwigObject_getattr SwigPyObject_getattr -#define PySwigObject_hex SwigPyObject_hex -#define PySwigObject_long SwigPyObject_long -#define PySwigObject_next SwigPyObject_next -#define PySwigObject_oct SwigPyObject_oct -#define PySwigObject_own SwigPyObject_own -#define PySwigObject_repr SwigPyObject_repr -#define PySwigObject_richcompare SwigPyObject_richcompare -#define PySwigObject_type SwigPyObject_type -#define PySwigPacked SwigPyPacked -#define PySwigPacked_Check SwigPyPacked_Check -#define PySwigPacked_New SwigPyPacked_New -#define PySwigPacked_UnpackData SwigPyPacked_UnpackData -#define PySwigPacked_compare SwigPyPacked_compare -#define PySwigPacked_dealloc SwigPyPacked_dealloc -#define PySwigPacked_repr SwigPyPacked_repr -#define PySwigPacked_str SwigPyPacked_str -#define PySwigPacked_type SwigPyPacked_type -#define pyseq swigpyseq -#define pyswigobject_type swigpyobject_type -#define pyswigpacked_type swigpypacked_type -%} diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyopers.swg b/mac/bin/swig/share/swig/4.1.0/python/pyopers.swg deleted file mode 100755 index fd2fcc58..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyopers.swg +++ /dev/null @@ -1,264 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - - The directives in this file apply whether or not you use the - -builtin option to SWIG, but operator overloads are particularly - attractive when using -builtin, because they are much faster - than named methods. - - If you're using the -builtin option to SWIG, and you want to define - python operator overloads beyond the defaults defined in this file, - here's what you need to know: - - There are two ways to define a python slot function: dispatch to a - statically defined function; or dispatch to a method defined on the - operand. - - To dispatch to a statically defined function, use %feature("python:"), - where is the name of a field in a PyTypeObject, PyNumberMethods, - PyMappingMethods, PySequenceMethods, or PyBufferProcs. For example: - - %feature("python:tp_hash") MyClass "myHashFunc"; - - class MyClass { - public: - ... - }; - - %{ - // Note: Py_hash_t was introduced in Python 3.2 - static Py_hash_t myHashFunc(PyObject *pyobj) { - MyClass *cobj; - // Convert pyobj to cobj - return (cobj->field1 * (cobj->field2 << 7)); - } - %} - - NOTE: It is the responsibility of the programmer (that's you) to ensure - that a statically defined slot function has the correct signature. - - If, instead, you want to dispatch to an instance method, you can - use %feature("python:slot"). For example: - - %feature("python:slot", "tp_hash", functype="hashfunc") MyClass::myHashFunc; - - class MyClass { - public: - Py_hash_t myHashFunc () const; - ... - }; - - NOTE: Some python slots use a method signature which does not - match the signature of SWIG-wrapped methods. For those slots, - SWIG will automatically generate a "closure" function to re-marshall - the arguments before dispatching to the wrapped method. Setting - the "functype" attribute of the feature enables SWIG to generate - a correct closure function. - - -------------------------------------------------------------- - - The tp_richcompare slot is a special case: SWIG automatically generates - a rich compare function for all wrapped types. If a type defines C++ - operator overloads for comparison (operator==, operator<, etc.), they - will be called from the generated rich compare function. If you - want to explicitly choose a method to handle a certain comparison - operation, you may use a different feature, %feature("python:compare") - like this: - - %feature("python:compare", "Py_LT") MyClass::lessThan; - - class MyClass { - public: - bool lessThan(const MyClass& other) const; - ... - }; - - ... where "Py_LT" is one of the rich comparison opcodes defined in the - python header file object.h. - - If there's no method defined to handle a particular comparison operation, - the default behavior is to compare pointer values of the wrapped - C++ objects. - - -------------------------------------------------------------- - - - For more information about python slots, including their names and - signatures, you may refer to the python documentation : - - http://docs.python.org/c-api/typeobj.html - - * ------------------------------------------------------------ */ - - -#ifdef __cplusplus - -#if defined(SWIGPYTHON_BUILTIN) -#define %pybinoperator(pyname,oper,functp,slt) %rename(pyname) oper; %pythonmaybecall oper; %feature("python:slot", #slt, functype=#functp) oper; %feature("python:slot", #slt, functype=#functp) pyname; -#define %pycompare(pyname,oper,comptype) %rename(pyname) oper; %pythonmaybecall oper; %feature("python:compare", #comptype) oper; %feature("python:compare", #comptype) pyname; -#else -#define %pybinoperator(pyname,oper,functp,slt) %rename(pyname) oper; %pythonmaybecall oper -#define %pycompare(pyname,oper,comptype) %pybinoperator(pyname,oper,,comptype) -#endif - -%pybinoperator(__add__, *::operator+, binaryfunc, nb_add); -%pybinoperator(__pos__, *::operator+(), unaryfunc, nb_positive); -%pybinoperator(__pos__, *::operator+() const, unaryfunc, nb_positive); -%pybinoperator(__sub__, *::operator-, binaryfunc, nb_subtract); -%pybinoperator(__neg__, *::operator-(), unaryfunc, nb_negative); -%pybinoperator(__neg__, *::operator-() const, unaryfunc, nb_negative); -%pybinoperator(__mul__, *::operator*, binaryfunc, nb_multiply); -%pybinoperator(__mod__, *::operator%, binaryfunc, nb_remainder); -%pybinoperator(__lshift__, *::operator<<, binaryfunc, nb_lshift); -%pybinoperator(__rshift__, *::operator>>, binaryfunc, nb_rshift); -%pybinoperator(__and__, *::operator&, binaryfunc, nb_and); -%pybinoperator(__or__, *::operator|, binaryfunc, nb_or); -%pybinoperator(__xor__, *::operator^, binaryfunc, nb_xor); -%pycompare(__lt__, *::operator<, Py_LT); -%pycompare(__le__, *::operator<=, Py_LE); -%pycompare(__gt__, *::operator>, Py_GT); -%pycompare(__ge__, *::operator>=, Py_GE); -%pycompare(__eq__, *::operator==, Py_EQ); -%pycompare(__ne__, *::operator!=, Py_NE); - -/* Special cases */ -%rename(__invert__) *::operator~; -%feature("python:slot", "nb_invert", functype="unaryfunc") *::operator~; -%rename(__call__) *::operator(); -%feature("python:slot", "tp_call", functype="ternarycallfunc") *::operator(); - -#if defined(SWIGPYTHON_BUILTIN) -%pybinoperator(__nonzero__, *::operator bool, inquiry, nb_nonzero); -%pybinoperator(__truediv__, *::operator/ , binaryfunc, nb_divide); -#else -%feature("shadow") *::operator bool %{ -def __nonzero__(self): - return $action(self) -__bool__ = __nonzero__ -%}; -%rename(__nonzero__) *::operator bool; -%feature("shadow") *::operator/ %{ -def __truediv__(self, *args): - return $action(self, *args) -__div__ = __truediv__ -%}; -%rename(__truediv__) *::operator/; -%pythonmaybecall *::operator/; -#endif - -/* Ignored operators */ -%ignoreoperator(LNOT) operator!; -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; -%ignoreoperator(EQ) *::operator=; -%ignoreoperator(PLUSPLUS) *::operator++; -%ignoreoperator(MINUSMINUS) *::operator--; -%ignoreoperator(ARROWSTAR) *::operator->*; -%ignoreoperator(INDEX) *::operator[]; - -/* - Inplace operator declarations. - - They translate the inplace C++ operators (+=, -=, ...) into the - corresponding python equivalents(__iadd__,__isub__), etc, - disabling the ownership of the input 'this' pointer, and assigning - it to the returning object: - - %feature("del") *::Operator; // disables ownership by generating SWIG_POINTER_DISOWN - %feature("new") *::Operator; // claims ownership by generating SWIG_POINTER_OWN - - This makes the most common case safe, ie: - - A& A::operator+=(int i) { ...; return *this; } - ^^^^ ^^^^^^ - - will work fine, even when the resulting python object shares the - 'this' pointer with the input one. The input object is usually - deleted after the operation, including the shared 'this' pointer, - producing 'strange' seg faults, as reported by Lucriz - (lucriz@sitilandia.it). - - If you have an interface that already takes care of that, ie, you - already are using inplace operators and you are not getting - seg. faults, with the new scheme you could end with 'free' elements - that never get deleted (maybe, not sure, it depends). But if that is - the case, you could recover the old behaviour using - - %feature("del","0") A::operator+=; - %feature("new","0") A::operator+=; - - which recovers the old behaviour for the class 'A', or if you are - 100% sure your entire system works fine in the old way, use: - - %feature("del","") *::operator+=; - %feature("new","") *::operator+=; - - The default behaviour assumes that the 'this' pointer's memory is - already owned by the SWIG object; it relinquishes ownership then - takes it back. This may not be the case though as the SWIG object - might be owned by memory managed elsewhere, eg after calling a - function that returns a C++ reference. In such case you will need - to use the features above to recover the old behaviour too. -*/ - -#if defined(SWIGPYTHON_BUILTIN) -#define %pyinplaceoper(SwigPyOper, Oper, functp, slt) %delobject Oper; %newobject Oper; %feature("python:slot", #slt, functype=#functp) Oper; %rename(SwigPyOper) Oper -#else -#define %pyinplaceoper(SwigPyOper, Oper, functp, slt) %delobject Oper; %newobject Oper; %rename(SwigPyOper) Oper -#endif - -%pyinplaceoper(__iadd__ , *::operator +=, binaryfunc, nb_inplace_add); -%pyinplaceoper(__isub__ , *::operator -=, binaryfunc, nb_inplace_subtract); -%pyinplaceoper(__imul__ , *::operator *=, binaryfunc, nb_inplace_multiply); -%pyinplaceoper(__imod__ , *::operator %=, binaryfunc, nb_inplace_remainder); -%pyinplaceoper(__iand__ , *::operator &=, binaryfunc, nb_inplace_and); -%pyinplaceoper(__ior__ , *::operator |=, binaryfunc, nb_inplace_or); -%pyinplaceoper(__ixor__ , *::operator ^=, binaryfunc, nb_inplace_xor); -%pyinplaceoper(__ilshift__, *::operator <<=, binaryfunc, nb_inplace_lshift); -%pyinplaceoper(__irshift__, *::operator >>=, binaryfunc, nb_inplace_rshift); - -/* Special cases */ -#if defined(SWIGPYTHON_BUILTIN) -%pyinplaceoper(__itruediv__ , *::operator /=, binaryfunc, nb_inplace_divide); -#else -%delobject *::operator /=; -%newobject *::operator /=; -%feature("shadow") *::operator /= %{ -def __itruediv__(self, *args): - return $action(self, *args) -__idiv__ = __itruediv__ -%}; -%rename(__itruediv__) *::operator /=; -#endif - -/* Finally, in python we need to mark the binary operations to fail as - 'maybecall' methods */ - -#define %pybinopermaybecall(oper) %pythonmaybecall __ ## oper ## __; %pythonmaybecall __r ## oper ## __ - -%pybinopermaybecall(add); -%pybinopermaybecall(pos); -%pybinopermaybecall(pos); -%pybinopermaybecall(sub); -%pybinopermaybecall(neg); -%pybinopermaybecall(neg); -%pybinopermaybecall(mul); -%pybinopermaybecall(div); -%pybinopermaybecall(truediv); -%pybinopermaybecall(mod); -%pybinopermaybecall(lshift); -%pybinopermaybecall(rshift); -%pybinopermaybecall(and); -%pybinopermaybecall(or); -%pybinopermaybecall(xor); -%pybinopermaybecall(lt); -%pybinopermaybecall(le); -%pybinopermaybecall(gt); -%pybinopermaybecall(ge); -%pybinopermaybecall(eq); -%pybinopermaybecall(ne); - -#endif - - - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyprimtypes.swg b/mac/bin/swig/share/swig/4.1.0/python/pyprimtypes.swg deleted file mode 100755 index 6a01af17..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyprimtypes.swg +++ /dev/null @@ -1,353 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE PyObject* - SWIG_From_dec(bool)(bool value) -{ - return PyBool_FromLong(value ? 1 : 0); -} -} - -#ifdef SWIG_PYTHON_LEGACY_BOOL -// Default prior to SWIG 3.0.0 -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(PyObject *obj, bool *val) -{ - int r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} -} -#else -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(PyObject *obj, bool *val) -{ - int r; - if (!PyBool_Check(obj)) - return SWIG_ERROR; - r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} -} -#endif - -/* int */ - -%fragment(SWIG_From_frag(int),"header") { -SWIGINTERNINLINE PyObject* - SWIG_From_dec(int)(int value) -{ - return PyInt_FromLong((long) value); -} -} - -/* unsigned int */ - -%fragment(SWIG_From_frag(unsigned int),"header") { -SWIGINTERNINLINE PyObject* - SWIG_From_dec(unsigned int)(unsigned int value) -{ - return PyInt_FromSize_t((size_t) value); -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { - %define_as(SWIG_From_dec(long), PyInt_FromLong) -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(long)(PyObject *obj, long* val) -{ -%#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else -%#endif - if (PyLong_Check(obj)) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - long v = PyInt_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } -%#endif - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE PyObject* -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(%numeric_cast(value,long)); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(PyObject *obj, unsigned long *val) -{ -%#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else -%#endif - if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -%#endif - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_dec(long long)(long long value) -{ - return ((value < LONG_MIN) || (value > LONG_MAX)) ? - PyLong_FromLongLong(value) : PyInt_FromLong(%numeric_cast(value,long)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment=SWIG_AsVal_frag(long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(PyObject *obj, long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - long long v = PyLong_AsLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - long v; - res = SWIG_AsVal(long)(obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - const double mant_min = -mant_max; - double d; - res = SWIG_AsVal(double)(obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, mant_min, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { - if (val) *val = (long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -%#endif - return res; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(%numeric_cast(value,long)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(PyObject *obj, unsigned long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - unsigned long long v = PyLong_AsUnsignedLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - unsigned long v; - res = SWIG_AsVal(unsigned long)(obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - res = SWIG_AsVal(double)(obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -%#endif - return res; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { - %define_as(SWIG_From_dec(double), PyFloat_FromDouble) -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(PyObject *obj, double *val) -{ - int res = SWIG_TypeError; - if (PyFloat_Check(obj)) { - if (val) *val = PyFloat_AsDouble(obj); - return SWIG_OK; -%#if PY_VERSION_HEX < 0x03000000 - } else if (PyInt_Check(obj)) { - if (val) *val = (double) PyInt_AsLong(obj); - return SWIG_OK; -%#endif - } else if (PyLong_Check(obj)) { - double v = PyLong_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - double d = PyFloat_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = d; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); - } else { - PyErr_Clear(); - } - } - } -%#endif - return res; -} -} - - - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyrun.swg b/mac/bin/swig/share/swig/4.1.0/python/pyrun.swg deleted file mode 100755 index 6b119be1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyrun.swg +++ /dev/null @@ -1,1913 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ -# error "This version of SWIG only supports Python >= 2.7" -#endif - -#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03030000 -# error "This version of SWIG only supports Python 3 >= 3.3" -#endif - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) - -#ifdef SWIGPYTHON_BUILTIN -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) -#else -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) -#endif - -#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) - -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -#if defined(SWIGPYTHON_BUILTIN) - -SWIGINTERN void -SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { - PyObject *s = PyString_InternFromString(key); - PyList_Append(seq, s); - Py_DECREF(s); -} - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); - if (public_interface) - SwigPyBuiltin_AddPublicSymbol(public_interface, name); -} - -#else - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); -} - -#endif - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - if (result) { - PyList_SET_ITEM(result, 0, o2); - } else { - Py_DECREF(obj); - return o2; - } - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -} - -/* Unpack the argument tuple */ - -SWIGINTERN Py_ssize_t -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - if (min <= 1 && max >= 1) { - Py_ssize_t i; - objs[0] = args; - for (i = 1; i < max; ++i) { - objs[i] = 0; - } - return 2; - } - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - Py_ssize_t i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -SWIGINTERN int -SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) { - int no_kwargs = 1; - if (kwargs) { - assert(PyDict_Check(kwargs)); - if (PyDict_Size(kwargs) > 0) { - PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name); - no_kwargs = 0; - } - } - return no_kwargs; -} - -/* A functor is a function object with one single object argument */ -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Python-specific SWIG API */ -#define SWIG_newvarlink() SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) - -/* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - -typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; -} swig_globalvar; - -typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; -} swig_varlinkobject; - -SWIGINTERN PyObject * -swig_varlink_repr(PyObject *SWIGUNUSEDPARM(v)) { -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_InternFromString(""); -#else - return PyString_FromString(""); -#endif -} - -SWIGINTERN PyObject * -swig_varlink_str(PyObject *o) { - swig_varlinkobject *v = (swig_varlinkobject *) o; -#if PY_VERSION_HEX >= 0x03000000 - PyObject *str = PyUnicode_InternFromString("("); - PyObject *tail; - PyObject *joined; - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - tail = PyUnicode_FromString(var->name); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - if (var->next) { - tail = PyUnicode_InternFromString(", "); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - } - } - tail = PyUnicode_InternFromString(")"); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; -#else - PyObject *str = PyString_FromString("("); - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - PyString_ConcatAndDel(&str,PyString_FromString(var->name)); - if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); - } - PyString_ConcatAndDel(&str,PyString_FromString(")")); -#endif - return str; -} - -SWIGINTERN void -swig_varlink_dealloc(PyObject *o) { - swig_varlinkobject *v = (swig_varlinkobject *) o; - swig_globalvar *var = v->vars; - while (var) { - swig_globalvar *n = var->next; - free(var->name); - free(var); - var = n; - } -} - -SWIGINTERN PyObject * -swig_varlink_getattr(PyObject *o, char *n) { - swig_varlinkobject *v = (swig_varlinkobject *) o; - PyObject *res = NULL; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->get_attr)(); - break; - } - var = var->next; - } - if (res == NULL && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; -} - -SWIGINTERN int -swig_varlink_setattr(PyObject *o, char *n, PyObject *p) { - swig_varlinkobject *v = (swig_varlinkobject *) o; - int res = 1; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->set_attr)(p); - break; - } - var = var->next; - } - if (res == 1 && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; -} - -SWIGINTERN PyTypeObject* -swig_varlink_type(void) { - static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "swigvarlink", /* tp_name */ - sizeof(swig_varlinkobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) swig_varlink_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /*tp_print*/ -#else - (Py_ssize_t)0, /*tp_vectorcall_offset*/ -#endif - (getattrfunc) swig_varlink_getattr, /* tp_getattr */ - (setattrfunc) swig_varlink_setattr, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) swig_varlink_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - varlink__doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - varlink_type = tmp; - type_init = 1; - if (PyType_Ready(&varlink_type) < 0) - return NULL; - } - return &varlink_type; -} - -/* Create a variable linking object for use later */ -SWIGINTERN PyObject * -SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); - if (result) { - result->vars = 0; - } - return ((PyObject*) result); -} - -SWIGINTERN void -SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v = (swig_varlinkobject *) p; - swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - if (gv) { - size_t size = strlen(name)+1; - gv->name = (char *)malloc(size); - if (gv->name) { - memcpy(gv->name, name, size); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - } - } - v->vars = gv; -} - - -static PyObject *Swig_Globals_global = NULL; - -SWIGINTERN PyObject * -SWIG_globals(void) { - if (Swig_Globals_global == NULL) { - Swig_Globals_global = SWIG_newvarlink(); - } - return Swig_Globals_global; -} - -#ifdef __cplusplus -} -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) -#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) - -#ifdef __cplusplus -extern "C" { -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; - PyTypeObject *pytype; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - int fail = data ? data->implicitconv : 0; - if (fail) - PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); - return fail; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* the newraw method and newargs arguments used to create a new raw instance */ - if (PyClass_Check(obj)) { - data->newraw = 0; - Py_INCREF(obj); - data->newargs = obj; - } else { - data->newraw = PyObject_GetAttrString(data->klass, "__new__"); - if (data->newraw) { - data->newargs = PyTuple_New(1); - if (data->newargs) { - Py_INCREF(obj); - PyTuple_SET_ITEM(data->newargs, 0, obj); - } else { - Py_DECREF(data->newraw); - Py_DECREF(data->klass); - free(data); - return 0; - } - } else { - Py_INCREF(obj); - data->newargs = obj; - } - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - data->delargs = !(PyCFunction_GET_FLAGS(data->destroy) & METH_O); - } else { - data->delargs = 0; - } - data->implicitconv = 0; - data->pytype = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) -{ - Py_XDECREF(data->klass); - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); - free(data); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -#ifdef SWIGPYTHON_BUILTIN - PyObject *dict; -#endif -} SwigPyObject; - - -#ifdef SWIGPYTHON_BUILTIN - -SWIGRUNTIME PyObject * -SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - - if (!sobj->dict) - sobj->dict = PyDict_New(); - - Py_XINCREF(sobj->dict); - return sobj->dict; -} - -#endif - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -SwigPyObject_format(const char* fmt, SwigPyObject *v) -{ - PyObject *res = NULL; - PyObject *args = PyTuple_New(1); - if (args) { - PyObject *val = SwigPyObject_long(v); - if (val) { - PyObject *ofmt; - PyTuple_SET_ITEM(args, 0, val); - ofmt = SWIG_Python_str_FromChar(fmt); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - } - Py_DECREF(args); - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_repr(SwigPyObject *v) -{ - const char *name = SWIG_TypePrettyName(v->ty); - PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); - if (repr && v->next) { - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); - if (nrep) { -# if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -# else - PyString_ConcatAndDel(&repr,nrep); -# endif - } else { - Py_DecRef(repr); - repr = NULL; - } - } - return repr; -} - -/* We need a version taking two PyObject* parameters so it's a valid - * PyCFunction to use in swigobject_methods[]. */ -SWIGRUNTIME PyObject * -SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - return SwigPyObject_repr((SwigPyObject*)v); -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -SWIGRUNTIME PyObject* -SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) -{ - PyObject* res; - if( op != Py_EQ && op != Py_NE ) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); - return res; -} - - -SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); - -#ifdef SWIGPYTHON_BUILTIN -static swig_type_info *SwigPyObject_stype = 0; -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - SwigPyClientData *cd; - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - assert(cd); - assert(cd->pytype); - return cd->pytype; -} -#else -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); - return type; -} -#endif - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN - PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) - return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); -#else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -#endif -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -static PyObject* Swig_Capsule_global = NULL; - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - - /* PyObject_CallFunction() has the potential to silently drop - the active exception. In cases of unnamed temporary - variable or where we just finished iterating over a generator - StopIteration will be active right now, and this needs to - remain true upon return from SwigPyObject_dealloc. So save - and restore. */ - - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); - - if (data->delargs) { - /* we need to create a temporary object to carry the destroy operation */ - PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); - if (tmp) { - res = SWIG_Python_CallFunctor(destroy, tmp); - } else { - res = 0; - } - Py_XDECREF(tmp); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - if (!res) - PyErr_WriteUnraisable(destroy); - - PyErr_Restore(type, value, traceback); - - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - Py_XDECREF(Swig_Capsule_global); - } - Py_XDECREF(next); -#ifdef SWIGPYTHON_BUILTIN - Py_XDECREF(sobj->dict); -#endif - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (!SwigPyObject_Check(next)) { - PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); - return NULL; - } - ((SwigPyObject *)next)->next = sobj->next; - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) { - return NULL; - } else { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { - if (PyObject_IsTrue(val)) { - Py_DECREF(SwigPyObject_acquire(v,args)); - } else { - Py_DECREF(SwigPyObject_disown(v,args)); - } - } - return obj; - } -} - -static PyMethodDef -swigobject_methods[] = { - {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"}, - {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"}, - {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"}, - {"append", SwigPyObject_append, METH_O, "appends another 'this' object"}, - {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"}, - {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"}, - {0, 0, 0, 0} -}; - -SWIGRUNTIME PyTypeObject* -SwigPyObject_TypeOnce(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ -#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#else - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#endif - }; - - static PyTypeObject swigpyobject_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /*tp_print*/ -#else - (Py_ssize_t)0, /*tp_vectorcall_offset*/ -#endif - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - swigpyobject_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpyobject_type) != 0) - return NULL; - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; -#ifdef SWIGPYTHON_BUILTIN - sobj->dict = 0; -#endif - if (own == SWIG_POINTER_OWN) { - /* Obtain a reference to the Python capsule wrapping the module information, so that the - * module information is correctly destroyed after all SWIG python objects have been freed - * by the GC (and corresponding destructors invoked) */ - Py_XINCREF(Swig_Capsule_global); - } - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_TypeOnce(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX>=0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /*tp_print*/ -#else - (Py_ssize_t)0, /*tp_vectorcall_offset*/ -#endif - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - swigpypacked_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpypacked_type) != 0) - return NULL; - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -static PyObject *Swig_This_global = NULL; - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - if (Swig_This_global == NULL) - Swig_This_global = SWIG_Python_str_FromChar("this"); - return Swig_This_global; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - PyObject *obj; - - if (SwigPyObject_Check(pyobj)) - return (SwigPyObject *) pyobj; - -#ifdef SWIGPYTHON_BUILTIN - (void)obj; -# ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - pyobj = PyWeakref_GET_OBJECT(pyobj); - if (pyobj && SwigPyObject_Check(pyobj)) - return (SwigPyObject*) pyobj; - } -# endif - return NULL; -#else - - obj = 0; - -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; -#endif -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - int res; - SwigPyObject *sobj; - int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; - - if (!obj) - return SWIG_ERROR; - if (obj == Py_None && !implicit_conv) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - res = SWIG_ERROR; - - sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !sobj->own) { - res = SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - sobj->ptr = 0; - } - res = SWIG_OK; - } - } else { - if (implicit_conv) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; - } - } - } - return res; -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - swig_cast_info *tc; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - return SWIG_OK; - } -} - -/* Convert a packed pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - } else{ - Py_DECREF(inst); - inst = 0; - } - } -#else - if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { - Py_DECREF(inst); - inst = 0; - } -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *empty_args = PyTuple_New(0); - if (empty_args) { - PyObject *empty_kwargs = PyDict_New(); - if (empty_kwargs) { - inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); - Py_DECREF(empty_kwargs); - if (inst) { - if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { - Py_DECREF(inst); - inst = 0; - } else { - PyType_Modified(Py_TYPE(inst)); - } - } - } - Py_DECREF(empty_args); - } -#else - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } -#endif - } - return inst; -} - -SWIGRUNTIME int -SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) -{ -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - if (dict) { - return PyDict_SetItem(dict, SWIG_This(), swig_this); - } else{ - return -1; - } - } -#endif - return PyObject_SetAttr(inst, SWIG_This(), swig_this); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - Py_DECREF(SwigPyObject_append((PyObject*) sthis, obj[1])); - } else { - if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) - return NULL; - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { - SwigPyClientData *clientdata; - PyObject * robj; - int own; - - if (!ptr) - return SWIG_Py_Void(); - - clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - if (clientdata && clientdata->pytype) { - SwigPyObject *newobj; - if (flags & SWIG_BUILTIN_TP_INIT) { - newobj = (SwigPyObject*) self; - if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); - while (newobj->next) - newobj = (SwigPyObject *) newobj->next; - newobj->next = next_self; - newobj = (SwigPyObject *)next_self; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - } else { - newobj = PyObject_New(SwigPyObject, clientdata->pytype); -#ifdef SWIGPYTHON_BUILTIN - if (newobj) { - newobj->dict = 0; - } -#endif - } - if (newobj) { - newobj->ptr = ptr; - newobj->ty = type; - newobj->own = own; - newobj->next = 0; - return (PyObject*) newobj; - } - return SWIG_Py_Void(); - } - - assert(!(flags & SWIG_BUILTIN_TP_INIT)); - - robj = SwigPyObject_New(ptr, type, own); - if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - Py_DECREF(robj); - robj = inst; - } - return robj; -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -static PyObject *Swig_TypeCache_global = NULL; - -/* The python cached type query */ -SWIGRUNTIME PyObject * -SWIG_Python_TypeCache(void) { - if (Swig_TypeCache_global == NULL) { - Swig_TypeCache_global = PyDict_New(); - } - return Swig_TypeCache_global; -} - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { -#ifdef SWIG_LINK_RUNTIME - static void *type_pointer = (void *)0; - /* first check if module already created */ - if (!type_pointer) { - type_pointer = SWIG_ReturnGlobalTypeList((void *)0); - } -#else - void *type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif - return (swig_module_info *) type_pointer; -} - - -static int interpreter_counter = 0; // how many (sub-)interpreters are using swig_module's types - -SWIGRUNTIME void -SWIG_Python_DestroyModule(PyObject *obj) -{ - swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); - swig_type_info **types = swig_module->types; - size_t i; - if (--interpreter_counter != 0) // another sub-interpreter may still be using the swig_module's types - return; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - ty->clientdata = 0; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); - Swig_This_global = NULL; - Py_DECREF(SWIG_globals()); - Swig_Globals_global = NULL; - Py_DECREF(SWIG_Python_TypeCache()); - Swig_TypeCache_global = NULL; - Swig_Capsule_global = NULL; -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); -#endif - PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); - if (pointer && module) { - if (PyModule_AddObject(module, SWIGPY_CAPSULE_ATTR_NAME, pointer) == 0) { - ++interpreter_counter; - Swig_Capsule_global = pointer; - } else { - Py_DECREF(pointer); - } - } else { - Py_XDECREF(pointer); - } -} - -SWIGRUNTIME swig_type_info * -SWIG_Python_TypeQuery(const char *type) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { - descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); - } else { - swig_module_info *swig_module = SWIG_GetModule(0); - descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); - if (descriptor) { - obj = PyCapsule_New((void*) descriptor, NULL, NULL); - if (obj) { - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); - } - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - const char *errmesg = tmp ? tmp : "Invalid error message"; - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, errmesg); - } else { - PyErr_Format(type, "%s %s", errmesg, mesg); - } - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : ""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - const char *otype = (obj ? obj->ob_type->tp_name : 0); - if (otype) { - PyObject *str = PyObject_Str(obj); - const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; - if (cstr) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", - type, otype, cstr); - } else { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", - type, otype); - } - Py_XDECREF(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { - void *result; - if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { - PyErr_Clear(); - } - return result; -} - -#ifdef SWIGPYTHON_BUILTIN -SWIGRUNTIME int -SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { - PyTypeObject *tp = obj->ob_type; - PyObject *descr; - PyObject *encoded_name; - descrsetfunc f; - int res = -1; - -# ifdef Py_USING_UNICODE - if (PyString_Check(name)) { - name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); - if (!name) - return -1; - } else if (!PyUnicode_Check(name)) -# else - if (!PyString_Check(name)) -# endif - { - PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); - return -1; - } else { - Py_INCREF(name); - } - - if (!tp->tp_dict) { - if (PyType_Ready(tp) != 0) - goto done; - } - - descr = _PyType_Lookup(tp, name); - f = NULL; - if (descr != NULL) - f = descr->ob_type->tp_descr_set; - if (!f) { - if (PyString_Check(name)) { - encoded_name = name; - Py_INCREF(name); - } else { - encoded_name = PyUnicode_AsUTF8String(name); - if (!encoded_name) - goto done; - } - PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); - Py_DECREF(encoded_name); - } else { - res = f(descr, obj, value); - } - - done: - Py_DECREF(name); - return res; -} -#endif - - -#ifdef __cplusplus -} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyruntime.swg b/mac/bin/swig/share/swig/4.1.0/python/pyruntime.swg deleted file mode 100755 index 1d028ada..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyruntime.swg +++ /dev/null @@ -1,49 +0,0 @@ -%insert(runtime) %{ -#if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND) -/* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */ -# include -#endif - -#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) -#define PY_SSIZE_T_CLEAN -#endif - -#if __GNUC__ >= 7 -#pragma GCC diagnostic push -#if defined(__cplusplus) && __cplusplus >=201703L -#pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */ -#endif -#endif - -#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) -/* Use debug wrappers with the Python release dll */ - -#if defined(_MSC_VER) && _MSC_VER >= 1929 -/* Workaround compilation errors when redefining _DEBUG in MSVC 2019 version 16.10 and later - * See https://github.com/swig/swig/issues/2090 */ -# include -#endif - -# undef _DEBUG -# include -# define _DEBUG 1 -#else -# include -#endif - -#if __GNUC__ >= 7 -#pragma GCC diagnostic pop -#endif -%} - -%insert(runtime) "swigrun.swg"; /* SWIG API */ -%insert(runtime) "swigerrors.swg"; /* SWIG errors */ -%insert(runtime) "pyhead.swg"; /* Python includes and fixes */ -%insert(runtime) "pyerrors.swg"; /* Python errors */ -%insert(runtime) "pythreads.swg"; /* Python thread code */ -%insert(runtime) "pyapi.swg"; /* Python API */ -%insert(runtime) "pyrun.swg"; /* Python run-time code */ - -#if defined(SWIGPYTHON_BUILTIN) -%insert(runtime) "builtin.swg"; /* Specialization for classes with single inheritance */ -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/python/pystdcommon.swg b/mac/bin/swig/share/swig/4.1.0/python/pystdcommon.swg deleted file mode 100755 index afa71350..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pystdcommon.swg +++ /dev/null @@ -1,265 +0,0 @@ -%fragment("StdTraits","header",fragment="StdTraitsCommon") -{ -namespace swig { - /* - Traits that provides the from method - */ - template struct traits_from_ptr { - static PyObject *from(Type *val, int owner = 0) { - return SWIG_InternalNewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static PyObject *from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static PyObject *from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static PyObject *from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline PyObject *from(const Type& val) { - return traits_from::from(val); - } - - template - inline PyObject *from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - /* - Traits that provides the asval/as/check method - */ - template - struct traits_asptr { - static int asptr(PyObject *obj, Type **val) { - int res = SWIG_ERROR; - swig_type_info *descriptor = type_info(); - if (val) { - Type *p = 0; - int newmem = 0; - res = descriptor ? SWIG_ConvertPtrAndOwn(obj, (void **)&p, descriptor, 0, &newmem) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (newmem & SWIG_CAST_NEW_MEMORY) { - res |= SWIG_NEWOBJMASK; - } - *val = p; - } - } else { - res = descriptor ? SWIG_ConvertPtr(obj, 0, descriptor, 0) : SWIG_ERROR; - } - return res; - } - }; - - template - inline int asptr(PyObject *obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(PyObject *obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(PyObject *obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(PyObject *obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(PyObject *obj) { - Type v; - int res = asval(obj, &v); - if (!obj || !SWIG_IsOK(res)) { - if (!PyErr_Occurred()) { - ::%type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(PyObject *obj) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - if (!PyErr_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(PyObject *obj) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res)) { - return v; - } else { - if (!PyErr_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(PyObject *obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(PyObject *obj) { - int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(PyObject *obj) { - int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(PyObject *obj) { - return traits_check::category>::check(obj); - } -} -} - -// -// Backward compatibility -// - -#ifdef SWIG_PYTHON_BACKWARD_COMP -%fragment(""); -%{ -PyObject* SwigInt_FromBool(bool b) { - return PyInt_FromLong(b ? 1L : 0L); -} -double SwigNumber_Check(PyObject* o) { - return PyFloat_Check(o) || PyInt_Check(o) || PyLong_Check(o); -} -double SwigNumber_AsDouble(PyObject* o) { - return PyFloat_Check(o) ? PyFloat_AsDouble(o) - : (PyInt_Check(o) ? double(PyInt_AsLong(o)) - : double(PyLong_AsLong(o))); -} -PyObject* SwigString_FromString(const std::string& s) { - return PyString_FromStringAndSize(s.data(),s.size()); -} -std::string SwigString_AsString(PyObject* o) { - return std::string(PyString_AsString(o)); -} -%} - -#endif - - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(PyObject *obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static PyObject *from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(PyObject *obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef - - -#define specialize_std_vector(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_list(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_deque(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_unordered_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_unordered_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) diff --git a/mac/bin/swig/share/swig/4.1.0/python/pystrings.swg b/mac/bin/swig/share/swig/4.1.0/python/pystrings.swg deleted file mode 100755 index 64ed685e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pystrings.swg +++ /dev/null @@ -1,139 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ -%#if PY_VERSION_HEX>=0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (PyBytes_Check(obj)) -%#else - if (PyUnicode_Check(obj)) -%#endif -%#else - if (PyString_Check(obj)) -%#endif - { - char *cstr; Py_ssize_t len; - int ret = SWIG_OK; -%#if PY_VERSION_HEX>=0x03000000 -%#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (!alloc && cptr) { - /* We can't allow converting without allocation, since the internal - representation of string in Python 3 is UCS-2/UCS-4 but we require - a UTF-8 representation. - TODO(bhy) More detailed explanation */ - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (!obj) - return SWIG_TypeError; - if (alloc) - *alloc = SWIG_NEWOBJ; -%#endif - if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) - return SWIG_TypeError; -%#else - if (PyString_AsStringAndSize(obj, &cstr, &len) == -1) - return SWIG_TypeError; -%#endif - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } else { -%#if PY_VERSION_HEX>=0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - *cptr = PyBytes_AsString(obj); -%#else - assert(0); /* Should never reach here with Unicode strings in Python 3 */ -%#endif -%#else - *cptr = SWIG_Python_str_AsChar(obj); - if (!*cptr) - ret = SWIG_TypeError; -%#endif - } - } - if (psize) *psize = len + 1; -%#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - Py_XDECREF(obj); -%#endif - return ret; - } else { -%#if defined(SWIG_PYTHON_2_UNICODE) -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) -%#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" -%#endif -%#if PY_VERSION_HEX<0x03000000 - if (PyUnicode_Check(obj)) { - char *cstr; Py_ssize_t len; - if (!alloc && cptr) { - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (!obj) - return SWIG_TypeError; - if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { - if (cptr) { - if (alloc) *alloc = SWIG_NEWOBJ; - *cptr = %new_copy_array(cstr, len + 1, char); - } - if (psize) *psize = len + 1; - - Py_XDECREF(obj); - return SWIG_OK; - } else { - Py_XDECREF(obj); - } - } -%#endif -%#endif - - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -%#if PY_VERSION_HEX >= 0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, %numeric_cast(size, Py_ssize_t)); -%#else - return PyUnicode_DecodeUTF8(carray, %numeric_cast(size, Py_ssize_t), "surrogateescape"); -%#endif -%#else - return PyString_FromStringAndSize(carray, %numeric_cast(size, Py_ssize_t)); -%#endif - } - } else { - return SWIG_Py_Void(); - } -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/python/python.swg b/mac/bin/swig/share/swig/4.1.0/python/python.swg deleted file mode 100755 index 769d9e10..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/python.swg +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------------------------ - * python.swg - * - * Python configuration module. - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Python keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Python autodoc support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Python classes, for C++ - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Python initialization function - * ------------------------------------------------------------ */ -%include - - -/* ------------------------------------------------------------ - * For backward compatibility - * ------------------------------------------------------------ */ -%include - - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pythonkw.swg b/mac/bin/swig/share/swig/4.1.0/python/pythonkw.swg deleted file mode 100755 index a2103452..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pythonkw.swg +++ /dev/null @@ -1,140 +0,0 @@ -/* - Warnings for Python keywords, built-in names and bad names. -*/ - -#define PYTHONKW(x) %keywordwarn("'" `x` "' is a python keyword", rename="_%s") `x` -#define PYTHONBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in python") `x` - - -/* - Warnings for Python keywords - https://docs.python.org/2/reference/lexical_analysis.html#keywords -*/ - -PYTHONKW(and); -PYTHONKW(as); -PYTHONKW(assert); -PYTHONKW(async); -PYTHONKW(await); -PYTHONKW(break); -PYTHONKW(class); -PYTHONKW(continue); -PYTHONKW(def); -PYTHONKW(del); -PYTHONKW(elif); -PYTHONKW(else); -PYTHONKW(except); -PYTHONKW(exec); -PYTHONKW(finally); -PYTHONKW(for); -PYTHONKW(from); -PYTHONKW(global); -PYTHONKW(if); -PYTHONKW(import); -PYTHONKW(in); -PYTHONKW(is); -PYTHONKW(lambda); -PYTHONKW(not); -PYTHONKW(or); -PYTHONKW(pass); -PYTHONKW(print); -PYTHONKW(raise); -PYTHONKW(return); -PYTHONKW(try); -PYTHONKW(while); -PYTHONKW(with); -PYTHONKW(yield); - -/* - built-in functions - https://docs.python.org/2/library/functions.html - */ - -PYTHONBN(abs); -PYTHONBN(apply); -PYTHONBN(bool); -PYTHONBN(buffer); -PYTHONBN(callable); -PYTHONBN(chr); -PYTHONBN(classmethod); -PYTHONBN(cmp); -PYTHONBN(coerce); -PYTHONBN(compile); -PYTHONBN(complex); -PYTHONBN(delattr); -PYTHONBN(dict); -PYTHONBN(dir); -PYTHONBN(divmod); -PYTHONBN(enumerate); -PYTHONBN(eval); -PYTHONBN(execfile); -PYTHONBN(file); -PYTHONBN(filter); -PYTHONBN(float); -PYTHONBN(frozenset); -PYTHONBN(getattr); -PYTHONBN(globals); -PYTHONBN(hasattr); -PYTHONBN(hash); -PYTHONBN(hex); -PYTHONBN(id); -PYTHONBN(input); -PYTHONBN(int); -PYTHONBN(intern); -PYTHONBN(isinstance); -PYTHONBN(issubclass); -PYTHONBN(iter); -PYTHONBN(len); -PYTHONBN(list); -PYTHONBN(locals); -PYTHONBN(long); -PYTHONBN(map); -PYTHONBN(max); -PYTHONBN(min); -PYTHONBN(object); -PYTHONBN(oct); -PYTHONBN(open); -PYTHONBN(ord); -PYTHONBN(pow); -PYTHONBN(property); -PYTHONBN(range); -PYTHONBN(raw_input); -PYTHONBN(reduce); -PYTHONBN(reload); -PYTHONBN(repr); -PYTHONBN(reversed); -PYTHONBN(round); -PYTHONBN(set); -PYTHONBN(setattr); -PYTHONBN(slice); -PYTHONBN(sorted); -PYTHONBN(staticmethod); -PYTHONBN(str); -PYTHONBN(sum); -PYTHONBN(super); -PYTHONBN(tuple); -PYTHONBN(type); -PYTHONBN(unichr); -PYTHONBN(unicode); -PYTHONBN(vars); -PYTHONBN(xrange); -PYTHONBN(zip); - - -/* - built-in names - boolean type and None -*/ -PYTHONBN(True); -PYTHONBN(False); - -PYTHONKW(None); - - -/* - 'self' is also a bad Name -*/ -PYTHONKW(self); - -#undef PYTHONBN -#undef PYTHONKW diff --git a/mac/bin/swig/share/swig/4.1.0/python/pythreads.swg b/mac/bin/swig/share/swig/4.1.0/python/pythreads.swg deleted file mode 100755 index 8d6c5ab4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pythreads.swg +++ /dev/null @@ -1,68 +0,0 @@ -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# define SWIG_PYTHON_USE_GIL -# endif -# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# if PY_VERSION_HEX < 0x03070000 -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() -# else -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/python/pytuplehlp.swg b/mac/bin/swig/share/swig/4.1.0/python/pytuplehlp.swg deleted file mode 100755 index 32e15803..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pytuplehlp.swg +++ /dev/null @@ -1,8 +0,0 @@ -/* - Helper function to return output types, now we need to use a list - instead of a tuple since all the other types - (std::pair,std::vector,std::list,etc) return tuples. -*/ - -#warning "Deprecated file: Don't use t_output_helper anymore," -#warning "use SWIG_Python_AppendOutput or %append_output instead." diff --git a/mac/bin/swig/share/swig/4.1.0/python/pytypemaps.swg b/mac/bin/swig/share/swig/4.1.0/python/pytypemaps.swg deleted file mode 100755 index 0ae25a68..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pytypemaps.swg +++ /dev/null @@ -1,105 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Python - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ -#ifdef SWIG_PYTHON_LEGACY_BOOL -// Default prior to SWIG 3.0.0 -#undef SWIG_TYPECHECK_BOOL -%define SWIG_TYPECHECK_BOOL 10000 %enddef -#endif - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Python fragments for fundamental types */ -%include - -/* Python fragments for char* strings */ -%include - -/* Backward compatibility output helper */ -%fragment("t_output_helper","header") %{ -#define t_output_helper SWIG_Python_AppendOutput -%} - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* directors are supported in Python */ -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Python types */ -#define SWIG_Object PyObject * -#define VOID_Object SWIG_Py_Void() - -/* Python allows implicit conversion */ -#define %implicitconv_flag $implicitconv - - -/* Overload of the output/constant/exception/dirout handling */ - -/* append output */ -#define SWIG_AppendOutput(result, obj) SWIG_Python_AppendOutput(result, obj) - -/* set constant */ -#if defined(SWIGPYTHON_BUILTIN) -#define SWIG_SetConstant(name, obj) SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, name,obj) -#else -#define SWIG_SetConstant(name, obj) SWIG_Python_SetConstant(d, name,obj) -#endif - -/* raise */ -#define SWIG_Raise(obj, type, desc) SWIG_Python_Raise(obj, type, desc) - -/* Include the unified typemap library */ -%include - - -/* ------------------------------------------------------------ - * Python extra typemaps / typemap overrides - * ------------------------------------------------------------ */ - -/* Get the address of the 'python self' object */ - -%typemap(in,numinputs=0,noblock=1) PyObject **PYTHON_SELF { - $1 = &$self; -} - - -/* Consttab, needed for callbacks, it should be removed later */ - -%typemap(consttab) SWIGTYPE ((*)(ANY)) -{ SWIG_PY_POINTER, "$symname", 0, 0, (void *)($value), &$descriptor } -%typemap(consttab) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY)); - -%typemap(constcode) SWIGTYPE ((*)(ANY)) "" -%typemap(constcode) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY)); - - -/* Smart Pointers */ -%typemap(out,noblock=1) const SWIGTYPE & SMARTPOINTER { - $result = SWIG_NewPointerObj(%new_copy(*$1, $*ltype), $descriptor, SWIG_POINTER_OWN | %newpointer_flags); -} - -%typemap(ret,noblock=1) const SWIGTYPE & SMARTPOINTER, SWIGTYPE SMARTPOINTER { - if ($result) { - PyObject *robj = PyObject_CallMethod($result, (char *)"__deref__", NULL); - if (robj && !PyErr_Occurred()) { - SwigPyObject_append((PyObject *) SWIG_Python_GetSwigThis($result), - (PyObject *) SWIG_Python_GetSwigThis(robj)); - Py_DECREF(robj); - } - } -} - diff --git a/mac/bin/swig/share/swig/4.1.0/python/pyuserdir.swg b/mac/bin/swig/share/swig/4.1.0/python/pyuserdir.swg deleted file mode 100755 index 31107607..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pyuserdir.swg +++ /dev/null @@ -1,242 +0,0 @@ -/* ------------------------------------------------------------------------- - * Special user directives - * ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ - -/* shadow code */ -#define %shadow %insert("shadow") -#define %pythoncode %insert("python") -#define %pythonbegin %insert("pythonbegin") - - -/* ------------------------------------------------------------------------- */ -/* -Use the "nondynamic" feature to make a wrapped class behave as a "nondynamic" -one, ie, a python class that doesn't dynamically add new attributes. - -For example, for the class - -%pythonnondynamic A; -struct A -{ - int a; - int b; -}; - -you will get: - - aa = A() - aa.a = 1 # Ok - aa.b = 1 # Ok - aa.c = 3 # error - -Since nondynamic is a feature, if you use it like - - %pythonnondynamic; - -it will make all the wrapped classes nondynamic ones. - -The implementation is based on this recipe: - - http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252158 - -*/ - -#define %pythonnondynamic %feature("python:nondynamic", "1") -#define %nopythonnondynamic %feature("python:nondynamic", "0") -#define %clearpythonnondynamic %feature("python:nondynamic", "") -#define %pythondynamic %nopythonnondynamic - - -/* ------------------------------------------------------------------------- */ -/* - -Use %pythonmaybecall to flag a method like __add__ or __radd__. These -don't produce an error when called, they just return NotImplemented. - -These methods "may be called" if needed. - -*/ - -#define %pythonmaybecall %feature("python:maybecall", "1") -#define %nopythonmaybecall %feature("python:maybecall", "0") -#define %clearpythonmaybecall %feature("python:maybecall", "") - -/* ------------------------------------------------------------------------- */ -/* - The %pythoncallback feature produce a more natural callback wrapper - than the %callback mechanism, ie, it uses the original name for - the callback and callable objects. - - Just use it as - - %pythoncallback(1) foo; - int foo(int a); - - %pythoncallback(1) A::foo; - struct A { - static int foo(int a); - }; - - int bar(int, int (*pf)(int)); - - then, you can use it as: - - a = foo(1) - b = bar(2, foo) - - c = A.foo(3) - d = bar(4, A.foo) - - - If you use it with a member method - %pythoncallback(1) A::foom; - struct A { - int foom(int a); - }; - - then you can use it as - - r = a.foom(3) # eval the method - mptr = A.foom_cb_ptr # returns the callback pointer - - where the '_cb_ptr' suffix is added for the callback pointer. - -*/ - -#define %pythoncallback %feature("python:callback") -#define %nopythoncallback %feature("python:callback","0") -#define %clearpythoncallback %feature("python:callback","") - -/* ------------------------------------------------------------------------- */ -/* - Support for the old %callback directive name -*/ -#ifdef %callback -#undef %callback -#endif - -#ifdef %nocallback -#undef %nocallback -#endif - -#ifdef %clearcallback -#undef %clearcallback -#endif - -#define %callback(x) %feature("python:callback",`x`) -#define %nocallback %nopythoncallback -#define %clearcallback %clearpythoncallback - -/* ------------------------------------------------------------------------- */ -/* - Thread support - Advance control - -*/ - -#define %nothread %feature("nothread") -#define %thread %feature("nothread","0") -#define %clearnothread %feature("nothread","") - -#define %nothreadblock %feature("nothreadblock") -#define %threadblock %feature("nothreadblock","0") -#define %clearnothreadblock %feature("nothreadblock","") - -#define %nothreadallow %feature("nothreadallow") -#define %threadallow %feature("nothreadallow","0") -#define %clearnothreadallow %feature("nothreadallow","") - - -/* ------------------------------------------------------------------------- */ -/* - Implicit Conversion using the C++ constructor mechanism -*/ - -#define %implicitconv %feature("implicitconv") -#define %noimplicitconv %feature("implicitconv", "0") -#define %clearimplicitconv %feature("implicitconv", "") - - -/* ------------------------------------------------------------------------- */ -/* - Enable keywords parameters -*/ - -#define %kwargs %feature("kwargs") -#define %nokwargs %feature("kwargs", "0") -#define %clearkwargs %feature("kwargs", "") - -/* ------------------------------------------------------------------------- */ -/* - Add python code to the proxy/shadow code - - %pythonprepend - Add code before the C++ function is called - %pythonappend - Add code after the C++ function is called -*/ - -#define %pythonprepend %feature("pythonprepend") -#define %clearpythonprepend %feature("pythonprepend","") - -#define %pythonappend %feature("pythonappend") -#define %clearpythonappend %feature("pythonappend","") - - -/* ------------------------------------------------------------------------- */ -/* - %extend_smart_pointer extend the smart pointer support. - - For example, if you have a smart pointer as: - - template class RCPtr { - public: - ... - RCPtr(Type *p); - Type * operator->() const; - ... - }; - - you use the %extend_smart_pointer directive as: - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - - then, if you have something like: - - RCPtr make_ptr(); - int foo(A *); - - you can do the following: - - a = make_ptr(); - b = foo(a); - - ie, swig will accept a RCPtr object where a 'A *' is - expected. - - Also, when using vectors - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - %template(vector_A) std::vector >; - - you can type - - a = A(); - v = vector_A(2) - v[0] = a - - ie, an 'A *' object is accepted, via implicit conversion, - where a RCPtr object is expected. Additionally - - x = v[0] - - returns (and sets 'x' as) a copy of v[0], making reference - counting possible and consistent. -*/ - -%define %extend_smart_pointer(Type...) -%implicitconv Type; -%apply const SWIGTYPE& SMARTPOINTER { const Type& }; -%apply SWIGTYPE SMARTPOINTER { Type }; -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/python/pywstrings.swg b/mac/bin/swig/share/swig/4.1.0/python/pywstrings.swg deleted file mode 100755 index 0e5a78df..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/pywstrings.swg +++ /dev/null @@ -1,85 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for wchar_t strings - * ------------------------------------------------------------ */ - -%{ -#if PY_VERSION_HEX >= 0x03020000 -# define SWIGPY_UNICODE_ARG(obj) ((PyObject*) (obj)) -#else -# define SWIGPY_UNICODE_ARG(obj) ((PyUnicodeObject*) (obj)) -#endif -%} - -%fragment("SWIG_AsWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor") { -SWIGINTERN int -SWIG_AsWCharPtrAndSize(PyObject *obj, wchar_t **cptr, size_t *psize, int *alloc) -{ - PyObject *tmp = 0; - int isunicode = PyUnicode_Check(obj); -%#if PY_VERSION_HEX < 0x03000000 && !defined(SWIG_PYTHON_STRICT_UNICODE_WCHAR) - if (!isunicode && PyString_Check(obj)) { - tmp = PyUnicode_FromObject(obj); - if (tmp) { - isunicode = 1; - obj = tmp; - } else { - PyErr_Clear(); - return SWIG_TypeError; - } - } -%#endif - if (isunicode) { -%#if PY_VERSION_HEX >= 0x03030000 - Py_ssize_t len = PyUnicode_GetLength(obj); -%#else - Py_ssize_t len = PyUnicode_GetSize(obj); -%#endif - if (cptr) { - Py_ssize_t length; - *cptr = %new_array(len + 1, wchar_t); - length = PyUnicode_AsWideChar(SWIGPY_UNICODE_ARG(obj), *cptr, len); - if (length == -1) { - PyErr_Clear(); - Py_XDECREF(tmp); - return SWIG_TypeError; - } - (*cptr)[length] = 0; - } - if (psize) *psize = (size_t) len + 1; - if (alloc) *alloc = cptr ? SWIG_NEWOBJ : 0; - Py_XDECREF(tmp); - return SWIG_OK; - } else { - swig_type_info* pwchar_descriptor = SWIG_pwchar_descriptor(); - if (pwchar_descriptor) { - void * vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pwchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (wchar_t *)vptr; - if (psize) *psize = vptr ? (wcslen((wchar_t *)vptr) + 1) : 0; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor") { -SWIGINTERNINLINE PyObject * -SWIG_FromWCharPtrAndSize(const wchar_t * carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pwchar_descriptor = SWIG_pwchar_descriptor(); - return pwchar_descriptor ? - SWIG_InternalNewPointerObj(%const_cast(carray,wchar_t *), pwchar_descriptor, 0) : SWIG_Py_Void(); - } else { - return PyUnicode_FromWideChar(carray, %numeric_cast(size, Py_ssize_t)); - } - } else { - return SWIG_Py_Void(); - } -} -} - - diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_alloc.i b/mac/bin/swig/share/swig/4.1.0/python/std_alloc.i deleted file mode 100755 index 35dc051b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_array.i b/mac/bin/swig/share/swig/4.1.0/python/std_array.i deleted file mode 100755 index a3de3125..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_array.i +++ /dev/null @@ -1,91 +0,0 @@ -/* - std::array -*/ - -%fragment("StdArrayTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::array **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::array& vec) { - return traits_from_stdseq >::from(vec); - } - }; - - template - inline void - assign(const SwigPySeq& swigpyseq, std::array* seq) { - if (swigpyseq.size() < seq->size()) - throw std::invalid_argument("std::array cannot be expanded in size"); - else if (swigpyseq.size() > seq->size()) - throw std::invalid_argument("std::array cannot be reduced in size"); - std::copy(swigpyseq.begin(), swigpyseq.end(), seq->begin()); - } - - template - inline void - erase(std::array* SWIGUNUSEDPARM(seq), const typename std::array::iterator& SWIGUNUSEDPARM(position)) { - throw std::invalid_argument("std::array object does not support item deletion"); - } - - // Only limited slicing is supported as std::array is fixed in size - template - inline std::array* - getslice(const std::array* self, Difference i, Difference j, Py_ssize_t step) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj); - - if (step == 1 && ii == 0 && static_cast(jj) == size) { - Sequence *sequence = new Sequence(); - std::copy(self->begin(), self->end(), sequence->begin()); - return sequence; - } else if (step == -1 && static_cast(ii) == (size - 1) && jj == -1) { - Sequence *sequence = new Sequence(); - std::copy(self->rbegin(), self->rend(), sequence->begin()); - return sequence; - } else { - throw std::invalid_argument("std::array object only supports getting a slice that is the size of the array"); - } - } - - template - inline void - setslice(std::array* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - - if (step == 1 && ii == 0 && static_cast(jj) == size) { - std::copy(is.begin(), is.end(), self->begin()); - } else if (step == -1 && static_cast(ii) == (size - 1) && jj == -1) { - std::copy(is.rbegin(), is.rend(), self->begin()); - } else { - throw std::invalid_argument("std::array object only supports setting a slice that is the size of the array"); - } - } - - template - inline void - delslice(std::array* SWIGUNUSEDPARM(self), Difference SWIGUNUSEDPARM(i), Difference SWIGUNUSEDPARM(j), Py_ssize_t SWIGUNUSEDPARM(step)) { - throw std::invalid_argument("std::array object does not support item deletion"); - } - } -%} - -#define %swig_array_methods(Type...) %swig_sequence_methods_non_resizable(Type) -#define %swig_array_methods_val(Type...) %swig_sequence_methods_non_resizable_val(Type); - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/python/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_basic_string.i b/mac/bin/swig/share/swig/4.1.0/python/std_basic_string.i deleted file mode 100755 index e3f524db..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_basic_string.i +++ /dev/null @@ -1,89 +0,0 @@ -#if !defined(SWIG_STD_STRING) -#define SWIG_STD_BASIC_STRING - -%include - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(PyObject* obj, std::string **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::string *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - PyErr_Clear(); - char* buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::string(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } else { - if (val) *val = 0; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromCharPtrAndSize") { -SWIGINTERNINLINE PyObject* - SWIG_From(std::basic_string)(const std::string& s) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } -} - -%include -%typemaps_asptrfromn(%checkcode(STRING), std::basic_string); - -#endif - - -#if !defined(SWIG_STD_WSTRING) - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsWCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(PyObject* obj, std::wstring **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::wstring *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - PyErr_Clear(); - wchar_t *buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsWCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::wstring(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } else { - if (val) *val = 0; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromWCharPtrAndSize") { -SWIGINTERNINLINE PyObject* - SWIG_From(std::basic_string)(const std::wstring& s) { - return SWIG_FromWCharPtrAndSize(s.data(), s.size()); - } -} - -%typemaps_asptrfromn(%checkcode(UNISTRING), std::basic_string); - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_carray.i b/mac/bin/swig/share/swig/4.1.0/python/std_carray.i deleted file mode 100755 index 680d6711..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_carray.i +++ /dev/null @@ -1,54 +0,0 @@ -%include - - -%fragment("StdCarrayTraits","header",fragment="StdSequenceTraits") -{ -namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::carray **array) { - return traits_asptr_stdseq >::asptr(obj, array); - } - }; -} -} - -%warnfilter(SWIGWARN_IGNORE_OPERATOR_INDEX) std::carray::operator[]; - -%extend std::carray { - %fragment(SWIG_Traits_frag(std::carray<_Type, _Size >), "header", - fragment="SwigPyIterator_T", - fragment=SWIG_Traits_frag(_Type), - fragment="StdCarrayTraits") { - namespace swig { - template <> struct traits > { - typedef pointer_category category; - static const char* type_name() { - return "std::carray<" #_Type "," #_Size " >"; - } - }; - } - } - - %typemaps_asptr(SWIG_TYPECHECK_VECTOR, swig::asptr, - SWIG_Traits_frag(std::carray<_Type, _Size >), - std::carray<_Type, _Size >); - - %typemap(out,noblock=1) iterator, const_iterator { - $result = SWIG_NewPointerObj(swig::make_output_iterator((const $type &)$1), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); - } - - inline size_t __len__() const { return self->size(); } - - inline const _Type& __getitem__(size_t i) const { return (*self)[i]; } - - inline void __setitem__(size_t i, const _Type& v) { (*self)[i] = v; } - - - swig::SwigPyIterator* __iter__(PyObject **PYTHON_SELF) { - return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } -} - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_char_traits.i b/mac/bin/swig/share/swig/4.1.0/python/std_char_traits.i deleted file mode 100755 index bf4e6c47..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_common.i b/mac/bin/swig/share/swig/4.1.0/python/std_common.i deleted file mode 100755 index 60576623..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_common.i +++ /dev/null @@ -1,74 +0,0 @@ -%include -%include - - -/* - Generate the traits for a 'primitive' type, such as 'double', - for which the SWIG_AsVal and SWIG_From methods are already defined. -*/ - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(PyObject *obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static PyObject *from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(PyObject *obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static PyObject *from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_complex.i b/mac/bin/swig/share/swig/4.1.0/python/std_complex.i deleted file mode 100755 index c9c46c4c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_complex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); - diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_container.i b/mac/bin/swig/share/swig/4.1.0/python/std_container.i deleted file mode 100755 index d24c1570..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_deque.i b/mac/bin/swig/share/swig/4.1.0/python/std_deque.i deleted file mode 100755 index d9a17470..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_deque.i +++ /dev/null @@ -1,27 +0,0 @@ -/* - Deques -*/ - -%fragment("StdDequeTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::deque **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::deque& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_except.i b/mac/bin/swig/share/swig/4.1.0/python/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_ios.i b/mac/bin/swig/share/swig/4.1.0/python/std_ios.i deleted file mode 100755 index aa6f0994..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_ios.i +++ /dev/null @@ -1,3 +0,0 @@ -%rename(ios_base_in) std::ios_base::in; - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_iostream.i b/mac/bin/swig/share/swig/4.1.0/python/std_iostream.i deleted file mode 100755 index 43d6b0c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_iostream.i +++ /dev/null @@ -1,8 +0,0 @@ -namespace std -{ -%callback(1) endl; -%callback(1) ends; -%callback(1) flush; -} - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_list.i b/mac/bin/swig/share/swig/4.1.0/python/std_list.i deleted file mode 100755 index 24d274b4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_list.i +++ /dev/null @@ -1,28 +0,0 @@ -/* - Lists -*/ - -%fragment("StdListTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::list& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_map.i b/mac/bin/swig/share/swig/4.1.0/python/std_map.i deleted file mode 100755 index e0b7d69d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_map.i +++ /dev/null @@ -1,310 +0,0 @@ -/* - Maps -*/ - -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") -{ - namespace swig { - template - struct from_key_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.first); - } - }; - - template - struct from_value_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.second); - } - }; - - template - struct SwigPyMapIterator_T : SwigPyIteratorClosed_T - { - SwigPyMapIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct SwigPyMapKeyIterator_T : SwigPyMapIterator_T - { - SwigPyMapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapIterator_T(curr, first, last, seq) - { - } - }; - - template - inline SwigPyIterator* - make_output_key_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapKeyIterator_T(current, begin, end, seq); - } - - template > - struct SwigPyMapValueIterator_T : SwigPyMapIterator_T - { - SwigPyMapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline SwigPyIterator* - make_output_value_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapValueIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::map map_type; - static int asptr(PyObject *obj, map_type **val) { - int res = SWIG_ERROR; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq >::asptr(items, val); - } else { - map_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } - }; - - template - struct traits_from > { - typedef std::map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static PyObject *asdict(const map_type& map) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - size_type size = map.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return obj; - } - - static PyObject *from(const map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - return asdict(map); - } - } - }; - } -} - -%define %swig_map_common(Map...) - %swig_sequence_iterator(Map); - %swig_container_methods(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_length", functype="lenfunc") __len__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "tp_iter", functype="getiterfunc") key_iterator; - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; - - %extend { - %newobject iterkeys(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iterkeys(PyObject **PYTHON_SELF) { - return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject itervalues(PyObject **PYTHON_SELF); - swig::SwigPyIterator* itervalues(PyObject **PYTHON_SELF) { - return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject iteritems(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iteritems(PyObject **PYTHON_SELF) { - return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -#else - %extend { - %pythoncode %{def __iter__(self): - return self.key_iterator()%} - %pythoncode %{def iterkeys(self): - return self.key_iterator()%} - %pythoncode %{def itervalues(self): - return self.value_iterator()%} - %pythoncode %{def iteritems(self): - return self.iterator()%} - } -#endif - - %extend { - mapped_type const & __getitem__(const key_type& key) throw (std::out_of_range) { - Map::const_iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - - void __delitem__(const key_type& key) throw (std::out_of_range) { - Map::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - - bool has_key(const key_type& key) const { - Map::const_iterator i = self->find(key); - return i != self->end(); - } - - PyObject* keys() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* keyList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(keyList, j, swig::from(i->first)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return keyList; - } - - PyObject* values() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* valList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(valList, j, swig::from(i->second)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return valList; - } - - PyObject* items() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* itemList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(itemList, j, swig::from(*i)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return itemList; - } - - bool __contains__(const key_type& key) { - return self->find(key) != self->end(); - } - - %newobject key_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* key_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject value_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* value_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -%enddef - -%define %swig_map_methods(Map...) - %swig_map_common(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - (*self)[key] = x; - } - - PyObject* asdict() { - return swig::traits_from< Map >::asdict(*self); - } - } - - -%enddef - - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_multimap.i b/mac/bin/swig/share/swig/4.1.0/python/std_multimap.i deleted file mode 100755 index bbffb6bc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_multimap.i +++ /dev/null @@ -1,93 +0,0 @@ -/* - Multimaps -*/ -%include - -%fragment("StdMultimapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::multimap *multimap) { - typedef typename std::multimap::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::multimap multimap_type; - static int asptr(PyObject *obj, std::multimap **val) { - int res = SWIG_ERROR; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - multimap_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::multimap multimap_type; - typedef typename multimap_type::const_iterator const_iterator; - typedef typename multimap_type::size_type size_type; - - static PyObject *from(const multimap_type& multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new multimap_type(multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = multimap.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_OverflowError, "multimap size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - return obj; - } - } - }; - } -} - -%define %swig_multimap_methods(Type...) - %swig_map_common(Type); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - self->insert(Type::value_type(key,x)); - } - } -%enddef - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_multiset.i b/mac/bin/swig/share/swig/4.1.0/python/std_multiset.i deleted file mode 100755 index ac430334..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_multiset.i +++ /dev/null @@ -1,41 +0,0 @@ -/* - Multisets -*/ - -%include - -%fragment("StdMultisetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::multiset* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_multiset_methods(Set...) %swig_set_methods(Set) - - - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_pair.i b/mac/bin/swig/share/swig/4.1.0/python/std_pair.i deleted file mode 100755 index cf463cb8..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_pair.i +++ /dev/null @@ -1,206 +0,0 @@ -/* - Pairs -*/ -%include - -//#define SWIG_STD_PAIR_ASVAL - -%fragment("StdPairTraits","header",fragment="StdTraits") { - namespace swig { -#ifdef SWIG_STD_PAIR_ASVAL - template - struct traits_asval > { - typedef std::pair value_type; - - static int get_pair(PyObject* first, PyObject* second, - std::pair *val) - { - if (val) { - T *pfirst = &(val->first); - int res1 = swig::asval((PyObject*)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = &(val->second); - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } else { - T *pfirst = 0; - int res1 = swig::asval((PyObject*)first, 0); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asval(PyObject *obj, std::pair *val) { - int res = SWIG_ERROR; - if (PyTuple_Check(obj)) { - if (PyTuple_GET_SIZE(obj) == 2) { - res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val); - } - } else if (PySequence_Check(obj)) { - if (PySequence_Size(obj) == 2) { - swig::SwigVar_PyObject first = PySequence_GetItem(obj,0); - swig::SwigVar_PyObject second = PySequence_GetItem(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = *p; - } - return res; - } - }; - -#else - template - struct traits_asptr > { - typedef std::pair value_type; - - static int get_pair(PyObject* first, PyObject* second, - std::pair **val) - { - if (val) { - value_type *vp = %new_instance(std::pair); - T *pfirst = &(vp->first); - int res1 = swig::asval((PyObject*)first, pfirst); - if (!SWIG_IsOK(res1)) { - %delete(vp); - return res1; - } - U *psecond = &(vp->second); - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) { - %delete(vp); - return res2; - } - *val = vp; - return SWIG_AddNewMask(res1 > res2 ? res1 : res2); - } else { - T *pfirst = 0; - int res1 = swig::asval((PyObject*)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asptr(PyObject *obj, std::pair **val) { - int res = SWIG_ERROR; - if (PyTuple_Check(obj)) { - if (PyTuple_GET_SIZE(obj) == 2) { - res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val); - } - } else if (PySequence_Check(obj)) { - if (PySequence_Size(obj) == 2) { - swig::SwigVar_PyObject first = PySequence_GetItem(obj,0); - swig::SwigVar_PyObject second = PySequence_GetItem(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - -#endif - template - struct traits_from > { - static PyObject *from(const std::pair& val) { - PyObject* obj = PyTuple_New(2); - PyTuple_SetItem(obj,0,swig::from(val.first)); - PyTuple_SetItem(obj,1,swig::from(val.second)); - return obj; - } - }; - } - -#if defined(SWIGPYTHON_BUILTIN) -SWIGINTERN Py_ssize_t -SwigPython_std_pair_len (PyObject *a) -{ - return 2; -} - -SWIGINTERN PyObject* -SwigPython_std_pair_repr (PyObject *o) -{ - PyObject *tuple = PyTuple_New(2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, PyObject_GetAttrString(o, (char*) "first")); - PyTuple_SET_ITEM(tuple, 1, PyObject_GetAttrString(o, (char*) "second")); - PyObject *result = PyObject_Repr(tuple); - Py_DECREF(tuple); - return result; -} - -SWIGINTERN PyObject* -SwigPython_std_pair_getitem (PyObject *a, Py_ssize_t b) -{ - PyObject *result = PyObject_GetAttrString(a, b % 2 ? (char*) "second" : (char*) "first"); - return result; -} - -SWIGINTERN int -SwigPython_std_pair_setitem (PyObject *a, Py_ssize_t b, PyObject *c) -{ - int result = PyObject_SetAttrString(a, b % 2 ? (char*) "second" : (char*) "first", c); - return result; -} -#endif - -} - -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; - -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; - -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; - -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; - -%define %swig_pair_methods(pair...) -#if !defined(SWIGPYTHON_BUILTIN) -%extend { -%pythoncode %{def __len__(self): - return 2 -def __repr__(self): - return str((self.first, self.second)) -def __getitem__(self, index): - if not (index % 2): - return self.first - else: - return self.second -def __setitem__(self, index, val): - if not (index % 2): - self.first = val - else: - self.second = val%} -} -#endif -%enddef - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_set.i b/mac/bin/swig/share/swig/4.1.0/python/std_set.i deleted file mode 100755 index 0ef01199..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_set.i +++ /dev/null @@ -1,67 +0,0 @@ -/* - Sets -*/ - -%fragment("StdSetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::set* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%define %swig_set_methods(set...) - %swig_sequence_iterator(set); - %swig_container_methods(set); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; -#endif - - %extend { - void append(value_type x) { - self->insert(x); - } - - bool __contains__(value_type x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void add(value_type x) { - self->insert(x); - } - - void discard(value_type x) { - self->erase(x); - } - } -%enddef - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/python/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_sstream.i b/mac/bin/swig/share/swig/4.1.0/python/std_sstream.i deleted file mode 100755 index 6647df8c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_sstream.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_streambuf.i b/mac/bin/swig/share/swig/4.1.0/python/std_streambuf.i deleted file mode 100755 index 44b9bb4d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_streambuf.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_string.i b/mac/bin/swig/share/swig/4.1.0/python/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/python/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_unordered_map.i b/mac/bin/swig/share/swig/4.1.0/python/std_unordered_map.i deleted file mode 100755 index 784be4c8..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_unordered_map.i +++ /dev/null @@ -1,296 +0,0 @@ -/* - Unordered Maps -*/ -%include - -%fragment("StdUnorderedMapForwardIteratorTraits","header") -{ - namespace swig { - template - struct SwigPyMapForwardIterator_T : SwigPyForwardIteratorClosed_T - { - SwigPyMapForwardIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyForwardIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct SwigPyMapKeyForwardIterator_T : SwigPyMapForwardIterator_T - { - SwigPyMapKeyForwardIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapForwardIterator_T(curr, first, last, seq) - { - } - }; - - template - inline SwigPyIterator* - make_output_key_forward_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapKeyForwardIterator_T(current, begin, end, seq); - } - - template > - struct SwigPyMapValueForwardIterator_T : SwigPyMapForwardIterator_T - { - SwigPyMapValueForwardIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapForwardIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline SwigPyIterator* - make_output_value_forward_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapValueForwardIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_map *unordered_map) { - typedef typename std::unordered_map::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - unordered_map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_map &seq, typename std::unordered_map::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - typedef std::unordered_map unordered_map_type; - static int asptr(PyObject *obj, unordered_map_type **val) { - int res = SWIG_ERROR; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - unordered_map_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_map unordered_map_type; - typedef typename unordered_map_type::const_iterator const_iterator; - typedef typename unordered_map_type::size_type size_type; - - static PyObject *asdict(const unordered_map_type& map) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - size_type size = map.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return obj; - } - - static PyObject *from(const unordered_map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new unordered_map_type(map), desc, SWIG_POINTER_OWN); - } else { - return asdict(map); - } - } - }; - } -} - -%define %swig_unordered_map_common(Map...) - %swig_sequence_forward_iterator(Map); - %swig_container_methods(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_length", functype="lenfunc") __len__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "tp_iter", functype="getiterfunc") key_iterator; - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; - - %extend { - %newobject iterkeys(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iterkeys(PyObject **PYTHON_SELF) { - return swig::make_output_key_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject itervalues(PyObject **PYTHON_SELF); - swig::SwigPyIterator* itervalues(PyObject **PYTHON_SELF) { - return swig::make_output_value_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject iteritems(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iteritems(PyObject **PYTHON_SELF) { - return swig::make_output_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -#else - %extend { - %pythoncode %{def __iter__(self): - return self.key_iterator()%} - %pythoncode %{def iterkeys(self): - return self.key_iterator()%} - %pythoncode %{def itervalues(self): - return self.value_iterator()%} - %pythoncode %{def iteritems(self): - return self.iterator()%} - } -#endif - - %extend { - mapped_type const & __getitem__(const key_type& key) throw (std::out_of_range) { - Map::const_iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - - void __delitem__(const key_type& key) throw (std::out_of_range) { - Map::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - - bool has_key(const key_type& key) const { - Map::const_iterator i = self->find(key); - return i != self->end(); - } - - PyObject* keys() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "unordered_map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* keyList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(keyList, j, swig::from(i->first)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return keyList; - } - - PyObject* values() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "unordered_map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* valList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(valList, j, swig::from(i->second)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return valList; - } - - PyObject* items() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "unordered_map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* itemList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(itemList, j, swig::from(*i)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return itemList; - } - - bool __contains__(const key_type& key) { - return self->find(key) != self->end(); - } - - %newobject key_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* key_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_key_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject value_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* value_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_value_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -%enddef - -%define %swig_unordered_map_methods(Map...) - %swig_unordered_map_common(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - (*self)[key] = x; - } - - PyObject* asdict() { - return swig::traits_from< Map >::asdict(*self); - } - } - - -%enddef - - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_unordered_multimap.i b/mac/bin/swig/share/swig/4.1.0/python/std_unordered_multimap.i deleted file mode 100755 index bc095ea4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_unordered_multimap.i +++ /dev/null @@ -1,100 +0,0 @@ -/* - Unordered Multimaps -*/ -%include - -%fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multimap *unordered_multimap) { - typedef typename std::unordered_multimap::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - unordered_multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_multimap &seq, typename std::unordered_multimap::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - typedef std::unordered_multimap unordered_multimap_type; - static int asptr(PyObject *obj, std::unordered_multimap **val) { - int res = SWIG_ERROR; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - unordered_multimap_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_multimap unordered_multimap_type; - typedef typename unordered_multimap_type::const_iterator const_iterator; - typedef typename unordered_multimap_type::size_type size_type; - - static PyObject *from(const unordered_multimap_type& unordered_multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new unordered_multimap_type(unordered_multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = unordered_multimap.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_OverflowError, "unordered_multimap size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= unordered_multimap.begin(); i!= unordered_multimap.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - return obj; - } - } - }; - } -} - -%define %swig_unordered_multimap_methods(Type...) - %swig_unordered_map_common(Type); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - self->insert(Type::value_type(key,x)); - } - } -%enddef - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_unordered_multiset.i b/mac/bin/swig/share/swig/4.1.0/python/std_unordered_multiset.i deleted file mode 100755 index b0f3f096..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_unordered_multiset.i +++ /dev/null @@ -1,48 +0,0 @@ -/* - Unordered Multisets -*/ - -%include - -%fragment("StdUnorderedMultisetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multiset* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_multiset &seq, typename std::unordered_multiset::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::unordered_multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::unordered_multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_unordered_multiset_methods(Set...) %swig_unordered_set_methods(Set) - - - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_unordered_set.i b/mac/bin/swig/share/swig/4.1.0/python/std_unordered_set.i deleted file mode 100755 index 79fca6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_unordered_set.i +++ /dev/null @@ -1,67 +0,0 @@ -/* - Unordered Sets -*/ - -%fragment("StdUnorderedSetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_set* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_set &seq, typename std::unordered_set::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::unordered_set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::unordered_set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%define %swig_unordered_set_methods(unordered_set...) - %swig_sequence_forward_iterator(unordered_set); - %swig_container_methods(unordered_set); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; -#endif - - - %extend { - void append(value_type x) { - self->insert(x); - } - - bool __contains__(value_type x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - } -%enddef - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_vector.i b/mac/bin/swig/share/swig/4.1.0/python/std_vector.i deleted file mode 100755 index 2ac41a54..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_vector.i +++ /dev/null @@ -1,34 +0,0 @@ -/* - Vectors -*/ - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_reserve > { - static void reserve(std::vector &seq, typename std::vector::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_vectora.i b/mac/bin/swig/share/swig/4.1.0/python/std_vectora.i deleted file mode 100755 index 3f084bd7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_vectora.i +++ /dev/null @@ -1,31 +0,0 @@ -/* - Vectors + allocators -*/ - -%fragment("StdVectorATraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - typedef std::vector vector_type; - typedef T value_type; - static int asptr(PyObject *obj, vector_type **vec) { - return traits_asptr_stdseq::asptr(obj, vec); - } - }; - - template - struct traits_from > { - typedef std::vector vector_type; - static PyObject *from(const vector_type& vec) { - return traits_from_stdseq::from(vec); - } - }; - } -%} - - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_wios.i b/mac/bin/swig/share/swig/4.1.0/python/std_wios.i deleted file mode 100755 index 930a57dd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_wios.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_wiostream.i b/mac/bin/swig/share/swig/4.1.0/python/std_wiostream.i deleted file mode 100755 index d3a5ee78..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_wiostream.i +++ /dev/null @@ -1,10 +0,0 @@ -namespace std -{ -%callback(1) wendl; -%callback(1) wends; -%callback(1) wflush; -} - -%include -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_wsstream.i b/mac/bin/swig/share/swig/4.1.0/python/std_wsstream.i deleted file mode 100755 index 8843f56d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_wsstream.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_wstreambuf.i b/mac/bin/swig/share/swig/4.1.0/python/std_wstreambuf.i deleted file mode 100755 index c0f09201..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_wstreambuf.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/std_wstring.i b/mac/bin/swig/share/swig/4.1.0/python/std_wstring.i deleted file mode 100755 index ef862813..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/std_wstring.i +++ /dev/null @@ -1,3 +0,0 @@ -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/python/stl.i b/mac/bin/swig/share/swig/4.1.0/python/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/python/swigmove.i b/mac/bin/swig/share/swig/4.1.0/python/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/typemaps.i b/mac/bin/swig/share/swig/4.1.0/python/typemaps.i deleted file mode 100755 index dba63dd5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/typemaps.i +++ /dev/null @@ -1,148 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Python tuple. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Python output of the function would be a tuple containing both -output values. - -*/ - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Python tuple. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Python). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Python variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/python/wchar.i b/mac/bin/swig/share/swig/4.1.0/python/wchar.i deleted file mode 100755 index 308139a3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/python/wchar.i +++ /dev/null @@ -1,21 +0,0 @@ -#ifdef __cplusplus - -%{ -#include -%} - -#else - -%{ -#include -%} - -#endif - -%types(wchar_t *); -%include - -/* - Enable swig wchar support. -*/ -#define SWIG_WCHAR diff --git a/mac/bin/swig/share/swig/4.1.0/r/boost_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/r/boost_shared_ptr.i deleted file mode 100755 index 13f041fb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/boost_shared_ptr.i +++ /dev/null @@ -1,420 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - -%typemap(rtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "$typemap(rtype, TYPE)" - -%typemap(scoercein) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - %{ if (inherits($input, "ExternalReference")) $input = slot($input,"ref"); %} - -%typemap(scoerceout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - %{ $result <- if (is.null($result)) $result - else new("$typemap(rtype, TYPE)", ref=$result); %} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/r/cdata.i b/mac/bin/swig/share/swig/4.1.0/r/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/r/exception.i b/mac/bin/swig/share/swig/4.1.0/r/exception.i deleted file mode 100755 index 39cb0959..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/exception.i +++ /dev/null @@ -1,8 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), -%block(switch (code) {case SWIG_IndexError: return Rf_ScalarLogical(NA_LOGICAL); default: %error(code, msg); SWIG_fail;} )) -} - diff --git a/mac/bin/swig/share/swig/4.1.0/r/r.swg b/mac/bin/swig/share/swig/4.1.0/r/r.swg deleted file mode 100755 index c1ce37c3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/r.swg +++ /dev/null @@ -1,281 +0,0 @@ -/* */ - - -%insert("header") "swiglabels.swg" - -%insert("init") "swiginit.swg" -%insert("runtime") "swigrun.swg" -%insert("runtime") "swigerrors.swg" -%insert("runtime") "rrun.swg" - -%init %{ -SWIGEXPORT void SWIG_init(void) { -%} - -%include - -#define %Rruntime %insert("s") - -#define SWIG_Object SEXP -#define VOID_Object R_NilValue - -#define %append_output(obj) SET_VECTOR_ELT($result, $n, obj) - -%define %set_constant(name, obj) %begin_block - SEXP _obj = obj; - assign(name, _obj); -%end_block %enddef - -%runtime %{ -SWIGINTERN void SWIG_R_Raise(SEXP obj, const char *msg) { - Rf_error(Rf_isString(obj) ? CHAR(Rf_asChar(obj)) : msg); -} -%} - -#define %raise(OBJ, TYPE, DESC) SWIG_R_Raise(OBJ, "C/C++ exception of type " TYPE); return R_NilValue - -%insert("sinit") "srun.swg" - -%insert("sinitroutine") %{ -SWIG_init(); -SWIG_InitializeModule(0); -%} - -%include -%typemap(in) (double *x, int len) %{ - $1 = REAL(x); - $2 = Rf_length(x); -%} - -/* XXX - Need to worry about inheritance, e.g. if B extends A - and we are looking for an A[], then B elements are okay. -*/ -%typemap(scheck) SWIGTYPE[ANY] - %{ -# assert(length($input) > $1_dim0) - assert(all(sapply($input, class) == "$R_class")); - %} - -%typemap(out) void "" - -%typemap(in) int *, int[ANY], - signed int *, signed int[ANY], - unsigned int *, unsigned int[ANY], - short *, short[ANY], - signed short *, signed short[ANY], - unsigned short *, unsigned short[ANY], - long *, long[ANY], - signed long *, signed long[ANY], - unsigned long *, unsigned long[ANY], - long long *, long long[ANY], - signed long long *, signed long long[ANY], - unsigned long long *, unsigned long long[ANY] - -{ -{ int _rswigi; - int _rswiglen = LENGTH($input); - $1 = %static_cast(calloc(sizeof($1_basetype), _rswiglen), $1_ltype); - for (_rswigi=0; _rswigi< _rswiglen; _rswigi++) { - $1[_rswigi] = INTEGER($input)[_rswigi]; - } -} -} - -%typemap(in) float *, float[ANY], - double *, double[ANY] - -{ -{ int _rswigi; - int _rswiglen = LENGTH($input); - $1 = %static_cast(calloc(sizeof($1_basetype), _rswiglen), $1_ltype); - for (_rswigi=0; _rswigi<_rswiglen; _rswigi++) { - $1[_rswigi] = REAL($input)[_rswigi]; - } -} -} - -%typemap(freearg,noblock=1) int *, int[ANY], - signed int *, signed int[ANY], - unsigned int *, unsigned int[ANY], - short *, short[ANY], - signed short *, signed short[ANY], - unsigned short *, unsigned short[ANY], - long *, long[ANY], - signed long *, signed long[ANY], - unsigned long *, unsigned long[ANY], - long long *, long long[ANY], - signed long long *, signed long long[ANY], - unsigned long long *, unsigned long long[ANY], - float *, float[ANY], - double *, double[ANY] -%{ - free($1); -%} - -%typemap(freearg, noblock=1) int *OUTPUT, -signed int *OUTPUT, -unsigned int *OUTPUT, -short *OUTPUT, -signed short *OUTPUT, -unsigned short *OUTPUT, -long *OUTPUT, -signed long *OUTPUT, -unsigned long *OUTPUT, -long long *OUTPUT, -signed long long *OUTPUT, -unsigned long long *OUTPUT, -float *OUTPUT, -double *OUTPUT, -char *OUTPUT, -signed char *OUTPUT, -unsigned char *OUTPUT -{} - - - -/* Should we recycle to make the length correct. - And warn if length() > the dimension. -*/ -%typemap(scheck) SWIGTYPE [ANY] %{ -# assert(length($input) >= $1_dim0) -%} - -/* Handling vector case to avoid warnings, - although we just use the first one. */ -%typemap(scheck) unsigned int %{ - assert(length($input) == 1 && $input >= 0, "All values must be non-negative"); -%} - - -%typemap(scheck) int, long %{ - if(length($input) > 1) { - warning("using only the first element of $input"); - }; -%} - -%include -%include -%include -%include -%include - -%typemap(in,noblock=1) enum SWIGTYPE[ANY] { - $1 = %reinterpret_cast(INTEGER($input), $1_ltype); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char * { - $1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype); -} - -%typemap(freearg,noblock=1) char * { - free($1); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char *[ANY] { - $1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype); -} - -%typemap(freearg,noblock=1) char *[ANY] { - free($1); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char[ANY] { - $1 = SWIG_strdup(CHAR(STRING_ELT($input, 0))); -} - -%typemap(freearg,noblock=1) char[ANY] { - free($1); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char[] { - $1 = SWIG_strdup(CHAR(STRING_ELT($input, 0))); -} - -%typemap(freearg,noblock=1) char[] { - free($1); -} - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)INTEGER($input)[0]; - $1 = &temp; %} - -%typemap(out) const enum SWIGTYPE & %{ $result = Rf_ScalarInteger((int)*$1); %} - -%typemap(memberin) char[] %{ -if ($input) strcpy($1, $input); -else -strcpy($1, ""); -%} - -%typemap(globalin) char[] %{ -if ($input) strcpy($1, $input); -else -strcpy($1, ""); -%} - -%typemap(out,noblock=1) char * - { $result = $1 ? Rf_mkString(%reinterpret_cast($1,char *)) : R_NilValue; } - -%typemap(in,noblock=1) char { -$1 = %static_cast(CHAR(STRING_ELT($input, 0))[0],$1_ltype); -} - -%typemap(out) char - { - char tmp[2] = "x"; - tmp[0] = $1; - $result = Rf_mkString(tmp); - } - - -%typemap(in,noblock=1) int, long -{ - $1 = %static_cast(INTEGER($input)[0], $1_ltype); -} - -%typemap(out,noblock=1) int, long - "$result = Rf_ScalarInteger($1);"; - - -%typemap(in,noblock=1) bool - "$1 = LOGICAL($input)[0] ? true : false;"; - - -%typemap(out,noblock=1) bool - "$result = Rf_ScalarLogical($1);"; - -%typemap(in,noblock=1) - float, - double -{ - $1 = %static_cast(REAL($input)[0], $1_ltype); -} - -/* Why is this here ? */ -/* %typemap(out,noblock=1) unsigned int * - "$result = ScalarReal(*($1));"; */ - -%Rruntime %{ -setMethod('[', "ExternalReference", -function(x,i,j, ..., drop=TRUE) -if (!is.null(x$"__getitem__")) -sapply(i, function(n) x$"__getitem__"(i=as.integer(n-1)))) - -setMethod('[<-' , "ExternalReference", -function(x,i,j, ..., value) -if (!is.null(x$"__setitem__")) { -sapply(1:length(i), function(n) -x$"__setitem__"(i=as.integer(i[n]-1), x=value[n])) -x -}) - -setAs('ExternalReference', 'character', -function(from) {if (!is.null(from$"__str__")) from$"__str__"()}) - -suppressMessages(suppressWarnings(setMethod('print', 'ExternalReference', -function(x) {print(as(x, "character"))}))) -%} - - - diff --git a/mac/bin/swig/share/swig/4.1.0/r/rcontainer.swg b/mac/bin/swig/share/swig/4.1.0/r/rcontainer.swg deleted file mode 100755 index 54b31b39..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/rcontainer.swg +++ /dev/null @@ -1,198 +0,0 @@ - -// -// Common fragments -// - - -/**** The python container methods ****/ - - - -%fragment("StdSequenceTraits","header",fragment="") -{ -%#include -namespace swig { - inline size_t - check_index(ptrdiff_t i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - - throw std::out_of_range("index out of range"); - } - - inline size_t - slice_index(ptrdiff_t i, size_t size) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) { - return (size_t) (i + size); - } else { - throw std::out_of_range("index out of range"); - } - } else { - return ( (size_t) i < size ) ? ((size_t) i) : size; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (jj > ii) { - typename Sequence::const_iterator vb = self->begin(); - typename Sequence::const_iterator ve = self->begin(); - std::advance(vb,ii); - std::advance(ve,jj); - return new Sequence(vb, ve); - } else { - return new Sequence(); - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj < ii) jj = ii; - size_t ssize = jj - ii; - if (ssize <= v.size()) { - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); - std::advance(sb,ii); - std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); - } else { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj > ii) { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - } - } -} -} - -%define %swig_container_methods(Container...) - - %newobject __getslice__; - - %extend { - bool __nonzero__() const { - return !(self->empty()); - } - - size_type __len__() const { - return self->size(); - } - } -%enddef - -%define %swig_sequence_methods_common(Sequence...) -// %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - - %fragment("StdSequenceTraits"); - - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range) { - return swig::getslice(self, i, j); - } - - void __setslice__(difference_type i, difference_type j, const Sequence& v) - throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, v); - } - - void __delslice__(difference_type i, difference_type j) throw (std::out_of_range) { - swig::delslice(self, i, j); - } - - void __delitem__(difference_type i) throw (std::out_of_range) { - self->erase(swig::getpos(self,i)); - } - } -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - const value_type& __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, const value_type& x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - - void append(const value_type& x) { - self->push_back(x); - } - } -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - value_type __getitem__(difference_type i) throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, value_type x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - - void append(value_type x) { - self->push_back(x); - } - } -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/r/rfragments.swg b/mac/bin/swig/share/swig/4.1.0/r/rfragments.swg deleted file mode 100755 index c3b40a90..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/rfragments.swg +++ /dev/null @@ -1,191 +0,0 @@ -/* for raw pointers */ -#define SWIG_ConvertPtr(oc, ptr, ty, flags) SWIG_R_ConvertPtr(oc, ptr, ty, flags) -#define SWIG_ConvertFunctionPtr(oc, ptr, ty) SWIG_R_ConvertPtr(oc, ptr, ty, 0) -#define SWIG_NewPointerObj(ptr, ty, flags) SWIG_R_NewPointerObj(ptr, ty, flags) -#define SWIG_NewFunctionPtrObj(ptr, ty) SWIG_R_NewPointerObj(ptr, ty, 0) - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_R_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, ty) SWIG_R_NewPackedObj(ptr, sz, ty) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, ty, flags) SWIG_ConvertPtr(obj, pptr, ty, flags) -#define SWIG_NewInstanceObj(ptr, ty, flags) SWIG_NewPointerObj(ptr, ty, flags) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_R_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, ty) SWIG_R_NewPackedObj(ptr, sz, ty) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_R_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_R_SetModule(pointer) - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE SEXP -SWIG_From_dec(long)(long value) -{ - return Rf_ScalarInteger((int)value); -} -} - -%fragment(SWIG_AsVal_frag(long),"header") { -SWIGINTERNINLINE int -SWIG_AsVal_dec(long)(SEXP obj, long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -} - - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SEXP -SWIG_From_dec(long long)(long long value) -{ - return Rf_ScalarInteger((int)value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE int -SWIG_AsVal_dec(long long)(SEXP obj, long long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -%#endif -} - -%fragment(SWIG_From_frag(unsigned long),"header") { -SWIGINTERNINLINE SEXP -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return Rf_ScalarInteger((int)value); -} -} - - -%fragment(SWIG_AsVal_frag(unsigned long),"header") { -SWIGINTERNINLINE int -SWIG_AsVal_dec(unsigned long)(SEXP obj, unsigned long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -} - - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SEXP -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return Rf_ScalarInteger((int)value); -} -%#endif -} - - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE int -SWIG_AsVal_dec(unsigned long long)(SEXP obj, unsigned long long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -%#endif -} - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERNINLINE SEXP -SWIG_From_dec(double)(double value) -{ - return Rf_ScalarReal(value); -} -} - - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERNINLINE int -SWIG_AsVal_dec(double)(SEXP obj, double *val) -{ - if (val) *val = Rf_asReal(obj); - return SWIG_OK; -} -} - -%fragment("SWIG_AsCharPtrAndSize", "header") -{ -SWIGINTERN int -SWIG_AsCharPtrAndSize(SEXP obj, char** cptr, size_t* psize, int *alloc) -{ - if (cptr && Rf_isString(obj)) { - char *cstr = %const_cast(CHAR(STRING_ELT(obj, 0)), char *); - int len = strlen(cstr); - - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - } - } else { - *cptr = %reinterpret_cast(malloc(len + 1), char *); - *cptr = strcpy(*cptr, cstr); - } - if (psize) *psize = len + 1; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_strdup","header") -{ -SWIGINTERN char * -SWIG_strdup(const char *str) -{ - char *newstr = %reinterpret_cast(malloc(strlen(str) + 1), char *); - return strcpy(newstr, str); -} -} - -//# This is modified from the R header files - -%fragment("SWIG_FromCharPtrAndSize","header") -{ -SWIGINTERN SEXP -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - SEXP t, c; - if (!carray) return R_NilValue; -/* See R internals document 1.10. - MkCharLen was introduced in 2.7.0. Use that instead of hand - creating vector. - - Starting in 2.8.0 creating strings via vectors was deprecated in - order to allow for use of CHARSXP caches. */ - - Rf_protect(t = Rf_allocVector(STRSXP, 1)); -%#if R_VERSION >= R_Version(2,7,0) - c = Rf_mkCharLen(carray, size); -%#else - c = Rf_allocVector(CHARSXP, size); - strncpy((char *)CHAR(c), carray, size); -%#endif - SET_STRING_ELT(t, 0, c); - Rf_unprotect(1); - return t; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/r/rkw.swg b/mac/bin/swig/share/swig/4.1.0/r/rkw.swg deleted file mode 100755 index c4af7084..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/rkw.swg +++ /dev/null @@ -1,36 +0,0 @@ -/* - Warnings for R keywords, built-in names and bad names. -*/ - -#define RKW(x) %keywordwarn("'" `x` "' is a R keyword", rename="_%s") `x` -#define RSWIGKW(x) %keywordwarn("'" `x` "' is a SWIG R reserved parameter name", rename="_%s") `x` - -/* - Warnings for R reserved words taken from - http://cran.r-project.org/doc/manuals/R-lang.html#Reserved-words -*/ - -RKW(if); -RKW(else); -RKW(repeat); -RKW(while); -RKW(function); -RKW(for); -RKW(in); -RKW(next); -RKW(break); -RKW(TRUE); -RKW(FALSE); -RKW(NULL); -RKW(Inf); -RKW(NaN); -RKW(NA); -RKW(NA_integer_); -RKW(NA_real_); -RKW(NA_complex_); -RKW(NA_character_); - -RSWIGKW(self); - -#undef RKW -#undef RSWIGKW diff --git a/mac/bin/swig/share/swig/4.1.0/r/ropers.swg b/mac/bin/swig/share/swig/4.1.0/r/ropers.swg deleted file mode 100755 index acb99798..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/ropers.swg +++ /dev/null @@ -1,32 +0,0 @@ -#ifdef __cplusplus - -%rename(Equal) operator =; -%rename(PlusEqual) operator +=; -%rename(MinusEqual) operator -=; -%rename(MultiplyEqual) operator *=; -%rename(DivideEqual) operator /=; -%rename(PercentEqual) operator %=; -%rename(Plus) operator +; -%rename(Minus) operator -; -%rename(Multiply) operator *; -%rename(Divide) operator /; -%rename(Percent) operator %; -%rename(Not) operator !; -%rename(IndexIntoConst) operator[](unsigned idx) const; -%rename(IndexInto) operator[](unsigned idx); -%rename(Functor) operator (); -%rename(EqualEqual) operator ==; -%rename(NotEqual) operator !=; -%rename(LessThan) operator <; -%rename(LessThanEqual) operator <=; -%rename(GreaterThan) operator >; -%rename(GreaterThanEqual) operator >=; -%rename(And) operator &&; -%rename(Or) operator ||; -%rename(PlusPlusPrefix) operator++(); -%rename(PlusPlusPostfix) operator++(int); -%rename(MinusMinusPrefix) operator--(); -%rename(MinusMinusPostfix) operator--(int); - - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/r/rrun.swg b/mac/bin/swig/share/swig/4.1.0/r/rrun.swg deleted file mode 100755 index 79844612..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/rrun.swg +++ /dev/null @@ -1,420 +0,0 @@ -/* Remove global namespace pollution */ -#if !defined(SWIG_NO_R_NO_REMAP) -# define R_NO_REMAP -#endif -#if !defined(SWIG_NO_STRICT_R_HEADERS) -# define STRICT_R_HEADERS -#endif - -#include -#include - -#ifdef __cplusplus -#include -extern "C" { -#endif - -/* for raw pointer */ -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_R_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_R_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_R_NewPointerObj(ptr, type, flags) - -#include -#include -#include -#include - -#if R_VERSION >= R_Version(2,6,0) -#define VMAXTYPE void * -#else -#define VMAXTYPE char * -#endif - -/* Last error */ -static int SWIG_lasterror_code = 0; -static char SWIG_lasterror_msg[1024]; -SWIGRUNTIME void SWIG_Error(int code, const char *format, ...) { - va_list arg; - SWIG_lasterror_code = code; - va_start(arg, format); - vsnprintf(SWIG_lasterror_msg, sizeof(SWIG_lasterror_msg), format, arg); - va_end(arg); -} - -SWIGRUNTIME const char *SWIG_ErrorType(int code) { - switch (code) { - case SWIG_MemoryError: - return "SWIG:MemoryError"; - case SWIG_IOError: - return "SWIG:IOError"; - case SWIG_RuntimeError: - return "SWIG:RuntimeError"; - case SWIG_IndexError: - return "SWIG:IndexError"; - case SWIG_TypeError: - return "SWIG:TypeError"; - case SWIG_DivisionByZero: - return "SWIG:DivisionByZero"; - case SWIG_OverflowError: - return "SWIG:OverflowError"; - case SWIG_SyntaxError: - return "SWIG:SyntaxError"; - case SWIG_ValueError: - return "SWIG:ValueError"; - case SWIG_SystemError: - return "SWIG:SystemError"; - case SWIG_AttributeError: - return "SWIG:AttributeError"; - } - return "SWIG:UnknownError"; -} - -#define SWIG_fail goto fail - -/* - This is mainly a way to avoid having lots of local variables that may - conflict with those in the routine. - - Change name to R_SWIG_Callb.... -*/ -typedef struct RCallbackFunctionData { - - SEXP fun; - SEXP userData; - - - SEXP expr; - SEXP retValue; - int errorOccurred; - - SEXP el; /* Temporary pointer used in the construction of the expression to call the R function. */ - - struct RCallbackFunctionData *previous; /* Stack */ - -} RCallbackFunctionData; - -static RCallbackFunctionData *callbackFunctionDataStack; - - -SWIGRUNTIME SEXP -R_SWIG_debug_getCallbackFunctionData() -{ - int n, i; - SEXP ans; - RCallbackFunctionData *p = callbackFunctionDataStack; - - n = 0; - while(p) { - n++; - p = p->previous; - } - - Rf_protect(ans = Rf_allocVector(VECSXP, n)); - for(p = callbackFunctionDataStack, i = 0; i < n; p = p->previous, i++) - SET_VECTOR_ELT(ans, i, p->fun); - - Rf_unprotect(1); - - return(ans); -} - - - -SWIGRUNTIME RCallbackFunctionData * -R_SWIG_pushCallbackFunctionData(SEXP fun, SEXP userData) -{ - RCallbackFunctionData *el; - el = (RCallbackFunctionData *) calloc(1, sizeof(RCallbackFunctionData)); - el->fun = fun; - el->userData = userData; - el->previous = callbackFunctionDataStack; - - callbackFunctionDataStack = el; - - return(el); -} - - -SWIGRUNTIME SEXP -R_SWIG_R_pushCallbackFunctionData(SEXP fun, SEXP userData) -{ - R_SWIG_pushCallbackFunctionData(fun, userData); - return R_NilValue; -} - -SWIGRUNTIME RCallbackFunctionData * -R_SWIG_getCallbackFunctionData() -{ - if(!callbackFunctionDataStack) { - Rf_error("Supposedly impossible error occurred in the SWIG callback mechanism." - " No callback function data set."); - } - - return callbackFunctionDataStack; -} - -SWIGRUNTIME void -R_SWIG_popCallbackFunctionData(int doFree) -{ - RCallbackFunctionData *el = NULL; - if(!callbackFunctionDataStack) - return ; /* Error !!! */ - - el = callbackFunctionDataStack ; - callbackFunctionDataStack = callbackFunctionDataStack->previous; - - if(doFree) - free(el); -} - - -/* - Interface to S function - is(obj, type) - which is to be used to determine if an - external pointer inherits from the right class. - - Ideally, we would like to be able to do this without an explicit call to the is() function. - When the S4 class system uses its own SEXP types, then we will hopefully be able to do this - in the C code. - - Should we make the expression static and preserve it to avoid the overhead of - allocating each time. -*/ -SWIGRUNTIME int -R_SWIG_checkInherits(SEXP obj, SEXP tag, const char *type) -{ - SEXP e, val; - int check_err = 0; - - Rf_protect(e = Rf_allocVector(LANGSXP, 3)); - SETCAR(e, Rf_install("extends")); - - SETCAR(CDR(e), Rf_mkString(CHAR(PRINTNAME(tag)))); - SETCAR(CDR(CDR(e)), Rf_mkString(type)); - - val = R_tryEval(e, R_GlobalEnv, &check_err); - Rf_unprotect(1); - if(check_err) - return(0); - - - return(LOGICAL(val)[0]); -} - - -SWIGRUNTIME void * -R_SWIG_resolveExternalRef(SEXP arg, const char * const type, const char * const argName, Rboolean nullOk) -{ - void *ptr; - SEXP orig = arg; - - if(TYPEOF(arg) != EXTPTRSXP) - arg = GET_SLOT(arg, Rf_mkString("ref")); - - - if(TYPEOF(arg) != EXTPTRSXP) { - Rf_error("argument %s must be an external pointer (from an ExternalReference)", argName); - } - - - ptr = R_ExternalPtrAddr(arg); - - if(ptr == NULL && nullOk == (Rboolean) FALSE) { - Rf_error("the external pointer (of type %s) for argument %s has value NULL", argName, type); - } - - if(type[0] && R_ExternalPtrTag(arg) != Rf_install(type) && strcmp(type, "voidRef") - && !R_SWIG_checkInherits(orig, R_ExternalPtrTag(arg), type)) { - Rf_error("the external pointer for argument %s has tag %s, not the expected value %s", - argName, CHAR(PRINTNAME(R_ExternalPtrTag(arg))), type); - } - - - return(ptr); -} - -SWIGRUNTIME void -R_SWIG_ReferenceFinalizer(SEXP el) -{ - void *ptr = R_SWIG_resolveExternalRef(el, "", "", (Rboolean) 1); - fprintf(stderr, "In R_SWIG_ReferenceFinalizer for %p\n", ptr); - Rf_PrintValue(el); - - if(ptr) { - if(TYPEOF(el) != EXTPTRSXP) - el = GET_SLOT(el, Rf_mkString("ref")); - - if(TYPEOF(el) == EXTPTRSXP) - R_ClearExternalPtr(el); - - free(ptr); - } - - return; -} - -SWIGRUNTIME SEXP -SWIG_MakePtr(void *ptr, const char *typeName, int flags) -{ - SEXP external, r_obj; - - Rf_protect(external = R_MakeExternalPtr(ptr, Rf_install(typeName), R_NilValue)); - Rf_protect(r_obj = NEW_OBJECT(MAKE_CLASS((char *) typeName))); - - if (flags & SWIG_POINTER_OWN) - R_RegisterCFinalizer(external, R_SWIG_ReferenceFinalizer); - - r_obj = SET_SLOT(r_obj, Rf_mkString((char *) "ref"), external); - SET_S4_OBJECT(r_obj); - Rf_unprotect(2); - - return(r_obj); -} - - -SWIGRUNTIME SEXP -R_SWIG_create_SWIG_R_Array(const char *typeName, SEXP ref, int len) -{ - SEXP arr; - -/*XXX remove the char * cast when we can. MAKE_CLASS should be declared appropriately. */ - Rf_protect(arr = NEW_OBJECT(MAKE_CLASS((char *) typeName))); - Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("ref"), ref)); - Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("dims"), Rf_ScalarInteger(len))); - - Rf_unprotect(3); - SET_S4_OBJECT(arr); - return arr; -} - -#define ADD_OUTPUT_ARG(result, pos, value, name) r_ans = AddOutputArgToReturn(pos, value, name, OutputValues); - -SWIGRUNTIME SEXP -AddOutputArgToReturn(int pos, SEXP value, const char *name, SEXP output) -{ - SET_VECTOR_ELT(output, pos, value); - - return(output); -} - -/* Create a new pointer object */ -SWIGRUNTIMEINLINE SEXP -SWIG_R_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - SEXP rptr; - if (!ptr) { - return R_NilValue; - } - rptr = R_MakeExternalPtr(ptr, - R_MakeExternalPtr(type, R_NilValue, R_NilValue), R_NilValue); - SET_S4_OBJECT(rptr); - return rptr; -} - - -/* Convert a pointer value */ -SWIGRUNTIMEINLINE int -SWIG_R_ConvertPtr(SEXP obj, void **ptr, swig_type_info *ty, int flags) { - void *vptr; - if (!obj) return SWIG_ERROR; - if (obj == R_NilValue) { - if (ptr) *ptr = NULL; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - vptr = R_ExternalPtrAddr(obj); - if (ty) { - swig_type_info *to = (swig_type_info*) - R_ExternalPtrAddr(R_ExternalPtrTag(obj)); - if (to == ty) { - if (ptr) *ptr = vptr; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - int newmemory = 0; - if (ptr) *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } - } else { - if (ptr) *ptr = vptr; - } - return SWIG_OK; -} - -SWIGRUNTIME swig_module_info * -SWIG_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - static void *type_pointer = (void *)0; - return (swig_module_info *) type_pointer; -} - -SWIGRUNTIME void -SWIG_SetModule(void *v, swig_module_info *swig_module) { -} - -typedef struct { - void *pack; - swig_type_info *ty; - size_t size; -} RSwigPacked; - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE SEXP RSwigPacked_New(void *ptr, size_t sz, - swig_type_info *ty) { - SEXP rptr; - RSwigPacked *sobj = - (RSwigPacked*) malloc(sizeof(RSwigPacked)); - if (sobj) { - void *pack = malloc(sz); - if (pack) { - memcpy(pack, ptr, sz); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = sz; - } else { - sobj = 0; - } - } - rptr = R_MakeExternalPtr(sobj, R_NilValue, R_NilValue); - return rptr; -} - -SWIGRUNTIME swig_type_info * -RSwigPacked_UnpackData(SEXP obj, void *ptr, size_t size) -{ - RSwigPacked *sobj = - (RSwigPacked *)R_ExternalPtrAddr(obj); - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; -} - -SWIGRUNTIMEINLINE SEXP -SWIG_R_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? RSwigPacked_New((void *) ptr, sz, type) : R_NilValue; -} - -/* Convert a packed pointer value */ - -SWIGRUNTIME int -SWIG_R_ConvertPacked(SEXP obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = RSwigPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -#ifdef __cplusplus -#define SWIG_exception_noreturn(code, msg) do { throw std::runtime_error(msg); } while(0) -#else -#define SWIG_exception_noreturn(code, msg) do { return result; } while(0) -#endif - -#ifdef __cplusplus -} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/r/rstdcommon.swg b/mac/bin/swig/share/swig/4.1.0/r/rstdcommon.swg deleted file mode 100755 index 5f41fd14..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/rstdcommon.swg +++ /dev/null @@ -1,205 +0,0 @@ -%fragment("StdTraits","header",fragment="StdTraitsCommon") -{ -namespace swig { - /* - Traits that provides the from method - */ - - template struct traits_from_ptr { - static SWIG_Object from(Type *val, int owner = 0) { - return SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static SWIG_Object from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static SWIG_Object from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template - inline SWIG_Object from(const Type& val) { - return traits_from::from(val); - } - - template - inline SWIG_Object from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - /* - Traits that provides the asval/as/check method - */ - template - struct traits_asptr { - static int asptr(SWIG_Object obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(SWIG_Object obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(SWIG_Object obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(SWIG_Object obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(SWIG_Object obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(SWIG_Object obj) { - Type v; - int res = asval(obj, &v); - if (!obj || !SWIG_IsOK(res)) { - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(SWIG_Object obj) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(SWIG_Object obj, bool throw_error) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res)) { - return v; - } else { - if (throw_error) - throw std::invalid_argument("bad type"); - return 0; - } - } - }; - - template - inline Type as(SWIG_Object obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(SWIG_Object obj) { - int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(SWIG_Object obj) { - int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(SWIG_Object obj) { - return traits_check::category>::check(obj); - } -} -} - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(SWIG_Object obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static SWIG_Object from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(SWIG_Object obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/r/rtype.swg b/mac/bin/swig/share/swig/4.1.0/r/rtype.swg deleted file mode 100755 index a9c06758..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/rtype.swg +++ /dev/null @@ -1,328 +0,0 @@ - -/* These map the primitive C types to the appropriate R type - for use in class representations. - */ - -%typemap("rtype") int, int *, int & "integer" -%typemap("rtype") long, long *, long & "integer" -%typemap("rtype") float, float*, float & "numeric" -%typemap("rtype") double, double*, double & "numeric" -%typemap("rtype") char *, char ** "character" -%typemap("rtype") char "character" -%typemap("rtype") string, string *, string & "character" -%typemap("rtype") std::string, std::string *, std::string & "character" -%typemap("rtype") bool, bool * "logical" -%typemap("rtype") enum SWIGTYPE "character" -%typemap("rtype") enum SWIGTYPE * "character" -%typemap("rtype") enum SWIGTYPE *const& "character" -%typemap("rtype") enum SWIGTYPE & "character" -%typemap("rtype") const enum SWIGTYPE & "character" -%typemap("rtype") enum SWIGTYPE && "character" -%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("rtypecheck") int, int &, long, long & - %{ (is.integer($arg) || is.numeric($arg)) && length($arg) == 1 %} -%typemap("rtypecheck") int *, long * - %{ is.integer($arg) || is.numeric($arg) %} - - -%typemap("rtypecheck") float, double - %{ is.numeric($arg) && length($arg) == 1 %} -%typemap("rtypecheck") float *, double * - %{ is.numeric($arg) %} - -%typemap("rtypecheck") bool, bool & - %{ is.logical($arg) && length($arg) == 1 %} -%typemap("rtypecheck") bool * - %{ is.logical($arg) %} - -/* - Set up type checks to insure overloading precedence. - We would like non pointer items to shadow pointer items, so that - they get called if length = 1 -*/ - -%typecheck(SWIG_TYPECHECK_BOOL) bool {} -%typecheck(SWIG_TYPECHECK_UINT32) unsigned int {} -%typecheck(SWIG_TYPECHECK_INTEGER) int {} -%typecheck(SWIG_TYPECHECK_FLOAT) float {} -%typecheck(SWIG_TYPECHECK_DOUBLE) double {} - -%typecheck(SWIG_TYPECHECK_BOOL_PTR) bool * {} -%typecheck(SWIG_TYPECHECK_INT32_PTR) int * {} -%typecheck(SWIG_TYPECHECK_FLOAT_PTR) float * {} -%typecheck(SWIG_TYPECHECK_DOUBLE_PTR) double * {} -%typecheck(SWIG_TYPECHECK_CHAR_PTR) char * {} - -%typecheck(SWIG_TYPECHECK_INT32_ARRAY) int[ANY] {} -%typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) float[ANY] {} -%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) double [ANY] {} - -/* Have to be careful that as(x, "numeric") is different from as.numeric(x). - The latter makes a REALSXP, whereas the former leaves an INTSXP as an - INTSXP. -*/ - -/* Force coercion of integer, since by default R sets all constants to - numeric, which means that you can't directly call a function with an - integer using an R numercal literal */ - -%typemap(scoercein) int, int *, int & - %{ $input = as.integer($input); %} -%typemap(scoercein) long, long *, long & - %{ $input = as.integer($input); %} -%typemap(scoercein) float, float*, float &, - double, double *, double & - %{ %} -%typemap(scoercein) char, char *, char & - %{ $input = as($input, "character"); %} -%typemap(scoercein) string, string *, string & - %{ $input = as($input, "character"); %} -%typemap(scoercein) std::string, std::string *, std::string & - %{ $input = as($input, "character"); %} -%typemap(scoercein) enum SWIGTYPE - %{ $input = enumToInteger($input, "$R_class"); %} -%typemap(scoercein) enum SWIGTYPE & - %{ $input = enumToInteger($input, "$*R_class"); %} -%typemap(scoercein) enum SWIGTYPE * - %{ $input = enumToInteger($input, "$R_class"); %} -%typemap(scoercein) enum SWIGTYPE *const - %{ $input = enumToInteger($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE, SWIGTYPE *, SWIGTYPE *const, SWIGTYPE *const&, SWIGTYPE &, SWIGTYPE && - %{ if (inherits($input, "ExternalReference")) $input = slot($input,"ref"); %} - -/* -%typemap(scoercein) SWIGTYPE *, SWIGTYPE *const - %{ $input = coerceIfNotSubclass($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE & - %{ $input = coerceIfNotSubclass($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE && - %{ $input = coerceIfNotSubclass($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE - %{ $input = coerceIfNotSubclass($input, "$&R_class"); %} -*/ - -%typemap(scoercein) SWIGTYPE[ANY] - %{ - if(is.list($input)) - assert(all(sapply($input, class) == "$R_class")); - %} - - -/* **************************************************************** */ - -%typemap(scoercein) bool, bool *, bool & - "$input = as.logical($input);"; -%typemap(scoercein) int, - int *, - int &, - long, - long *, - long & - "$input = as.integer($input);"; - -%typemap(scoercein) char *, string, std::string, -string &, std::string & -%{ $input = as($input, "character"); %} - -%typemap(scoerceout) enum SWIGTYPE - %{ $result = enumFromInteger($result, "$R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE & - %{ $result = enumFromInteger($result, "$*R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE && - %{ $result = enumFromInteger($result, "$R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE * - %{ $result = enumToInteger($result, "$R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE *const - %{ $result = enumToInteger($result, "$R_class"); %} - -%typemap(scoerceout) SEXP %{ %} - -%typemap(scoerceout) SWIGTYPE - %{ $result <- if (is.null($result)) $result - else new("$&R_class", ref=$result); %} - -%typemap(scoerceout) SWIGTYPE & - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - - -%typemap(scoerceout) SWIGTYPE && - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - -%typemap(scoerceout) SWIGTYPE * - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - - -%typemap(scoerceout) SWIGTYPE *const - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - -%typemap(scoerceout) SWIGTYPE *const& - %{ $result <- if (is.null($result)) $result - else new("$*R_class", ref=$result); %} - - -/* Override the SWIGTYPE * above. */ -%typemap(scoerceout) char, - char *, - char &, - float, - double, - float*, - double*, - float &, - double &, - int, - int &, - long, - long &, - bool, - bool &, - string, - std::string, - string &, - std::string &, - void, - signed int, - signed int &, - unsigned int, - unsigned int &, - short, - short &, - unsigned short, - unsigned short &, - long long, - signed long long, - signed long long &, - unsigned long long, - unsigned long long &, - signed long, - signed long &, - unsigned long, - unsigned long &, - signed char, - signed char &, - unsigned char, - unsigned char & - %{ %} - -%apply int {size_t, -std::size_t, -ptrdiff_t, -std::ptrdiff_t, -signed int, -unsigned int, -short, -unsigned short, -signed char, -unsigned char} - -%apply int* {size_t[], -std::size_t[], -ptrdiff_t[], -std::ptrdiff_t[], -signed int[], -unsigned int[], -short[], -unsigned short[], -signed char[], -unsigned char[]} - -%apply int* {size_t[ANY], -std::size_t[ANY], -ptrdiff_t[ANY], -std::ptrdiff_t[ANY], -signed int[ANY], -unsigned int[ANY], -short[ANY], -unsigned short[ANY], -signed char[ANY], -unsigned char[ANY]} - -%apply int* {size_t*, -std::size_t*, -ptrdiff_t*, -std::ptrdiff_t*, -signed int*, -unsigned int*, -short*, -unsigned short*, -signed char*, -unsigned char*} - -%apply long { - long long, - signed long long, - unsigned long long, - signed long, - unsigned long} - -%apply long* { - long long*, - signed long long*, - unsigned long long*, - signed long*, - unsigned long*, - long long[], - signed long long[], - unsigned long long[], - signed long[], - unsigned long[], - long long[ANY], - signed long long[ANY], - unsigned long long[ANY], - signed long[ANY], - unsigned long[ANY]} - -%apply float* { - float[], - float[ANY] -} -%apply double * { - double[], - double[ANY] -} - -%apply bool* { - bool[], - bool[ANY] -} - -#if 0 - Just examining the values for a SWIGTYPE. - -%typemap(scoerceout) SWIGTYPE %{ - - name = $1_name - type = $1_type - ltype = $1_ltype - - mangle = $1_mangle - descriptor = $1_descriptor - - pointer type = $*1_type - pointer ltype = $*1_ltype - - pointer descriptor = $*1_descriptor - basetype = $*_basetype - -%} -#endif - - diff --git a/mac/bin/swig/share/swig/4.1.0/r/srun.swg b/mac/bin/swig/share/swig/4.1.0/r/srun.swg deleted file mode 100755 index 2e8eda11..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/srun.swg +++ /dev/null @@ -1,150 +0,0 @@ -# srun.swg # -# -# This is the basic code that is needed at run time within R to -# provide and define the relevant classes. It is included -# automatically in the generated code by copying the contents of -# srun.swg into the newly created binding code. - - -# This could be provided as a separate run-time library but this -# approach allows the code to be included directly into the -# generated bindings and so removes the need to have and install an -# additional library. We may however end up with multiple copies of -# this and some confusion at run-time as to which class to use. This -# is an issue when we use NAMESPACES as we may need to export certain -# classes. - -###################################################################### - -if(length(getClassDef("RSWIGStruct")) == 0) - setClass("RSWIGStruct", representation("VIRTUAL")) - - - -if(length(getClassDef("ExternalReference")) == 0) -# Should be virtual but this means it loses its slots currently -#representation("VIRTUAL") - setClass("ExternalReference", representation( ref = "externalptr")) - - - -if(length(getClassDef("NativeRoutinePointer")) == 0) - setClass("NativeRoutinePointer", - representation(parameterTypes = "character", - returnType = "character", - "VIRTUAL"), - contains = "ExternalReference") - -if(length(getClassDef("CRoutinePointer")) == 0) - setClass("CRoutinePointer", contains = "NativeRoutinePointer") - - -if(length(getClassDef("EnumerationValue")) == 0) - setClass("EnumerationValue", contains = "integer") - - -if(!isGeneric("copyToR")) - setGeneric("copyToR", - function(value, obj = new(gsub("Ref$", "", class(value)))) - standardGeneric("copyToR" - )) - -setGeneric("delete", function(obj) standardGeneric("delete")) - - -SWIG_createNewRef = -function(className, ..., append = TRUE) -{ - f = get(paste("new", className, sep = "_"), mode = "function") - - f(...) -} - -if(!isGeneric("copyToC")) - setGeneric("copyToC", - function(value, obj = SWIG_createNewRef(class(value))) - standardGeneric("copyToC" - )) - - -# -defineEnumeration = -function(name, .values, where = topenv(parent.frame()), suffix = "Value") -{ - # Mirror the class definitions via the E analogous to .__C__ - defName = paste(".__E__", name, sep = "") - delayedAssign(defName, .values, assign.env = where) - - if(nchar(suffix)) - name = paste(name, suffix, sep = "") - - setClass(name, contains = "EnumerationValue", where = where) -} - -enumToInteger <- function(name,type) -{ - if (is.character(name)) { - ans <- as.integer(get(paste(".__E__", type, sep = ""))[name]) - if (is.na(ans)) {warning("enum not found ", name, " ", type)} - ans - } -} - -enumFromInteger = -function(i,type) -{ - itemlist <- get(paste(".__E__", type, sep="")) - names(itemlist)[match(i, itemlist)] -} - -coerceIfNotSubclass = -function(obj, type) -{ - if(!is(obj, type)) {as(obj, type)} else obj -} - - -setClass("SWIGArray", representation(dims = "integer"), contains = "ExternalReference") - -setMethod("length", "SWIGArray", function(x) x@dims[1]) - - -defineEnumeration("SCopyReferences", - .values = c( "FALSE" = 0, "TRUE" = 1, "DEEP" = 2)) - -assert = -function(condition, message = "") -{ - if(!condition) - stop(message) - - TRUE -} - - -if(FALSE) { -print.SWIGFunction = -function(x, ...) - { - } -} - - -####################################################################### - -R_SWIG_getCallbackFunctionStack = -function() -{ - # No PACKAGE argument as we don't know what the DLL is. - .Call("R_SWIG_debug_getCallbackFunctionData") -} - -R_SWIG_addCallbackFunctionStack = -function(fun, userData = NULL) -{ - # No PACKAGE argument as we don't know what the DLL is. - .Call("R_SWIG_R_pushCallbackFunctionData", fun, userData) -} - - -####################################################################### diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_alloc.i b/mac/bin/swig/share/swig/4.1.0/r/std_alloc.i deleted file mode 100755 index 87fa8d4a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include \ No newline at end of file diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_common.i b/mac/bin/swig/share/swig/4.1.0/r/std_common.i deleted file mode 100755 index cda26231..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_common.i +++ /dev/null @@ -1,73 +0,0 @@ -%include - - -/* - Generate the traits for a 'primitive' type, such as 'double', - for which the SWIG_AsVal and SWIG_From methods are already defined. -*/ - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SEXP obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SEXP from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SEXP obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SEXP from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_container.i b/mac/bin/swig/share/swig/4.1.0/r/std_container.i deleted file mode 100755 index 076c1c6a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_deque.i b/mac/bin/swig/share/swig/4.1.0/r/std_deque.i deleted file mode 100755 index 0c757ab0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include \ No newline at end of file diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_except.i b/mac/bin/swig/share/swig/4.1.0/r/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_list.i b/mac/bin/swig/share/swig/4.1.0/r/std_list.i deleted file mode 100755 index d67ec021..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_list.i +++ /dev/null @@ -1,5 +0,0 @@ -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_map.i b/mac/bin/swig/share/swig/4.1.0/r/std_map.i deleted file mode 100755 index 56057514..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_map.i +++ /dev/null @@ -1,5 +0,0 @@ -%fragment("StdMapTraits","header") -%{ -%} - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_pair.i b/mac/bin/swig/share/swig/4.1.0/r/std_pair.i deleted file mode 100755 index e9803449..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_pair.i +++ /dev/null @@ -1,5 +0,0 @@ -%fragment("StdPairTraits","header") -%{ -%} - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/r/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_string.i b/mac/bin/swig/share/swig/4.1.0/r/std_string.i deleted file mode 100755 index dc1378ae..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/r/std_vector.i b/mac/bin/swig/share/swig/4.1.0/r/std_vector.i deleted file mode 100755 index 62478fe6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/std_vector.i +++ /dev/null @@ -1,1105 +0,0 @@ -// R specific swig components -/* - Vectors -*/ - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - // vectors of doubles - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(REALSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - NUMERIC_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of floats - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(REALSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - NUMERIC_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of unsigned 8bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 8bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of unsigned 16bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 16bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of 32 bit unsigned int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of 32bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of 64 bit unsigned int -#if defined(SWIGWORDSIZE64) - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 64 bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; -#else - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 64 bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; -#endif - // vectors of bool - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(LGLSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - LOGICAL_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of strings - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector > *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(STRSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - CHARACTER_POINTER(result)[pos] = Rf_mkChar(((*val)[pos]).c_str()); - } - UNPROTECT(1); - return(result); - } - }; - - // catch all that does everything with vectors - template - struct traits_from_ptr< std::vector< T > > { - static SEXP from (std::vector< T > *val, int owner = 0) { - return SWIG_R_NewPointerObj(val, type_info< std::vector< T > >(), owner); - } - }; - ///////////////////////////////////////////////// - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - double *S = NUMERIC_POINTER(obj); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - double *S = NUMERIC_POINTER(obj); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - // 8 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - // 16 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - // 32 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - -#if defined(SWIGWORDSIZE64) - // 64 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - -#else - // 64 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - -#endif - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, LGLSXP)); - int *S = LOGICAL_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > > { - static int asptr(SEXP obj, std::vector > **val) { - std::vector > *p; - // R character vectors are STRSXP containing CHARSXP - // access a CHARSXP using STRING_ELT - int sexpsz = Rf_length(obj); - p = new std::vector >(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, STRSXP)); - //SEXP *S = CHARACTER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - const char * thecstring = CHAR(STRING_ELT(coerced, pos)); - (*p)[pos] = std::basic_string(thecstring); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - // catchall for R to vector conversion - template - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - int res = SWIG_R_ConvertPtr(obj, (void**)&p, type_info< std::vector >(), 0); - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - // now for vectors of vectors. These will be represented as lists of vectors on the - // catch all that does everything with vectors - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(INTSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - INTEGER_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(INTSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - INTEGER_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(REALSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - NUMERIC_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(REALSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - NUMERIC_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(LGLSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - LOGICAL_POINTER(VECTOR_ELT(result, pos))[vpos] = (val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > > { - static SEXP from (std::vector< std::vector > > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(STRSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - CHARACTER_POINTER(VECTOR_ELT(result, pos))[vpos] = Rf_mkChar(val->at(pos).at(vpos).c_str()); - } - } - UNPROTECT(1); - return(result); - } - }; - - template - struct traits_from_ptr< std::vector < std::vector< T > > > { - static SEXP from (std::vector < std::vector< T > > *val, int owner = 0) { - return SWIG_R_NewPointerObj(val, type_info< std::vector < std::vector< T > > >(), owner); - } - }; - - ///////////////////////////////////////////////////////////////// - - // R side - template <> - struct traits_asptr < std::vector< std::vector > > { - static int asptr(SEXP obj, std::vector< std::vector > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(INTEGER_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< int> > > { - static int asptr(SEXP obj, std::vector< std::vector< int> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< int> > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(INTEGER_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< float> > > { - static int asptr(SEXP obj, std::vector< std::vector< float> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< float> > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(NUMERIC_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< double> > > { - static int asptr(SEXP obj, std::vector< std::vector< double> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< double> > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(NUMERIC_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< bool > > > { - static int asptr(SEXP obj, std::vector< std::vector< bool> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< bool > > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(LOGICAL_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - // catchall - template - struct traits_asptr < std::vector< std::vector > > { - static int asptr(SEXP obj, std::vector< std::vector > **val) { - std::vector< std::vector > *p; - Rprintf("vector of vectors - unsupported content\n"); - int res = SWIG_R_ConvertPtr(obj, (void**)&p, type_info< std::vector< std::vector > > (), 0); - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - } -%} - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%define %traits_type_name(Type...) -%fragment(SWIG_Traits_frag(Type), "header", - fragment="StdTraits",fragment="StdVectorTraits") { - namespace swig { - template <> struct traits< Type > { - typedef pointer_category category; - static const char* type_name() { - return #Type; - } - }; - } - } -%enddef - -%include - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector) -%traits_type_name(std::vector) -%typemap("rtypecheck") std::vector, std::vector *, std::vector & - %{ is.numeric($arg) %} -%typemap("rtype") std::vector "numeric" -%typemap("scoercein") std::vector, std::vector *, std::vector & "$input = as.numeric($input);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector) -%traits_type_name(std::vector) - -// reuse these for float -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; - - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -%typemap("rtypecheck") std::vector, std::vector *, std::vector & - %{ is.logical($arg) %} -%typemap("rtype") std::vector "logical" -%typemap("scoercein") std::vector , std::vector & "$input = as.logical($input);" - - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -%typemap("rtypecheck") std::vector, std::vector *, std::vector & - %{ is.integer($arg) || is.numeric($arg) %} - -%typemap("rtype") std::vector "integer" -%typemap("scoercein") std::vector , std::vector *, std::vector & "$input = as.integer($input);" - -// strings -%typemap("rtype") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & "character" - -%typemap("rtypecheck") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & - %{ is.character($arg) %} - -%typemap("scoercein") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & "$input = as.character($input);"; - -%typemap("scoerceout") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & -%{ %} - -// all the related integer vectors -// signed -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -#if defined(SWIGWORDSIZE64) -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#else -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#endif - -// unsigned -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -#if defined(SWIGWORDSIZE64) -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#else -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#endif - -// These R side typemaps are common for integer types -// but we can't use %apply as it will copy the C side ones too -// Also note that we don't seem to be able to use types like -// int_least8_t here. -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; - -#if defined(SWIGWORDSIZE64) -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -#else -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -#endif - - -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; - -#if defined(SWIGWORDSIZE64) -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -#else -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -#endif - -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; - -#if defined(SWIGWORDSIZE64) -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -#else -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -#endif - -/////////////////////////////////////////////////////////////// - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.integer);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.integer);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.numeric);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & - "$input = lapply($input, as.numeric);"; - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.logical);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector > >); -%traits_type_name(std::vector< std::vector > >); -%typemap("rtypecheck") std::vector > >, std::vector > > *, std::vector > > & - %{ is.list($arg) && all(sapply($arg , is.character)) %} -%typemap("rtype") std::vector > >, std::vector > > *, std::vector > > & "list" -%typemap("scoercein") std::vector< std::vector > >, std::vector > > *, std::vector > > & "$input = lapply($input, as.character);" - -// we don't want these to be given R classes as they -// have already been turned into R vectors. -%typemap(scoerceout) std::vector, - std::vector*, - std::vector&, - std::vector , - std::vector*, - std::vector , - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - // vectors of vectors - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector > >, - std::vector< std::vector > >*, - std::vector< std::vector > >& - %{ %} - -#if defined(SWIGWORDSIZE64) -%typemap(scoerceout) std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector& - %{ %} -#else - -%typemap(scoerceout) std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector& - %{ %} - -#endif - -%apply std::vector< std::basic_string > { std::vector }; -%apply std::vector< std::vector< std::basic_string > > { std::vector< std::vector > }; diff --git a/mac/bin/swig/share/swig/4.1.0/r/stl.i b/mac/bin/swig/share/swig/4.1.0/r/stl.i deleted file mode 100755 index 91da6a2b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/stl.i +++ /dev/null @@ -1,9 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/r/swigmove.i b/mac/bin/swig/share/swig/4.1.0/r/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/r/typemaps.i b/mac/bin/swig/share/swig/4.1.0/r/typemaps.i deleted file mode 100755 index 1f9b9c43..00000000 --- a/mac/bin/swig/share/swig/4.1.0/r/typemaps.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/Makefile.swig b/mac/bin/swig/share/swig/4.1.0/ruby/Makefile.swig deleted file mode 100755 index 648b3213..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/Makefile.swig +++ /dev/null @@ -1,42 +0,0 @@ -# File : Makefile.swig -# Makefile for a SWIG module. Use this file if you are -# producing a Ruby extension for general use or distribution. -# -# 1. Prepare extconf.rb. -# 2. Modify this file as appropriate. -# 3. Type 'make -f Makefile.swig' to generate wrapper code and Makefile. -# 4. Type 'make' to build your extension. -# 5. Type 'make install' to install your extension. -# - -MODULE = yourmodule -FEATURE = $(MODULE) -INTERFACE = $(MODULE).i -RUBY = ruby -SWIG = swig - -# for C extension -SWIGOPT = -ruby -WRAPPER = $(MODULE)_wrap.c - -## for C++ extension -#SWIGOPT = -ruby -c++ -#WRAPPER = $(MODULE)_wrap.cc - - -swigall: $(WRAPPER) Makefile - -$(WRAPPER): $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $@ $(INTERFACE) - -Makefile: extconf.rb - $(RUBY) extconf.rb - @if [ -f Makefile ] ; then\ - echo "include Makefile.swig" >> Makefile;\ - fi - -swigclean: - @if [ -f Makefile ] ; then\ - make -f Makefile clean;\ - fi - rm -f Makefile $(WRAPPER) diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/argcargv.i b/mac/bin/swig/share/swig/4.1.0/ruby/argcargv.i deleted file mode 100755 index 24df9c94..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/argcargv.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - - Use it as follows: - - %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) } - - %inline %{ - - int mainApp(size_t argc, const char **argv) { - return argc; - } - - then from ruby: - - $args = ["asdf", "asdf2"] - mainApp(args) - - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - if (rb_obj_is_kind_of($input,rb_cArray)) { - int i; - int size = RARRAY_LEN($input); - $1 = ($1_ltype) size; - $2 = (char **) malloc((size+1)*sizeof(char *)); - VALUE *ptr = RARRAY_PTR($input); - for (i=0; i < size; i++, ptr++) { - $2[i]= StringValuePtr(*ptr); - } - $2[i]=NULL; - } else { - $1 = 0; $2 = 0; - %argument_fail(SWIG_TypeError, "int ARGC, char **ARGV", $symname, $argnum); - } -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = rb_obj_is_kind_of($input,rb_cArray); -} - -%typemap(freearg) (int ARGC, char **ARGV) { - free((char *) $2); -} diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/attribute.i b/mac/bin/swig/share/swig/4.1.0/ruby/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/boost_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/ruby/boost_shared_ptr.i deleted file mode 100755 index 70deae4f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/boost_shared_ptr.i +++ /dev/null @@ -1,401 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE - %{(void)arg1; - delete reinterpret_cast< SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > * >(self);%} - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - swig_ruby_owntype newmem = {0, 0}; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - swig_ruby_owntype newmem = {0, 0}; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - swig_ruby_owntype newmem = {0, 0}; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - swig_ruby_owntype newmem = {0, 0}; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - swig_ruby_owntype newmem = {0, 0}; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - swig_ruby_owntype newmem = {0, 0}; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/carrays.i b/mac/bin/swig/share/swig/4.1.0/ruby/carrays.i deleted file mode 100755 index 8f74cd9b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/carrays.i +++ /dev/null @@ -1,6 +0,0 @@ -%define %array_class(TYPE,NAME) - %array_class_wrap(TYPE,NAME,__getitem__,__setitem__) -%enddef - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/cdata.i b/mac/bin/swig/share/swig/4.1.0/ruby/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/cmalloc.i b/mac/bin/swig/share/swig/4.1.0/ruby/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/cpointer.i b/mac/bin/swig/share/swig/4.1.0/ruby/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/cstring.i b/mac/bin/swig/share/swig/4.1.0/ruby/cstring.i deleted file mode 100755 index ede9c596..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/director.swg b/mac/bin/swig/share/swig/4.1.0/ruby/director.swg deleted file mode 100755 index 9395b818..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/director.swg +++ /dev/null @@ -1,311 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Ruby proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -/* - Use -DSWIG_DIRECTOR_NOUEH if you prefer to avoid the use of the - Undefined Exception Handler provided by swig. -*/ -#ifndef SWIG_DIRECTOR_NOUEH -#ifndef SWIG_DIRECTOR_UEH -#define SWIG_DIRECTOR_UEH -#endif -#endif - -#include -#include -#include -#include - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() { - } - - virtual swig_ruby_owntype get_own() const { - swig_ruby_owntype own = {0, 0}; - return own; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem *operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(swig_ruby_owntype own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - swig_ruby_owntype get_own() const { - return _own; - } - - private: - swig_ruby_owntype _own; - }; - - template - struct GCArray_T : GCItem { - GCArray_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCArray_T() { - delete[] _ptr; - } - - private: - Type *_ptr; - }; - - - /* body args */ - struct body_args { - VALUE recv; - ID id; - int argc; - VALUE *argv; - }; - - /* Base class for director exceptions */ - class DirectorException : public std::exception { - protected: - VALUE swig_error; - std::string swig_msg; - protected: - DirectorException(VALUE error) : swig_error(error) { - } - - DirectorException(VALUE error, const char *hdr, const char *msg ="") : swig_error(error), swig_msg(hdr) { - if (msg[0]) { - swig_msg += " "; - swig_msg += msg; - } - if (swig_msg.size()) { - VALUE str = rb_str_new(swig_msg.data(), swig_msg.size()); - swig_error = rb_exc_new3(error, str); - } else { - swig_error = error; - } - } - - public: - virtual ~DirectorException() throw() { - } - - VALUE getType() const { - return CLASS_OF(swig_error); - } - - VALUE getError() const { - return swig_error; - } - - /* Deprecated, use what() instead */ - const std::string& getMessage() const { - return swig_msg; - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - /* Type mismatch in the return value from a Ruby method call */ - class DirectorTypeMismatchException : public DirectorException { - public: - DirectorTypeMismatchException(VALUE error, const char *msg="") - : DirectorException(error, "SWIG director type mismatch", msg) { - } - - DirectorTypeMismatchException(const char *msg="") - : DirectorException(rb_eTypeError, "SWIG director type mismatch", msg) { - } - - static void raise(VALUE error, const char *msg) { - throw DirectorTypeMismatchException(error, msg); - } - - static void raise(const char *msg) { - throw DirectorTypeMismatchException(msg); - } - }; - - /* Any Ruby exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException { - public: - DirectorMethodException(VALUE error) - : DirectorException(error) { - } - - DirectorMethodException(const char *msg = "") - : DirectorException(rb_eRuntimeError, "SWIG director method error.", msg) { - } - - static void raise(VALUE error) { - throw DirectorMethodException(error); - } - }; - - /* Attempted to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException - { - public: - DirectorPureVirtualException(const char *msg = "") - : DirectorException(rb_eRuntimeError, "SWIG director pure virtual method called", msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - /* Simple thread abstraction for pthreads on win32 */ -#ifdef __THREAD__ -# define __PTHREAD__ -# if defined(_WIN32) || defined(__WIN32__) -# define pthread_mutex_lock EnterCriticalSection -# define pthread_mutex_unlock LeaveCriticalSection -# define pthread_mutex_t CRITICAL_SECTION -# define SWIG_MUTEX_INIT(var) var -# else -# include -# define SWIG_MUTEX_INIT(var) var = PTHREAD_MUTEX_INITIALIZER -# endif -#endif - -#ifdef __PTHREAD__ - struct Guard { - pthread_mutex_t *_mutex; - - Guard(pthread_mutex_t &mutex) : _mutex(&mutex) { - pthread_mutex_lock(_mutex); - } - - ~Guard() { - pthread_mutex_unlock(_mutex); - } - }; -# define SWIG_GUARD(mutex) Guard _guard(mutex) -#else -# define SWIG_GUARD(mutex) -#endif - - /* director base class */ - class Director { - private: - /* pointer to the wrapped Ruby object */ - VALUE swig_self; - /* flag indicating whether the object is owned by Ruby or c++ */ - mutable bool swig_disown_flag; - - public: - /* wrap a Ruby object. */ - Director(VALUE self) : swig_self(self), swig_disown_flag(false) { - } - - /* discard our reference at destruction */ - virtual ~Director() { - } - - /* return a pointer to the wrapped Ruby object */ - VALUE swig_get_self() const { - return swig_self; - } - - /* acquire ownership of the wrapped Ruby object (the sense of "disown" is from Ruby) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag = true; - } - } - - /* ownership management */ - private: - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; -#ifdef __PTHREAD__ - static pthread_mutex_t swig_mutex_own; -#endif - - public: - template - void swig_acquire_ownership_array(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCArray_T(vptr); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, swig_ruby_owntype own) const { - if (vptr && own.datafree) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_Object(own); - } - } - - swig_ruby_owntype swig_release_ownership(void *vptr) const { - swig_ruby_owntype own = {0, 0}; - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_ownership_map::iterator iter = swig_owner.find(vptr); - if (iter != swig_owner.end()) { - own.datafree = iter->second->get_own().datafree; - swig_owner.erase(iter); - } - } - return own; - } - }; -} - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/embed.i b/mac/bin/swig/share/swig/4.1.0/ruby/embed.i deleted file mode 100755 index 9226ef45..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/embed.i +++ /dev/null @@ -1,16 +0,0 @@ -%wrapper %{ - -#include - -int -main(argc, argv) - int argc; - char **argv; -{ - ruby_init(); - ruby_options(argc, argv); - ruby_run(); - return 0; -} - -%} diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/exception.i b/mac/bin/swig/share/swig/4.1.0/ruby/exception.i deleted file mode 100755 index 1e80d96d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/exception.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg);)) -} diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/extconf.rb b/mac/bin/swig/share/swig/4.1.0/ruby/extconf.rb deleted file mode 100755 index 3bac8ccc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/extconf.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'mkmf' - -dir_config('yourlib') - -if have_header('yourlib.h') and have_library('yourlib', 'yourlib_init') - # If you use swig -c option, you may have to link libswigrb. - # have_library('swigrb') - create_makefile('yourlib') -end diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/extra-install.list b/mac/bin/swig/share/swig/4.1.0/ruby/extra-install.list deleted file mode 100755 index 4610fa8f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/extra-install.list +++ /dev/null @@ -1,3 +0,0 @@ -# see top-level Makefile.in -Makefile.swig -extconf.rb diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/factory.i b/mac/bin/swig/share/swig/4.1.0/ruby/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/file.i b/mac/bin/swig/share/swig/4.1.0/ruby/file.i deleted file mode 100755 index f9aaa275..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/file.i +++ /dev/null @@ -1,39 +0,0 @@ -// FILE * -%{ -#ifdef __cplusplus -extern "C" { -#endif - -/* Ruby 1.9 changed the file name of this header */ -#ifdef HAVE_RUBY_IO_H -#include "ruby/io.h" -#else -#include "rubyio.h" -#endif - -#ifdef __cplusplus -} -#endif -%} - -%typemap(in) FILE *READ { - OpenFile *of; - GetOpenFile($input, of); - rb_io_check_readable(of); - $1 = GetReadFile(of); - rb_read_check($1); -} - -%typemap(in) FILE *READ_NOCHECK { - OpenFile *of; - GetOpenFile($input, of); - rb_io_check_readable(of); - $1 = GetReadFile(of); -} - -%typemap(in) FILE *WRITE { - OpenFile *of; - GetOpenFile($input, of); - rb_io_check_writable(of); - $1 = GetWriteFile(of); -} diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/progargcargv.i b/mac/bin/swig/share/swig/4.1.0/ruby/progargcargv.i deleted file mode 100755 index a2843c34..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/progargcargv.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -int PROG_ARGC -char **PROG_ARGV - - Some C function receive argc and argv from C main function. - This typemap provides ignore typemap which pass Ruby ARGV contents - as argc and argv to C function. -*/ - - - -// argc and argv -%typemap(in,numinputs=0) int PROG_ARGC { - $1 = RARRAY_LEN(rb_argv) + 1; -} - -%typemap(in,numinputs=0) char **PROG_ARGV { - int i, n; - VALUE ary = rb_eval_string("[$0] + ARGV"); - n = RARRAY_LEN(ary); - $1 = (char **)malloc(n + 1); - for (i = 0; i < n; i++) { - VALUE v = rb_obj_as_string(RARRAY_PTR(ary)[i]); - $1[i] = (char *)malloc(RSTRING_LEN(v) + 1); - strcpy($1[i], RSTRING_PTR(v)); - } -} - -%typemap(freearg) char **PROG_ARGV { - int i, n = RARRAY_LEN(rb_argv) + 1; - for (i = 0; i < n; i++) free($1[i]); - free($1); -} - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/ruby.swg b/mac/bin/swig/share/swig/4.1.0/ruby/ruby.swg deleted file mode 100755 index d1335974..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/ruby.swg +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------------------------ - * ruby.swg - * - * Ruby configuration module. - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * The Ruby auto rename rules - * ------------------------------------------------------------ */ -#if defined(SWIG_RUBY_AUTORENAME) -/* Class names are CamelCase */ -%rename("%(camelcase)s", %$isclass) ""; - -/* Constants created by %constant or #define are UPPER_CASE */ -%rename("%(uppercase)s", %$isconstant) ""; - -/* SWIG only considers static class members with inline initializers - to be constants. For examples of what is and isn't considered - a constant by SWIG see naming.i in the Ruby test suite. */ -%rename("%(uppercase)s", %$ismember, %$isvariable,%$isimmutable,%$isstatic,%$hasvalue,%$hasconsttype) ""; - -/* Enums are mapped to constants but all we do is make sure the - first letter is uppercase */ -%rename("%(firstuppercase)s", %$isenumitem) ""; - -/* Method names should be lower_case_with_underscores */ -%rename("%(undercase)s", %$isfunction, %$not %$ismemberget, %$not %$ismemberset) ""; -#endif - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Ruby keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Documentation for common Ruby methods - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Ruby initialization function - * ------------------------------------------------------------ */ -%include - - - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyapi.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyapi.swg deleted file mode 100755 index e0077572..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyapi.swg +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Ruby API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -SWIGINTERN VALUE -SWIG_Ruby_AppendOutput(VALUE target, VALUE o) { - if (NIL_P(target)) { - target = o; - } else { - if (TYPE(target) != T_ARRAY) { - VALUE o2 = target; - target = rb_ary_new(); - rb_ary_push(target, o2); - } - rb_ary_push(target, o); - } - return target; -} - -/* For ruby1.8.4 and earlier. */ -#ifndef RUBY_INIT_STACK - RUBY_EXTERN void Init_stack(VALUE* addr); -# define RUBY_INIT_STACK \ - VALUE variable_in_this_stack_frame; \ - Init_stack(&variable_in_this_stack_frame); -#endif - - -#ifdef __cplusplus -} -#endif - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyautodoc.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyautodoc.swg deleted file mode 100755 index 6b0472ce..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyautodoc.swg +++ /dev/null @@ -1,105 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyautodoc.swg - * - * This file implements autodoc typemaps for some common ruby methods. - * ----------------------------------------------------------------------------- */ - -%define AUTODOC(func, str) - %feature("autodoc", str) func; -%enddef - - -AUTODOC(to_i, "Convert $class to an Integer"); -AUTODOC(to_f, "Convert $class to a Float"); -AUTODOC(coerce, "Coerce class to a number"); -AUTODOC(to_a, "Convert $class to an Array"); -AUTODOC(to_s, "Convert class to a String representation"); -AUTODOC(inspect, "Inspect class and its contents"); - -AUTODOC(at, "Return element at a certain index"); -AUTODOC(__getitem__, "Element accessor/slicing"); -AUTODOC(__setitem__, "Element setter/slicing"); -AUTODOC(slice, "Return a slice (portion of) the $class"); - -AUTODOC(push, "Add an element at the end of the $class"); -AUTODOC(pop, "Remove and return element at the end of the $class"); -AUTODOC(shift, "Remove and return element at the beginning of the $class"); -AUTODOC(unshift, "Add one or more elements at the beginning of the $class"); -AUTODOC(first, "Return the first element in $class"); -AUTODOC(last, "Return the last element in $class"); - - -// -// Common Object methods -// -AUTODOC(hash, "Hashing function for class"); -AUTODOC(dup, "Create a duplicate of the class and unfreeze it if needed"); -AUTODOC(clone, "Create a duplicate of the class"); - -// -// Container methods -// -AUTODOC(empty, "Check if $class is empty"); -AUTODOC(size, "Size or Length of the $class"); -AUTODOC(insert, "Insert one or more new elements in the $class"); - -// -// Iterator methods (block) -// -AUTODOC(each, "Iterate thru each element in the $class. A block must be provided"); -AUTODOC(find, "Find an element in the class"); -AUTODOC(each_key, "Iterate thru each key element in the $class. A block must be provided"); -AUTODOC(each_value, "Iterate thru each key element in the $class. A block must be provided"); -AUTODOC(reject, "Iterate thru each element in the $class and reject those that fail a condition returning a new $class. A block must be provided"); -AUTODOC(reject_bang, "Iterate thru each element in the $class and reject those that fail a condition. A block must be provided. $class is modified in place"); -AUTODOC(select, "Iterate thru each element in the $class and select those that match a condition. A block must be provided"); -AUTODOC(delete_at, "Delete an element at a certain index"); -AUTODOC(__delete__, "Delete a matching element"); - - -// -// Hash methods -// -AUTODOC(keys, "Return an Array of key elements"); -AUTODOC(values, "Return an Array of value elements"); -AUTODOC(values_at, "Return an Array of value elements matching the conditions"); - - -// -// Operators -// -#ifdef __cplusplus -AUTODOC(operator==, "Equality comparison operator"); -AUTODOC(operator<=, "Lower or equal comparison operator"); -AUTODOC(operator>=, "Higher or equal comparison operator"); -AUTODOC(operator<, "Lower than comparison operator"); -AUTODOC(operator>, "Higher than comparison operator"); -AUTODOC(operator<<, "Left shifting or appending operator"); -AUTODOC(operator>>, "Right shifting operator or extracting operator"); -AUTODOC(operator+, "Add operator"); -AUTODOC(operator-, "Subtraction operator"); -AUTODOC(operator+(), "Positive operator"); -AUTODOC(operator-(), "Negation operator"); -AUTODOC(operator&, "AND operator"); -AUTODOC(operator|, "OR operator"); -AUTODOC(operator^, "XOR operator"); -AUTODOC(operator~, "Invert operator"); -#endif -AUTODOC(__eq__, "Equality comparison operator"); -AUTODOC(__le__, "Lower or equal comparison operator"); -AUTODOC(__ge__, "Higher or equal comparison operator"); -AUTODOC(__lt__, "Lower than comparison operator"); -AUTODOC(__gt__, "Higher than comparison operator"); -AUTODOC(__lshift__, "Left shifting or appending operator"); -AUTODOC(__rshift__, "Right shifting operator or extracting operator"); -AUTODOC(__add___, "Add operator"); -AUTODOC(__sub__, "Subtraction operator"); -AUTODOC(__pos__, "Positive operator"); -AUTODOC(__neg__, "Negation operator"); -AUTODOC(__and__, "AND operator"); -AUTODOC(__or__, "OR operator"); -AUTODOC(__xor__, "XOR operator"); -AUTODOC(__negate__, "Invert operator"); -AUTODOC(__pow__, "Exponential operator"); -AUTODOC(__divmod__, "Modulo of division"); -AUTODOC(__cmp__, "Comparison operator. Returns < 0 for less than, 0 for equal or > 1 for higher than."); diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyclasses.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyclasses.swg deleted file mode 100755 index c43f38fc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyclasses.swg +++ /dev/null @@ -1,404 +0,0 @@ -#ifdef __cplusplus - -/* - GC_VALUE is used as a replacement of Ruby's VALUE. - GC_VALUE automatically handles registering and unregistering - of the underlying Ruby object with the GC. - - It can be used if you want to create STL containers of VALUEs, such as: - - std::vector< GC_VALUE >; - - or as a member variable: - - struct A { - GC_VALUE _obj; - A(VALUE o) : _obj(o) { - } - }; - - or as a input/output value (not much use for this, as VALUE works just as - well here, thou): - - GC_VALUE func(GC_VALUE obj) { - GC_VALUE out = rb_obj_classname(obj); - return out; - } - - - GC_VALUE is 'visible' at the wrapped side, so you can do: - - %template(RubyVector) std::vector; - - and all the proper typemaps will be used. - -*/ - -%fragment("GC_VALUE_definition","header") { -namespace swig { - class SwigGCReferences { - VALUE _hash; - - SwigGCReferences() : _hash(Qnil) { - } - ~SwigGCReferences() { - if (_hash != Qnil) - rb_gc_unregister_address(&_hash); - } - static void EndProcHandler(VALUE) { - // Ruby interpreter ending - _hash can no longer be accessed. - SwigGCReferences &s_references = instance(); - s_references._hash = Qnil; - } - public: - static SwigGCReferences& instance() { - // Hash of all GC_VALUE's currently in use - static SwigGCReferences s_references; - - return s_references; - } - static void initialize() { - SwigGCReferences &s_references = instance(); - if (s_references._hash == Qnil) { - rb_set_end_proc(&EndProcHandler, Qnil); - s_references._hash = rb_hash_new(); - rb_gc_register_address(&s_references._hash); - } - } - void GC_register(VALUE& obj) { - if (FIXNUM_P(obj) || SPECIAL_CONST_P(obj) || SYMBOL_P(obj)) - return; - if (_hash != Qnil) { - VALUE val = rb_hash_aref(_hash, obj); - unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 0; - ++n; - rb_hash_aset(_hash, obj, INT2NUM(n)); - } - } - void GC_unregister(const VALUE& obj) { - if (FIXNUM_P(obj) || SPECIAL_CONST_P(obj) || SYMBOL_P(obj)) - return; - // this test should not be needed but I've noticed some very erratic - // behavior of none being unregistered in some very rare situations. - if (BUILTIN_TYPE(obj) == T_NONE) - return; - if (_hash != Qnil) { - VALUE val = rb_hash_aref(_hash, obj); - unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 1; - --n; - if (n) - rb_hash_aset(_hash, obj, INT2NUM(n)); - else - rb_hash_delete(_hash, obj); - } - } - }; - - class GC_VALUE { - protected: - VALUE _obj; - - static ID hash_id; - static ID lt_id; - static ID gt_id; - static ID eq_id; - static ID le_id; - static ID ge_id; - - static ID pos_id; - static ID neg_id; - static ID inv_id; - - static ID add_id; - static ID sub_id; - static ID mul_id; - static ID div_id; - static ID mod_id; - - static ID and_id; - static ID or_id; - static ID xor_id; - - static ID lshift_id; - static ID rshift_id; - - struct OpArgs - { - VALUE src; - ID id; - int nargs; - VALUE target; - }; - - - public: - GC_VALUE() : _obj(Qnil) - { - } - - GC_VALUE(const GC_VALUE& item) : _obj(item._obj) - { - SwigGCReferences::instance().GC_register(_obj); - } - - GC_VALUE(VALUE obj) :_obj(obj) - { - SwigGCReferences::instance().GC_register(_obj); - } - - ~GC_VALUE() - { - SwigGCReferences::instance().GC_unregister(_obj); - } - - GC_VALUE & operator=(const GC_VALUE& item) - { - SwigGCReferences::instance().GC_unregister(_obj); - _obj = item._obj; - SwigGCReferences::instance().GC_register(_obj); - return *this; - } - - operator VALUE() const - { - return _obj; - } - - VALUE inspect() const - { - return rb_inspect(_obj); - } - - VALUE to_s() const - { - return rb_inspect(_obj); - } - - static VALUE swig_rescue_swallow(VALUE, VALUE) - { - /* - VALUE errstr = rb_obj_as_string(rb_errinfo()); - printf("Swallowing error: '%s'\n", RSTRING_PTR(StringValue(errstr))); - */ - return Qnil; /* Swallow Ruby exception */ - } - - static VALUE swig_rescue_funcall(VALUE p) - { - OpArgs* args = (OpArgs*) p; - return rb_funcall(args->src, args->id, args->nargs, args->target); - } - - bool relational_equal_op(const GC_VALUE& other, const ID& op_id, bool (*op_func)(const VALUE& a, const VALUE& b)) const - { - if (FIXNUM_P(_obj) && FIXNUM_P(other._obj)) { - return op_func(_obj, other._obj); - } - bool res = false; - VALUE ret = Qnil; - SWIG_RUBY_THREAD_BEGIN_BLOCK; - if (rb_respond_to(_obj, op_id)) { - OpArgs args; - args.src = _obj; - args.id = op_id; - args.nargs = 1; - args.target = VALUE(other); - ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args), - (VALUEFUNC(swig_rescue_swallow)), Qnil); - } - if (ret == Qnil) { - VALUE a = rb_funcall2( _obj, hash_id, 0, 0 ); - VALUE b = rb_funcall2( VALUE(other), hash_id, 0, 0 ); - res = op_func(a, b); - } else { - res = RTEST(ret); - } - SWIG_RUBY_THREAD_END_BLOCK; - return res; - } - - static bool operator_eq(const VALUE& a, const VALUE& b) { return a == b; } - static bool operator_lt(const VALUE& a, const VALUE& b) { return a < b; } - static bool operator_le(const VALUE& a, const VALUE& b) { return a <= b; } - static bool operator_gt(const VALUE& a, const VALUE& b) { return a > b; } - static bool operator_ge(const VALUE& a, const VALUE& b) { return a >= b; } - - bool operator==(const GC_VALUE& other) const { return relational_equal_op(other, eq_id, operator_eq); } - bool operator<(const GC_VALUE& other) const { return relational_equal_op(other, lt_id, operator_lt); } - bool operator<=(const GC_VALUE& other) const { return relational_equal_op(other, le_id, operator_le); } - bool operator>(const GC_VALUE& other) const { return relational_equal_op(other, gt_id, operator_gt); } - bool operator>=(const GC_VALUE& other) const { return relational_equal_op(other, ge_id, operator_ge); } - - bool operator!=(const GC_VALUE& other) const - { - return !(this->operator==(other)); - } - - GC_VALUE unary_op(const ID& op_id) const - { - VALUE ret = Qnil; - SWIG_RUBY_THREAD_BEGIN_BLOCK; - OpArgs args; - args.src = _obj; - args.id = op_id; - args.nargs = 0; - args.target = Qnil; - ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args), - (VALUEFUNC(swig_rescue_swallow)), Qnil); - SWIG_RUBY_THREAD_END_BLOCK; - return ret; - } - - GC_VALUE operator+() const { return unary_op(pos_id); } - GC_VALUE operator-() const { return unary_op(neg_id); } - GC_VALUE operator~() const { return unary_op(inv_id); } - - GC_VALUE binary_op(const GC_VALUE& other, const ID& op_id) const - { - VALUE ret = Qnil; - SWIG_RUBY_THREAD_BEGIN_BLOCK; - OpArgs args; - args.src = _obj; - args.id = op_id; - args.nargs = 1; - args.target = VALUE(other); - ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args), - (VALUEFUNC(swig_rescue_swallow)), Qnil); - SWIG_RUBY_THREAD_END_BLOCK; - return GC_VALUE(ret); - } - - GC_VALUE operator+(const GC_VALUE& other) const { return binary_op(other, add_id); } - GC_VALUE operator-(const GC_VALUE& other) const { return binary_op(other, sub_id); } - GC_VALUE operator*(const GC_VALUE& other) const { return binary_op(other, mul_id); } - GC_VALUE operator/(const GC_VALUE& other) const { return binary_op(other, div_id); } - GC_VALUE operator%(const GC_VALUE& other) const { return binary_op(other, mod_id); } - GC_VALUE operator&(const GC_VALUE& other) const { return binary_op(other, and_id); } - GC_VALUE operator^(const GC_VALUE& other) const { return binary_op(other, xor_id); } - GC_VALUE operator|(const GC_VALUE& other) const { return binary_op(other, or_id); } - GC_VALUE operator<<(const GC_VALUE& other) const { return binary_op(other, lshift_id); } - GC_VALUE operator>>(const GC_VALUE& other) const { return binary_op(other, rshift_id); } - }; - - ID GC_VALUE::hash_id = rb_intern("hash"); - ID GC_VALUE::lt_id = rb_intern("<"); - ID GC_VALUE::gt_id = rb_intern(">"); - ID GC_VALUE::eq_id = rb_intern("=="); - ID GC_VALUE::le_id = rb_intern("<="); - ID GC_VALUE::ge_id = rb_intern(">="); - - ID GC_VALUE::pos_id = rb_intern("+@"); - ID GC_VALUE::neg_id = rb_intern("-@"); - ID GC_VALUE::inv_id = rb_intern("~"); - - ID GC_VALUE::add_id = rb_intern("+"); - ID GC_VALUE::sub_id = rb_intern("-"); - ID GC_VALUE::mul_id = rb_intern("*"); - ID GC_VALUE::div_id = rb_intern("/"); - ID GC_VALUE::mod_id = rb_intern("%"); - - ID GC_VALUE::and_id = rb_intern("&"); - ID GC_VALUE::or_id = rb_intern("|"); - ID GC_VALUE::xor_id = rb_intern("^"); - - ID GC_VALUE::lshift_id = rb_intern("<<"); - ID GC_VALUE::rshift_id = rb_intern(">>"); - - typedef GC_VALUE LANGUAGE_OBJ; - -} // namespace swig - -} // %fragment(GC_VALUE_definition) - - - -namespace swig { - - %apply VALUE {GC_VALUE}; - - // Make sure this is the last typecheck done - %typecheck(999999,fragment="GC_VALUE_definition",noblock=1) GC_VALUE, GC_VALUE&, - const GC_VALUE& { $1 = 1; }; - - /* For input */ - %typemap(in,fragment="GC_VALUE_definition",noblock=1) GC_VALUE* (GC_VALUE r), GC_VALUE& (GC_VALUE r) { - r = $input; $1 = &r; - } - - /* For output */ - %typemap(out,fragment="GC_VALUE_definition",noblock=1) GC_VALUE { - $result = (VALUE)$1; - } - - %typemap(out,fragment="GC_VALUE_definition",noblock=1) GC_VALUE*, GC_VALUE const & { - $result = (VALUE)*$1; - } - - %nodirector GC_VALUE; - - // We ignore the constructor so that user can never create a GC_VALUE - // manually - %ignore GC_VALUE::GC_VALUE; - - struct GC_VALUE { - VALUE inspect() const; - VALUE to_s() const; - GC_VALUE(); - protected: - GC_VALUE(const GC_VALUE&); - ~GC_VALUE(); - }; - - %exception GC_VALUE {}; - - - %ignore LANGUAGE_OBJ; - typedef GC_VALUE LANGUAGE_OBJ; -} - - -%init { - swig::SwigGCReferences::initialize(); -} - - - -// -// Fragment that contains traits to properly deal with GC_VALUE. -// These functions may be invoked as a need of the from(), asval(), -// asptr() and as() template functors, usually used in %typemaps. -// -%fragment(SWIG_Traits_frag(swig::GC_VALUE),"header",fragment="StdTraits",fragment="GC_VALUE_definition") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "GC_VALUE"; } - }; - - template <> struct traits_from { - typedef GC_VALUE value_type; - static VALUE from(const value_type& val) { - return static_cast(val); - } - }; - - template <> - struct traits_check { - static bool check(GC_VALUE) { - return true; - } - }; - - template <> struct traits_asval { - typedef GC_VALUE value_type; - static int asval(VALUE obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} // swig -} // %fragment(traits for swig::GC_VALUE) - - -#endif // __cplusplus - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubycomplex.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubycomplex.swg deleted file mode 100755 index d2aaf6cb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubycomplex.swg +++ /dev/null @@ -1,148 +0,0 @@ -/* - Defines the As/From conversors for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -%fragment("rb_complex_new","header") -{ -%#if !defined(T_COMPLEX) -/* Ruby versions prior to 1.9 did not have native complex numbers. They were an extension in the STD library. */ -SWIGINTERN VALUE rb_complex_new(VALUE x, VALUE y) { - static ID new_id = rb_intern("new"); - static VALUE cComplex = rb_const_get(rb_cObject, rb_intern("Complex")); - return rb_funcall(cComplex, new_id, 2, x, y); -} -%#endif -} - -%fragment("SWIG_Complex_Numbers","header") -{ -%#if !defined(T_COMPLEX) -SWIGINTERN int SWIG_Is_Complex( VALUE obj ) { - static ID real_id = rb_intern("real"); - static ID imag_id = rb_intern("imag"); - return ( (rb_respond_to( obj, real_id ) ) && - (rb_respond_to( obj, imag_id ) ) ); -} -%#else -SWIGINTERN int SWIG_Is_Complex( VALUE obj ) { - return TYPE(obj) == T_COMPLEX; -} -%#endif - -SWIGINTERN VALUE SWIG_Complex_Real(VALUE obj) { - static ID real_id = rb_intern("real"); - return rb_funcall2(obj, real_id, 0, 0); -} - -SWIGINTERN VALUE SWIG_Complex_Imaginary(VALUE obj) { - static ID imag_id = rb_intern("imag"); - return rb_funcall2(obj, imag_id, 0, 0); -} -} - -%init { -%#if !defined(T_COMPLEX) - rb_require("complex"); -%#endif -} - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header",fragment="rb_complex_new") -{ -SWIGINTERNINLINE VALUE -SWIG_From(Type)(%ifcplusplus(const Type&, Type) c) -{ - VALUE re = rb_float_new(Real(c)); - VALUE im = rb_float_new(Imag(c)); - return rb_complex_new(re, im); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double), - fragment="SWIG_Complex_Numbers") -{ -SWIGINTERN int -SWIG_AsVal(Type) (VALUE o, Type* val) -{ - if ( SWIG_Is_Complex( o ) ) { - if (val) { - VALUE real = SWIG_Complex_Real(o); - VALUE imag = SWIG_Complex_Imaginary(o); - double re = 0; - SWIG_AsVal_double( real, &re ); - double im = 0; - SWIG_AsVal_double( imag, &im ); - *val = Constructor(re, im); - } - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float), - fragment=SWIG_AsVal_frag(double), - fragment="SWIG_Complex_Numbers") { -SWIGINTERN int -SWIG_AsVal(Type)(VALUE o, Type *val) -{ - if ( SWIG_Is_Complex( o ) ) { - VALUE real = SWIG_Complex_Real(o); - VALUE imag = SWIG_Complex_Imaginary(o); - double re = 0; - SWIG_AsVal_double( real, &re ); - double im = 0; - SWIG_AsVal_double( imag, &im ); - if ((-FLT_MAX <= re && re <= FLT_MAX) && - (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0f); - return res; - } - } - return SWIG_TypeError; -} -} - -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) - - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubycontainer.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubycontainer.swg deleted file mode 100755 index 597ae83d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubycontainer.swg +++ /dev/null @@ -1,1114 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubycontainer.swg - * - * Ruby sequence <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Ruby, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - -%include - -/**** The RubySequence C++ Wrap ***/ - -%fragment(""); - -%include - - -%fragment("RubySequence_Base","header") -{ -%#include - - -namespace swig { - template < class T > - struct yield - { - bool - operator()( const T& v ) const - { - return RTEST( rb_yield( swig::from< T >(v) ) ); - } - }; - - - inline size_t - check_index(ptrdiff_t i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - - throw std::out_of_range("index out of range"); - } - - inline size_t - slice_index(ptrdiff_t i, size_t size) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) { - return (size_t) (i + size); - } else { - throw std::out_of_range("index out of range"); - } - } else { - return ( (size_t) i < size ) ? ((size_t) i) : size; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline void - resize(Sequence *seq, typename Sequence::size_type n, typename Sequence::value_type x) { - seq->resize(n, x); - } - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, (i == size && j == size)); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (jj > ii) { - typename Sequence::const_iterator vb = self->begin(); - typename Sequence::const_iterator ve = self->begin(); - std::advance(vb,ii); - std::advance(ve,jj); - return new Sequence(vb, ve); - } else { - return new Sequence(); - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj < ii) jj = ii; - size_t ssize = jj - ii; - if (ssize <= v.size()) { - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); - std::advance(sb,ii); - std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); - } else { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj > ii) { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - } - } -} -} - -%fragment("RubySequence_Cont","header", - fragment="", - fragment="StdTraits", - fragment="RubySequence_Base", - fragment="ConstIterator_T") -{ -namespace swig -{ - - /** - * This class is a proxy class for references, used to return and set values - * of an element of a Ruby Array of stuff. - * It can be used by RubySequence_InputIterator to make it work with STL - * algorithms. - */ - template - struct RubySequence_Ref - { - RubySequence_Ref(VALUE seq, int index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - VALUE item = rb_ary_entry(_seq, _index ); - try { - return swig::as(item); - } catch (const std::invalid_argument& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", _index); - VALUE lastErr = rb_gv_get("$!"); - if ( lastErr == Qnil ) { - %type_error(swig::type_name()); - } - VALUE str = rb_str_new2(msg); - str = rb_str_cat2( str, e.what() ); - SWIG_Ruby_ExceptionType( NULL, str ); - throw; - } - } - - RubySequence_Ref& operator=(const T& v) - { - rb_ary_set(_seq, _index, swig::from< T >(v)); - return *this; - } - - private: - VALUE _seq; - int _index; - }; - - - /** - * This class is a proxy to return a pointer to a class, usually - * RubySequence_Ref. - * It can be used by RubySequence_InputIterator to make it work with STL - * algorithms. - */ - template - struct RubySequence_ArrowProxy - { - RubySequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - - /** - * Input Iterator. This adapator class is a random access iterator that - * allows you to use STL algorithms with a Ruby class (a Ruby Array by default). - */ - template > - struct RubySequence_InputIterator - { - typedef RubySequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef ptrdiff_t difference_type; - - RubySequence_InputIterator() - { - } - - RubySequence_InputIterator(VALUE seq, int index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - RubySequence_ArrowProxy - operator->() const { - return RubySequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index) && (_seq == ri._seq); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - VALUE _seq; - difference_type _index; - }; - - - /** - * This adaptor class allows you to use a Ruby Array as if it was an STL - * container, giving it begin(), end(), and iterators. - */ - template - struct RubySequence_Cont - { - typedef RubySequence_Ref reference; - typedef const RubySequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - typedef int size_type; - typedef const pointer const_pointer; - typedef RubySequence_InputIterator iterator; - typedef RubySequence_InputIterator const_iterator; - - RubySequence_Cont(VALUE seq) : _seq(0) - { - if (!rb_obj_is_kind_of(seq, rb_cArray)) { - throw std::invalid_argument("an Array is expected"); - } - _seq = seq; - } - - ~RubySequence_Cont() - { - } - - size_type size() const - { - return RARRAY_LEN(_seq); - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - int s = (int) size(); - for (int i = 0; i < s; ++i) { - VALUE item = rb_ary_entry(_seq, i ); - if (!swig::check(item)) - return false; - } - return true; - } - - private: - VALUE _seq; - }; - -} -} - -/** - * Macros used to typemap an STL iterator -> SWIGIterator conversion. - */ -%define %swig_sequence_iterator(Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - - %typemap(out,noblock=1,fragment="RubySequence_Cont") - const_iterator, const_reverse_iterator { - $result = SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &), - self), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN); - } - - %typemap(out,noblock=1,fragment="RubySequence_Cont") - iterator, reverse_iterator { - $result = SWIG_NewPointerObj(swig::make_nonconst_iterator(%static_cast($1,const $type &), - self), - swig::Iterator::descriptor(),SWIG_POINTER_OWN); - } - - %typemap(out,noblock=1,fragment="RubySequence_Cont") - std::pair { - $result = rb_ary_new2(2); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).first), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).second), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - } - - // std::map/multimap/set allow returning std::pair< iterator, iterator > from - // equal_range, but we cannot still modify the key, so the iterator is - // const. - %typemap(out,noblock=1,fragment="RubySequence_Cont") - std::pair { - $result = rb_ary_new2(2); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).first), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).second), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - } - - - %typemap(in,noblock=1,fragment="RubySequence_Cont") - const_iterator(swig::ConstIterator *iter = 0, int res), - const_reverse_iterator(swig::ConstIterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::ConstIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::ConstIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typemap(in,noblock=1,fragment="RubySequence_Cont") - iterator(swig::Iterator *iter = 0, int res), - reverse_iterator(swig::Iterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::Iterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::Iterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="RubySequence_Cont") - const_iterator, const_reverse_iterator { - swig::ConstIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::ConstIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="RubySequence_Cont") - iterator, reverse_iterator { - swig::ConstIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::Iterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("RubySequence_Cont"); - -// %newobject iterator; -// %newobject const_iterator; -// %extend { -// swig::Iterator* iterator(VALUE* RUBY_SELF) { -// return swig::make_nonconst_iterator($self->begin(), $self->begin(), -// $self->end(), *RUBY_SELF); -// } - -// swig::ConstIterator* const_iterator(VALUE* RUBY_SELF) { -// return swig::make_const_iterator($self->begin(), $self->begin(), -// $self->end(), *RUBY_SELF); -// } -// } -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - - -/**** The Ruby container methods ****/ - - - -%define %swig_container_methods(Container...) - - %extend { - - %newobject dup; - Container* dup() - { - return new Container(*$self); - } - - } - -%enddef - - -/** - * Macro used to define common Ruby printing methods for STL container - */ -%define %swig_sequence_printing_methods(Sequence...) - - %extend { - - VALUE inspect() - { - Sequence::const_iterator i = $self->begin(); - Sequence::const_iterator e = $self->end(); - const char *type_name = swig::type_name< Sequence >(); - VALUE str = rb_str_new2(type_name); - str = rb_str_cat2( str, " [" ); - bool comma = false; - VALUE tmp; - for ( ; i != e; ++i, comma = true ) - { - if (comma) str = rb_str_cat2( str, "," ); - tmp = swig::from< Sequence::value_type >( *i ); - tmp = rb_inspect( tmp ); - str = rb_str_buf_append( str, tmp ); - } - str = rb_str_cat2( str, "]" ); - return str; - } - - VALUE to_a() - { - Sequence::const_iterator i = $self->begin(); - Sequence::const_iterator e = $self->end(); - VALUE ary = rb_ary_new2( std::distance( i, e ) ); - VALUE tmp; - for ( ; i != e; ++i ) - { - tmp = swig::from< Sequence::value_type >( *i ); - rb_ary_push( ary, tmp ); - } - return ary; - } - - VALUE to_s() - { - Sequence::iterator i = $self->begin(); - Sequence::iterator e = $self->end(); - VALUE str = rb_str_new2( "" ); - VALUE tmp; - for ( ; i != e; ++i ) - { - tmp = swig::from< Sequence::value_type >( *i ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - } - return str; - } -} -%enddef - - -/** - * Macro used to add common methods to all STL sequence-type containers - */ -%define %swig_sequence_methods_non_resizable_common(Sequence...) - %swig_container_methods(%arg(Sequence)) - %swig_sequence_iterator(%arg(Sequence)) - %swig_sequence_printing_methods(%arg(Sequence)) - - %fragment("RubySequence_Base"); - - %extend { - - VALUE slice( difference_type i, difference_type length ) throw (std::invalid_argument) { - if ( length < 0 ) - return Qnil; - std::size_t len = $self->size(); - if ( i < 0 ) { - if ( i + static_cast(len) < 0 ) - return Qnil; - else - i = len + i; - } - Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) - j = len; - - VALUE r = Qnil; - try { - r = swig::from< const Sequence* >( swig::getslice(self, i, j) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - - Sequence* each() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE r; - Sequence::const_iterator i = self->begin(); - Sequence::const_iterator e = self->end(); - for ( ; i != e; ++i ) - { - r = swig::from< Sequence::value_type >(*i); - rb_yield(r); - } - - return self; - } - - VALUE __delete2__(const value_type& i) { - VALUE r = Qnil; - return r; - } - - } -%enddef - -%define %swig_sequence_methods_resizable_common(Sequence...) - %extend { - - %newobject select; - Sequence* select() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - Sequence* r = new Sequence(); - Sequence::const_iterator i = $self->begin(); - Sequence::const_iterator e = $self->end(); - for ( ; i != e; ++i ) - { - VALUE v = swig::from< Sequence::value_type >(*i); - if ( RTEST( rb_yield(v) ) ) - $self->insert( r->end(), *i); - } - - return r; - } - - VALUE delete_at(difference_type i) { - VALUE r = Qnil; - try { - Sequence::iterator at = swig::getpos(self, i); - r = swig::from< Sequence::value_type >( *(at) ); - $self->erase(at); - } - catch (const std::out_of_range&) { - } - return r; - } - } -%enddef - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_methods_non_resizable_common(%arg(Sequence)) - %swig_sequence_methods_resizable_common(%arg(Sequence)) -%enddef - -/** - * Macro used to add functions for back insertion of values in - * STL sequence containers - */ -%define %swig_sequence_back_inserters( Sequence... ) - %extend { - - VALUE pop() { - if ($self->empty()) return Qnil; - Sequence::value_type x = self->back(); - $self->pop_back(); - return swig::from< Sequence::value_type >( x ); - } - - %alias push "<<"; - const value_type push( const value_type& e ) { - $self->push_back( e ); - return e; - } - - %newobject reject; - Sequence* reject() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - Sequence* r = new Sequence(); - std::remove_copy_if( $self->begin(), $self->end(), - std::back_inserter(*r), - swig::yield< Sequence::value_type >() ); - return r; - } - - } -%enddef - -%define %swig_sequence_methods_extra(Sequence...) - %extend { - %alias reject_bang "delete_if"; - Sequence* reject_bang() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - $self->erase( std::remove_if( $self->begin(), $self->end(), - swig::yield< Sequence::value_type >() ), $self->end() ); - return $self; - } - } -%enddef - -%define %swig_sequence_methods_non_resizable_accessors(Sequence...) - %extend { - - VALUE at(difference_type i) const { - VALUE r = Qnil; - try { - r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - VALUE __getitem__(difference_type i, difference_type length) const throw (std::invalid_argument) { - if ( length < 0 ) - return Qnil; - std::size_t len = $self->size(); - if ( i < 0 ) { - if ( i + static_cast(len) < 0 ) - return Qnil; - else - i = len + i; - } - Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) - j = len; - - VALUE r = Qnil; - try { - r = swig::from< const Sequence* >( swig::getslice(self, i, j) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - VALUE __getitem__(difference_type i) const { - VALUE r = Qnil; - try { - r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - VALUE __getitem__(VALUE i) const throw (std::invalid_argument) { - if ( rb_obj_is_kind_of( i, rb_cRange ) == Qfalse ) { - rb_raise( rb_eTypeError, "not a valid index or range" ); - } - - static ID id_end = rb_intern("end"); - static ID id_start = rb_intern("begin"); - static ID id_noend = rb_intern("exclude_end?"); - - VALUE start = rb_funcall2( i, id_start, 0, 0 ); - VALUE end = rb_funcall2( i, id_end, 0, 0 ); - bool noend = ( rb_funcall2( i, id_noend, 0, 0 ) == Qtrue ); - - int len = $self->size(); - - int s = NUM2INT( start ); - if ( s < 0 ) { - s = len + s; - if ( s < 0 ) - return Qnil; - } else if ( s > len ) - return Qnil; - - int e = NUM2INT( end ); - if ( e < 0 ) e = len + e; - if ( noend ) e -= 1; - if ( e < 0 ) e = -1; - if ( e >= len ) e = len - 1; - if ( s == len ) e = len - 1; - - return swig::from< Sequence* >( swig::getslice(self, s, e+1) ); - } - - VALUE __setitem__(difference_type i, const value_type& x) throw (std::invalid_argument, std::out_of_range) - { - if ( i >= static_cast( $self->size()) ) - swig::resize( $self, i+1, x ); - else - *(swig::getpos($self, i)) = x; - - return swig::from< Sequence::value_type >( x ); - } - - VALUE __setitem__(difference_type i, difference_type length, const Sequence& v) throw (std::invalid_argument) { - - if ( length < 0 ) - return Qnil; - std::size_t len = $self->size(); - if ( i < 0 ) { - if ( i + static_cast(len) < 0 ) - return Qnil; - else - i = len + i; - } - Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) { - swig::resize( $self, j, *(v.begin()) ); - } - - VALUE r = Qnil; - swig::setslice($self, i, j, v); - r = swig::from< const Sequence* >( &v ); - return r; - } - } -%enddef - -/** - * Macro used to add functions for non resizable sequences - */ -%define %swig_sequence_methods_non_resizable(Sequence...) - %swig_sequence_methods_non_resizable_common(%arg(Sequence)) - %swig_sequence_methods_non_resizable_accessors(%arg(Sequence)) -%enddef - - -/** - * Macro used to add functions for sequences - */ -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_non_resizable_common(%arg(Sequence)) - %swig_sequence_methods_resizable_common(%arg(Sequence)) - %swig_sequence_methods_non_resizable_accessors(%arg(Sequence)) - %swig_sequence_methods_extra(%arg(Sequence)); - %swig_sequence_back_inserters(%arg(Sequence)); -%enddef - -%define %swig_sequence_methods_non_resizable_val(Sequence...) - %swig_sequence_methods_non_resizable(%arg(Sequence)) -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods(%arg(Sequence)) -%enddef - - -/** - * Macro used to add functions for front insertion of - * elements in STL sequence containers that support it. - */ -%define %swig_sequence_front_inserters( Sequence... ) -%extend { - - VALUE shift() - { - if ($self->empty()) return Qnil; - Sequence::value_type x = self->front(); - $self->erase( $self->begin() ); - return swig::from< Sequence::value_type >( x ); - } - - %typemap(in) (int argc, VALUE* argv) { - $1 = argc - 1; - $2 = argv + 1; - } - - Sequence* insert( difference_type pos, int argc, VALUE* argv, ... ) - { - std::size_t len = $self->size(); - std::size_t i = swig::check_index( pos, len, true ); - Sequence::iterator start; - - VALUE elem = argv[0]; - int idx = 0; - try { - Sequence::value_type val = swig::as( elem ); - if ( i >= len ) { - $self->resize(i-1, val); - return $self; - } - start = $self->begin(); - std::advance( start, i ); - $self->insert( start++, val ); - - for ( ++idx; idx < argc; ++idx ) - { - elem = argv[idx]; - val = swig::as( elem ); - $self->insert( start++, val ); - } - - } - catch(const std::invalid_argument &) - { - rb_raise( rb_eArgError, "%s", - Ruby_Format_TypeError( "", - swig::type_name(), - __FUNCTION__, idx+2, elem )); - } - - - return $self; - } - - %typemap(in) (int argc, VALUE* argv) { - $1 = argc; - $2 = argv; - } - - Sequence* unshift( int argc, VALUE* argv, ... ) - { - for ( int idx = argc-1; idx >= 0; --idx ) - { - Sequence::iterator start = $self->begin(); - VALUE elem = argv[idx]; - try { - Sequence::value_type val = swig::as( elem ); - $self->insert( start, val ); - } - catch(const std::invalid_argument &) - { - rb_raise( rb_eArgError, "%s", - Ruby_Format_TypeError( "", - swig::type_name(), - __FUNCTION__, idx+2, elem )); - } - } - - return $self; - } -} -%enddef - - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="RubySequence_Cont", - fragment="GC_VALUE_definition") -{ -namespace swig { - template - inline void - assign(const RubySeq& rubyseq, Seq* seq) { - // seq->assign(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(VALUE obj, sequence **seq) { - if (rb_obj_is_kind_of(obj, rb_cArray) == Qtrue) { - try { - RubySequence_Cont rubyseq(obj); - if (seq) { - sequence *pseq = new sequence(); - assign(rubyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return rubyseq.check() ? SWIG_OK : SWIG_ERROR; - } - } catch (const std::exception& e) { - if (seq) { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - rb_raise(rb_eTypeError, "%s", e.what()); - } - } - return SWIG_ERROR; - } - } else { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } - }; - - // Partial specialization for GC_VALUE's. No need to typecheck each - // element. - template< class Seq > - struct traits_asptr_stdseq< Seq, swig::GC_VALUE > { - typedef Seq sequence; - typedef swig::GC_VALUE value_type; - - static int asptr(VALUE obj, sequence **seq) { - if (rb_obj_is_kind_of(obj, rb_cArray) == Qtrue) { - try { - if (seq) { - RubySequence_Cont rubyseq(obj); - sequence *pseq = new sequence(); - assign(rubyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return true; - } - } catch (const std::exception& e) { - if (seq) { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - rb_raise(rb_eTypeError, "%s", e.what()); - } - } - return SWIG_ERROR; - } - } else { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static VALUE from(const sequence& seq) { -#ifdef SWIG_RUBY_EXTRA_NATIVE_CONTAINERS - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); - } -#endif - size_type size = seq.size(); - if (size <= (size_type)INT_MAX) { - VALUE obj = rb_ary_new2((int)size); - int i = 0; - for (const_iterator it = seq.begin(); - it != seq.end(); ++it, ++i) { - rb_ary_push(obj, swig::from< value_type >(*it)); - } - rb_obj_freeze(obj); // treat as immutable result - return obj; - } else { - rb_raise(rb_eRangeError,"sequence size not valid in ruby"); - return Qnil; - } - } - }; -} -} - - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubycontainer_extended.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubycontainer_extended.swg deleted file mode 100755 index 663dddb8..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubycontainer_extended.swg +++ /dev/null @@ -1,134 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubycontainer_extended.swg - * - * This file contains additional functions that make containers - * behave closer to ruby primitive types. - * However, some of these functions place some restrictions on - * the underlying object inside of the container and the iterator - * (that it has to have an == comparison function, that it has to have - * an = assignment operator, etc). - * ----------------------------------------------------------------------------- */ - -/** - * Macro used to add extend functions that require operator== in object. - * - * @param Container STL container - * @param Type class inside container - * - */ -%define %swig_container_with_equal_operator( Container, Type ) - - VALUE __delete__( const Type& val ) { - VALUE r = Qnil; - Container::iterator e = $self->end(); - Container::iterator i = std::remove( $self->begin(), e, val ); - // remove dangling elements now - $self->erase( i, e ); - - if ( i != e ) - r = swig::from< Type >( val ); - else if ( rb_block_given_p() ) - r = rb_yield(Qnil); - return r; - } - -%enddef // end of %swig_container_with_equal_operator - - - - -/** - * Macro used to add extend functions that require the assignment - * operator (ie. = ) of contained class - * - * @param Container STL container - * @param Type class inside container - * - */ - -%define %swig_container_with_assignment( Container, Type ) - - - // - // map! -- the equivalent of std::transform - // - Container< Type >* map_bang() { - - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "No block given" ); - - VALUE r = Qnil; - Container< Type >::iterator i = $self->begin(); - Container< Type >::iterator e = $self->end(); - - try { - for ( ; i != e; ++i ) - { - r = swig::from< Type >( *i ); - r = rb_yield( r ); - *i = swig::as< Type >( r ); - } - } - catch (const std::invalid_argument&) - { - rb_raise(rb_eTypeError, - "Yield block did not return a valid element for " "Container"); - } - - return $self; - } - - -%enddef // end of %swig_container_with_assignment - - - - - -/** - * Macro used to add all extended functions to a container - * - * @param Container STL container - * @param Type class inside container - * - */ -%define %swig_container_extend( Container, Type ) - -%extend Container< Type > { - - %swig_container_with_assignment( %arg(Container), Type ); - %swig_container_with_equal_operator( %arg(Container), Type ); - -} - -%enddef - - -/** - * Private macro used to add all extended functions to C/C++ - * primitive types - * - * @param Container an STL container, like std::vector (with no class template) - * - */ -%define %__swig_container_extend_primtypes( Container ) - -%swig_container_extend( %arg( Container ), bool ); -%swig_container_extend( %arg( Container ), char ); -%swig_container_extend( %arg( Container ), short ); -%swig_container_extend( %arg( Container ), int ); -%swig_container_extend( %arg( Container ), unsigned short ); -%swig_container_extend( %arg( Container ), unsigned int ); -%swig_container_extend( %arg( Container ), float ); -%swig_container_extend( %arg( Container ), double ); -%swig_container_extend( %arg( Container ), std::complex ); -%swig_container_extend( %arg( Container ), std::string ); -%swig_container_extend( %arg( Container ), swig::GC_VALUE ); - -%enddef - - -%__swig_container_extend_primtypes( std::vector ); -%__swig_container_extend_primtypes( std::deque ); -%__swig_container_extend_primtypes( std::list ); - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubydef.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubydef.swg deleted file mode 100755 index 956aaee0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubydef.swg +++ /dev/null @@ -1 +0,0 @@ -/* empty file added for backward comp. */ diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyerrors.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyerrors.swg deleted file mode 100755 index 434544bc..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyerrors.swg +++ /dev/null @@ -1,154 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - - -/* Define some additional error types */ -#define SWIG_ObjectPreviouslyDeletedError -100 - - -/* Define custom exceptions for errors that do not map to existing Ruby - exceptions. Note this only works for C++ since a global cannot be - initialized by a function in C. For C, fallback to rb_eRuntimeError.*/ - -SWIGINTERN VALUE -getNullReferenceError(void) { - static int init = 0; - static VALUE rb_eNullReferenceError ; - if (!init) { - init = 1; - rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError); - } - return rb_eNullReferenceError; -} - -SWIGINTERN VALUE -getObjectPreviouslyDeletedError(void) { - static int init = 0; - static VALUE rb_eObjectPreviouslyDeleted ; - if (!init) { - init = 1; - rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError); - } - return rb_eObjectPreviouslyDeleted; -} - - -SWIGINTERN VALUE -SWIG_Ruby_ErrorType(int SWIG_code) { - VALUE type; - switch (SWIG_code) { - case SWIG_MemoryError: - type = rb_eNoMemError; - break; - case SWIG_IOError: - type = rb_eIOError; - break; - case SWIG_RuntimeError: - type = rb_eRuntimeError; - break; - case SWIG_IndexError: - type = rb_eIndexError; - break; - case SWIG_TypeError: - type = rb_eTypeError; - break; - case SWIG_DivisionByZero: - type = rb_eZeroDivError; - break; - case SWIG_OverflowError: - type = rb_eRangeError; - break; - case SWIG_SyntaxError: - type = rb_eSyntaxError; - break; - case SWIG_ValueError: - type = rb_eArgError; - break; - case SWIG_SystemError: - type = rb_eFatal; - break; - case SWIG_AttributeError: - type = rb_eRuntimeError; - break; - case SWIG_NullReferenceError: - type = getNullReferenceError(); - break; - case SWIG_ObjectPreviouslyDeletedError: - type = getObjectPreviouslyDeletedError(); - break; - case SWIG_UnknownError: - type = rb_eRuntimeError; - break; - default: - type = rb_eRuntimeError; - } - return type; -} - - -/* This function is called when a user inputs a wrong argument to - a method. - */ -SWIGINTERN -const char* Ruby_Format_TypeError( const char* msg, - const char* type, - const char* name, - const int argn, - VALUE input ) -{ - char buf[128]; - VALUE str; - VALUE asStr; - if ( msg && *msg ) - { - str = rb_str_new2(msg); - } - else - { - str = rb_str_new(NULL, 0); - } - - str = rb_str_cat2( str, "Expected argument " ); - sprintf( buf, "%d of type ", argn-1 ); - str = rb_str_cat2( str, buf ); - str = rb_str_cat2( str, type ); - str = rb_str_cat2( str, ", but got " ); - str = rb_str_cat2( str, rb_obj_classname(input) ); - str = rb_str_cat2( str, " " ); - asStr = rb_inspect(input); - if ( RSTRING_LEN(asStr) > 30 ) - { - str = rb_str_cat( str, StringValuePtr(asStr), 30 ); - str = rb_str_cat2( str, "..." ); - } - else - { - str = rb_str_append( str, asStr ); - } - - if ( name ) - { - str = rb_str_cat2( str, "\n\tin SWIG method '" ); - str = rb_str_cat2( str, name ); - str = rb_str_cat2( str, "'" ); - } - - return StringValuePtr( str ); -} - -/* This function is called when an overloaded method fails */ -SWIGINTERN -void Ruby_Format_OverloadedError( - const int argc, - const int maxargs, - const char* method, - const char* prototypes - ) -{ - const char* msg = "Wrong # of arguments"; - if ( argc <= maxargs ) msg = "Wrong arguments"; - rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n" - "Possible C/C++ prototypes are:\n%s", - msg, method, prototypes); -} diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyfragments.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyfragments.swg deleted file mode 100755 index 3c3b6581..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'rubyfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the ones defined by default by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(VALUE obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyhead.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyhead.swg deleted file mode 100755 index e4d9e214..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyhead.swg +++ /dev/null @@ -1,185 +0,0 @@ -#if __GNUC__ >= 7 -#pragma GCC diagnostic push -#if defined(__cplusplus) -#pragma GCC diagnostic ignored "-Wregister" -#if __GNUC__ >= 10 -#pragma GCC diagnostic ignored "-Wvolatile" -#if __GNUC__ >= 11 -#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" -#endif -#endif -#endif -#endif - -#include - -#if __GNUC__ >= 7 -#pragma GCC diagnostic pop -#endif - -/* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which - * breaks using rb_intern as an lvalue, as SWIG does. We work around this - * issue for now by disabling this. - * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645 - */ -#ifdef rb_intern -# undef rb_intern -#endif - -/* Remove global macros defined in Ruby's win32.h */ -#ifdef write -# undef write -#endif -#ifdef read -# undef read -#endif -#ifdef bind -# undef bind -#endif -#ifdef close -# undef close -#endif -#ifdef connect -# undef connect -#endif - - -/* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */ -#ifndef NUM2LL -#define NUM2LL(x) NUM2LONG((x)) -#endif -#ifndef LL2NUM -#define LL2NUM(x) INT2NUM((long) (x)) -#endif -#ifndef ULL2NUM -#define ULL2NUM(x) UINT2NUM((unsigned long) (x)) -#endif - -/* Ruby 1.7 doesn't (yet) define NUM2ULL() */ -#ifndef NUM2ULL -#ifdef HAVE_LONG_LONG -#define NUM2ULL(x) rb_num2ull((x)) -#else -#define NUM2ULL(x) NUM2ULONG(x) -#endif -#endif - -/* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */ -/* Define these for older versions so we can just write code the new way */ -#ifndef RSTRING_LEN -# define RSTRING_LEN(x) RSTRING(x)->len -#endif -#ifndef RSTRING_PTR -# define RSTRING_PTR(x) RSTRING(x)->ptr -#endif -#ifndef RSTRING_END -# define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x)) -#endif -#ifndef RARRAY_LEN -# define RARRAY_LEN(x) RARRAY(x)->len -#endif -#ifndef RARRAY_PTR -# define RARRAY_PTR(x) RARRAY(x)->ptr -#endif -#ifndef RFLOAT_VALUE -# define RFLOAT_VALUE(x) RFLOAT(x)->value -#endif -#ifndef DOUBLE2NUM -# define DOUBLE2NUM(x) rb_float_new(x) -#endif -#ifndef RHASH_TBL -# define RHASH_TBL(x) (RHASH(x)->tbl) -#endif -#ifndef RHASH_ITER_LEV -# define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev) -#endif -#ifndef RHASH_IFNONE -# define RHASH_IFNONE(x) (RHASH(x)->ifnone) -#endif -#ifndef RHASH_SIZE -# define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries) -#endif -#ifndef RHASH_EMPTY_P -# define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0) -#endif -#ifndef RSTRUCT_LEN -# define RSTRUCT_LEN(x) RSTRUCT(x)->len -#endif -#ifndef RSTRUCT_PTR -# define RSTRUCT_PTR(x) RSTRUCT(x)->ptr -#endif -#ifndef RTYPEDDATA_P -# define RTYPEDDATA_P(x) (TYPE(x) != T_DATA) -#endif - - - -/* - * The following macros are used for providing the correct type of a - * function pointer to the Ruby C API. - * Starting with Ruby 2.7 (corresponding to RB_METHOD_DEFINITION_DECL being - * defined) these macros act transparently due to Ruby's moving away from - * ANYARGS and instead employing strict function signatures. - * - * Note: In case of C (not C++) the macros are transparent even before - * Ruby 2.7 due to the fact that the Ruby C API used function declarators - * with empty parentheses, which allows for an unspecified number of - * arguments. - * - * PROTECTFUNC(f) is used for the function pointer argument of the Ruby - * C API function rb_protect(). - * - * VALUEFUNC(f) is used for the function pointer argument(s) of Ruby C API - * functions like rb_define_method() and rb_define_singleton_method(). - * - * VOIDFUNC(f) is used to typecast a C function that implements either - * the "mark" or "free" stuff for a Ruby Data object, so that it can be - * passed as an argument to Ruby C API functions like Data_Wrap_Struct() - * and Data_Make_Struct(). - * - * SWIG_RUBY_VOID_ANYARGS_FUNC(f) is used for the function pointer - * argument(s) of Ruby C API functions like rb_define_virtual_variable(). - * - * SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer - * argument(s) of Ruby C API functions like st_foreach(). - */ -#if defined(__cplusplus) && !defined(RB_METHOD_DEFINITION_DECL) -# define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f) -# define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f) -# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f) -# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) ((void (*)(ANYARGS))(f)) -# define SWIG_RUBY_INT_ANYARGS_FUNC(f) ((int (*)(ANYARGS))(f)) -#else -# define PROTECTFUNC(f) (f) -# define VALUEFUNC(f) (f) -# define VOIDFUNC(f) (f) -# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f) -# define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f) -#endif - -/* Don't use for expressions have side effect */ -#ifndef RB_STRING_VALUE -#define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s))) -#endif -#ifndef StringValue -#define StringValue(s) RB_STRING_VALUE(s) -#endif -#ifndef StringValuePtr -#define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s)) -#endif -#ifndef StringValueLen -#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s)) -#endif -#ifndef SafeStringValue -#define SafeStringValue(v) do {\ - StringValue(v);\ - rb_check_safe_str(v);\ -} while (0) -#endif - -#ifndef HAVE_RB_DEFINE_ALLOC_FUNC -#define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1) -#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new") -#endif - -static VALUE _mSWIG = Qnil; diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyinit.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyinit.swg deleted file mode 100755 index fc6e039b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyinit.swg +++ /dev/null @@ -1 +0,0 @@ -%insert(initbeforefunc) "swiginit.swg" diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyiterators.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyiterators.swg deleted file mode 100755 index 89fea452..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyiterators.swg +++ /dev/null @@ -1,932 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyiterators.swg - * - * Implement a C++ 'output' iterator for Ruby. - * - * Users can derive form the Iterator to implement their - * own iterators. As an example (real one since we use it for STL/STD - * containers), the template Iterator_T does the - * implementation for generic C++ iterators. - * ----------------------------------------------------------------------------- */ - -%include - - -%fragment("ConstIterator","header",fragment="",fragment="GC_VALUE_definition") { -namespace swig { - struct stop_iteration { - }; - - /** - * Abstract base class used to represent all iterators of STL containers. - */ - struct ConstIterator { - public: - typedef ConstIterator self_type; - - protected: - GC_VALUE _seq; - - protected: - ConstIterator(VALUE seq) : _seq(seq) - { - } - - // Random access iterator methods, but not required in Ruby - virtual ptrdiff_t distance(const ConstIterator &x) const - { - throw std::invalid_argument("distance not supported"); - } - - virtual bool equal (const ConstIterator &x) const - { - throw std::invalid_argument("equal not supported"); - } - - virtual self_type* advance(ptrdiff_t n) - { - throw std::invalid_argument("advance not supported"); - } - - public: - virtual ~ConstIterator() {} - - // Access iterator method, required by Ruby - virtual VALUE value() const { - throw std::invalid_argument("value not supported"); - return Qnil; - }; - - virtual VALUE setValue( const VALUE& v ) { - throw std::invalid_argument("value= not supported"); - return Qnil; - } - - virtual self_type* next( size_t n = 1 ) - { - return this->advance( n ); - } - - virtual self_type* previous( size_t n = 1 ) - { - ptrdiff_t nn = n; - return this->advance( -nn ); - } - - virtual VALUE to_s() const { - throw std::invalid_argument("to_s not supported"); - return Qnil; - } - - virtual VALUE inspect() const { - throw std::invalid_argument("inspect not supported"); - return Qnil; - } - - virtual ConstIterator *dup() const - { - throw std::invalid_argument("dup not supported"); - return NULL; - } - - // - // C++ common/needed methods. We emulate a bidirectional - // operator, to be compatible with all the STL. - // The iterator traits will then tell the STL what type of - // iterator we really are. - // - ConstIterator() : _seq( Qnil ) - { - } - - ConstIterator( const self_type& b ) : _seq( b._seq ) - { - } - - self_type& operator=( const self_type& b ) - { - _seq = b._seq; - return *this; - } - - bool operator == (const ConstIterator& x) const - { - return equal(x); - } - - bool operator != (const ConstIterator& x) const - { - return ! operator==(x); - } - - // Pre-decrement operator - self_type& operator--() - { - return *previous(); - } - - // Pre-increment operator - self_type& operator++() - { - return *next(); - } - - // Post-decrement operator - self_type operator--(int) - { - self_type r = *this; - previous(); - return r; - } - - // Post-increment operator - self_type operator++(int) - { - self_type r = *this; - next(); - return r; - } - - ConstIterator& operator += (ptrdiff_t n) - { - return *advance(n); - } - - ConstIterator& operator -= (ptrdiff_t n) - { - return *advance(-n); - } - - ConstIterator* operator + (ptrdiff_t n) const - { - return dup()->advance(n); - } - - ConstIterator* operator - (ptrdiff_t n) const - { - return dup()->advance(-n); - } - - ptrdiff_t operator - (const ConstIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::ConstIterator *"); - init = 1; - } - return desc; - } - }; - - - /** - * Abstract base class used to represent all non-const iterators of STL containers. - * - */ - struct Iterator : public ConstIterator { - public: - typedef Iterator self_type; - - protected: - Iterator(VALUE seq) : ConstIterator(seq) - { - } - - virtual self_type* advance(ptrdiff_t n) - { - throw std::invalid_argument("operation not supported"); - } - - public: - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::Iterator *"); - init = 1; - } - return desc; - } - - virtual Iterator *dup() const - { - throw std::invalid_argument("dup not supported"); - return NULL; - } - - virtual self_type* next( size_t n = 1 ) - { - return this->advance( n ); - } - - virtual self_type* previous( size_t n = 1 ) - { - ptrdiff_t nn = n; - return this->advance( -nn ); - } - - bool operator == (const ConstIterator& x) const - { - return equal(x); - } - - bool operator != (const Iterator& x) const - { - return ! operator==(x); - } - - Iterator& operator += (ptrdiff_t n) - { - return *advance(n); - } - - Iterator& operator -= (ptrdiff_t n) - { - return *advance(-n); - } - - Iterator* operator + (ptrdiff_t n) const - { - return dup()->advance(n); - } - - Iterator* operator - (ptrdiff_t n) const - { - return dup()->advance(-n); - } - - ptrdiff_t operator - (const Iterator& x) const - { - return x.distance(*this); - } - }; - -} -} - - -%fragment("ConstIterator_T","header",fragment="",fragment="ConstIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - - /** - * Templated base classes for all custom const_iterators. - * - */ - template - class ConstIterator_T : public ConstIterator - { - public: - typedef OutConstIterator const_iter; - typedef typename std::iterator_traits::value_type value_type; - typedef ConstIterator_T self_type; - - protected: - - - virtual bool equal (const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual ptrdiff_t distance(const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual ConstIterator* advance(ptrdiff_t n) - { - std::advance( current, n ); - return this; - } - - public: - ConstIterator_T() : ConstIterator(Qnil) - { - } - - ConstIterator_T(const_iter curr, VALUE seq = Qnil) - : ConstIterator(seq), current(curr) - { - } - - const const_iter& get_current() const - { - return current; - } - - const value_type& operator*() const - { - return *current; - } - - virtual VALUE inspect() const - { - VALUE ret = rb_str_new2("#<"); - ret = rb_str_cat2( ret, rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::const_iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_inspect(cur) ); - ret = rb_str_cat2( ret, ">" ); - return ret; - } - - virtual VALUE to_s() const - { - VALUE ret = rb_str_new2( rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::const_iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_obj_as_string(cur) ); - return ret; - } - - protected: - const_iter current; - }; - - - /** - * Templated base classes for all custom non-const iterators. - * - */ - template - class Iterator_T : public Iterator - { - public: - typedef InOutIterator nonconst_iter; - - // Make this class iterator STL compatible, by using iterator_traits - typedef typename std::iterator_traits::iterator_category iterator_category; - typedef typename std::iterator_traits::value_type value_type; - typedef typename std::iterator_traits::difference_type difference_type; - typedef typename std::iterator_traits::pointer pointer; - typedef typename std::iterator_traits::reference reference; - - typedef Iterator base; - typedef Iterator_T< nonconst_iter > self_type; - - protected: - - virtual bool equal (const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual ptrdiff_t distance(const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( current, n ); - return this; - } - - public: - - Iterator_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator(seq), current(curr) - { - } - - const nonconst_iter& get_current() const - { - return current; - } - - self_type& operator=( const self_type& b ) - { - base::operator=( b ); - return *this; - } - - self_type& operator=( const value_type& b ) - { - *current = b; - return *this; - } - - const value_type& operator*() const - { - return *current; - } - - value_type& operator*() - { - return *current; - } - - virtual VALUE inspect() const - { - VALUE ret = rb_str_new2("#<"); - ret = rb_str_cat2( ret, rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_inspect(cur) ); - ret = rb_str_cat2( ret, ">" ); - return ret; - } - - virtual VALUE to_s() const - { - VALUE ret = rb_str_new2( rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_obj_as_string(cur) ); - return ret; - } - - protected: - nonconst_iter current; - }; - - - /** - * Auxiliary functor to store the value of a ruby object inside - * a reference of a compatible C++ type. ie: Ruby -> C++ - * - */ - template - struct asval_oper - { - typedef ValueType value_type; - typedef bool result_type; - bool operator()(VALUE obj, value_type& v) const - { - return ( swig::asval< value_type >(obj, &v) == SWIG_OK ); - } - }; - - /** - * Auxiliary functor to return a ruby object from a C++ type. - * ie: C++ -> Ruby - * - */ - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef VALUE result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - - /** - * ConstIterator class for a const_iterator with no end() boundaries. - * - */ - template::value_type, - typename FromOper = from_oper > - class ConstIteratorOpen_T : public ConstIterator_T - { - public: - FromOper from; - typedef OutConstIterator const_iter; - typedef ValueType value_type; - typedef ConstIterator_T base; - typedef ConstIteratorOpen_T self_type; - - ConstIteratorOpen_T(const_iter curr, VALUE seq = Qnil) - : ConstIterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - ConstIterator *dup() const - { - return new self_type(*this); - } - }; - - /** - * Iterator class for an iterator with no end() boundaries. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class IteratorOpen_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef IteratorOpen_T self_type; - - public: - IteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - virtual VALUE setValue( const VALUE& v ) - { - value_type& dst = *base::current; - if ( asval(v, dst) ) return v; - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - }; - - /** - * ConstIterator class for a const_iterator where begin() and end() boundaries are known. - * - */ - template::value_type, - typename FromOper = from_oper > - class ConstIteratorClosed_T : public ConstIterator_T - { - public: - FromOper from; - typedef OutConstIterator const_iter; - typedef ValueType value_type; - typedef ConstIterator_T base; - typedef ConstIteratorClosed_T self_type; - - protected: - virtual ConstIterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - ConstIteratorClosed_T(const_iter curr, const_iter first, - const_iter last, VALUE seq = Qnil) - : ConstIterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - ConstIterator *dup() const - { - return new self_type(*this); - } - - - private: - const_iter begin; - const_iter end; - }; - - /** - * Iterator class for a iterator where begin() and end() boundaries are known. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class IteratorClosed_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef IteratorClosed_T self_type; - - protected: - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - IteratorClosed_T(nonconst_iter curr, nonconst_iter first, - nonconst_iter last, VALUE seq = Qnil) - : Iterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - // Iterator setter method, required by Ruby - virtual VALUE setValue( const VALUE& v ) - { - if (base::current == end) - throw stop_iteration(); - - value_type& dst = *base::current; - if ( asval( v, dst ) ) return v; - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - - private: - nonconst_iter begin; - nonconst_iter end; - }; - - /* Partial specialization for bools which don't allow de-referencing */ - template< typename InOutIterator, typename FromOper, typename AsvalOper > - class IteratorOpen_T< InOutIterator, bool, FromOper, AsvalOper > : - public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef bool value_type; - typedef Iterator_T base; - typedef IteratorOpen_T self_type; - - IteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - virtual VALUE setValue( const VALUE& v ) - { - bool tmp = *base::current; - if ( asval( v, tmp ) ) - { - *base::current = tmp; - return v; - } - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - - }; - - /* Partial specialization for bools which don't allow de-referencing */ - template< typename InOutIterator, typename FromOper, typename AsvalOper > - class IteratorClosed_T< InOutIterator, bool, FromOper, AsvalOper > : - public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef bool value_type; - typedef Iterator_T base; - typedef IteratorClosed_T self_type; - - protected: - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - IteratorClosed_T(nonconst_iter curr, nonconst_iter first, - nonconst_iter last, VALUE seq = Qnil) - : Iterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - virtual VALUE setValue( const VALUE& v ) - { - if (base::current == end) - throw stop_iteration(); - - bool tmp = *base::current; - if ( asval( v, tmp ) ) - { - *base::current = tmp; - return v; - } - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - - private: - nonconst_iter begin; - nonconst_iter end; - }; - - - /** - * Helper function used to wrap a bounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline Iterator* - make_nonconst_iterator(const InOutIter& current, const InOutIter& begin, - const InOutIter& end, VALUE seq = Qnil) - { - return new IteratorClosed_T(current, begin, end, seq); - } - - /** - * Helper function used to wrap an unbounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline Iterator* - make_nonconst_iterator(const InOutIter& current, VALUE seq = Qnil) - { - return new IteratorOpen_T(current, seq); - } - - /** - * Helper function used to wrap a bounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline ConstIterator* - make_const_iterator(const OutIter& current, const OutIter& begin, - const OutIter& end, VALUE seq = Qnil) - { - return new ConstIteratorClosed_T(current, begin, end, seq); - } - - /** - * Helper function used to wrap an unbounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline ConstIterator* - make_const_iterator(const OutIter& current, VALUE seq = Qnil) - { - return new ConstIteratorOpen_T(current, seq); - } -} -} - - -%fragment("ConstIterator"); - - -// -// This part is just so SWIG is aware of the base abstract iterator class. -// -namespace swig -{ - /* - Throw a StopIteration exception - */ - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws) stop_iteration { - (void)$1; - SWIG_Ruby_ExceptionType(NULL, Qnil); - SWIG_fail; - } - - /* - Mark methods that return new objects - */ - %newobject ConstIterator::dup; - %newobject ConstIterator::operator + (ptrdiff_t n) const; - %newobject ConstIterator::operator - (ptrdiff_t n) const; - - %nodirector ConstIterator; - - %catches(swig::stop_iteration) ConstIterator::value() const; - %catches(swig::stop_iteration) ConstIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) ConstIterator::decr(size_t n = 1); - %catches(std::invalid_argument) ConstIterator::distance(const ConstIterator &x) const; - %catches(std::invalid_argument) ConstIterator::equal (const ConstIterator &x) const; - %catches(swig::stop_iteration) ConstIterator::next(); - %catches(swig::stop_iteration) ConstIterator::previous(); - %catches(swig::stop_iteration) ConstIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) ConstIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) ConstIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) ConstIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) ConstIterator::operator - (ptrdiff_t n) const; - - - struct ConstIterator - { - protected: - ConstIterator(VALUE seq); - - public: - virtual ~ConstIterator(); - - // Access iterator method, required by Ruby - virtual VALUE value() const; - - // C++ common/needed methods - virtual ConstIterator *dup() const; - - virtual VALUE inspect() const; - virtual VALUE to_s() const; - - virtual ConstIterator* next(size_t n = 1); - virtual ConstIterator* previous(size_t n = 1); - - bool operator == (const ConstIterator& x) const; - ConstIterator* operator + (ptrdiff_t n) const; - ConstIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const ConstIterator& x) const; - }; - - struct Iterator : public ConstIterator - { - %rename("value=") setValue( const VALUE& v ); - virtual VALUE setValue( const VALUE& v ); - - virtual Iterator *dup() const; - - virtual Iterator* next(size_t n = 1); - virtual Iterator* previous(size_t n = 1); - - virtual VALUE inspect() const; - virtual VALUE to_s() const; - - bool operator == (const Iterator& x) const; - Iterator* operator + (ptrdiff_t n) const; - Iterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const Iterator& x) const; - }; - -} - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubykw.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubykw.swg deleted file mode 100755 index 6b4685eb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubykw.swg +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef RUBY_RUBYKW_SWG_ -#define RUBY_RUBYKW_SWG_ - -/* Warnings for Ruby keywords */ -#define RUBYKW(x) %keywordwarn("'" `x` "' is a ruby keyword",rename="C_%s",fullname=1) `x` - -/* - - from http://www.rubycentral.com/book/language.html - -*/ - -RUBYKW(BEGIN); -RUBYKW(END); -RUBYKW(alias); -RUBYKW(and); -RUBYKW(begin); -RUBYKW(break); -RUBYKW(case); -RUBYKW(class); -RUBYKW(def); -RUBYKW("defined"); -RUBYKW(do); -RUBYKW(else); -RUBYKW(elsif); -RUBYKW(end); -RUBYKW(ensure); -RUBYKW(false); -RUBYKW(fatal); -RUBYKW(for); -RUBYKW(if); -RUBYKW(in); -RUBYKW(module); -RUBYKW(next); -RUBYKW(nil); -RUBYKW(not); -RUBYKW(or); -RUBYKW(redo); -RUBYKW(rescue); -RUBYKW(retry); -RUBYKW(return); -RUBYKW(self); -RUBYKW(super); -RUBYKW(then); -RUBYKW(true); -RUBYKW(undef); -RUBYKW(unless); -RUBYKW(until); -RUBYKW(when); -RUBYKW(while); -RUBYKW(yield); - -// RUBYKW(FalseClass); -// RUBYKW(TrueClass); -// RUBYKW(Numeric); -// RUBYKW(Integer); -// RUBYKW(Fixnum); -// RUBYKW(Float); -// RUBYKW(Range); -// RUBYKW(Array); -// RUBYKW(String); -// RUBYKW(IO); -// RUBYKW(File); -// RUBYKW(FileUtils); -// RUBYKW(Find); -// RUBYKW(Struct); -// RUBYKW(OpenStruct); -// RUBYKW(Regexp); - -#undef RUBYKW - -#endif //RUBY_RUBYKW_SWG_ diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubymacros.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubymacros.swg deleted file mode 100755 index de2a52ba..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubymacros.swg +++ /dev/null @@ -1,13 +0,0 @@ - -// Redefine these macros so argument index for ruby is done properly, -// ignoring self and we get some more info about the input. -#define %argfail_fmt(_type,_name,_argn) Ruby_Format_TypeError( "", _type, #_name, _argn, $input ) - -#define %argnullref_fmt(_type,_name,_argn) Ruby_Format_TypeError(%nullref_fmt(), _type, #_name, _argn, $input) - -%{ -#define SWIG_RUBY_THREAD_BEGIN_BLOCK -#define SWIG_RUBY_THREAD_END_BLOCK -%} - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyopers.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyopers.swg deleted file mode 100755 index d1ac8bf0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyopers.swg +++ /dev/null @@ -1,55 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus - -%rename(__add__) *::operator+; -%rename(__pos__) *::operator+(); -%rename(__pos__) *::operator+() const; -%rename(__sub__) *::operator-; -%rename(__neg__) *::operator-(); -%rename(__neg__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__mod__) *::operator%; -%rename(__lshift__) *::operator<<; -%rename(__rshift__) *::operator>>; -%rename(__and__) *::operator&; -%rename(__or__) *::operator|; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__lt__) *::operator<; -%rename(__le__) *::operator<=; -%rename(__gt__) *::operator>; -%rename(__ge__) *::operator>=; -%rename(__eq__) *::operator==; - -/* Special cases */ -%rename(__call__) *::operator(); - -/* Ignored inplace operators */ -%ignoreoperator(NOTEQUAL) operator!=; -%ignoreoperator(PLUSEQ) operator+=; -%ignoreoperator(MINUSEQ) operator-=; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; - -/* Ignored operators */ -%ignoreoperator(LNOT) operator!; -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; -%ignoreoperator(EQ) operator=; -%ignoreoperator(PLUSPLUS) operator++; -%ignoreoperator(MINUSMINUS) operator--; -%ignoreoperator(ARROWSTAR) operator->*; -%ignoreoperator(INDEX) operator[]; - - -#endif /* __cplusplus */ diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyprimtypes.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyprimtypes.swg deleted file mode 100755 index 4b078dee..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyprimtypes.swg +++ /dev/null @@ -1,228 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyprimtypes.swg - * ----------------------------------------------------------------------------- */ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* auxiliary ruby fail method */ - -%fragment("SWIG_ruby_failed","header") -{ -SWIGINTERN VALUE -SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2)) -{ - return Qnil; -} -} - -%define %ruby_aux_method(Type, Method, Action) -SWIGINTERN VALUE SWIG_AUX_##Method##(VALUE arg) -{ - VALUE *args = (VALUE *)arg; - VALUE obj = args[0]; - VALUE type = TYPE(obj); - Type *res = (Type *)(args[1]); - *res = Action; - return obj; -} -%enddef - - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE VALUE -SWIG_From_dec(bool)(bool value) -{ - return value ? Qtrue : Qfalse; -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(int)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(VALUE obj, bool *val) -{ - if (obj == Qtrue) { - if (val) *val = true; - return SWIG_OK; - } else if (obj == Qfalse) { - if (val) *val = false; - return SWIG_OK; - } else { - int res = 0; - if (SWIG_AsVal(int)(obj, &res) == SWIG_OK) { - if (val) *val = res ? true : false; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header", - fragment="") { - %define_as(SWIG_From_dec(long), LONG2NUM) -} - -%fragment(SWIG_AsVal_frag(long),"header",fragment="SWIG_ruby_failed") { -%ruby_aux_method(long, NUM2LONG, type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(long)(VALUE obj, long* val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE VALUE -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return ULONG2NUM(value); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header",fragment="SWIG_ruby_failed") { -%ruby_aux_method(unsigned long, NUM2ULONG, type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(VALUE obj, unsigned long *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - unsigned long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE VALUE -SWIG_From_dec(long long)(long long value) -{ - return LL2NUM(value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_ruby_failed", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -%ruby_aux_method(long long, NUM2LL, type == T_FIXNUM ? NUM2LL(obj) : rb_big2ll(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(long long)(VALUE obj, long long *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - long long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE VALUE -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return ULL2NUM(value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_ruby_failed", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -%ruby_aux_method(long long, NUM2ULL, type == T_FIXNUM ? NUM2ULL(obj) : rb_big2ull(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(VALUE obj, unsigned long long *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - unsigned long long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { - %define_as(SWIG_From_dec(double), rb_float_new) -} - -%fragment(SWIG_AsVal_frag(double),"header",fragment="SWIG_ruby_failed") { -%ruby_aux_method(double, NUM2DBL, NUM2DBL(obj); (void)type) - -SWIGINTERN int -SWIG_AsVal_dec(double)(VALUE obj, double *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) { - double v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2DBL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyrun.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyrun.swg deleted file mode 100755 index 6cac4626..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyrun.swg +++ /dev/null @@ -1,468 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyrun.swg - * - * This file contains the runtime support for Ruby modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 - -/* for raw pointers */ -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags) -#define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own) -#define swig_owntype swig_ruby_owntype - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code) -#define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg) -#define SWIG_fail goto fail - - -/* Ruby-specific SWIG API */ - -#define SWIG_InitRuntime() SWIG_Ruby_InitRuntime() -#define SWIG_define_class(ty) SWIG_Ruby_define_class(ty) -#define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty) -#define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value) -#define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty) - -#include "assert.h" - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - VALUE klass; - VALUE mImpl; - void (*mark)(void *); - void (*destroy)(void *); - int trackObjects; -} swig_class; - - -/* Global pointer used to keep some internal SWIG stuff */ -static VALUE _cSWIG_Pointer = Qnil; -static VALUE swig_runtime_data_type_pointer = Qnil; - -/* Global IDs used to keep some internal SWIG stuff */ -static ID swig_arity_id = 0; -static ID swig_call_id = 0; - -/* - If your swig extension is to be run within an embedded ruby and has - director callbacks, you should set -DRUBY_EMBEDDED during compilation. - This will reset ruby's stack frame on each entry point from the main - program the first time a virtual director function is invoked (in a - non-recursive way). - If this is not done, you run the risk of Ruby trashing the stack. -*/ - -#ifdef RUBY_EMBEDDED - -# define SWIG_INIT_STACK \ - if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \ - ++swig_virtual_calls; -# define SWIG_RELEASE_STACK --swig_virtual_calls; -# define Ruby_DirectorTypeMismatchException(x) \ - rb_raise( rb_eTypeError, "%s", x ); return c_result; - - static unsigned int swig_virtual_calls = 0; - -#else /* normal non-embedded extension */ - -# define SWIG_INIT_STACK -# define SWIG_RELEASE_STACK -# define Ruby_DirectorTypeMismatchException(x) \ - throw Swig::DirectorTypeMismatchException( x ); - -#endif /* RUBY_EMBEDDED */ - - -SWIGRUNTIME VALUE -getExceptionClass(void) { - static int init = 0; - static VALUE rubyExceptionClass ; - if (!init) { - init = 1; - rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception")); - } - return rubyExceptionClass; -} - -/* This code checks to see if the Ruby object being raised as part - of an exception inherits from the Ruby class Exception. If so, - the object is simply returned. If not, then a new Ruby exception - object is created and that will be returned to Ruby.*/ -SWIGRUNTIME VALUE -SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) { - VALUE exceptionClass = getExceptionClass(); - if (rb_obj_is_kind_of(obj, exceptionClass)) { - return obj; - } else { - return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj)); - } -} - -/* Initialize Ruby runtime support */ -SWIGRUNTIME void -SWIG_Ruby_InitRuntime(void) -{ - if (_mSWIG == Qnil) { - _mSWIG = rb_define_module("SWIG"); - swig_call_id = rb_intern("call"); - swig_arity_id = rb_intern("arity"); - } -} - -/* Define Ruby class for C type */ -SWIGRUNTIME void -SWIG_Ruby_define_class(swig_type_info *type) -{ - char *klass_name = (char *) malloc(4 + strlen(type->name) + 1); - sprintf(klass_name, "TYPE%s", type->name); - if (NIL_P(_cSWIG_Pointer)) { - _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject); - rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new"); - } - rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer); - free((void *) klass_name); -} - -/* Create a new pointer object */ -SWIGRUNTIME VALUE -SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags) -{ - int own = flags & SWIG_POINTER_OWN; - int track; - char *klass_name; - swig_class *sklass; - VALUE klass; - VALUE obj; - - if (!ptr) - return Qnil; - - assert(type); - if (type->clientdata) { - sklass = (swig_class *) type->clientdata; - - /* Are we tracking this class and have we already returned this Ruby object? */ - track = sklass->trackObjects; - if (track) { - obj = SWIG_RubyInstanceFor(ptr); - - /* Check the object's type and make sure it has the correct type. - It might not in cases where methods do things like - downcast methods. */ - if (obj != Qnil) { - VALUE value = rb_iv_get(obj, "@__swigtype__"); - const char* type_name = RSTRING_PTR(value); - - if (strcmp(type->name, type_name) == 0) { - return obj; - } - } - } - - /* Create a new Ruby object */ - obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), - ( own ? VOIDFUNC(sklass->destroy) : - (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 ) - ), ptr); - - /* If tracking is on for this class then track this object. */ - if (track) { - SWIG_RubyAddTracking(ptr, obj); - } - } else { - klass_name = (char *) malloc(4 + strlen(type->name) + 1); - sprintf(klass_name, "TYPE%s", type->name); - klass = rb_const_get(_mSWIG, rb_intern(klass_name)); - free((void *) klass_name); - obj = Data_Wrap_Struct(klass, 0, 0, ptr); - } - rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); - - return obj; -} - -/* Create a new class instance (always owned) */ -SWIGRUNTIME VALUE -SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type) -{ - VALUE obj; - swig_class *sklass = (swig_class *) type->clientdata; - obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0); - rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); - return obj; -} - -/* Get type mangle from class name */ -SWIGRUNTIMEINLINE char * -SWIG_Ruby_MangleStr(VALUE obj) -{ - VALUE stype = rb_iv_get(obj, "@__swigtype__"); - if (NIL_P(stype)) - return NULL; - return StringValuePtr(stype); -} - -/* Acquire a pointer value */ -typedef struct { - void (*datafree)(void *); - int own; -} swig_ruby_owntype; - -SWIGRUNTIME swig_ruby_owntype -SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) { - swig_ruby_owntype oldown = {0, 0}; - if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) { - oldown.datafree = RDATA(obj)->dfree; - RDATA(obj)->dfree = own.datafree; - } - return oldown; -} - -/* Convert a pointer value */ -SWIGRUNTIME int -SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, swig_ruby_owntype *own) -{ - char *c; - swig_cast_info *tc; - void *vptr = 0; - - /* Grab the pointer */ - if (NIL_P(obj)) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } else { - if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) { - return SWIG_ERROR; - } - Data_Get_Struct(obj, void, vptr); - } - - if (own) { - own->datafree = RDATA(obj)->dfree; - own->own = 0; - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE)) { - if (!RDATA(obj)->dfree) - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - - /* Check to see if the input object is giving up ownership - of the underlying C struct or C++ object. If so then we - need to reset the destructor since the Ruby object no - longer owns the underlying C++ object.*/ - if (flags & SWIG_POINTER_DISOWN) { - /* Is tracking on for this class? */ - int track = 0; - if (ty && ty->clientdata) { - swig_class *sklass = (swig_class *) ty->clientdata; - track = sklass->trackObjects; - } - - if (track) { - /* We are tracking objects for this class. Thus we change the destructor - * to SWIG_RubyRemoveTracking. This allows us to - * remove the mapping from the C++ to Ruby object - * when the Ruby object is garbage collected. If we don't - * do this, then it is possible we will return a reference - * to a Ruby object that no longer exists thereby crashing Ruby. */ - RDATA(obj)->dfree = SWIG_RubyRemoveTracking; - } else { - RDATA(obj)->dfree = 0; - } - } - - if (flags & SWIG_POINTER_CLEAR) { - DATA_PTR(obj) = 0; - } - - /* Do type-checking if type info was provided */ - if (ty) { - if (ty->clientdata) { - if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) { - if (vptr == 0) { - /* The object has already been deleted */ - return SWIG_ObjectPreviouslyDeletedError; - } - } - } - if ((c = SWIG_MangleStr(obj)) == NULL) { - return SWIG_ERROR; - } - tc = SWIG_TypeCheck(c, ty); - if (!tc) { - return SWIG_ERROR; - } else { - if (ptr) { - if (tc->type == ty) { - *ptr = vptr; - } else { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, vptr, &newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - own->own = own->own | SWIG_CAST_NEW_MEMORY; - } - } - } - } - } else { - if (ptr) - *ptr = vptr; - } - - return SWIG_OK; -} - -/* Check convert */ -SWIGRUNTIMEINLINE int -SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty) -{ - char *c = SWIG_MangleStr(obj); - if (!c) return 0; - return SWIG_TypeCheck(c,ty) != 0; -} - -SWIGRUNTIME VALUE -SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; - *(r++) = '_'; - r = SWIG_PackData(r, ptr, sz); - strcpy(r, type->name); - return rb_str_new2(result); -} - -/* Convert a packed pointer value */ -SWIGRUNTIME int -SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c; - - if (TYPE(obj) != T_STRING) goto type_error; - c = StringValuePtr(obj); - /* Pointer values must start with leading underscore */ - if (*c != '_') goto type_error; - c++; - c = SWIG_UnpackData(c, ptr, sz); - if (ty) { - tc = SWIG_TypeCheck(c, ty); - if (!tc) goto type_error; - } - return SWIG_OK; - - type_error: - return SWIG_ERROR; -} - -SWIGRUNTIME swig_module_info * -SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata)) -{ - VALUE pointer; - swig_module_info *ret = 0; - VALUE verbose = rb_gv_get("VERBOSE"); - - /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */ - rb_gv_set("VERBOSE", Qfalse); - - /* first check if pointer already created */ - pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - if (pointer != Qnil) { - Data_Get_Struct(pointer, swig_module_info, ret); - } - - /* reinstate warnings */ - rb_gv_set("VERBOSE", verbose); - return ret; -} - -SWIGRUNTIME void -SWIG_Ruby_SetModule(swig_module_info *pointer) -{ - /* register a new class */ - VALUE cl = rb_define_class("swig_runtime_data", rb_cObject); - rb_undef_alloc_func(cl); - /* create and store the structure pointer to a global variable */ - swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer); - rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer); -} - -/* This function can be used to check whether a proc or method or similarly - callable function has been passed. Usually used in a %typecheck, like: - - %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) { - $result = SWIG_Ruby_isCallable( $input ); - } - */ -SWIGINTERN -int SWIG_Ruby_isCallable( VALUE proc ) -{ - if ( rb_respond_to( proc, swig_call_id ) ) - return 1; - return 0; -} - -/* This function can be used to check the arity (number of arguments) - a proc or method can take. Usually used in a %typecheck. - Valid arities will be that equal to minimal or those < 0 - which indicate a variable number of parameters at the end. - */ -SWIGINTERN -int SWIG_Ruby_arity( VALUE proc, int minimal ) -{ - if ( rb_respond_to( proc, swig_arity_id ) ) - { - VALUE num = rb_funcall2( proc, swig_arity_id, 0, 0 ); - int arity = NUM2INT(num); - if ( arity < 0 && (arity+1) < -minimal ) return 1; - if ( arity == minimal ) return 1; - return 1; - } - return 0; -} - - -#ifdef __cplusplus -} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyruntime.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyruntime.swg deleted file mode 100755 index 41215614..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyruntime.swg +++ /dev/null @@ -1,9 +0,0 @@ - -%runtime "swiglabels.swg" /* Common C API type-checking code */ -%runtime "swigrun.swg" /* Common C API type-checking code */ -%runtime "swigerrors.swg" /* SWIG errors */ -%runtime "rubyhead.swg" /* Ruby includes and fixes */ -%runtime "rubyerrors.swg" /* Ruby errors */ -%runtime "rubytracking.swg" /* API for tracking C++ classes to Ruby objects */ -%runtime "rubyapi.swg" -%runtime "rubyrun.swg" diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubystdautodoc.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubystdautodoc.swg deleted file mode 100755 index e14f6590..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubystdautodoc.swg +++ /dev/null @@ -1,33 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubystdautodoc.swg - * - * This file contains autodocs for standard STL functions. - * ----------------------------------------------------------------------------- */ - -// -// For STL autodocumentation -// -AUTODOC(c_str, "Convert class to a String representation"); -AUTODOC(begin, "Return an iterator to the beginning of the $class"); -AUTODOC(end, "Return an iterator to past the end of the $class"); -AUTODOC(rbegin, "Return a reverse iterator to the beginning (the end) of the $class"); -AUTODOC(rend, "Return a reverse iterator to past the end (past the beginning) of the $class"); -AUTODOC(length, "Size or Length of the $class"); -AUTODOC(replace, "Replace all or a portion of the $class"); -AUTODOC(resize, "Resize the size of the $class"); -AUTODOC(capacity, "Reserved capacity of the $class"); -AUTODOC(reserve, "Reserve memory in the $class for a number of elements"); -AUTODOC(erase, "Delete a portion of the $class"); -AUTODOC(max_size, "Maximum size of elements allowed in the $class"); -AUTODOC(iterator, "Return an iterator to the $class"); -AUTODOC(empty, "Check if the $class is empty or not"); -AUTODOC(rfind, "Find an element in reverse usually starting from the end of the $class"); -AUTODOC(assign, "Assign a new $class or portion of it"); -AUTODOC(front, "Return the first element in $class"); -AUTODOC(back, "Return the last element in $class"); -AUTODOC(second, "Return the second element in $class"); -AUTODOC(push_front, "Add an element at the beginning of the $class"); -AUTODOC(push_back, "Add an element at the end of the $class"); -AUTODOC(pop_front, "Remove and return element at the beginning of the $class"); -AUTODOC(pop_back, "Remove and return an element at the end of the $class"); -AUTODOC(clear, "Clear $class contents"); diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubystdcommon.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubystdcommon.swg deleted file mode 100755 index 99dd7f81..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubystdcommon.swg +++ /dev/null @@ -1,199 +0,0 @@ - -/* ------------------------------------------------------------ - * The Ruby classes, for C++ - * ------------------------------------------------------------ */ -%include -%include - -%fragment("StdTraits","header",fragment="StdTraitsCommon",fragment="StdTraitsForwardDeclaration") -{ - -namespace swig { - /* - Traits that provides the from method - */ - template struct traits_from_ptr { - static VALUE from(Type *val, int owner = 0) { - return SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static VALUE from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static VALUE from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static VALUE from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline VALUE from(const Type& val) { - return traits_from::from(val); - } - - template - inline VALUE from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - /* - Traits that provides the asval/as/check method - */ - template - struct traits_asptr { - static int asptr(VALUE obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(VALUE obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(VALUE obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(VALUE obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(VALUE obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(VALUE obj) { - Type v; - int res = asval(obj, &v); - if (!SWIG_IsOK(res)) { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(VALUE obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(VALUE obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(VALUE obj) { - return traits_as< Type, typename traits< Type >::category >::as(obj); - } - - template - struct traits_check { - static bool check(VALUE obj) { - int res = asval(obj, (Type *)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(VALUE obj) { - int res = asptr(obj, (Type **)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(VALUE obj) { - return traits_check::category>::check(obj); - } -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubystdcommon_forward.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubystdcommon_forward.swg deleted file mode 100755 index 4120b38e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubystdcommon_forward.swg +++ /dev/null @@ -1,15 +0,0 @@ -%fragment("StdTraitsForwardDeclaration","header") -{ -namespace swig { - template struct traits_asptr; - template struct traits_asval; - struct pointer_category; - template struct traits_as; - template struct traits_from; - template struct traits_from_ptr; - template struct noconst_traits; - template swig_type_info* type_info(); - template const char* type_name(); - template VALUE from(const Type& val); -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubystdfunctors.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubystdfunctors.swg deleted file mode 100755 index 5150333c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubystdfunctors.swg +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @file rubystdfunctors.swg - * @date Sun May 6 00:44:33 2007 - * - * @brief This file provides unary and binary functors for STL - * containers, that will invoke a Ruby proc or method to do - * their operation. - * - * You can use them in a swig file like: - * - * %include - * %include - * - * %template< IntSet > std::set< int, swig::BinaryPredicate<> >; - * - * - * which will then allow calling them from Ruby either like: - * - * # order of set is defined by C++ default - * a = IntSet.new - * - * # sort order defined by Ruby proc - * b = IntSet.new( proc { |a,b| a > b } ) - * - */ - -%include rubyclasses.swg - - -namespace swig { - - %apply GC_VALUE { UnaryPredicate, BinaryPredicate, UnaryFunction, - BinaryFunction }; - - %typecheck(SWIG_TYPECHECK_POINTER,noblock=1) - UnaryPredicate, UnaryPredicate&, UnaryFunction, UnaryFunction& - { - $1 = SWIG_Ruby_isCallable($input) && SWIG_Ruby_arity($input, 1); - } - - %typecheck(SWIG_TYPECHECK_POINTER,noblock=1) - BinaryPredicate, BinaryPredicate&, BinaryFunction, BinaryFunction& { - $1 = SWIG_Ruby_isCallable($input) && SWIG_Ruby_arity($input, 2); - } - - %typemap(in,noblock=1) BinaryFunction&, BinaryFunction { - $1 = new swig::BinaryFunction< >($input); - } - %typemap(in,noblock=1) UnaryFunction&, UnaryFunction { - $1 = new swig::UnaryFunction< >($input); - } - - %typemap(in,noblock=1) BinaryPredicate&, BinaryPredicate { - $1 = new swig::BinaryPredicate<>($input); - } - - %typemap(in,noblock=1) UnaryPredicate&, UnaryPredicate { - $1 = new swig::UnaryPredicate< >($input); - } - - - %ignore BinaryFunction; - template< class _T = GC_VALUE > - struct BinaryFunction { - }; - - %ignore UnaryFunction; - template< class _T = GC_VALUE > - struct UnaryFunction { - }; - - %ignore BinaryPredicate; - template< class _T = GC_VALUE > - struct BinaryPredicate { - }; - - %ignore UnaryPredicate; - template< class _T = GC_VALUE > - struct UnaryPredicate { - - }; - -} - - -%fragment("StdFunctors","header",fragment="StdTraits",fragment="GC_VALUE_definition") -{ -namespace swig { - - static ID call_id = rb_intern("call"); - - template > - struct BinaryPredicate : GC_VALUE - { - BinaryPredicate(VALUE obj = Qnil) : GC_VALUE(obj) { } - bool operator()(_T a, _T b) const - { - if (_obj != Qnil) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from(a); - VALUE arg2 = swig::from(b); - VALUE res = rb_funcall( _obj, swig::call_id, 2, arg1, arg2); - SWIG_RUBY_THREAD_END_BLOCK; - return RTEST(res); - } else { - return _DefaultFunc()(a, b); - } - } - }; - - template > - struct BinaryFunction : GC_VALUE - { - BinaryFunction(VALUE obj = Qnil) : GC_VALUE(obj) { } - _T operator()(_T a, _T b) const - { - if (_obj != Qnil) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from(a); - VALUE arg2 = swig::from(b); - VALUE res = rb_funcall( _obj, swig::call_id, 2, arg1, arg2); - SWIG_RUBY_THREAD_END_BLOCK; - return swig::as<_T >(res); - } else { - return _DefaultFunc()(a, b); - } - } - }; - - template< class _T = GC_VALUE > - struct UnaryPredicate : GC_VALUE - { - UnaryPredicate(VALUE obj = Qnil) : GC_VALUE(obj) { } - bool operator()(_T a) const - { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from<_T >(a); - VALUE res = rb_funcall( _obj, swig::call_id, 1, arg1); - SWIG_RUBY_THREAD_END_BLOCK; - return RTEST(res); - } - }; - - template< class _T = GC_VALUE > - struct UnaryFunction : GC_VALUE - { - UnaryFunction(VALUE obj = Qnil) : GC_VALUE(obj) { } - _T operator()(_T a) const - { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from(a); - VALUE res = rb_funcall( _obj, swig::call_id, 1, VALUE(arg1)); - SWIG_RUBY_THREAD_END_BLOCK; - return swig::as< _T >(res); - } - }; - -} // namespace swig - -} - - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubystrings.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubystrings.swg deleted file mode 100755 index 3adf0008..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubystrings.swg +++ /dev/null @@ -1,57 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc) -{ - if (TYPE(obj) == T_STRING) { - char *cstr = StringValuePtr(obj); - size_t size = RSTRING_LEN(obj) + 1; - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, size, char); - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } - } - if (psize) *psize = size; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *)vptr; - if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE VALUE -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > LONG_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_NewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : Qnil; - } else { - return rb_str_new(carray, %numeric_cast(size,long)); - } - } else { - return Qnil; - } -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubytracking.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubytracking.swg deleted file mode 100755 index 1edcc568..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubytracking.swg +++ /dev/null @@ -1,136 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubytracking.swg - * - * This file contains support for tracking mappings from - * Ruby objects to C++ objects. This functionality is needed - * to implement mark functions for Ruby's mark and sweep - * garbage collector. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(ST_DATA_T_DEFINED) -/* Needs to be explicitly included for Ruby 1.8 and earlier */ -#include -#endif - -/* Ruby 1.8 actually assumes the first case. */ -#if SIZEOF_VOIDP == SIZEOF_LONG -# define SWIG2NUM(v) LONG2NUM((unsigned long)v) -# define NUM2SWIG(x) (unsigned long)NUM2LONG(x) -#elif SIZEOF_VOIDP == SIZEOF_LONG_LONG -# define SWIG2NUM(v) LL2NUM((unsigned long long)v) -# define NUM2SWIG(x) (unsigned long long)NUM2LL(x) -#else -# error sizeof(void*) is not the same as long or long long -#endif - -/* Global hash table to store Trackings from C/C++ - structs to Ruby Objects. -*/ -static st_table* swig_ruby_trackings = NULL; - -static VALUE swig_ruby_trackings_count(ID id, VALUE *var) { - return SWIG2NUM(swig_ruby_trackings->num_entries); -} - - -/* Setup a hash table to store Trackings */ -SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) { - /* Create a hash table to store Trackings from C++ - objects to Ruby objects. */ - - /* Try to see if some other .so has already created a - tracking hash table, which we keep hidden in an instance var - in the SWIG module. - This is done to allow multiple DSOs to share the same - tracking table. - */ - VALUE trackings_value = Qnil; - /* change the variable name so that we can mix modules - compiled with older SWIG's - this used to be called "@__trackings__" */ - ID trackings_id = rb_intern( "@__safetrackings__" ); - VALUE verbose = rb_gv_get("VERBOSE"); - rb_gv_set("VERBOSE", Qfalse); - trackings_value = rb_ivar_get( _mSWIG, trackings_id ); - rb_gv_set("VERBOSE", verbose); - - /* The trick here is that we have to store the hash table - pointer in a Ruby variable. We do not want Ruby's GC to - treat this pointer as a Ruby object, so we convert it to - a Ruby numeric value. */ - if (trackings_value == Qnil) { - /* No, it hasn't. Create one ourselves */ - swig_ruby_trackings = st_init_numtable(); - rb_ivar_set( _mSWIG, trackings_id, SWIG2NUM(swig_ruby_trackings) ); - } else { - swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value); - } - - rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", - VALUEFUNC(swig_ruby_trackings_count), - SWIG_RUBY_VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL)); -} - -/* Add a Tracking from a C/C++ struct to a Ruby object */ -SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) { - /* Store the mapping to the global hash table. */ - st_insert(swig_ruby_trackings, (st_data_t)ptr, object); -} - -/* Get the Ruby object that owns the specified C/C++ struct */ -SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) { - /* Now lookup the value stored in the global hash table */ - VALUE value; - - if (st_lookup(swig_ruby_trackings, (st_data_t)ptr, &value)) { - return value; - } else { - return Qnil; - } -} - -/* Remove a Tracking from a C/C++ struct to a Ruby object. It - is very important to remove objects once they are destroyed - since the same memory address may be reused later to create - a new object. */ -SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) { - /* Delete the object from the hash table */ - st_delete(swig_ruby_trackings, (st_data_t *)&ptr, NULL); -} - -/* This is a helper method that unlinks a Ruby object from its - underlying C++ object. This is needed if the lifetime of the - Ruby object is longer than the C++ object. */ -SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) { - VALUE object = SWIG_RubyInstanceFor(ptr); - - if (object != Qnil) { - // object might have the T_ZOMBIE type, but that's just - // because the GC has flagged it as such for a deferred - // destruction. Until then, it's still a T_DATA object. - DATA_PTR(object) = 0; - } -} - -/* This is a helper method that iterates over all the trackings - passing the C++ object pointer and its related Ruby object - to the passed callback function. */ - -/* Proxy method to abstract the internal trackings datatype */ -static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) { - ((void (*) (void *, VALUE))meth)((void *)ptr, (VALUE)obj); - return ST_CONTINUE; -} - -SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) { - st_foreach(swig_ruby_trackings, - SWIG_RUBY_INT_ANYARGS_FUNC(swig_ruby_internal_iterate_callback), - (st_data_t)meth); -} - -#ifdef __cplusplus -} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubytypemaps.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubytypemaps.swg deleted file mode 100755 index 3837df07..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubytypemaps.swg +++ /dev/null @@ -1,62 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Ruby - * ------------------------------------------------------------ */ -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ -/* bool is dangerous in Ruby, change precedence */ -#undef SWIG_TYPECHECK_BOOL -%define SWIG_TYPECHECK_BOOL 10000 %enddef - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Ruby fragments for primitive types */ -%include - -/* Ruby fragments for char* strings */ -%include - -/* Backward compatibility output helper */ -%fragment("output_helper","header") %{ -#define output_helper SWIG_Ruby_AppendOutput -%} - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* Directors are supported in Ruby */ -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Ruby types */ -#define SWIG_Object VALUE -#define VOID_Object Qnil - -/* Overload of the output/constant/exception handling */ - -/* append output */ -#define SWIG_AppendOutput(result,obj) SWIG_Ruby_AppendOutput(result, obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) rb_define_const($module, name, obj) - -/* raise */ -#define SWIG_Raise(obj, type, desc) rb_exc_raise(SWIG_Ruby_ExceptionType(desc, obj)) - -/* Get the address of the 'Ruby self' object */ - -%typemap(in,numinputs=0,noblock=1) VALUE* RUBY_SELF { - $1 = &self; -} - -/* Include the unified typemap library */ -%include - - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubyuserdir.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubyuserdir.swg deleted file mode 100755 index 1689c7f0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubyuserdir.swg +++ /dev/null @@ -1,20 +0,0 @@ -#define %alias %feature("alias") -#define %freefunc %feature("freefunc") -#define %markfunc %feature("markfunc") -#define %mixin %feature("mixin") -#define %predicate %feature("predicate", "1") -#define %bang %feature("bang", "1") -#define %trackobjects %feature("trackobjects") -#define %nooutput %feature("outputs","0") -#define %initstack %feature("initstack", "1") -#define %ignorestack %feature("initstack", "0") - -/* ------------------------------------------------------------------------- */ -/* - Enable keywords parameters -*/ - -#define %kwargs %feature("kwargs") -#define %nokwargs %feature("kwargs", "0") -#define %clearkwargs %feature("kwargs", "") - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/rubywstrings.swg b/mac/bin/swig/share/swig/4.1.0/ruby/rubywstrings.swg deleted file mode 100755 index 7da6f4bf..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/rubywstrings.swg +++ /dev/null @@ -1,58 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubywstrings.swg - * - * utility methods for wchar_t strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_AsCharPtrAndSize",fragment="SWIG_ruby_wstring_encoding_init") { -SWIGINTERN int -SWIG_AsWCharPtrAndSize(VALUE obj, wchar_t **cptr, size_t *psize, int *alloc) -{ - rb_encoding* wstr_enc = swig_ruby_wstring_encoding; - - if (TYPE(obj) == T_STRING) { - VALUE rstr = rb_str_conv_enc(obj, rb_enc_get(obj), wstr_enc); - wchar_t* cstr = (wchar_t*) StringValuePtr(rstr); - size_t size = RSTRING_LEN(rstr) / sizeof(wchar_t) + 1; - - if ( RSTRING_LEN(rstr) % sizeof(wchar_t) != 0 ) { - rb_raise(rb_eRuntimeError, - "The length of the byte sequence of converted string is not a multiplier of sizeof(wchar_t). Invalid byte sequence is given. Or invalid SWIG_RUBY_WSTRING_ENCODING is given when compiling this binding."); - } - if (cptr && alloc) { - *alloc = SWIG_NEWOBJ; - *cptr = %new_array(size, wchar_t); - memmove(*cptr, cstr, RSTRING_LEN(rstr)); - } - if (psize) *psize = size; - - return SWIG_OK; - } else { - return SWIG_TypeError; - } -} -} - -%fragment("SWIG_FromWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_FromCharPtrAndSize",fragment="SWIG_ruby_wstring_encoding_init") { -SWIGINTERNINLINE VALUE -SWIG_FromWCharPtrAndSize(const wchar_t * carray, size_t size) -{ - rb_encoding* wstr_enc = swig_ruby_wstring_encoding; - rb_encoding* rb_enc = swig_ruby_internal_encoding; - - if (carray && size <= LONG_MAX/sizeof(wchar_t)) { - VALUE rstr = rb_str_new( (const char*)carray, %numeric_cast(size*sizeof(wchar_t),long) ); - rb_encoding* new_enc = rb_default_internal_encoding(); - - rb_enc_associate(rstr, wstr_enc); - if ( !new_enc ) { - new_enc = rb_enc; - } - return rb_str_conv_enc(rstr, wstr_enc, new_enc); - } else { - return Qnil; - } -} -} - - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_alloc.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_alloc.i deleted file mode 100755 index 35dc051b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_array.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_array.i deleted file mode 100755 index a4d3ef54..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_array.i +++ /dev/null @@ -1,102 +0,0 @@ -/* - std::array -*/ - -%fragment("StdArrayTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::array **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::array& vec) { - return traits_from_stdseq >::from(vec); - } - }; - - template - inline void - assign(const RubySeq& rubyseq, std::array* seq) { - if (rubyseq.size() < seq->size()) - throw std::invalid_argument("std::array cannot be expanded in size"); - else if (rubyseq.size() > seq->size()) - throw std::invalid_argument("std::array cannot be reduced in size"); - std::copy(rubyseq.begin(), rubyseq.end(), seq->begin()); - } - - template - inline void - resize(std::array *seq, typename std::array::size_type n, typename std::array::value_type x) { - throw std::invalid_argument("std::array is a fixed size container and does not support resizing"); - } - - // Only limited slicing is supported as std::array is fixed in size - template - inline std::array* - getslice(const std::array* self, Difference i, Difference j) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, (i == size && j == size)); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (ii == 0 && jj == size) { - Sequence *sequence = new Sequence(); - std::copy(self->begin(), self->end(), sequence->begin()); - return sequence; - } else { - throw std::invalid_argument("std::array object only supports getting a slice that is the size of the array"); - } - } - - template - inline void - setslice(std::array* self, Difference i, Difference j, const InputSeq& v) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (ii == 0 && jj == size) { - std::copy(v.begin(), v.end(), self->begin()); - } else { - throw std::invalid_argument("std::array object only supports setting a slice that is the size of the array"); - } - } - - template - inline void - delslice(std::array* self, Difference i, Difference j) { - throw std::invalid_argument("std::array object does not support item deletion"); - } - } -%} - - -%define %swig_array_methods(Type...) - %swig_sequence_methods_non_resizable(Type) -%enddef - -%define %swig_array_methods_val(Type...) - %swig_sequence_methods_non_resizable_val(Type); -%enddef - - -%mixin std::array "Enumerable"; -%ignore std::array::push_back; -%ignore std::array::pop_back; - - -%rename("delete") std::array::__delete__; -%rename("reject!") std::array::reject_bang; -%rename("map!") std::array::map_bang; -%rename("empty?") std::array::empty; -%rename("include?" ) std::array::__contains__ const; -%rename("has_key?" ) std::array::has_key const; - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_auto_ptr.i deleted file mode 100755 index 3d7ae8ba..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_basic_string.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_basic_string.i deleted file mode 100755 index ba13ba76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_basic_string.i +++ /dev/null @@ -1,92 +0,0 @@ -#if !defined(SWIG_STD_STRING) -#define SWIG_STD_BASIC_STRING - -%include - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - - -%traits_swigtype(std::basic_string); -%fragment(SWIG_Traits_frag(std::basic_string)); - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(VALUE obj, std::string **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::string *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - char* buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::string(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromCharPtrAndSize") { -SWIGINTERNINLINE VALUE - SWIG_From(std::basic_string)(const std::string& s) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } -} - -%ignore std::basic_string::operator!=; -%ignore std::basic_string::operator+=; - -%include -%typemaps_asptrfromn(%checkcode(STRING), std::basic_string); - -#endif - - -#if !defined(SWIG_STD_WSTRING) - -%traits_swigtype(std::basic_string); -%fragment(SWIG_Traits_frag(std::basic_string)); - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsWCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(VALUE obj, std::wstring **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::wstring *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - wchar_t *buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsWCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::wstring(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromWCharPtrAndSize") { -SWIGINTERNINLINE VALUE - SWIG_From(std::basic_string)(const std::wstring& s) { - return SWIG_FromWCharPtrAndSize(s.data(), s.size()); - } -} - -%typemaps_asptrfromn(%checkcode(UNISTRING), std::basic_string); - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_char_traits.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_char_traits.i deleted file mode 100755 index bf4e6c47..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_common.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_common.i deleted file mode 100755 index 0cf9ce10..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_common.i +++ /dev/null @@ -1,74 +0,0 @@ -%include -%include -%include - - -/* - Generate the traits for a 'primitive' type, such as 'double', - for which the SWIG_AsVal and SWIG_From methods are already defined. -*/ - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(VALUE obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static VALUE from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(VALUE obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static VALUE from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_complex.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_complex.i deleted file mode 100755 index ef4e8a10..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_complex.i +++ /dev/null @@ -1,29 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); - - - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_container.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_container.i deleted file mode 100755 index 85379505..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_deque.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_deque.i deleted file mode 100755 index b70f34ee..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_deque.i +++ /dev/null @@ -1,30 +0,0 @@ -/* - Deques -*/ - -%fragment("StdDequeTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::deque **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::deque& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%ignore std::deque::push_back; -%ignore std::deque::pop_back; - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_except.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_functors.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_functors.i deleted file mode 100755 index 54ee97b5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_functors.i +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file std_functors.i - * @date Sun May 6 00:44:33 2007 - * - * @brief This file provides unary and binary functors for STL - * containers, that will invoke a Ruby proc or method to do - * their operation. - * - * You can use them in a swig file like: - * - * %include - * %include - * - * %template< IntSet > std::set< int, swig::BinaryPredicate >; - * - * - * which will then allow calling them from Ruby either like: - * - * # order of set is defined by C++ default - * a = IntSet.new - * - * # sort order defined by Ruby proc - * b = IntSet.new( proc { |a,b| a > b } ) - * - */ - -%include - -%fragment("StdFunctors"); diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_ios.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_ios.i deleted file mode 100755 index 7aafae28..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_ios.i +++ /dev/null @@ -1,14 +0,0 @@ - -#pragma SWIG nowarn=801 - -%rename(ios_base_in) std::ios_base::in; - -AUTODOC(cerr, "Standard C++ error stream"); -AUTODOC(cout, "Standard C++ output stream"); -AUTODOC(cin, "Standard C++ input stream"); -AUTODOC(clog, "Standard C++ logging stream"); -AUTODOC(endl, "Add an end line to stream"); -AUTODOC(ends, "Ends stream"); -AUTODOC(flush, "Flush stream"); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_iostream.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_iostream.i deleted file mode 100755 index ee36bec4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_iostream.i +++ /dev/null @@ -1,12 +0,0 @@ -namespace std -{ -%callback("%s") endl; -%callback("%s") ends; -%callback("%s") flush; -} - -%warnfilter(365) operator+=; -%warnfilter(802) std::basic_iostream; // turn off multiple inheritance warning - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_list.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_list.i deleted file mode 100755 index b0b4928e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_list.i +++ /dev/null @@ -1,42 +0,0 @@ -/* - Lists -*/ - -%fragment("StdListTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static VALUE from(const std::list& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%ignore std::list::push_back; -%ignore std::list::pop_back; - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%mixin std::list "Enumerable"; - -%rename("delete") std::list::__delete__; -%rename("reject!") std::list::reject_bang; -%rename("map!") std::list::map_bang; -%rename("empty?") std::list::empty; -%rename("include?" ) std::list::__contains__ const; -%rename("has_key?" ) std::list::has_key const; - -%alias std::list::push "<<"; - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_map.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_map.i deleted file mode 100755 index 6dd2ffa7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_map.i +++ /dev/null @@ -1,424 +0,0 @@ -// -// Maps -// -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") -{ - namespace swig { - template - struct from_key_oper - { - typedef const ValueType& argument_type; - typedef VALUE result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.first); - } - }; - - template - struct from_value_oper - { - typedef const ValueType& argument_type; - typedef VALUE result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.second); - } - }; - - template - struct MapIterator_T : ConstIteratorClosed_T - { - MapIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq) - : ConstIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct MapKeyIterator_T : MapIterator_T - { - MapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq) - : MapIterator_T(curr, first, last, seq) - { - } - }; - - template - inline ConstIterator* - make_output_key_iterator(const OutIter& current, const OutIter& begin, - const OutIter& end, VALUE seq = 0) - { - return new MapKeyIterator_T(current, begin, end, seq); - } - - template > - struct MapValueIterator_T : MapIterator_T - { - MapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq) - : MapIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline ConstIterator* - make_output_value_iterator(const OutIter& current, const OutIter& begin, - const OutIter& end, VALUE seq = 0) - { - return new MapValueIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::map map_type; - static int asptr(VALUE obj, map_type **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_HASH ) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - map_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static VALUE from(const map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - size_type size = map.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise( rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - rb_hash_aset(obj, key, val); - } - return obj; - } - } - }; - } -} - -%define %swig_map_common(Map...) - %swig_container_methods(%arg(Map)); - // %swig_sequence_iterator(%arg(Map)); - - %extend { - - VALUE __delete__(const key_type& key) { - Map::iterator i = self->find(key); - if (i != self->end()) { - self->erase(i); - return swig::from( key ); - } - else { - return Qnil; - } - } - - bool has_key(const key_type& key) const { - Map::const_iterator i = self->find(key); - return i != self->end(); - } - - VALUE keys() { - Map::size_type size = self->size(); - int rubysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE ary = rb_ary_new2(rubysize); - Map::const_iterator i = self->begin(); - Map::const_iterator e = self->end(); - for ( ; i != e; ++i ) { - rb_ary_push( ary, swig::from(i->first) ); - } - return ary; - } - - Map* each() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE k, v; - Map::iterator i = self->begin(); - Map::iterator e = self->end(); - for ( ; i != e; ++i ) - { - const Map::key_type& key = i->first; - const Map::mapped_type& val = i->second; - - k = swig::from(key); - v = swig::from(val); - rb_yield_values(2, k, v); - } - - return self; - } - - %newobject select; - Map* select() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - Map* r = new Map; - Map::iterator i = $self->begin(); - Map::iterator e = $self->end(); - for ( ; i != e; ++i ) - { - VALUE k = swig::from(i->first); - VALUE v = swig::from(i->second); - if ( RTEST( rb_yield_values(2, k, v) ) ) - $self->insert(r->end(), *i); - } - - return r; - } - - %typemap(in) (int argc, VALUE* argv) { - $1 = argc; - $2 = argv; - } - - VALUE values_at(int argc, VALUE* argv, ...) { - - VALUE r = rb_ary_new(); - ID id = rb_intern("[]"); - swig_type_info* type = swig::type_info< Map >(); - VALUE me = SWIG_NewPointerObj( $self, type, 0 ); - for ( int i = 0; i < argc; ++i ) - { - VALUE key = argv[i]; - VALUE tmp = rb_funcall( me, id, 1, key ); - rb_ary_push( r, tmp ); - } - - return r; - } - - - Map* each_key() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE r; - Map::iterator i = self->begin(); - Map::iterator e = self->end(); - for ( ; i != e; ++i ) - { - r = swig::from( i->first ); - rb_yield(r); - } - - return self; - } - - VALUE values() { - Map::size_type size = self->size(); - int rubysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE ary = rb_ary_new2(rubysize); - Map::const_iterator i = self->begin(); - Map::const_iterator e = self->end(); - for ( ; i != e; ++i ) { - rb_ary_push( ary, swig::from(i->second) ); - } - return ary; - } - - Map* each_value() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE r; - Map::iterator i = self->begin(); - Map::iterator e = self->end(); - for ( ; i != e; ++i ) - { - r = swig::from( i->second ); - rb_yield(r); - } - - return self; - } - - VALUE entries() { - Map::size_type size = self->size(); - int rubysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE ary = rb_ary_new2(rubysize); - Map::const_iterator i = self->begin(); - Map::const_iterator e = self->end(); - for ( ; i != e; ++i ) { - rb_ary_push( ary, swig::from >(*i) ); - } - return ary; - } - - bool __contains__(const key_type& key) { - return self->find(key) != self->end(); - } - - %newobject key_iterator(VALUE *RUBY_SELF); - swig::ConstIterator* key_iterator(VALUE *RUBY_SELF) { - return swig::make_output_key_iterator($self->begin(), $self->begin(), - $self->end(), *RUBY_SELF); - } - - %newobject value_iterator(VALUE *RUBY_SELF); - swig::ConstIterator* value_iterator(VALUE *RUBY_SELF) { - return swig::make_output_value_iterator($self->begin(), $self->begin(), - $self->end(), *RUBY_SELF); - } - - } -%enddef - -%define %swig_map_methods(Map...) - %swig_map_common(Map) - %extend { - VALUE __getitem__(const key_type& key) const { - Map::const_iterator i = self->find(key); - if ( i != self->end() ) - return swig::from( i->second ); - else - return Qnil; - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - (*self)[key] = x; - } - - VALUE inspect() - { - Map::const_iterator i = $self->begin(); - Map::const_iterator e = $self->end(); - const char *type_name = swig::type_name< Map >(); - VALUE str = rb_str_new2( type_name ); - str = rb_str_cat2( str, " {" ); - bool comma = false; - VALUE tmp; - for ( ; i != e; ++i, comma = true ) - { - if (comma) str = rb_str_cat2( str, "," ); - tmp = swig::from< Map::key_type >( i->first ); - tmp = rb_inspect( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, "=>" ); - tmp = swig::from< Map::mapped_type >( i->second ); - tmp = rb_inspect( tmp ); - str = rb_str_buf_append( str, tmp ); - } - str = rb_str_cat2( str, "}" ); - return str; - } - - VALUE to_a() - { - Map::const_iterator i = $self->begin(); - Map::const_iterator e = $self->end(); - VALUE ary = rb_ary_new2( std::distance( i, e ) ); - VALUE tmp; - for ( ; i != e; ++i ) - { - // @todo: improve -- this should just be swig::from(*i) - tmp = swig::from< std::pair >( *i ); - rb_ary_push( ary, tmp ); - } - return ary; - } - - VALUE to_s() - { - Map::iterator i = $self->begin(); - Map::iterator e = $self->end(); - VALUE str = rb_str_new2( "" ); - VALUE tmp; - for ( ; i != e; ++i ) - { - // @todo: improve -- this should just be swig::from(*i) - tmp = swig::from< std::pair >( *i ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - } - return str; - } - - } -%enddef - - -%mixin std::map "Enumerable"; - - -%rename("delete") std::map::__delete__; -%rename("reject!") std::map::reject_bang; -%rename("map!") std::map::map_bang; -%rename("empty?") std::map::empty; -%rename("include?" ) std::map::__contains__ const; -%rename("has_key?" ) std::map::has_key const; - -%alias std::map::push "<<"; - - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_multimap.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_multimap.i deleted file mode 100755 index 5d8e33e9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_multimap.i +++ /dev/null @@ -1,226 +0,0 @@ -/* - Multimaps -*/ -%include - -%fragment("StdMultimapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::multimap *multimap) { - typedef typename std::multimap::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::multimap multimap_type; - static int asptr(VALUE obj, std::multimap **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_HASH ) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - return traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - multimap_type *p; - res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info(),0); - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::multimap multimap_type; - typedef typename multimap_type::const_iterator const_iterator; - typedef typename multimap_type::size_type size_type; - - static VALUE from(const multimap_type& multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new multimap_type(multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = multimap.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, - "multimap size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - - VALUE oldval = rb_hash_aref( obj, key ); - if ( oldval == Qnil ) - rb_hash_aset(obj, key, val); - else { - // Multiple values for this key, create array if needed - // and add a new element to it. - VALUE ary; - if ( TYPE(oldval) == T_ARRAY ) - ary = oldval; - else - { - ary = rb_ary_new2(2); - rb_ary_push( ary, oldval ); - rb_hash_aset( obj, key, ary ); - } - rb_ary_push( ary, val ); - } - - } - return obj; - } - } - }; - } -} - -%define %swig_multimap_methods(MultiMap...) - %swig_map_common(%arg(MultiMap)); - - %extend { - VALUE __getitem__(const key_type& key) const { - std::pair r = $self->equal_range(key); - if ( r.first != r.second ) - { - VALUE ary = rb_ary_new(); - for (MultiMap::const_iterator i = r.first ; i != r.second; ++i ) - { - rb_ary_push( ary, swig::from( i->second ) ); - } - if ( RARRAY_LEN(ary) == 1 ) - return RARRAY_PTR(ary)[0]; - return ary; - } - else - return Qnil; - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - self->insert(MultiMap::value_type(key,x)); - } - - VALUE inspect() - { - MultiMap::iterator i = $self->begin(); - MultiMap::iterator e = $self->end(); - const char *type_name = swig::type_name< MultiMap >(); - VALUE str = rb_str_new2( type_name ); - str = rb_str_cat2( str, " {" ); - VALUE tmp; - while ( i != e ) - { - const MultiMap::key_type& key = i->first; - const MultiMap::key_type& oldkey = key; - tmp = swig::from( key ); - str = rb_str_buf_append( str, rb_inspect(tmp) ); - str = rb_str_cat2( str, "=>" ); - - VALUE vals = rb_ary_new(); - for ( ; i != e && key == oldkey; ++i ) - { - const MultiMap::mapped_type& val = i->second; - tmp = swig::from( val ); - rb_ary_push( vals, tmp ); - } - - if ( RARRAY_LEN(vals) == 1 ) - { - str = rb_str_buf_append( str, rb_inspect(tmp) ); - } - else - { - str = rb_str_buf_append( str, rb_inspect(vals) ); - } - } - str = rb_str_cat2( str, "}" ); - return str; - } - - VALUE to_a() - { - MultiMap::const_iterator i = $self->begin(); - MultiMap::const_iterator e = $self->end(); - VALUE ary = rb_ary_new2( std::distance( i, e ) ); - VALUE tmp; - while ( i != e ) - { - const MultiMap::key_type& key = i->first; - const MultiMap::key_type& oldkey = key; - tmp = swig::from( key ); - rb_ary_push( ary, tmp ); - - VALUE vals = rb_ary_new(); - for ( ; i != e && key == oldkey; ++i ) - { - const MultiMap::mapped_type& val = i->second; - tmp = swig::from( val ); - rb_ary_push( vals, tmp ); - } - - if ( RARRAY_LEN(vals) == 1 ) - { - rb_ary_push( ary, tmp ); - } - else - { - rb_ary_push( ary, vals ); - } - } - return ary; - } - - VALUE to_s() - { - MultiMap::iterator i = $self->begin(); - MultiMap::iterator e = $self->end(); - VALUE str = rb_str_new2( "" ); - VALUE tmp; - while ( i != e ) - { - const MultiMap::key_type& key = i->first; - const MultiMap::key_type& oldkey = key; - tmp = swig::from( key ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - - VALUE vals = rb_ary_new(); - for ( ; i != e && key == oldkey; ++i ) - { - const MultiMap::mapped_type& val = i->second; - tmp = swig::from( val ); - rb_ary_push( vals, tmp ); - } - - tmp = rb_obj_as_string( vals ); - str = rb_str_buf_append( str, tmp ); - } - return str; - } - } -%enddef - - -%mixin std::multimap "Enumerable"; - -%rename("delete") std::multimap::__delete__; -%rename("reject!") std::multimap::reject_bang; -%rename("map!") std::multimap::map_bang; -%rename("empty?") std::multimap::empty; -%rename("include?" ) std::multimap::__contains__ const; -%rename("has_key?" ) std::multimap::has_key const; - -%alias std::multimap::push "<<"; - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_multiset.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_multiset.i deleted file mode 100755 index 252ae10d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_multiset.i +++ /dev/null @@ -1,50 +0,0 @@ -/* - Multisets -*/ - -%include - -%fragment("StdMultisetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::multiset* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static VALUE from(const std::multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_multiset_methods(Set...) %swig_set_methods(Set) - -%mixin std::multiset "Enumerable"; - -%rename("delete") std::multiset::__delete__; -%rename("reject!") std::multiset::reject_bang; -%rename("map!") std::multiset::map_bang; -%rename("empty?") std::multiset::empty; -%rename("include?" ) std::multiset::__contains__ const; -%rename("has_key?" ) std::multiset::has_key const; - -%alias std::multiset::push "<<"; - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_pair.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_pair.i deleted file mode 100755 index 38a4ffb9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_pair.i +++ /dev/null @@ -1,212 +0,0 @@ -/* - Pairs -*/ -%include - -//#define SWIG_STD_PAIR_ASVAL - -%fragment("StdPairTraits","header",fragment="StdTraits") { - namespace swig { - - template - struct traits_asval > { - typedef std::pair value_type; - - static int get_pair(VALUE first, VALUE second, - std::pair *val) - { - if (val) { - T *pfirst = &(val->first); - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = &(val->second); - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } else { - T *pfirst = 0; - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asval(VALUE obj, std::pair *val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_ARRAY ) { - if (RARRAY_LEN(obj) == 2) { - VALUE first = rb_ary_entry(obj,0); - VALUE second = rb_ary_entry(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = *p; - } - return res; - } - }; - - template - struct traits_asptr > { - typedef std::pair value_type; - - static int get_pair(VALUE first, VALUE second, - std::pair **val) - { - if (val) { - value_type *vp = %new_instance(std::pair); - T *pfirst = &(vp->first); - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) { - %delete(vp); - return res1; - } - U *psecond = &(vp->second); - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) { - %delete(vp); - return res2; - } - *val = vp; - return SWIG_AddNewMask(res1 > res2 ? res1 : res2); - } else { - T *pfirst = 0; - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asptr(VALUE obj, std::pair **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_ARRAY ) { - if ( RARRAY_LEN(obj) == 2) { - VALUE first = rb_ary_entry(obj,0); - VALUE second = rb_ary_entry(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - - - template - struct traits_from > { - static VALUE _wrap_pair_second( VALUE self ) - { - std::pair< typename swig::noconst_traits::noconst_type,U>* p = NULL; - swig::asptr( self, &p ); - return swig::from( p->second ); - } - - static VALUE _wrap_pair_second_eq( VALUE self, VALUE arg ) - { - std::pair< typename swig::noconst_traits::noconst_type,U>* p = NULL; - swig::asptr( self, &p ); - return swig::from( p->second ); - } - - static VALUE from(const std::pair& val) { - VALUE obj = rb_ary_new2(2); - rb_ary_push(obj, swig::from::noconst_type>(val.first)); - rb_ary_push(obj, swig::from(val.second)); - rb_define_singleton_method(obj, "second", - VALUEFUNC(_wrap_pair_second), 0 ); - rb_define_singleton_method(obj, "second=", - VALUEFUNC(_wrap_pair_second_eq), 1 ); - rb_obj_freeze(obj); // treat as immutable tuple - return obj; - } - }; - - } -} - -// Missing typemap -%typemap(in) std::pair* (int res) { - res = swig::asptr( $input, &$1 ); - if (!SWIG_IsOK(res)) - %argument_fail(res, "$1_type", $symname, $argnum); -} - - -%define %swig_pair_methods(pair...) - -%extend { - VALUE inspect() const - { - VALUE tmp; - const char *type_name = swig::type_name< pair >(); - VALUE str = rb_str_new2( type_name ); - str = rb_str_cat2( str, " (" ); - tmp = swig::from( $self->first ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, "," ); - tmp = swig::from( $self->second ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, ")" ); - return str; - } - - VALUE to_s() const - { - VALUE tmp; - VALUE str = rb_str_new2( "(" ); - tmp = swig::from( $self->first ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, "," ); - tmp = swig::from( $self->second ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, ")" ); - return str; - } - - VALUE __getitem__( int index ) - { - if (( index % 2 ) == 0 ) - return swig::from( $self->first ); - else - return swig::from( $self->second ); - } - - VALUE __setitem__( int index, VALUE obj ) - { - int res; - if (( index % 2 ) == 0 ) - { - res = swig::asval( obj, &($self->first) ); - } - else - { - res = swig::asval(obj, &($self->second) ); - } - if (!SWIG_IsOK(res)) - rb_raise( rb_eArgError, "invalid item for " #pair ); - return obj; - } - - } // extend - -%enddef - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_queue.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_queue.i deleted file mode 100755 index 2a16d9cf..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_queue.i +++ /dev/null @@ -1,33 +0,0 @@ -/* - Queues -*/ - -%fragment("StdQueueTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::queue **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::queue& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%rename("delete") std::queue::__delete__; -%rename("reject!") std::queue::reject_bang; -%rename("map!") std::queue::map_bang; -%rename("empty?") std::queue::empty; -%rename("include?" ) std::queue::__contains__ const; -%rename("has_key?" ) std::queue::has_key const; - -%alias std::queue::push "<<"; - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_set.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_set.i deleted file mode 100755 index 1b425c6b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_set.i +++ /dev/null @@ -1,228 +0,0 @@ -/* - Sets -*/ - -%fragment("StdSetTraits","header",fragment="",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::set* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static VALUE from(const std::set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - - - /** - * Set Iterator class for an iterator with no end() boundaries. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class SetIteratorOpen_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef SetIteratorOpen_T self_type; - - public: - SetIteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - // no setValue allowed - - Iterator *dup() const - { - return new self_type(*this); - } - }; - - - /** - * Set Iterator class for a iterator where begin() and end() boundaries - are known. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class SetIteratorClosed_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef SetIteratorClosed_T self_type; - - protected: - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - SetIteratorClosed_T(nonconst_iter curr, nonconst_iter first, - nonconst_iter last, VALUE seq = Qnil) - : Iterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - // no setValue allowed - - - Iterator *dup() const - { - return new self_type(*this); - } - - private: - nonconst_iter begin; - nonconst_iter end; - }; - - // Template specialization to construct a closed iterator for sets - // this turns a nonconst iterator into a const one for ruby to avoid - // allowing the user to change the value - template< typename InOutIter > - inline Iterator* - make_set_nonconst_iterator(const InOutIter& current, - const InOutIter& begin, - const InOutIter& end, - VALUE seq = Qnil) - { - return new SetIteratorClosed_T< InOutIter >(current, - begin, end, seq); - } - - // Template specialization to construct an open iterator for sets - // this turns a nonconst iterator into a const one for ruby to avoid - // allowing the user to change the value - template< typename InOutIter > - inline Iterator* - make_set_nonconst_iterator(const InOutIter& current, - VALUE seq = Qnil) - { - return new SetIteratorOpen_T< InOutIter >(current, seq); - } - - } -%} - -%define %swig_sequence_methods_extra_set(Sequence...) - %extend { - %alias reject_bang "delete_if"; - Sequence* reject_bang() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - for ( Sequence::iterator i = $self->begin(); i != $self->end(); ) { - VALUE r = swig::from< Sequence::value_type >(*i); - Sequence::iterator current = i++; - if ( RTEST( rb_yield(r) ) ) - $self->erase(current); - } - - return self; - } - } -%enddef - -%define %swig_set_methods(set...) - - %swig_sequence_methods_common(%arg(set)); - %swig_sequence_methods_extra_set(%arg(set)); - - %fragment("RubyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="RubySequence_Cont") {} - -// Redefine std::set iterator/reverse_iterator typemap -%typemap(out,noblock=1) iterator, reverse_iterator { - $result = SWIG_NewPointerObj((swig::make_set_nonconst_iterator<$type>($1, self)), swig::Iterator::descriptor(), SWIG_POINTER_OWN); - } - -// Redefine std::set std::pair typemap - %typemap(out,noblock=1,fragment="RubyPairBoolOutputIterator") - std::pair { - $result = rb_ary_new2(2); - rb_ary_push($result, SWIG_NewPointerObj((swig::make_set_nonconst_iterator($1.first)), swig::Iterator::descriptor(), SWIG_POINTER_OWN)); - rb_ary_push($result, SWIG_From(bool)(%static_cast($1,const $type &).second)); - } - - %extend { - %alias push "<<"; - value_type push(const value_type& x) { - self->insert(x); - return x; - } - - bool __contains__(const value_type& x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - }; -%enddef - - -%mixin std::set "Enumerable"; - - - -%rename("delete") std::set::__delete__; -%rename("reject!") std::set::reject_bang; -%rename("map!") std::set::map_bang; -%rename("empty?") std::set::empty; -%rename("include?" ) std::set::__contains__ const; -%rename("has_key?" ) std::set::has_key const; - -%alias std::set::push "<<"; - - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_shared_ptr.i deleted file mode 100755 index 086e3081..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_shared_ptr.i +++ /dev/null @@ -1,144 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include -%include - - -%fragment("StdSharedPtrTraits","header",fragment="StdTraitsForwardDeclaration",fragment="") -{ -namespace swig { - /* - Template specialization for functions defined in rubystdcommon.swg. Special handling for shared_ptr - is required as, shared_ptr * is used rather than the usual T *, see shared_ptr.i. - */ - template - struct traits_asptr > { - static int asptr(VALUE obj, std::shared_ptr **val) { - int res = SWIG_ERROR; - swig_type_info *descriptor = type_info >(); - if (val) { - std::shared_ptr *p = 0; - swig_ruby_owntype newmem = {0, 0}; - res = descriptor ? SWIG_ConvertPtrAndOwn(obj, (void **)&p, descriptor, 0, &newmem) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (*val) { - **val = p ? *p : std::shared_ptr(); - } else { - *val = p; - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - // Upcast for pointers to shared_ptr in this generic framework has not been implemented - res = SWIG_ERROR; - } - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) - delete p; - } - } else { - res = descriptor ? SWIG_ConvertPtr(obj, 0, descriptor, 0) : SWIG_ERROR; - } - return res; - } - }; - - template - struct traits_asval > { - static int asval(VALUE obj, std::shared_ptr *val) { - if (val) { - std::shared_ptr ret; - std::shared_ptr *p = &ret; - int res = traits_asptr >::asptr(obj, &p); - if (!SWIG_IsOK(res)) - return res; - *val = ret; - return SWIG_OK; - } else { - return traits_asptr >::asptr(obj, (std::shared_ptr **)(0)); - } - } - }; - - template - struct traits_asval *> { - static int asval(VALUE obj, std::shared_ptr **val) { - if (val) { - typedef typename noconst_traits >::noconst_type noconst_type; - if (*val) { - noconst_type ret; - noconst_type *p = &ret; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) - **(const_cast(val)) = ret; - return res; - } else { - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) - *val = p; - return res; - } - } else { - return traits_asptr >::asptr(obj, (std::shared_ptr **)(0)); - } - } - }; - - template - struct traits_as, pointer_category> { - static std::shared_ptr as(VALUE obj) { - std::shared_ptr ret; - std::shared_ptr *v = &ret; - int res = traits_asptr >::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return ret; - } else { - - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) - SWIG_Error(SWIG_TypeError, swig::type_name >()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as *, pointer_category> { - static std::shared_ptr * as(VALUE obj) { - std::shared_ptr *p = 0; - int res = traits_asptr >::asptr(obj, &p); - if (SWIG_IsOK(res)) { - return p; - } else { - - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) - SWIG_Error(SWIG_TypeError, swig::type_name *>()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_from_ptr > { - static VALUE from(std::shared_ptr *val, int owner = 0) { - if (val && *val) { - return SWIG_NewPointerObj(val, type_info >(), owner); - } else { - return Qnil; - } - } - }; - - /* - The descriptors in the shared_ptr typemaps remove the const qualifier for the SWIG type system. - Remove const likewise here, otherwise SWIG_TypeQuery("std::shared_ptr") will return NULL. - */ - template - struct traits_from > { - static VALUE from(const std::shared_ptr& val) { - std::shared_ptr p = std::const_pointer_cast(val); - return swig::from(p); - } - }; -} -} - -%fragment("StdSharedPtrTraits"); diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_sstream.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_sstream.i deleted file mode 100755 index 537a3ae5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_sstream.i +++ /dev/null @@ -1,2 +0,0 @@ - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_stack.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_stack.i deleted file mode 100755 index 7df48ef1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_stack.i +++ /dev/null @@ -1,35 +0,0 @@ -/* - Stacks -*/ - -%fragment("StdStackTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::stack **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::stack& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - - -%rename("delete") std::stack::__delete__; -%rename("reject!") std::stack::reject_bang; -%rename("map!") std::stack::map_bang; -%rename("empty?") std::stack::empty; -%rename("include?" ) std::stack::__contains__ const; -%rename("has_key?" ) std::stack::has_key const; - -%alias std::stack::push "<<"; - - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_streambuf.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_streambuf.i deleted file mode 100755 index 44b9bb4d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_streambuf.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_string.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_string.i deleted file mode 100755 index f9ecd8e8..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_string.i +++ /dev/null @@ -1,7 +0,0 @@ - -%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::basic_string; - -AUTODOC(substr, "Return a portion of the String"); - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_unique_ptr.i deleted file mode 100755 index f988714d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_map.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_map.i deleted file mode 100755 index 3c6b6502..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_map.i +++ /dev/null @@ -1,83 +0,0 @@ -// -// Maps -// -%include - -%fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_map *map) { - typedef typename std::unordered_map::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::unordered_map map_type; - static int asptr(VALUE obj, map_type **val) { - int res = SWIG_ERROR; - if (TYPE(obj) == T_HASH) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - map_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static VALUE from(const map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - size_type size = map.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - rb_hash_aset(obj, key, val); - } - return obj; - } - } - }; - } -} - -#define %swig_unordered_map_common(Map...) %swig_map_common(Map) -#define %swig_unordered_map_methods(Map...) %swig_map_methods(Map) - -%rename("delete") std::unordered_map::__delete__; -%rename("reject!") std::unordered_map::reject_bang; -%rename("map!") std::unordered_map::map_bang; -%rename("empty?") std::unordered_map::empty; -%rename("include?") std::unordered_map::__contains__ const; -%rename("has_key?") std::unordered_map::has_key const; - -%mixin std::unordered_map "Enumerable"; -%alias std::unordered_map::push "<<"; - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_multimap.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_multimap.i deleted file mode 100755 index c3261f9e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_multimap.i +++ /dev/null @@ -1,100 +0,0 @@ -/* - Multimaps -*/ -%include - -%fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_multimap *multimap) { - typedef typename std::unordered_multimap::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::unordered_multimap multimap_type; - static int asptr(VALUE obj, std::unordered_multimap **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_HASH ) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - return traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - multimap_type *p; - res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info(),0); - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_multimap multimap_type; - typedef typename multimap_type::const_iterator const_iterator; - typedef typename multimap_type::size_type size_type; - - static VALUE from(const multimap_type& multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new multimap_type(multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = multimap.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, - "multimap_ size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - - VALUE oldval = rb_hash_aref(obj, key); - if (oldval == Qnil) { - rb_hash_aset(obj, key, val); - } else { - // Multiple values for this key, create array if needed - // and add a new element to it. - VALUE ary; - if (TYPE(oldval) == T_ARRAY) { - ary = oldval; - } else { - ary = rb_ary_new2(2); - rb_ary_push(ary, oldval); - rb_hash_aset(obj, key, ary); - } - rb_ary_push(ary, val); - } - } - return obj; - } - } - }; - } -} - -#define %swig_unordered_multimap_methods(MultiMap...) %swig_multimap_methods(MultiMap) - -%mixin std::unordered_multimap "Enumerable"; - -%rename("delete") std::unordered_multimap::__delete__; -%rename("reject!") std::unordered_multimap::reject_bang; -%rename("map!") std::unordered_multimap::map_bang; -%rename("empty?") std::unordered_multimap::empty; -%rename("include?" ) std::unordered_multimap::__contains__ const; -%rename("has_key?" ) std::unordered_multimap::has_key const; - -%alias std::unordered_multimap::push "<<"; - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_multiset.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_multiset.i deleted file mode 100755 index dae13eef..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_multiset.i +++ /dev/null @@ -1,50 +0,0 @@ -/* - Multisets -*/ - -%include - -%fragment("StdUnorderedMultisetTraits","header",fragment="StdUnorderedSetTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_multiset* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::unordered_multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static VALUE from(const std::unordered_multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_unordered_multiset_methods(Set...) %swig_unordered_set_methods(Set) - -%mixin std::unordered_multiset "Enumerable"; - -%rename("delete") std::unordered_multiset::__delete__; -%rename("reject!") std::unordered_multiset::reject_bang; -%rename("map!") std::unordered_multiset::map_bang; -%rename("empty?") std::unordered_multiset::empty; -%rename("include?") std::unordered_multiset::__contains__ const; -%rename("has_key?") std::unordered_multiset::has_key const; - -%alias std::unordered_multiset::push "<<"; - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_set.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_set.i deleted file mode 100755 index e8e1b087..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_unordered_set.i +++ /dev/null @@ -1,50 +0,0 @@ -/* - Sets -*/ - -%include - -%fragment("StdUnorderedSetTraits","header",fragment="",fragment="StdSetTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_set* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::unordered_set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static VALUE from(const std::unordered_set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_unordered_set_methods(set...) %swig_set_methods(set) - -%mixin std::unordered_set "Enumerable"; - -%rename("delete") std::unordered_set::__delete__; -%rename("reject!") std::unordered_set::reject_bang; -%rename("map!") std::unordered_set::map_bang; -%rename("empty?") std::unordered_set::empty; -%rename("include?" ) std::unordered_set::__contains__ const; -%rename("has_key?" ) std::unordered_set::has_key const; - -%alias std::unordered_set::push "<<"; - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_vector.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_vector.i deleted file mode 100755 index 67fdcd1f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_vector.i +++ /dev/null @@ -1,52 +0,0 @@ -/* - Vectors -*/ - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - - - -%define %swig_vector_methods(Type...) - %swig_sequence_methods(Type) - %swig_sequence_front_inserters(Type); -%enddef - -%define %swig_vector_methods_val(Type...) - %swig_sequence_methods_val(Type); - %swig_sequence_front_inserters(Type); -%enddef - - -%mixin std::vector "Enumerable"; -%ignore std::vector::push_back; -%ignore std::vector::pop_back; - - -%rename("delete") std::vector::__delete__; -%rename("reject!") std::vector::reject_bang; -%rename("map!") std::vector::map_bang; -%rename("empty?") std::vector::empty; -%rename("include?" ) std::vector::__contains__ const; -%rename("has_key?" ) std::vector::has_key const; - -%alias std::vector::push "<<"; - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_vectora.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_vectora.i deleted file mode 100755 index 1708361e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_vectora.i +++ /dev/null @@ -1,36 +0,0 @@ -/* - Vectors + allocators -*/ - -%fragment("StdVectorATraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - typedef std::vector vector_type; - typedef T value_type; - static int asptr(VALUE obj, vector_type **vec) { - return traits_asptr_stdseq::asptr(obj, vec); - } - }; - - template - struct traits_from > { - typedef std::vector vector_type; - static VALUE from(const vector_type& vec) { - return traits_from_stdseq::from(vec); - } - }; - } -%} - - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%mixin std::vector "Enumerable"; -%ignore std::vector::push_back; -%ignore std::vector::pop_back; -%alias std::vector::push "<<"; - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/std_wstring.i b/mac/bin/swig/share/swig/4.1.0/ruby/std_wstring.i deleted file mode 100755 index c5d168a0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/std_wstring.i +++ /dev/null @@ -1,63 +0,0 @@ -%{ -#if defined(__linux__) -#include -#if BYTE_ORDER == LITTLE_ENDIAN -#define SWIG_RUBY_ENDIAN "LE" -#elif BYTE_ORDER == BIG_ENDIAN -#define SWIG_RUBY_ENDIAN "BE" -#endif -#else -#define SWIG_RUBY_ENDIAN "LE" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_RUBY_ENCODING_H -#include "ruby/encoding.h" -#endif - -/** - * The internal encoding of std::wstring is defined based on - * the size of wchar_t. If it is not appropriate for your library, - * SWIG_RUBY_WSTRING_ENCODING must be given when compiling. - */ -#ifndef SWIG_RUBY_WSTRING_ENCODING - -#if WCHAR_MAX == 0x7fff || WCHAR_MAX == 0xffff -#define SWIG_RUBY_WSTRING_ENCODING "UTF-16" SWIG_RUBY_ENDIAN -#elif WCHAR_MAX == 0x7fffffff || WCHAR_MAX == 0xffffffff -#define SWIG_RUBY_WSTRING_ENCODING "UTF-32" SWIG_RUBY_ENDIAN -#else -#error unsupported wchar_t size. SWIG_RUBY_WSTRING_ENCODING must be given. -#endif - -#endif - -/** - * If Encoding.default_internal is nil, this encoding will be used - * when converting from std::wstring to String object in Ruby. - */ -#ifndef SWIG_RUBY_INTERNAL_ENCODING -#define SWIG_RUBY_INTERNAL_ENCODING "UTF-8" -#endif - -static rb_encoding *swig_ruby_wstring_encoding; -static rb_encoding *swig_ruby_internal_encoding; - -#ifdef __cplusplus -} -#endif -%} - -%fragment("SWIG_ruby_wstring_encoding_init", "init") { - swig_ruby_wstring_encoding = rb_enc_find( SWIG_RUBY_WSTRING_ENCODING ); - swig_ruby_internal_encoding = rb_enc_find( SWIG_RUBY_INTERNAL_ENCODING ); -} - -%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::basic_string; - -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/stl.i b/mac/bin/swig/share/swig/4.1.0/ruby/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/swigmove.i b/mac/bin/swig/share/swig/4.1.0/ruby/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/timeval.i b/mac/bin/swig/share/swig/4.1.0/ruby/timeval.i deleted file mode 100755 index 94a75c80..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/timeval.i +++ /dev/null @@ -1,69 +0,0 @@ -/* - struct timeval * - time_t - - Ruby has builtin class Time. INPUT/OUTPUT typemap for timeval and - time_t is provided. - -*/ -%{ -#ifdef __cplusplus -extern "C" { -#endif -#ifdef HAVE_SYS_TIME_H -# include -struct timeval rb_time_timeval(VALUE); -#endif -#ifdef __cplusplus -} -#endif -%} - -%typemap(in) struct timeval *INPUT (struct timeval temp) -{ - if (NIL_P($input)) - $1 = NULL; - else { - temp = rb_time_timeval($input); - $1 = &temp; - } -} - -%typemap(in,numinputs=0) struct timeval *OUTPUT(struct timeval temp) -{ - $1 = &temp; -} - -%typemap(argout) struct timeval *OUTPUT -{ - $result = rb_time_new($1->tv_sec, $1->tv_usec); -} - -%typemap(out) struct timeval * -{ - $result = rb_time_new($1->tv_sec, $1->tv_usec); -} - -%typemap(out) struct timespec * -{ - $result = rb_time_new($1->tv_sec, $1->tv_nsec / 1000); -} - -// time_t -%typemap(in) time_t -{ - if (NIL_P($input)) - $1 = (time_t)-1; - else - $1 = NUM2LONG(rb_funcall2($input, rb_intern("tv_sec"), 0, 0)); -} - -%typemap(typecheck) time_t -{ - $1 = (NIL_P($input) || TYPE(rb_funcall($input, rb_intern("respond_to?"), 1, ID2SYM(rb_intern("tv_sec")))) == T_TRUE); -} - -%typemap(out) time_t -{ - $result = rb_time_new($1, 0); -} diff --git a/mac/bin/swig/share/swig/4.1.0/ruby/typemaps.i b/mac/bin/swig/share/swig/4.1.0/ruby/typemaps.i deleted file mode 100755 index 68343646..00000000 --- a/mac/bin/swig/share/swig/4.1.0/ruby/typemaps.i +++ /dev/null @@ -1,314 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * - * These mappings provide support for input/output arguments and - * common uses for C/C++ pointers. INOUT mappings allow for C/C++ - * pointer variables in addition to input/output arguments. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_USE_OLD_TYPEMAPS) -%include -#else - -/* -The SWIG typemap library provides a language independent mechanism for -supporting output arguments, input values, and other C function -calling mechanisms. The primary use of the library is to provide a -better interface to certain C function--especially those involving -pointers. -*/ - -// ------------------------------------------------------------------------ -// Pointer handling -// -// These mappings provide support for input/output arguments and common -// uses for C/C++ pointers. -// ------------------------------------------------------------------------ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -%define INPUT_TYPEMAP(type, converter) -%typemap(in) type *INPUT($*1_ltype temp), type &INPUT($*1_ltype temp) -{ - temp = ($*1_ltype) converter($input); - $1 = &temp; -} -%typemap(typecheck) type *INPUT = type; -%typemap(typecheck) type &INPUT = type; -%enddef - -INPUT_TYPEMAP(float, NUM2DBL); -INPUT_TYPEMAP(double, NUM2DBL); -INPUT_TYPEMAP(int, NUM2INT); -INPUT_TYPEMAP(short, NUM2SHRT); -INPUT_TYPEMAP(long, NUM2LONG); -INPUT_TYPEMAP(long long, NUM2LL); -INPUT_TYPEMAP(unsigned int, NUM2UINT); -INPUT_TYPEMAP(unsigned short, NUM2USHRT); -INPUT_TYPEMAP(unsigned long, NUM2ULONG); -INPUT_TYPEMAP(unsigned long long, NUM2ULL); -INPUT_TYPEMAP(unsigned char, NUM2UINT); -INPUT_TYPEMAP(signed char, NUM2INT); -INPUT_TYPEMAP(bool, RTEST); - -#undef INPUT_TYPEMAP - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a array element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Ruby Array. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include typemaps.i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Ruby output of the function would be a Array containing both -output values. -*/ - -%define OUTPUT_TYPEMAP(type, converter, convtype) -%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 { - VALUE o = converter(convtype (*$1)); - $result = output_helper($result, o); -} -%enddef - -OUTPUT_TYPEMAP(int, INT2NUM, (int)); -OUTPUT_TYPEMAP(short, INT2NUM, (int)); -OUTPUT_TYPEMAP(long, INT2NUM, (long)); -OUTPUT_TYPEMAP(long long, LL2NUM, (long long)); -OUTPUT_TYPEMAP(unsigned int, UINT2NUM, (unsigned int)); -OUTPUT_TYPEMAP(unsigned short, UINT2NUM, (unsigned int)); -OUTPUT_TYPEMAP(unsigned long, UINT2NUM, (unsigned long)); -OUTPUT_TYPEMAP(unsigned long long, ULL2NUM, (unsigned long long)); -OUTPUT_TYPEMAP(unsigned char, UINT2NUM, (unsigned int)); -OUTPUT_TYPEMAP(signed char, INT2NUM, (int)); -OUTPUT_TYPEMAP(float, rb_float_new, (double)); -OUTPUT_TYPEMAP(double, rb_float_new, (double)); - -#undef OUTPUT_TYPEMAP - -%typemap(in,numinputs=0) bool *OUTPUT(bool temp), bool &OUTPUT(bool temp) "$1 = &temp;" -%typemap(argout, fragment="output_helper") bool *OUTPUT, bool &OUTPUT { - VALUE o = (*$1) ? Qtrue : Qfalse; - $result = output_helper($result, o); -} - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Ruby array. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - void neg(double *INOUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Ruby). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Ruby variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned &INOUT = unsigned &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) signed char &INOUT = signed char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned *INOUT = unsigned *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned &INOUT = unsigned &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) signed char &INOUT = signed char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; - -/* Overloading information */ - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) float *INOUT = float; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) float &INOUT = float; - -#endif - -// -------------------------------------------------------------------- -// Special types -// -------------------------------------------------------------------- -%include -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/runtime.swg b/mac/bin/swig/share/swig/4.1.0/runtime.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/boost_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/scilab/boost_shared_ptr.i deleted file mode 100755 index 87c89b5f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/boost_shared_ptr.i +++ /dev/null @@ -1,401 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/carrays.i b/mac/bin/swig/share/swig/4.1.0/scilab/carrays.i deleted file mode 100755 index 014de37f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/carrays.i +++ /dev/null @@ -1,5 +0,0 @@ -%define %array_class(TYPE,NAME) - %array_class_wrap(TYPE,NAME,__paren__,__paren_asgn__) -%enddef - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/cmalloc.i b/mac/bin/swig/share/swig/4.1.0/scilab/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/cpointer.i b/mac/bin/swig/share/swig/4.1.0/scilab/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/exception.i b/mac/bin/swig/share/swig/4.1.0/scilab/exception.i deleted file mode 100755 index 17f4175c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/exception.i +++ /dev/null @@ -1,6 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), SWIG_Scilab_Error(code, msg);) -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/matrix.i b/mac/bin/swig/share/swig/4.1.0/scilab/matrix.i deleted file mode 100755 index 0936d936..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/matrix.i +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Matrix typemaps - * - */ - -%include -%include -%include -%include - - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/sciarray.swg b/mac/bin/swig/share/swig/4.1.0/scilab/sciarray.swg deleted file mode 100755 index c00e3837..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/sciarray.swg +++ /dev/null @@ -1,115 +0,0 @@ -/* -------------------------------------------------------------------------- - * - * Arrays typemaps - * - * --------------------------------------------------------------------------*/ - -%{ -#include -%} - -%define %scilab_asarray_withallocatecopy(TYPEMAPTYPE, FRAGMENTNAME, CTYPE, TEMPDATATYPE) -%typemap(TYPEMAPTYPE, fragment="FRAGMENTNAME") CTYPE { - size_t i = 0; - int iRows = 0; - int iCols = 0; - TEMPDATATYPE *pTempData = NULL; - if (FRAGMENTNAME(pvApiCtx, $input, &iRows, &iCols, &pTempData, fname)) { - return SWIG_ERROR; - } - $1 = ($1_ltype)MALLOC(sizeof($*1_ltype) * iRows * iCols); - for (i = 0; i < iRows * iCols; i++) { - $1[i] = ($*1_ltype) pTempData[i]; - } -} -%enddef - -%define %scilab_asarrayandsize_withcopy(TYPEMAPTYPE, FRAGMENTNAME, CTYPE, TEMPDATATYPE) -%typemap(TYPEMAPTYPE, fragment="FRAGMENTNAME") CTYPE { - int iRows = 0; - int iCols = 0; - TEMPDATATYPE *pTempData = NULL; - if (FRAGMENTNAME(pvApiCtx, $input, &iRows, &iCols, &pTempData, fname)) { - return SWIG_ERROR; - } - if (iRows*iCols <= $1_dim0) { - size_t i; - for (i = 0; i < $1_dim0; i++) { - $1[i] = ($*1_ltype) pTempData[i]; - } - } - else { - char errmsg[100]; - sprintf(errmsg, "Size of input data (%d) is too big (maximum is %d)", - iRows*iCols, $1_dim0); - SWIG_exception_fail(SWIG_OverflowError, errmsg); - } -} -%enddef - -%define %scilab_fromarrayandsize(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - %set_output(FRAGMENTNAME(pvApiCtx, $result, 1, $1_dim0, $1)); -} -%enddef - -%define %scilab_array_typemaps(CTYPE, ASARRAY_FRAGMENT, FROMARRAY_FRAGMENT, TEMPDATATYPE) - %scilab_asarrayandsize_withcopy(varin, ASARRAY_FRAGMENT, CTYPE[ANY], TEMPDATATYPE); - %scilab_asarray_withallocatecopy(in, ASARRAY_FRAGMENT, CTYPE[ANY], TEMPDATATYPE); - %scilab_fromarrayandsize(varout, FROMARRAY_FRAGMENT, CTYPE[ANY]); - %scilab_fromarrayandsize(out, FROMARRAY_FRAGMENT, CTYPE[ANY]); - - %apply SWIGTYPE[] { CTYPE[] }; - %scilab_asarray_withallocatecopy(in, ASARRAY_FRAGMENT, CTYPE[], TEMPDATATYPE); -%enddef - - -// Double -%scilab_array_typemaps(double, SWIG_SciDouble_AsDoubleArrayAndSize, - SWIG_SciDouble_FromDoubleArrayAndSize, double); - -// Signed char - -%scilab_array_typemaps(signed char, SWIG_SciDoubleOrInt8_AsSignedCharArrayAndSize, - SWIG_SciDouble_FromSignedCharArrayAndSize, signed char); - -// Unsigned char -%scilab_array_typemaps(unsigned char, SWIG_SciDoubleOrUint8_AsUnsignedCharArrayAndSize, - SWIG_SciDouble_FromUnsignedCharArrayAndSize, unsigned char); - -// Short -%scilab_array_typemaps(short, SWIG_SciDoubleOrInt16_AsShortArrayAndSize, - SWIG_SciDouble_FromShortArrayAndSize, short); - -// Unsigned short -%scilab_array_typemaps(unsigned short, SWIG_SciDoubleOrUint16_AsUnsignedShortArrayAndSize, - SWIG_SciDouble_FromUnsignedShortArrayAndSize, unsigned short); - -// Int -%scilab_array_typemaps(int, SWIG_SciDoubleOrInt32_AsIntArrayAndSize, - SWIG_SciDouble_FromIntArrayAndSize, int); - -// Unsigned int -%scilab_array_typemaps(unsigned int, SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize, - SWIG_SciDouble_FromUnsignedIntArrayAndSize, unsigned int); - -// Long -%scilab_array_typemaps(long, SWIG_SciDoubleOrInt32_AsIntArrayAndSize, - SWIG_SciDouble_FromLongArrayAndSize, int); - -// Unsigned long -%scilab_array_typemaps(unsigned long, SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize, - SWIG_SciDouble_FromUnsignedLongArrayAndSize, unsigned int); - -// Float -%scilab_array_typemaps(float, SWIG_SciDouble_AsFloatArrayAndSize, - SWIG_SciDouble_FromFloatArrayAndSize, float); - -// Bool -%scilab_array_typemaps(bool, SWIG_SciBoolean_AsIntArrayAndSize, - SWIG_SciBoolean_FromBoolArrayAndSize, int); - -// Char * -%scilab_array_typemaps(char *, SWIG_SciString_AsCharPtrArrayAndSize, - SWIG_SciString_FromCharPtrArrayAndSize, char *); - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scibool.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scibool.swg deleted file mode 100755 index 9aed88ec..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scibool.swg +++ /dev/null @@ -1,156 +0,0 @@ -/* - * C-type: bool - * Scilab type: boolean scalar - */ -%fragment(SWIG_AsVal_frag(bool), "header") { -SWIGINTERN int -SWIG_AsVal_dec(bool)(SwigSciObject iVar, bool *pbValue) { - SciErr sciErr; - int iRet = 0; - int *piAddrVar = NULL; - int iTempValue = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (!isBooleanType(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean expected.\n"), SWIG_Scilab_GetFuncName(), iVar); - return SWIG_ERROR; - } - - if (!isScalar(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A boolean expected.\n"), SWIG_Scilab_GetFuncName(), iVar); - return SWIG_ERROR; - } - - iRet = getScalarBoolean(pvApiCtx, piAddrVar, &iTempValue); - if (iRet) { - return SWIG_ERROR; - } - - *pbValue = iTempValue; - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(bool), "header") { -SWIGINTERN int -SWIG_From_dec(bool)(bool bValue) { - if (createScalarBoolean(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) - + SWIG_Scilab_GetOutputPosition(), bValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: bool[] - * Scilab type: boolean matrix - */ -%fragment("SWIG_SciBoolean_AsBoolArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_AsBoolArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, bool **pbValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - int *piValue = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isBooleanType(pvApiCtx, piAddrVar)) { - int i; - sciErr = getMatrixOfBoolean(pvApiCtx, piAddrVar, iRows, iCols, &piValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - *pbValue = (bool*) malloc((*iRows) * (*iCols) * sizeof(bool)); - for (i = 0; i < (*iRows) * (*iCols); i++) - (*pbValue)[i] = piValue[i] != 0; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciBoolean_FromBoolArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_FromBoolArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, bool *pbValue) { - SciErr sciErr; - int *piValue = NULL; - int i; - - piValue = (int*) malloc(iRows * iCols * sizeof(int)); - for (i = 0; i < iRows * iCols; i++) - piValue[i] = pbValue[i]; - - sciErr = createMatrixOfBoolean(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, piValue); - if(sciErr.iErr) { - printError(&sciErr, 0); - free(piValue); - return SWIG_ERROR; - } - - free(piValue); - return SWIG_OK; -} -} - -/* - * C-type: int[] - * Scilab type: boolean matrix - */ -%fragment("SWIG_SciBoolean_AsIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_AsIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, int **piValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isBooleanType(pvApiCtx, piAddrVar)) { - sciErr = getMatrixOfBoolean(pvApiCtx, piAddrVar, iRows, iCols, piValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciBoolean_FromIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_FromIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, int *piValue) { - SciErr sciErr; - - sciErr = createMatrixOfBoolean(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, piValue); - if(sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scichar.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scichar.swg deleted file mode 100755 index 5edbf5b7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scichar.swg +++ /dev/null @@ -1,292 +0,0 @@ -/* - * C-type: char or char* - * Scilab type: string - */ - -/* - * CHAR - */ - -%fragment(SWIG_AsVal_frag(char), "header", fragment="SWIG_SciString_AsChar") { -#define SWIG_AsVal_char(scilabValue, valuePointer) SWIG_SciString_AsChar(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciString_AsChar", "header") { -SWIGINTERN int -SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - char *pstValue = NULL; - int iRet; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isStringType(pvApiCtx, piAddrVar) == 0) - { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - iRet = getAllocatedSingleString(pvApiCtx, piAddrVar, &pstValue); - if (iRet) { - return SWIG_ERROR; - } - - if (pcValue != NULL) { - *pcValue = pstValue[0]; - } - - freeAllocatedSingleString(pstValue); - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(char), "header", fragment="SWIG_SciString_FromChar") { -#define SWIG_From_char(value) SWIG_SciString_FromChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value) -} -%fragment("SWIG_SciString_FromChar", "header") { -SWIGINTERN int -SWIG_SciString_FromChar(void *pvApiCtx, int iVarOut, char chValue) { - char *pchValue = (char*)malloc(sizeof(char) * 2); - pchValue[0] = chValue; - pchValue[1] = '\0'; - - if (createSingleString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, pchValue)) - return SWIG_ERROR; - - free(pchValue); - return SWIG_OK; -} -} - -/* - * CHAR * -*/ - -%fragment("SWIG_AsCharArray", "header", fragment = "SWIG_SciString_AsCharPtr") { -#define SWIG_AsCharArray(scilabValue, charPtrPointer, charPtrLength) SWIG_SciString_AsCharPtr(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciString_AsCharPtr", "header") { -SWIGINTERN int -SWIG_SciString_AsCharPtr(void *pvApiCtx, int iVar, char *pcValue, int iLength, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - char* pcTmpValue = NULL; - int iRet; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - iRet = getAllocatedSingleString(pvApiCtx, piAddrVar, &pcTmpValue); - if (iRet) { - return SWIG_ERROR; - } - - if (pcValue != NULL) { - strncpy(pcValue, pcTmpValue, iLength); - } - - freeAllocatedSingleString(pcTmpValue); - return SWIG_OK; -} -} - -%fragment("SWIG_AsCharPtrAndSize", "header", fragment = "SWIG_SciString_AsCharPtrAndSize") { -#define SWIG_AsCharPtrAndSize(scilabValue, charPtrPointer, charPtrLength, allocMemory) SWIG_SciString_AsCharPtrAndSize(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, allocMemory, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciString_AsCharPtrAndSize", "header") { -SWIGINTERN int -SWIG_SciString_AsCharPtrAndSize(void *pvApiCtx, int iVar, char **pcValue, size_t *piLength, int *alloc, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - char *pstString = NULL; - int iRows = 0; - int iCols = 0; - int iLen = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isScalar(pvApiCtx, piAddrVar) == 0 || isStringType(pvApiCtx, piAddrVar) == 0) - { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &iLen, NULL); - if (sciErr.iErr) - { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - pstString = %new_array(iLen + 1, char); - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &iLen, &pstString); - if (sciErr.iErr) - { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - // TODO: return SWIG_ERROR if pcValue NULL (now returning SWIG_ERROR fails some typechecks) - if (pcValue) { - *pcValue = pstString; - } - - if (alloc != NULL) { - *alloc = SWIG_NEWOBJ; - } - - if (piLength != NULL) { - *piLength = strlen(pstString); - } - - return SWIG_OK; -} -} - -%fragment("SWIG_FromCharPtr", "header", fragment = "SWIG_SciString_FromCharPtr") { -#define SWIG_FromCharPtr(charPtr) SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr) -} -%fragment("SWIG_SciString_FromCharPtr", "header") { -SWIGINTERN int -SWIG_SciString_FromCharPtr(void *pvApiCtx, int iVarOut, const char *pchValue) { - if (pchValue) { - SciErr sciErr; - const char* pstStrings[1]; - pstStrings[0] = pchValue; - - sciErr = createMatrixOfString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, 1, 1, pstStrings); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - int iRet = createEmptyMatrix(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut); - if (iRet) { - return SWIG_ERROR; - } - } - - return SWIG_OK; -} -} - -/* - * CHAR * ARRAY - */ - -%fragment("SWIG_SciString_AsCharPtrArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciString_AsCharPtrArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, char ***charPtrArray, char *fname) { - SciErr sciErr; - int i = 0; - int *piAddrVar = NULL; - int* piLength = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, iRows, iCols, NULL, NULL); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - piLength = (int*) malloc((*iRows) * (*iCols) * sizeof(int)); - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, iRows, iCols, piLength, NULL); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - *charPtrArray = (char**) malloc((*iRows) * (*iCols) * sizeof(char*)); - for(i = 0 ; i < (*iRows) * (*iCols); i++) { - (*charPtrArray)[i] = (char*) malloc(sizeof(char) * (piLength[i] + 1)); - } - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, iRows, iCols, piLength, *charPtrArray); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - free(piLength); - return SWIG_OK; -} -} - -%fragment("SWIG_SciString_FromCharPtrArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciString_FromCharPtrArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, char **charPtrArray) { - SciErr sciErr; - - sciErr = createMatrixOfString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, (const char* const*) charPtrArray); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_FromCharPtrAndSize", "header", fragment = "SWIG_SciString_FromCharPtr") { -#define SWIG_FromCharPtrAndSize(charPtr, charPtrLength) SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr) -} - - -/* - * Char* Scilab variable - */ - -%fragment(SWIG_CreateScilabVariable_frag(char), "wrapper") { -SWIGINTERN int -SWIG_CreateScilabVariable_dec(char)(void *pvApiCtx, const char* psVariableName, const char cVariableValue) { - SciErr sciErr; - char sValue[2]; - const char* psStrings[1]; - - sValue[0] = cVariableValue; - sValue[1] = '\0'; - psStrings[0] = sValue; - - sciErr = createNamedMatrixOfString(pvApiCtx, psVariableName, 1, 1, psStrings); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - return SWIG_OK; -} -} - -%fragment(SWIG_CreateScilabVariable_frag(charptr), "wrapper") { -SWIGINTERN int -SWIG_CreateScilabVariable_dec(charptr)(void *pvApiCtx, const char* psVariableName, const char* psVariableValue) { - SciErr sciErr; - const char* psStrings[1]; - psStrings[0] = psVariableValue; - - sciErr = createNamedMatrixOfString(pvApiCtx, psVariableName, 1, 1, psStrings); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - return SWIG_OK; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scicontainer.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scicontainer.swg deleted file mode 100755 index f6078690..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scicontainer.swg +++ /dev/null @@ -1,445 +0,0 @@ -/* ----------------------------------------------------------------------------- - * scicontainer.swg - * - * Scilab list <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Scilab, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - - -// #define (SWIG_SCILAB_EXTRA_NATIVE_CONTAINERS) -// if defined: sequences in return are converted from/to Scilab lists or matrices -// if not defined: sequences are passed from/to Scilab as pointers - -%{ -#define SWIG_STD_NOASSIGN_STL -%} - -%include -%include - -%{ -#include -%} - -%include -%include - -%fragment("SciSequence_Cont", "header", - fragment="StdTraits", - fragment="SwigSciIterator_T", - fragment=SWIG_Traits_Sequence_frag(ptr), - fragment=SWIG_Traits_SequenceItem_frag(ptr)) -{ -namespace swig -{ - template - struct SciSequence_Ref - { - SciSequence_Ref(const SwigSciObject& seq, int index) - : _seq(seq), _index(index) - { - if (traits_as_sequence::get(_seq, &piSeqAddr) != SWIG_OK) - { - throw std::invalid_argument("Cannot get sequence data."); - } - } - - operator T () const - { - return traits_asval_sequenceitem::asval(_seq, piSeqAddr, _index); - } - - SciSequence_Ref& operator=(const T& v) - { - // TODO - return *this; - } - - private: - SwigSciObject _seq; - int _index; - void *piSeqAddr; - }; - - - template - struct SciSequence_ArrowProxy - { - SciSequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct SwigSciSequence_InputIterator - { - typedef SwigSciSequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - - SwigSciSequence_InputIterator() - { - } - - SwigSciSequence_InputIterator(const SwigSciObject& seq, int index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - SciSequence_ArrowProxy - operator->() const { - return SciSequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - SwigSciObject _seq; - difference_type _index; - }; - - template - struct SciSequence_Cont - { - typedef SciSequence_Ref reference; - typedef const SciSequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - typedef int size_type; - typedef const pointer const_pointer; - typedef SwigSciSequence_InputIterator iterator; - typedef SwigSciSequence_InputIterator const_iterator; - - SciSequence_Cont(const SwigSciObject& seq) : _seq(seq) - { - } - - ~SciSequence_Cont() - { - } - - size_type size() const - { - int iSeqSize; - if (traits_as_sequence::size(_seq, &iSeqSize) == SWIG_OK) - { - return iSeqSize; - } - else - { - return SWIG_ERROR; - } - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - private: - SwigSciObject _seq; - }; -} -} - -%define %swig_sequence_iterator(Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - class iterator; - class reverse_iterator; - class const_iterator; - class const_reverse_iterator; - - %typemap(out,noblock=1,fragment="SciSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - %set_output(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &)), - swig::SciSwigIterator::descriptor(),SWIG_POINTER_OWN)); - } - %typemap(out,fragment="SciSequence_Cont") - std::pair, std::pair { - // TODO: return a Scilab list from the pair (see code for Octave) - } - - %fragment("SciSwigPairBoolOutputIterator", "header", - fragment=SWIG_From_frag(bool), fragment="SciSequence_Cont") {} - - %typemap(out,fragment="SciSwigPairBoolOutputIterator") - std::pair, std::pair { - // TODO: return a Scilab list from the pair (see code for Octave) - } - - %typemap(in,noblock=1,fragment="SciSequence_Cont") - iterator(swig::SciSwigIterator *iter = 0, int res), - reverse_iterator(swig::SciSwigIterator *iter = 0, int res), - const_iterator(swig::SciSwigIterator *iter = 0, int res), - const_reverse_iterator(swig::SciSwigIterator *iter = 0, int res) { - res = SWIG_ConvertPtr((SwigSciObject)$input, %as_voidptrptr(&iter), swig::SciSwigIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::SwigSciIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="SciSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - swig::SciSwigIterator *iter = 0; - int res = SWIG_ConvertPtr((SwigSciObject)$input, %as_voidptrptr(&iter), swig::SciSwigIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("SciSequence_Cont"); -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - -// The Scilab container methods - -%define %swig_container_methods(Container...) -%enddef - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="SciSequence_Cont") -{ -namespace swig { - template - inline void - assign(const SciSeq& sciSeq, Seq* seq) { -%#ifdef SWIG_STD_NOASSIGN_STL - typedef typename SciSeq::value_type value_type; - typename SciSeq::const_iterator it = sciSeq.begin(); - for (;it != sciSeq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } -%#else - seq->assign(sciSeq.begin(), sciSeq.end()); -%#endif - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(const SwigSciObject& obj, sequence **seq) - { - swig_type_info *typeInfo = swig::type_info(); - if (typeInfo) - { - sequence *p; - if (SWIG_ConvertPtr(obj, (void**)&p, typeInfo, 0) == SWIG_OK) - { - if (seq) - *seq = p; - return SWIG_OLDOBJ; - } - } - - if (traits_as_sequence::check(obj) == SWIG_OK) - { - try - { - SciSequence_Cont sciSeq(obj); - if (seq) - { - *seq = new sequence(); - assign(sciSeq, *seq); - return SWIG_NEWOBJ; - } - else - { - return SWIG_ERROR; - } - } - catch (std::exception& e) - { - SWIG_exception(SWIG_RuntimeError, e.what()); - return SWIG_ERROR; - } - } - else - { - return SWIG_ERROR; - } - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static SwigSciObject from(const sequence& seq) - { - %#ifdef SWIG_SCILAB_EXTRA_NATIVE_CONTAINERS - swig_type_info *typeInfo = swig::type_info(); - if (typeInfo) - { - return SWIG_NewPointerObj(new sequence(seq), typeInfo, SWIG_POINTER_OWN); - } - %#endif - - try - { - void *data; - size_type size = seq.size(); - if (traits_from_sequence::create(size, &data) == SWIG_OK) { - const_iterator it; - int index = 0; - for (it = seq.begin(); it != seq.end(); ++it) - { - traits_from_sequenceitem::from(data, index, *it); - index++; - } - return traits_from_sequence::set(size, data); - } - return SWIG_OK; - } - catch (std::exception& e) - { - SWIG_exception(SWIG_RuntimeError, e.what()); - return SWIG_ERROR; - } - } - }; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scidouble.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scidouble.swg deleted file mode 100755 index 1b826330..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scidouble.swg +++ /dev/null @@ -1,108 +0,0 @@ -/* - * DOUBLE SCALAR - */ -%fragment(SWIG_AsVal_frag(double), "header", fragment="SWIG_SciDouble_AsDouble") { -%#define SWIG_AsVal_double(scilabValue, valuePointer) SWIG_SciDouble_AsDouble(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_AsDouble", "header") { -SWIGINTERN int -SWIG_SciDouble_AsDouble(void *pvApiCtx, SwigSciObject iVar, double *pdblValue, char *fname) { - SciErr sciErr; - int iRet = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (!isDoubleType(pvApiCtx, piAddrVar) || isVarComplex(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - if (!isScalar(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A real expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - iRet = getScalarDouble(pvApiCtx, piAddrVar, pdblValue); - if (iRet) { - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(double), "header", fragment="SWIG_SciDouble_FromDouble") { -%#define SWIG_From_double(scilabValue) SWIG_SciDouble_FromDouble(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromDouble", "header") { -SWIGINTERN int -SWIG_SciDouble_FromDouble(void *pvApiCtx, int iVarOut, double dblValue, char *fname) { - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, dblValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * DOUBLE ARRAY - */ - -%fragment("SWIG_SciDouble_AsDoubleArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_AsDoubleArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, double **pdValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar) && !isVarComplex(pvApiCtx, piAddrVar)) { - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, pdValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromDoubleArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromDoubleArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, double *pdblValue) { - SciErr sciErr; - sciErr = createMatrixOfDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, pdblValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_CreateScilabVariable_frag(double), "wrapper") { -SWIGINTERN int -SWIG_CreateScilabVariable_dec(double)(void *pvApiCtx, const char* psVariableName, const double dVariableValue) { - SciErr sciErr; - sciErr = createNamedMatrixOfDouble(pvApiCtx, psVariableName, 1, 1, &dVariableValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - return SWIG_OK; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scienum.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scienum.swg deleted file mode 100755 index cc1f7c97..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scienum.swg +++ /dev/null @@ -1,31 +0,0 @@ -/* - * C-type: enum - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(Enum), "header", fragment="SWIG_Int_AsEnum") { -%#define SWIG_AsVal_Enum(scilabValue, valuePointer) SWIG_Int_AsEnum(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_AsEnum", "header", fragment="SWIG_SciDoubleOrInt32_AsInt") { -SWIGINTERN int -SWIG_Int_AsEnum(void *pvApiCtx, int iVar, int *enumValue, char *fname) { - int iValue = 0; - if (SWIG_SciDoubleOrInt32_AsInt(pvApiCtx, iVar, &iValue, fname) != SWIG_OK) - return SWIG_ERROR; - *enumValue = iValue; - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(Enum), "header", fragment="SWIG_Int_FromEnum") { -%#define SWIG_From_Enum(scilabValue) SWIG_Int_FromEnum(pvApiCtx, SWIG_Scilab_GetOutputPosition(), (int)scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_FromEnum", "header", fragment="SWIG_SciDouble_FromInt") { -SWIGINTERN int -SWIG_Int_FromEnum(void *pvApiCtx, int iVarOut, int enumValue, char *fname) { - if (SWIG_SciDouble_FromInt(pvApiCtx, iVarOut, enumValue, fname) != SWIG_OK) - return SWIG_ERROR; - SWIG_Scilab_SetOutput(pvApiCtx, iVarOut); - return SWIG_OK; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/sciexception.swg b/mac/bin/swig/share/swig/4.1.0/scilab/sciexception.swg deleted file mode 100755 index 1d653b31..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/sciexception.swg +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Exception typemaps (throws) - */ - -%include - -%typemap(throws, noblock=1) int, unsigned int, signed int, - int&,unsigned int&, signed int&, - long, unsigned long, signed long, - short, unsigned short,signed short, - long long, unsigned long long, - unsigned char, signed char, - long&, unsigned long&, signed long&, - short&, unsigned short&, signed short&, - long long&, unsigned long long&, - unsigned char&, signed char&, - size_t, size_t&, - ptrdiff_t, ptrdiff_t& { - char obj[20]; - sprintf(obj, "%d", (int)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) enum SWIGTYPE { - char obj[20]; - sprintf(obj, "%d", (int)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) float, double, - float&, double& { - char obj[20]; - sprintf(obj, "%5.3f", (double)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) bool, bool& { - SWIG_Scilab_Raise_Ex($1 ? "true" : "false", "$type", $descriptor); -} - -%typemap(throws, noblock=1) char*, char[ANY] { - SWIG_Scilab_Raise_Ex($1, "$type", $descriptor); -} - -%typemap(throws, noblock=1) char, char& { - char obj[2]; - sprintf(obj, "%c", (char)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) SWIGTYPE, - SWIGTYPE*, - SWIGTYPE [ANY], - SWIGTYPE & { - SWIG_Scilab_Raise_Ex((char*)NULL, "$type", $descriptor); -} - -%typemap(throws, noblock=1) (...) { - SWIG_exception(SWIG_RuntimeError, "unknown exception"); -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scifloat.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scifloat.swg deleted file mode 100755 index f0af17c0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scifloat.swg +++ /dev/null @@ -1,83 +0,0 @@ -/* - * FLOAT SCALAR - */ - -%fragment(SWIG_AsVal_frag(float), "header", fragment=SWIG_AsVal_frag(double)) { -SWIGINTERN int -SWIG_AsVal_dec(float)(SwigSciObject iVar, float *pfValue) { - double dblValue = 0.0; - if(SWIG_AsVal_dec(double)(iVar, &dblValue) != SWIG_OK) { - return SWIG_ERROR; - } - if (pfValue) - *pfValue = (float) dblValue; - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(float), "header") { -SWIGINTERN int -SWIG_From_dec(float)(float flValue) { - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) - + SWIG_Scilab_GetOutputPosition(), (double)flValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_AsFloatArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_AsFloatArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, float **pfValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - double *pdValue = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar) && !isVarComplex(pvApiCtx, piAddrVar)) { - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - *pfValue = (float *) malloc((*iRows) * (*iCols) * sizeof(float)); - for (i=0; i < (*iRows) * (*iCols); i++) - (*pfValue)[i] = (float) pdValue[i]; - - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } -} -} - -%fragment("SWIG_SciDouble_FromFloatArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromFloatArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, float *pfValue) { - SciErr sciErr; - double *pdValue; - int i; - - pdValue = (double *) malloc(iRows * iCols * sizeof(double)); - for (i = 0; i < iRows * iCols; i++) - pdValue[i] = pfValue[i]; - - sciErr = createMatrixOfDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, pdValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - free(pdValue); - return SWIG_OK; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/sciint.swg b/mac/bin/swig/share/swig/4.1.0/scilab/sciint.swg deleted file mode 100755 index 2d699356..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/sciint.swg +++ /dev/null @@ -1,202 +0,0 @@ -/* - * C-type: int - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(int), "header", fragment="SWIG_SciDoubleOrInt32_AsInt", fragment="") { -%#define SWIG_AsVal_int(scilabValue, valuePointer) SWIG_SciDoubleOrInt32_AsInt(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDoubleOrInt32_AsInt", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt32_AsInt(void *pvApiCtx, SwigSciObject iVar, int *piValue, char *fname) -{ - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - if (piValue) { - int iPrec = 0; - int *piData = NULL; - - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - sciErr = getMatrixOfInteger32(pvApiCtx, piAddrVar, &iRows, &iCols, &piData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - *piValue = *piData; - } - } - else if (iType == sci_matrix) { - if (piValue) { - double *pdData = NULL; - double dValue = 0.0f; - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < INT_MIN) || (dValue > INT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *piValue = (int) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(int), "header", fragment="SWIG_SciDouble_FromInt") { -%#define SWIG_From_int(scilabValue) SWIG_SciDouble_FromInt(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromInt", "header") { -SWIGINTERN int -SWIG_SciDouble_FromInt(void *pvApiCtx, int iVarOut, int iValue, char *fname){ - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) - + iVarOut, (double) iValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: int[] - * Scilab type: double or int32 matrix - */ -%fragment("SWIG_SciDoubleOrInt32_AsIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt32_AsIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, int **piValue, char *fname) { - SciErr sciErr; - int iType = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *piValue = (int*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*piValue)[i] = (int) pdData[i]; - } - else if (iType == sci_ints) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - sciErr = getMatrixOfInteger32(pvApiCtx, piAddrVar, iRows, iCols, piValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const int *piData) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i - -%fragment("SciSwigIterator","header",fragment="") { -namespace swig { - struct stop_iteration { - }; - - struct SciSwigIterator { - private: - SwigSciObject _seq; - - protected: - SciSwigIterator(SwigSciObject seq) : _seq(seq) - { - } - - public: - virtual ~SciSwigIterator() {} - - virtual SwigSciObject value() const = 0; - - virtual SciSwigIterator *incr(size_t n = 1) = 0; - - virtual SciSwigIterator *decr(size_t n = 1) - { - throw stop_iteration(); - } - - virtual ptrdiff_t distance(const SciSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual bool equal (const SciSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual SciSwigIterator *copy() const = 0; - - SwigSciObject next() - { - SwigSciObject obj = value(); - incr(); - return obj; - } - - SwigSciObject previous() - { - decr(); - return value(); - } - - SciSwigIterator *advance(ptrdiff_t n) - { - return (n > 0) ? incr(n) : decr(-n); - } - - bool operator == (const SciSwigIterator& x) const - { - return equal(x); - } - - bool operator != (const SciSwigIterator& x) const - { - return ! operator==(x); - } - - SciSwigIterator* operator ++ () { - incr(); - return this; - } - - SciSwigIterator* operator -- () { - decr(); - return this; - } - - SciSwigIterator* operator + (ptrdiff_t n) const - { - return copy()->advance(n); - } - - SciSwigIterator* operator - (ptrdiff_t n) const - { - return copy()->advance(-n); - } - - ptrdiff_t operator - (const SciSwigIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::SciSwigIterator *"); - init = 1; - } - return desc; - } - }; -} -} - -%fragment("SwigSciIterator_T","header",fragment="",fragment="SciSwigIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - template - class SwigSciIterator_T : public SciSwigIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef SwigSciIterator_T self_type; - - SwigSciIterator_T(out_iterator curr, SwigSciObject seq) - : SciSwigIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const SciSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const SciSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef SwigSciObject result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - template::value_type, - typename FromOper = from_oper > - class SciSwigIteratorOpen_T : public SwigSciIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigSciIterator_T base; - typedef SciSwigIteratorOpen_T self_type; - - SciSwigIteratorOpen_T(out_iterator curr, SwigSciObject seq) - : SwigSciIterator_T(curr, seq) - { - } - - SwigSciObject value() const { - return from(static_cast(*(base::current))); - } - - SciSwigIterator *copy() const - { - return new self_type(*this); - } - - SciSwigIterator *incr(size_t n = 1) - { - while (n--) { - ++base::current; - } - return this; - } - - SciSwigIterator *decr(size_t n = 1) - { - while (n--) { - --base::current; - } - return this; - } - }; - - template::value_type, - typename FromOper = from_oper > - class SciSwigIteratorClosed_T : public SwigSciIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigSciIterator_T base; - typedef SciSwigIteratorClosed_T self_type; - - SciSwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, SwigSciObject seq) - : SwigSciIterator_T(curr, seq), begin(first), end(last) - { - } - - SwigSciObject value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - SciSwigIterator *copy() const - { - return new self_type(*this); - } - - SciSwigIterator *incr(size_t n = 1) - { - while (n--) { - if (base::current == end) { - throw stop_iteration(); - } else { - ++base::current; - } - } - return this; - } - - SciSwigIterator *decr(size_t n = 1) - { - while (n--) { - if (base::current == begin) { - throw stop_iteration(); - } else { - --base::current; - } - } - return this; - } - - private: - out_iterator begin; - out_iterator end; - }; - - template - inline SciSwigIterator* - make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, SwigSciObject seq = SwigSciObject()) - { - return new SciSwigIteratorClosed_T(current, begin, end, seq); - } - - template - inline SciSwigIterator* - make_output_iterator(const OutIter& current, SwigSciObject seq = SwigSciObject()) - { - return new SciSwigIteratorOpen_T(current, seq); - } -} -} - - -%fragment("SciSwigIterator"); -namespace swig -{ -// Throw a StopIteration exception - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws, noblock=1) stop_iteration - { - SWIG_Scilab_Raise(0, "stop_iteration", NULL); - return SWIG_ERROR; - } - -// Mark methods that return new objects - %newobject SciSwigIterator::copy; - %newobject SciSwigIterator::operator + (ptrdiff_t n) const; - %newobject SciSwigIterator::operator - (ptrdiff_t n) const; - - %nodirector SciSwigIterator; - - %catches(swig::stop_iteration) SciSwigIterator::value() const; - %catches(swig::stop_iteration) SciSwigIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) SciSwigIterator::decr(size_t n = 1); - %catches(std::invalid_argument) SciSwigIterator::distance(const SciSwigIterator &x) const; - %catches(std::invalid_argument) SciSwigIterator::equal (const SciSwigIterator &x) const; - %catches(swig::stop_iteration) SciSwigIterator::next(); - %catches(swig::stop_iteration) SciSwigIterator::previous(); - %catches(swig::stop_iteration) SciSwigIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) SciSwigIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) SciSwigIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) SciSwigIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) SciSwigIterator::operator - (ptrdiff_t n) const; - - %ignore SciSwigIterator::operator==; - %ignore SciSwigIterator::operator!=; - %ignore SciSwigIterator::operator++; - %ignore SciSwigIterator::operator--; - %ignore SciSwigIterator::operator+; - %ignore SciSwigIterator::operator-; - - struct SciSwigIterator - { - protected: - SciSwigIterator(SwigSciObject seq); - - public: - virtual ~SciSwigIterator(); - - virtual SwigSciObject value() const = 0; - - virtual SciSwigIterator *incr(size_t n = 1) = 0; - - virtual SciSwigIterator *decr(size_t n = 1); - - virtual ptrdiff_t distance(const SciSwigIterator &x) const; - - virtual bool equal (const SciSwigIterator &x) const; - - virtual SciSwigIterator *copy() const = 0; - - SwigSciObject next(); - SwigSciObject previous(); - SciSwigIterator *advance(ptrdiff_t n); - - bool operator == (const SciSwigIterator& x) const; - bool operator != (const SciSwigIterator& x) const; - SciSwigIterator* operator ++ (); - SciSwigIterator* operator -- (); - SciSwigIterator* operator + (ptrdiff_t n) const; - SciSwigIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const SciSwigIterator& x) const; - }; -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scilab.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scilab.swg deleted file mode 100755 index 3b5f6e81..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scilab.swg +++ /dev/null @@ -1,6 +0,0 @@ -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scilist.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scilist.swg deleted file mode 100755 index 513f40b6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scilist.swg +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Scilab list related functions - * - */ - -%fragment("SWIG_ScilabList", "header") -{ -SWIGINTERN int -SWIG_GetScilabList(SwigSciObject obj, int **piListAddr) -{ - SciErr sciErr; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -SWIGINTERN int -SWIG_GetScilabListSize(SwigSciObject obj, int *piListSize) -{ - SciErr sciErr; - int *piListAddr; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getListItemNumber(pvApiCtx, piListAddr, piListSize); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -SWIGINTERN int -SWIG_GetScilabListAndSize(SwigSciObject obj, int **piListAddr, int *piListSize) -{ - SciErr sciErr; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getListItemNumber(pvApiCtx, *piListAddr, piListSize); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -SWIGINTERN int -SWIG_CheckScilabList(SwigSciObject obj) -{ - SciErr sciErr; - int *piListAddr; - int iType; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piListAddr, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if ((iType != sci_list) && (iType != sci_tlist) && (iType != sci_mlist)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A list is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -} - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scilong.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scilong.swg deleted file mode 100755 index 4e55be53..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scilong.swg +++ /dev/null @@ -1,123 +0,0 @@ -/* - * C-type: long - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(long), "header", fragment="SWIG_SciDoubleOrInt32_AsLong", fragment="") { -%#define SWIG_AsVal_long(scilabValue, valuePointer) SWIG_SciDoubleOrInt32_AsLong(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()); -} -%fragment("SWIG_SciDoubleOrInt32_AsLong", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt32_AsLong(void *pvApiCtx, SwigSciObject iVar, long *plValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - int iPrec = 0; - int *piData = NULL; - - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - sciErr = getMatrixOfInteger32(pvApiCtx, piAddrVar, &iRows, &iCols, &piData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - *plValue = (long) *piData; - } - else if (iType == sci_matrix) { - double *pdData = NULL; - double dValue = 0.0f; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < LONG_MIN) || (dValue > LONG_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *plValue = (long) dValue; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(long), "header", fragment="SWIG_SciDouble_FromLong") { -%#define SWIG_From_long(scilabValue) SWIG_SciDouble_FromLong(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromLong", "header") { -SWIGINTERN int -SWIG_SciDouble_FromLong(void *pvApiCtx, int iVarOut, long lValue, char *fname) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) lValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - - -%fragment("SWIG_SciDouble_FromLongArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromLongArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const long *plData) { - SciErr sciErr; - int i; - double *pdValues = NULL; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i - -// in (bool *IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, bool *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, bool *IN) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (bool *IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, bool *IN) - -%typemap(in, noblock=1) (int IN_SIZE, bool *IN) (int rowCount, int colCount) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (bool**) malloc(sizeof(bool*)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(freearg, noblock=1) (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - free(*$1); - free($1); - free($2); - free($3); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int*) malloc(sizeof(int)); - $3 = (bool**) malloc(sizeof(bool*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ - free($1); - free($2); - free(*$3); - free($3); -} - - -// out (bool **OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (bool **OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit, noblock=1) (bool **OUT, int *OUT_SIZE) -{ - $1 = (bool**) malloc(sizeof(bool*)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (bool **OUT, int *OUT_SIZE) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (bool **OUT, int *OUT_SIZE) -{ - free(*$1); - free($1); - free($2); -} - - -// out (int *OUT_SIZE, bool **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, bool **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, bool **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (bool**) malloc(sizeof(bool*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (int *OUT_SIZE, bool **OUT) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_SIZE, bool **OUT) -{ - free($1); - free(*$2); - free($2); -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scimatrixchar.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scimatrixchar.swg deleted file mode 100755 index 37f68339..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scimatrixchar.swg +++ /dev/null @@ -1,199 +0,0 @@ -/* - * C-type: char* - * Scilab type: string matrix - */ - -%include - -// in (char **IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, char **IN) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, char **IN) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (char **IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, char **IN) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN) (int rowCount, int colCount) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (char***) malloc(sizeof(char**)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - { - int i; - for (i = 0; i < (*$2) * (*$3); i++) - free((*$1)[i]); - } - free(*$1); - free($1); - free($2); - free($3); -} - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ - $1 = (char***) malloc(sizeof(char**)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int**) malloc(sizeof(int*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ - free($1); - free($2); - { - int i; - for (i = 0; i < (*$1) * (*$2); i++) - free((*$3)[i]); - } - free(*$3); - free($3); -} - - -// out (char ***OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (char ***OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit, noblock=1) (char ***OUT, int *OUT_SIZE) -{ - $1 = (char***) malloc(sizeof(char**)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(freearg, noblock=1) (char ***OUT, int *OUT_SIZE) -{ - { - int i; - for (i = 0; i < *$2; i++) - free((*$1)[i]); - } - free(*$1); - free($1); - free($2); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (char ***OUT, int *OUT_SIZE) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, char **IN) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, 1, &$1, &$2, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// out (int *OUT_SIZE, char ***OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, char ***OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, char ***OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (char***) malloc(sizeof(char**)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (int *OUT_SIZE, char ***OUT) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_SIZE, char ***OUT) -{ - free($1); - { - int i; - for (i = 0; i < *$1; i++) - free((*$2)[i]); - } - free(*$2); - free($2); -} - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scimatrixdouble.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scimatrixdouble.swg deleted file mode 100755 index 9444a807..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scimatrixdouble.swg +++ /dev/null @@ -1,170 +0,0 @@ -/* - * C-type: double array - * Scilab type: double matrix - */ - -%include - -// in (double *IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, double *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, double *IN) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (double *IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, double *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_SIZE, double *IN) (int rowCount, int colCount) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (double**) malloc(sizeof(double*)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(freearg, noblock=1) (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - free(*$1); - free($1); - free($2); - free($3); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int*) malloc(sizeof(int)); - $3 = (double**) malloc(sizeof(double*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (int *IN_ROWCOUNT, int *IN_COLCOUNT, double **OUT) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) -{ - free($1); - free($2); - free(*$3); - free($3); -} - - -// out (double **OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (double **OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit, noblock=1) (double **OUT, int *OUT_SIZE) -{ - $1 = (double**) malloc(sizeof(double*)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (double **OUT, int *OUT_SIZE) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (double **OUT, int *OUT_SIZE) -{ - free(*$1); - free($1); - free($2); -} - - -// out (int *OUT_SIZE, double **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, double **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, double **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (double**) malloc(sizeof(double*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (int *OUT_SIZE, double **OUT) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_SIZE, double **OUT) -{ - free($1); - free(*$2); - free($2); -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scimatrixint.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scimatrixint.swg deleted file mode 100755 index e304d4f6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scimatrixint.swg +++ /dev/null @@ -1,175 +0,0 @@ -/* - * C-type: int array - * Scilab type: 32-bit integer matrix - */ - -%include - -// in (int *IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, int *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, int *IN) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - - -// in (int *IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - - -// in (int IN_SIZE, int *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_SIZE, int *IN) (int rowCount, int colCount) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (int**) malloc(sizeof(int*)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - free(*$1); - free($1); - free($2); - free($3); -} - - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int**) malloc(sizeof(int*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ - free($1); - free($2); - free(*$3); - free($3); -} - - -// out (int **OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (int **OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit) (int **OUT, int *OUT_SIZE) -{ - $1 = (int**) malloc(sizeof(int*)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int **OUT, int *OUT_SIZE) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int **OUT, int *OUT_SIZE) -{ - free(*$1); - free($1); - free($2); -} - - -// out (int *OUT_SIZE, int **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, int **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, int **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int**) malloc(sizeof(int*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int *OUT_SIZE, int **OUT) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *IN_SIZE, int **OUT) -{ - free($1); - free(*$2); - free($2); -} - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scimisctypes.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scimisctypes.swg deleted file mode 100755 index fe75e156..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scimisctypes.swg +++ /dev/null @@ -1,69 +0,0 @@ -// Other primitive such as size_t and ptrdiff_t - -/* - * C-type: size_t - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(size_t), "header", fragment="SWIG_Int_AsSize") { -%#define SWIG_AsVal_size_t(scilabValue, valuePointer) SWIG_Int_AsSize(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_AsSize", "header", fragment=SWIG_AsVal_frag(int)) -{ -SWIGINTERN int -SWIG_Int_AsSize(void *pvApiCtx, SwigSciObject iVar, size_t *piValue, char *fname) { - int iValue = 0; - if (SWIG_AsVal_dec(int)(iVar, &iValue) != SWIG_OK) - return SWIG_ERROR; - - if (piValue) - *piValue = (size_t) iValue; - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(size_t), "header", fragment="SWIG_Int_FromSize") { -%#define SWIG_From_size_t(scilabValue) SWIG_Int_FromSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_FromSize", "header", fragment=SWIG_From_frag(int)) -{ -SWIGINTERN int -SWIG_Int_FromSize(void *pvApiCtx, int iVarOut, size_t iValue, char *fname) { - return SWIG_From_dec(int)((int)iValue); -} -} - -/* - * C-type: ptrdiff_t - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(ptrdiff_t), "header", fragment="SWIG_Int_AsPtrDiff") { -%#define SWIG_AsVal_ptrdiff_t(scilabValue, valuePointer) SWIG_Int_AsPtrDiff(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_AsPtrDiff", "header", fragment=SWIG_AsVal_frag(int)) -{ -SWIGINTERN int -SWIG_Int_AsPtrDiff(void *pvApiCtx, SwigSciObject iVar, ptrdiff_t *piValue, char *fname) { - int iValue = 0; - if (SWIG_AsVal_dec(int)(iVar, &iValue) != SWIG_OK) - return SWIG_ERROR; - - if (piValue) - *piValue = (ptrdiff_t) iValue; - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(ptrdiff_t), "header", fragment="SWIG_Int_FromPtrDiff") { -%#define SWIG_From_ptrdiff_t(scilabValue) SWIG_Int_FromPtrDiff(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_FromPtrDiff", "header", fragment=SWIG_From_frag(int)) { -SWIGINTERN int -SWIG_Int_FromPtrDiff(void *pvApiCtx, int iVarOut, ptrdiff_t iValue, char *fname) { - return SWIG_From_dec(int)((int)iValue); -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scipointer.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scipointer.swg deleted file mode 100755 index 94ca4ef3..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scipointer.swg +++ /dev/null @@ -1,32 +0,0 @@ -/* - * POINTER - */ -%fragment("SWIG_ConvertPtr", "header") { -#define SWIG_ConvertPtr(scilabValue, voidPointer, pointerDescriptor, flags) SwigScilabPtrToObject(pvApiCtx, scilabValue, voidPointer, pointerDescriptor, flags, SWIG_Scilab_GetFuncName()) -} - -%fragment("SWIG_NewPointerObj", "header") { -#define SWIG_NewPointerObj(pointer, pointerDescriptor, flags) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, flags, NULL) -} - -/* - * FUNCTION POINTER - */ -%fragment("SWIG_ConvertFunctionPtr", "header") { -#define SWIG_ConvertFunctionPtr(scilabValue, voidPointer, pointerDescriptor) SwigScilabPtrToObject(pvApiCtx, scilabValue, voidPointer, pointerDescriptor, 0, SWIG_Scilab_GetFuncName()) -} - -%fragment("SWIG_NewFunctionPtrObj", "header") { -#define SWIG_NewFunctionPtrObj(pointer, pointerDescriptor) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, 0, NULL) -} -// No fragment used here, the functions "SwigScilabPtrToObject" and "SwigScilabPtrFromObject" are defined in sciruntime.swg - -/* - * C++ member pointers, ie, member methods - */ -%fragment("SWIG_NewMemberObj", "header") { -#define SWIG_NewMemberObj(ptr, sz, tp) SWIG_Scilab_NewMemberObj(pvApiCtx, $result, ptr, sz, tp) -} -%fragment("SWIG_ConvertMember", "header") { -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Scilab_ConvertPacked(pvApiCtx, obj, ptr, sz, ty, SWIG_Scilab_GetFuncName()) -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/sciprimtypes.swg b/mac/bin/swig/share/swig/4.1.0/scilab/sciprimtypes.swg deleted file mode 100755 index b5e30d93..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/sciprimtypes.swg +++ /dev/null @@ -1,23 +0,0 @@ -%include -%include - -%include - -%include -%include - -%include -%include - -%include -%include - -%include -%include -%include - -%include - -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scirun.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scirun.swg deleted file mode 100755 index 586d5f16..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scirun.swg +++ /dev/null @@ -1,532 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Scilab support runtime - * -----------------------------------------------------------------------------*/ - -/* Scilab version macro */ - -#include "version.h" -#define SWIG_SCILAB_VERSION (SCI_VERSION_MAJOR * 100) + (SCI_VERSION_MINOR * 10) + SCI_VERSION_MAINTENANCE - -/* Scilab standard headers */ - -#ifdef __cplusplus -extern "C" { -#endif -#include "api_scilab.h" -#if SWIG_SCILAB_VERSION < 540 -#define __USE_DEPRECATED_STACK_FUNCTIONS__ -#include "stack-c.h" -#endif -#if SWIG_SCILAB_VERSION < 600 -#include "MALLOC.h" -#endif -#include "Scierror.h" -#include "localization.h" -#include "freeArrayOfString.h" -#include -#include -#ifdef __cplusplus -} -#endif - -/* Gateway signature */ - -#if SWIG_SCILAB_VERSION >= 600 -#define SWIG_GatewayParameters char* fname, void *pvApiCtx -#define SWIG_GatewayArguments fname, pvApiCtx -#else -#define SWIG_GatewayParameters char* fname, unsigned long fname_len -#define SWIG_GatewayArguments fname, fname_len -#endif - -/* Function name management functions */ - -#include -static char *SwigFuncName = NULL; -static char *SWIG_Scilab_GetFuncName(void) { - return SwigFuncName; -} -static void SWIG_Scilab_SetFuncName(char *funcName) { - free(SwigFuncName); - SwigFuncName = NULL; - if (funcName) { - SwigFuncName = (char *)malloc(strlen(funcName) + 1); - if (SwigFuncName) - strcpy(SwigFuncName, funcName); - } -} - -/* Api context management functions */ - -#if SWIG_SCILAB_VERSION >= 600 -static void *pvApiCtx = NULL; -static void SWIG_Scilab_SetApiContext(void *apiCtx) { - pvApiCtx = apiCtx; -} -#else -#define SWIG_Scilab_SetApiContext(apiCtx) -#endif - -/* Argument management functions */ - -#if SWIG_SCILAB_VERSION >= 540 -#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) -#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) -#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) -#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) -#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos -#else -#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument) -#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckRhs(minInputArgument, 256) -#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument) -#define SWIG_NbInputArgument(pvApiCtx) Rhs -#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) LhsVar(outputArgumentPos) = argumentPos -#endif - -typedef int SwigSciObject; - -static int SwigOutputPosition = -1; -static int SWIG_Scilab_GetOutputPosition(void) { - return SwigOutputPosition; -} -static void SWIG_Scilab_SetOutputPosition(int outputPosition) { - SwigOutputPosition = outputPosition; -} - -SWIGRUNTIME int -SWIG_Scilab_SetOutput(void *pvApiCtx, SwigSciObject output) { - int outputPosition = SWIG_Scilab_GetOutputPosition(); - if (outputPosition < 0) - return SWIG_ERROR; - SWIG_AssignOutputArgument(pvApiCtx, outputPosition, - SWIG_NbInputArgument(pvApiCtx) + outputPosition); - return SWIG_OK; -} - -/* Error functions */ - -#define SCILAB_API_ARGUMENT_ERROR 999 - -SWIGINTERN const char* -SWIG_Scilab_ErrorType(int code) { - switch(code) { - case SWIG_MemoryError: - return "MemoryError"; - case SWIG_IOError: - return "IOError"; - case SWIG_RuntimeError: - return "RuntimeError"; - case SWIG_IndexError: - return "IndexError"; - case SWIG_TypeError: - return "TypeError"; - case SWIG_DivisionByZero: - return "ZeroDivisionError"; - case SWIG_OverflowError: - return "OverflowError"; - case SWIG_SyntaxError: - return "SyntaxError"; - case SWIG_ValueError: - return "ValueError"; - case SWIG_SystemError: - return "SystemError"; - case SWIG_AttributeError: - return "AttributeError"; - default: - return "RuntimeError"; - } -} -#define SWIG_ErrorType(code) SWIG_Scilab_ErrorType(code) - -#ifndef SWIG_SCILAB_ERROR -#define SWIG_SCILAB_ERROR 20000 -#endif - -SWIGINTERN void -SWIG_Scilab_Error(int code, const char *msg) { - Scierror(SWIG_SCILAB_ERROR - code, _("SWIG/Scilab: %s: %s\n"), SWIG_Scilab_ErrorType(code), msg); -} - -#define SWIG_Error(code, msg) SWIG_Scilab_Error(code, msg) - -#define SWIG_fail return SWIG_ERROR; - -SWIGRUNTIME void -SWIG_Scilab_Raise_Ex(const char *obj, const char *type, swig_type_info *descriptor) { - if (type) { - if (obj) - Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occurred: %s\n", type, obj); - else - Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occurred.\n", type); - } -} - -SWIGRUNTIME void -SWIG_Scilab_Raise(const int obj, const char *type, swig_type_info *descriptor) { - Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occurred.\n", type); -} - -/* Module initialization */ - -static int swig_module_initialized = 0; - -SWIGRUNTIME int -SWIG_Module_Initialized() { - return swig_module_initialized; -} - -/* Pointer conversion functions */ - -SWIGRUNTIME swig_type_info * -SWIG_Scilab_TypeQuery(const char *name); - -SWIGINTERN int -SwigScilabCheckPtr(void *pvApiCtx, int iVar, swig_type_info *descriptor, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - int iType = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_mlist) { - int iItemCount = 0; - void *pvTypeinfo = NULL; - - sciErr = getListItemNumber(pvApiCtx, piAddrVar, &iItemCount); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iItemCount < 3) { - return SWIG_ERROR; - } - - sciErr = getPointerInList(pvApiCtx, piAddrVar, 2, &pvTypeinfo); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (descriptor) { - swig_cast_info *cast = SWIG_TypeCheck(SWIG_TypeName((swig_type_info*)pvTypeinfo), descriptor); - return (cast != NULL); - } - else { - return SWIG_ERROR; - } - } - else { - return (iType == sci_pointer); - } -} - -SWIGINTERN int -SwigScilabPtrToObject(void *pvApiCtx, int iVar, void **pvObj, swig_type_info *descriptor, int flags, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - int iType = 0; - void *pvPtr = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_mlist) { - int iItemCount = 0; - void *pvTypeinfo = NULL; - - sciErr = getListItemNumber(pvApiCtx, piAddrVar, &iItemCount); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iItemCount < 3) { - return SWIG_ERROR; - } - - sciErr = getPointerInList(pvApiCtx, piAddrVar, 2, &pvTypeinfo); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getPointerInList(pvApiCtx, piAddrVar, 3, &pvPtr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (pvPtr) { - if (descriptor) { - swig_cast_info *cast = SWIG_TypeCheck(SWIG_TypeName((swig_type_info *)pvTypeinfo), descriptor); - if (cast) { - int newmemory = 0; - pvPtr = SWIG_TypeCast(cast, pvPtr, &newmemory); - // TODO newmemory - } - else { - return SWIG_ERROR; - } - } - } - } - else if (iType == sci_pointer) { - sciErr = getPointer(pvApiCtx, piAddrVar, &pvPtr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - return SWIG_ERROR; - } - - if (pvObj) { - *pvObj = pvPtr; - if (pvPtr) - return SWIG_OK; - else - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - else { - return SWIG_ERROR; - } -} - -SWIGRUNTIMEINLINE int -SwigScilabPtrFromObject(void *pvApiCtx, int iVarOut, void *pvObj, swig_type_info *descriptor, int flags, const char *pstTypeName) { - SciErr sciErr; - - if (descriptor) { - int *piMListAddr = NULL; - - sciErr = createMList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, 3, &piMListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (pstTypeName == NULL) { - pstTypeName = SWIG_TypeName(descriptor); - } - - sciErr = createMatrixOfStringInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 1, 1, 1, &pstTypeName); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = createPointerInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 2, descriptor); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = createPointerInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 3, pvObj); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - sciErr = createPointer(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, pvObj); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - - return SWIG_OK; -} - -/* Pointer argument conversions */ - - -SWIGRUNTIME int -SWIG_Scilab_ConvertPacked(void *pvApiCtx, int iVar, void *ptr, int sz, swig_type_info *ty, char *fname) { - swig_cast_info *tc; - int *piAddrVar = NULL; - char *pstString = NULL; - char *pstStringPtr = NULL; - SciErr sciErr; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (getAllocatedSingleString(pvApiCtx, piAddrVar, &pstString)) { - return SWIG_ERROR; - } - - /* Pointer values must start with leading underscore */ - if (*pstString != '_') { - freeAllocatedSingleString(pstString); - return SWIG_ERROR; - } - - pstStringPtr = pstString; - pstStringPtr++; - pstStringPtr = (char*)SWIG_UnpackData(pstStringPtr, ptr, sz); - - if (ty) { - if (!pstStringPtr) { - freeAllocatedSingleString(pstString); - return SWIG_ERROR; - } - tc = SWIG_TypeCheck(pstStringPtr, ty); - if (!tc) { - freeAllocatedSingleString(pstString); - return SWIG_ERROR; - } - } - - freeAllocatedSingleString(pstString); - return SWIG_OK; -} - -SWIGRUNTIME int -SWIG_Scilab_NewMemberObj(void *pvApiCtx, int iVarOut, void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - - if ((2*sz + 1 + strlen(type->name)) > 1000) { - return SWIG_ERROR; - } - *(r++) = '_'; - r = SWIG_PackData(r, ptr, sz); - strcpy(r, type->name); - - if (createSingleString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, &result[0])) - return SWIG_ERROR; - - return SWIG_OK; -} - - - - -/* - * Pointer utility functions - */ - -#include - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT int SWIG_this(SWIG_GatewayParameters) { - void *ptrValue = NULL; - if (SwigScilabPtrToObject(pvApiCtx, 1, &ptrValue, NULL, 0, fname) == SWIG_OK) { - SWIG_Scilab_SetOutputPosition(1); - return SWIG_Scilab_SetOutput(pvApiCtx, - createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + 1, - (double)(uintptr_t)ptrValue)); - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The value is not a pointer.\n"), fname, 1); - return SWIG_ERROR; - } -} - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT int SWIG_ptr(SWIG_GatewayParameters) { - if (SWIG_NbInputArgument(pvApiCtx) > 0) { - SciErr sciErr; - int *piAddrVar1 = NULL; - int iTypeVar1 = 0; - char *pstInputPtrTypeName = NULL; - char *pstOutputMListTypeName = NULL; - if (SWIG_NbInputArgument(pvApiCtx) > 2) { - int *piAddrVar2 = NULL; - int *piAddrVar3 = NULL; - sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddrVar2); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (getAllocatedSingleString(pvApiCtx, piAddrVar2, &pstInputPtrTypeName)) { - return SWIG_ERROR; - } - sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddrVar3); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (getAllocatedSingleString(pvApiCtx, piAddrVar3, &pstOutputMListTypeName)) { - return SWIG_ERROR; - } - } - - sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddrVar1); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - sciErr = getVarType(pvApiCtx, piAddrVar1, &iTypeVar1); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if ((iTypeVar1 == sci_pointer) || (iTypeVar1 == sci_mlist)) { - void *ptrValue = NULL; - if (SwigScilabPtrToObject(pvApiCtx, 1, &ptrValue, SWIG_Scilab_TypeQuery(pstInputPtrTypeName), 0, (char *) "SWIG_ptr") == SWIG_OK) { - SWIG_Scilab_SetOutputPosition(1); - return SWIG_Scilab_SetOutput(pvApiCtx, - SwigScilabPtrFromObject(pvApiCtx, 1, ptrValue, SWIG_Scilab_TypeQuery(pstInputPtrTypeName), 0, pstOutputMListTypeName)); - } - else { - return SWIG_ERROR; - } - } - else if (iTypeVar1 == sci_matrix) { - double dValue = 0; - if (getScalarDouble(pvApiCtx, piAddrVar1, &dValue) == 0) { - if (dValue != (uintptr_t)dValue) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a pointer.\n"), fname, 1); - return SWIG_ValueError; - } - if ((dValue < 0) || (dValue > ULONG_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a pointer.\n"), fname, 1); - return SWIG_OverflowError; - } - SWIG_Scilab_SetOutputPosition(1); - return SWIG_Scilab_SetOutput(pvApiCtx, - SwigScilabPtrFromObject(pvApiCtx, 1, (void *) (uintptr_t)dValue, SWIG_Scilab_TypeQuery(pstInputPtrTypeName), 0, pstOutputMListTypeName)); - } - else { - return SWIG_TypeError; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A mlist, pointer or a double expected.\n"), (char *) "SWIG_ptr", 1); - return SWIG_TypeError; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: A mlist, pointer, or a double expected.\n"), "SWIG_ptr", 1); - return SWIG_TypeError; - } -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/sciruntime.swg b/mac/bin/swig/share/swig/4.1.0/scilab/sciruntime.swg deleted file mode 100755 index e772926f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/sciruntime.swg +++ /dev/null @@ -1,47 +0,0 @@ -%insert(runtime) "swigrun.swg"; -%insert(runtime) "swigerrors.swg"; - -%insert(runtime) "scirun.swg"; - -%insert(init) %{ -/* Module management functions */ - -#define SWIG_GetModule(clientdata) SWIG_Scilab_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Scilab_SetModule(pointer) - -SWIGRUNTIME swig_module_info* -SWIG_Scilab_GetModule(void) { - return NULL; -} - -SWIGRUNTIME void -SWIG_Scilab_SetModule(swig_module_info *swig_module) { -} -%} - -%insert(init) "swiginit.swg" - -%insert(init) %{ -SWIGRUNTIME swig_type_info * -SWIG_Scilab_TypeQuery(const char *name) { - if (SWIG_Module_Initialized()) { - if (name) { - return SWIG_TypeQuery(name); - } - } - else { - SWIG_Error(SWIG_RuntimeError, "the module is not initialized"); - } - return NULL; -} -%} - -%insert(init) %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT int SWIG__Init(SWIG_GatewayParameters) { - SWIG_InitializeModule(NULL); - SWIG_CreateScilabVariables(pvApiCtx); - swig_module_initialized = 1; -%} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scisequence.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scisequence.swg deleted file mode 100755 index 5fe0fdbe..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scisequence.swg +++ /dev/null @@ -1,195 +0,0 @@ -/* - * - * Scilab sequence conversions - * - */ - -#define SWIG_Traits_Sequence_frag(Type) %fragment_name(AsVal_Traits_Sequence, Type) - -#define SWIG_AsCheck_Sequence_frag(Type...) %fragment_name(AsCheck_Sequence, Type) -#define SWIG_AsCheck_Sequence_dec(Type...) %symbol_name(AsCheck_Sequence, Type) -#define SWIG_AsGet_Sequence_frag(Type...) %fragment_name(AsGet_Sequence, Type) -#define SWIG_AsGet_Sequence_dec(Type...) %symbol_name(AsGet_Sequence, Type) -#define SWIG_AsSize_Sequence_frag(Type...) %fragment_name(AsSize_Sequence, Type) -#define SWIG_AsSize_Sequence_dec(Type...) %symbol_name(AsSize_Sequence, Type) -#define SWIG_FromCreate_Sequence_frag(Type...) %fragment_name(FromCreate_Sequence, Type) -#define SWIG_FromCreate_Sequence_dec(Type...) %symbol_name(FromCreate_Sequence, Type) -#define SWIG_FromSet_Sequence_frag(Type...) %fragment_name(FromSet_Sequence, Type) -#define SWIG_FromSet_Sequence_dec(Type...) %symbol_name(FromSet_Sequence, Type) - -#define SWIG_Traits_SequenceItem_frag(Type) %fragment_name(AsVal_Traits_SequenceItem, Type) -#define SWIG_AsVal_SequenceItem_frag(Type...) %fragment_name(AsVal_SequenceItem, Type) -#define SWIG_AsVal_SequenceItem_dec(Type...) %symbol_name(AsVal_SequenceItem, Type) -#define SWIG_From_SequenceItem_frag(Type...) %fragment_name(From_SequenceItem, Type) -#define SWIG_From_SequenceItem_dec(Type...) %symbol_name(From_SequenceItem, Type) - -%include -%include -%include -%include -%include -%include - -// -// Sequence conversion -// - -%fragment(SWIG_Traits_Sequence_frag(ptr), "header", - fragment=SWIG_AsCheck_Sequence_frag(ptr), - fragment=SWIG_AsGet_Sequence_frag(ptr), - fragment=SWIG_AsSize_Sequence_frag(ptr), - fragment=SWIG_FromCreate_Sequence_frag(ptr), - fragment=SWIG_FromSet_Sequence_frag(ptr), - fragment="StdTraits", - fragment="") { - -namespace swig { - // Error returned for sequence containers of default item type - template struct traits_as_sequence { - static int check(SwigSciObject obj) { - throw std::invalid_argument("The container data type is not supported."); - } - static int get(SwigSciObject obj, void **sequence) { - throw std::invalid_argument("The container data type is not supported."); - } - static int size(SwigSciObject obj, int *size) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - template struct traits_from_sequence { - static int create(int size, void **sequence) { - throw std::invalid_argument("The container data type is not supported."); - } - static SwigSciObject set(int size, void *sequence) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - - // Support sequence containers of pointers - template struct traits_as_sequence { - static int check(SwigSciObject obj) { - return SWIG_AsCheck_Sequence_dec(ptr)(obj); - } - static int get(SwigSciObject obj, void **sequence) { - return SWIG_AsGet_Sequence_dec(ptr)(obj, (int **)sequence); - } - static int size(SwigSciObject obj, int *size) { - return SWIG_AsSize_Sequence_dec(ptr)(obj, size); - } - }; - template struct traits_from_sequence { - static int create(int size, void **sequence) { - return SWIG_FromCreate_Sequence_dec(ptr)(size, (uintptr_t **)sequence); - } - static SwigSciObject set(int size, void *sequence) { - return SWIG_FromSet_Sequence_dec(ptr)(size, (uintptr_t *)sequence); - } - }; -} -} - -%define %traits_sequence(CppType, ScilabType) - %fragment(SWIG_Traits_Sequence_frag(CppType), "header", - fragment=SWIG_Traits_Sequence_frag(ptr), - fragment=SWIG_AsCheck_Sequence_frag(CppType), - fragment=SWIG_AsGet_Sequence_frag(CppType), - fragment=SWIG_AsSize_Sequence_frag(CppType), - fragment=SWIG_FromCreate_Sequence_frag(CppType), - fragment=SWIG_FromSet_Sequence_frag(CppType)) { - -namespace swig { - template <> struct traits_as_sequence { - static int check(SwigSciObject obj) { - return SWIG_AsCheck_Sequence_dec(CppType)(obj); - } - static int get(SwigSciObject obj, void **sequence) { - return SWIG_AsGet_Sequence_dec(CppType)(obj, (ScilabType **)sequence); - } - static int size(SwigSciObject obj, int *size) { - return SWIG_AsSize_Sequence_dec(CppType)(obj, size); - } - }; - template <> struct traits_from_sequence { - static int create(int size, void **sequence) { - return SWIG_FromCreate_Sequence_dec(CppType)(size, (ScilabType **)sequence); - } - static SwigSciObject set(int size, void *sequence) { - return SWIG_FromSet_Sequence_dec(CppType)(size, (ScilabType *)sequence); - } - }; -} -} -%enddef - - -// -// Sequence item conversion -// - -%fragment(SWIG_Traits_SequenceItem_frag(ptr), "header", - fragment=SWIG_AsVal_SequenceItem_frag(ptr), - fragment=SWIG_From_SequenceItem_frag(ptr), - fragment="StdTraits", - fragment="") { - -namespace swig { - // Error returned for sequence containers of default item type - template struct traits_asval_sequenceitem { - static T asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - template struct traits_from_sequenceitem { - static int from(void *pSequence, int iItemIndex, T itemValue) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - - // Support sequence containers of pointers - template struct traits_asval_sequenceitem { - static T* asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - return static_cast(SWIG_AsVal_SequenceItem_dec(ptr)(obj, (int *)pSequence, iItemIndex)); - } - }; - template struct traits_from_sequenceitem { - static int from(void *pSequence, int iItemIndex, T *itemValue) { - return SWIG_From_SequenceItem_dec(ptr)((uintptr_t *)pSequence, iItemIndex, (uintptr_t) itemValue); - } - }; -} -} - -%define %traits_sequenceitem(CppType, ScilabType) - %fragment(SWIG_Traits_SequenceItem_frag(CppType), "header", - fragment=SWIG_Traits_SequenceItem_frag(ptr), - fragment=SWIG_AsVal_SequenceItem_frag(CppType), - fragment=SWIG_From_SequenceItem_frag(CppType)) { - -namespace swig { - template <> struct traits_asval_sequenceitem { - static CppType asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - return SWIG_AsVal_SequenceItem_dec(CppType)(obj, (ScilabType *)pSequence, iItemIndex); - } - }; - template <> struct traits_from_sequenceitem { - static int from(void *pSequence, int iItemIndex, CppType itemValue) { - return SWIG_From_SequenceItem_dec(CppType)((ScilabType *)pSequence, iItemIndex, itemValue); - } - }; -} -} -%enddef - -%define %add_traits_sequence(CppType, ScilabType) - %traits_sequence(CppType, ScilabType); - %fragment(SWIG_Traits_Sequence_frag(CppType)); - %traits_sequenceitem(CppType, ScilabType); - %fragment(SWIG_Traits_SequenceItem_frag(CppType)); -%enddef - -%add_traits_sequence(int, int); -%add_traits_sequence(double, double); -%add_traits_sequence(float, float); -%add_traits_sequence(std::string, char*); -%add_traits_sequence(bool, int); - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scisequencebool.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scisequencebool.swg deleted file mode 100755 index b7d07844..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scisequencebool.swg +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Scilab matrix of bool <-> C++ bool container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(bool), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(bool)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isBooleanType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(bool), "header", - fragment="SWIG_SciBoolean_AsIntArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(bool)(SwigSciObject obj, int **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciBoolean_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(bool), "header", - fragment="SWIG_SciBoolean_AsIntArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(bool)(SwigSciObject obj, int *piSize) { - int *piMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciBoolean_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &piMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: An integer vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(bool), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(bool)(int size, int **pSequence) { - *pSequence = new int[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(bool), "header", - fragment="SWIG_SciBoolean_FromIntArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(bool)(int size, int *pSequence) { - SwigSciObject obj = SWIG_SciBoolean_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (int *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(bool), "header") { - -SWIGINTERN bool -SWIG_AsVal_SequenceItem_dec(bool)(SwigSciObject obj, int *pSequence, int iItemIndex) { - return (bool) pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(bool), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(bool)(int *pSequence, int iItemIndex, bool itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scisequencedouble.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scisequencedouble.swg deleted file mode 100755 index 29cc52d6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scisequencedouble.swg +++ /dev/null @@ -1,99 +0,0 @@ -/* - * - * Scilab matrix of double <-> C++ double container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(double), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(double)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A double is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(double), "header", - fragment="SWIG_SciDouble_AsDoubleArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(double)(SwigSciObject obj, double **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(double), "header", - fragment="SWIG_SciDouble_AsDoubleArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(double)(SwigSciObject obj, int *piSize) { - double *pdblMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &pdblMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A double vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(double), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(double)(int size, double **pSequence) { - *pSequence = new double[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(double), "header", - fragment="SWIG_SciDouble_FromDoubleArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(double)(int size, double *pSequence) { - SwigSciObject obj = SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (double *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(double), "header") { - -SWIGINTERN double -SWIG_AsVal_SequenceItem_dec(double)(SwigSciObject obj, double *pSequence, int iItemIndex) { - return pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(double), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(double)(double *pSequence, int iItemIndex, double itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scisequencefloat.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scisequencefloat.swg deleted file mode 100755 index 41d37e55..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scisequencefloat.swg +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Scilab matrix of float <-> C++ float container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(float), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(float)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A double is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(float), "header", - fragment="SWIG_SciDouble_AsFloatArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(float)(SwigSciObject obj, float **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciDouble_AsFloatArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(float), "header", - fragment="SWIG_SciDouble_AsFloatArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(float)(SwigSciObject obj, int *piSize) { - float *pdblMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciDouble_AsFloatArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &pdblMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A float vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(float), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(float)(int size, float **pSequence) { - *pSequence = new float[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(float), "header", - fragment="SWIG_SciDouble_FromFloatArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(float)(int size, float *pSequence) { - SwigSciObject obj = SWIG_SciDouble_FromFloatArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (float *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(float), "header") { - -SWIGINTERN float -SWIG_AsVal_SequenceItem_dec(float)(SwigSciObject obj, float *pSequence, int iItemIndex) { - return pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(float), "header") { -SWIGINTERN int -SWIG_From_SequenceItem_dec(float)(float *pSequence, int iItemIndex, float itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scisequenceint.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scisequenceint.swg deleted file mode 100755 index 3a9f7bf6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scisequenceint.swg +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * Scilab matrix of int <-> C++ int container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(int), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(int)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - int iType = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if ((iType == sci_matrix) || (iType == sci_ints)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: An integer is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(int), "header", - fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") { -SWIGINTERN int -SWIG_AsGet_Sequence_dec(int)(SwigSciObject obj, int **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(int), "header", - fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(int)(SwigSciObject obj, int *piSize) { - int *piMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &piMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: An integer vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(int), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(int)(int size, int **pSequence) { - *pSequence = new int[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(int), "header", - fragment="SWIG_SciDouble_FromIntArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(int)(int size, int *pSequence) { - SwigSciObject obj = SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (int *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(int), "header") { - -SWIGINTERN int -SWIG_AsVal_SequenceItem_dec(int)(SwigSciObject obj, int *pSequence, int iItemIndex) { - return pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(int), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(int)(int *pSequence, int iItemIndex, int itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scisequencepointer.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scisequencepointer.swg deleted file mode 100755 index b3618e94..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scisequencepointer.swg +++ /dev/null @@ -1,123 +0,0 @@ -/* - * - * Scilab list of pointer <-> C++ pointer container - * - */ - -%include - -%fragment("", "header") { -%#include -} - -%fragment(SWIG_AsCheck_Sequence_frag(ptr), "header", - fragment="SWIG_ScilabList") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(ptr)(SwigSciObject obj) { - return SWIG_CheckScilabList(obj); -} -} - -%fragment(SWIG_AsGet_Sequence_frag(ptr), "header", - fragment="SWIG_ScilabList") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(ptr)(SwigSciObject obj, int **piSequence) { - return SWIG_GetScilabList(obj, piSequence); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(ptr), "header", - fragment="SWIG_ScilabList") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(ptr)(SwigSciObject obj, int *piSize) { - return SWIG_GetScilabListSize(obj, piSize); -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(ptr), "header", - fragment="") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(ptr)(int size, uintptr_t **pSequence) { - *pSequence = new uintptr_t[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(ptr), "header", - fragment="") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(ptr)(int size, uintptr_t *pSequence) { - SciErr sciErr; - int *piListAddr; - - int iVarOut = SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); - - sciErr = createList(pvApiCtx, iVarOut, size, &piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - for (int i=0; i C++ std::string container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(std::string), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(std::string)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isStringType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A string is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(std::string), "header", - fragment="SWIG_SciString_AsCharPtrArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(std::string)(SwigSciObject obj, char ***pSequence) { - int iRows = 0; - int iCols = 0; - return (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, obj, &iRows, &iCols, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(std::string), "header", - fragment="SWIG_SciString_AsCharPtrArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(std::string)(SwigSciObject obj, int *piSize) { - char **pstMatrix; - int iCols = 0; - int iRows = 0; - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, obj, &iRows, &iCols, &pstMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - *piSize = iRows * iCols; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(std::string), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(std::string)(int size, char ***pSequence) { - *pSequence = new char*[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(std::string), "header", - fragment="SWIG_SciString_FromCharPtrArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(std::string)(int size, char **pSequence) { - SwigSciObject obj = SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (char **)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(std::string), "header") { - -SWIGINTERN std::string -SWIG_AsVal_SequenceItem_dec(std::string)(SwigSciObject obj, char **pSequence, int iItemIndex) { - return std::string(pSequence[iItemIndex]); -} -} - -%fragment(SWIG_From_SequenceItem_frag(std::string), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(std::string)(char **pSequence, int iItemIndex, std::string itemValue) { - char *pChar = new char((int) itemValue.size() + 1); - strcpy(pChar, itemValue.c_str()); - pSequence[iItemIndex] = pChar; - return SWIG_OK; -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scishort.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scishort.swg deleted file mode 100755 index 3d2f0f97..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scishort.swg +++ /dev/null @@ -1,188 +0,0 @@ -/* - * C-type: short - * Scilab type: double or int16 - */ - -%fragment(SWIG_AsVal_frag(short), "header", fragment="SWIG_SciDoubleOrInt16_AsShort", fragment="") { -#define SWIG_AsVal_short(scilabValue, valuePointer) SWIG_SciDoubleOrInt16_AsShort(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDoubleOrInt16_AsShort", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt16_AsShort(void *pvApiCtx, int iVar, short *psValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - int iPrec = 0; - short *psData = NULL; - - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT16) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - sciErr = getMatrixOfInteger16(pvApiCtx, piAddrVar, &iRows, &iCols, &psData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - *psValue = *psData; - } - else if (iType == sci_matrix) { - double *pdData = NULL; - double dValue = 0.0f; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 16-bit signed integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < SHRT_MIN) || (dValue > SHRT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 16-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *psValue = (short) dValue; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(short), "header", fragment="SWIG_SciDouble_FromShort") { -#define SWIG_From_short(scilabValue) SWIG_SciDouble_FromShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromShort", "header") { -SWIGINTERN int -SWIG_SciDouble_FromShort(void *pvApiCtx, int iVarOut, short sValue, char *fname) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) sValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: short[] - * Scilab type: double or int16 matrix - */ -%fragment("SWIG_SciDoubleOrInt16_AsShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt16_AsShortArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, short **psValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *psValue = (short*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*psValue)[i] = (short) pdData[i]; - } - else if (iType == sci_ints) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT16) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfInteger16(pvApiCtx, piAddrVar, iRows, iCols, psValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} -%fragment("SWIG_SciDouble_FromShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromShortArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, short *psValue) { - SciErr sciErr; - int i; - double *pdValues = NULL; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i SCHAR_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 8-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *pscValue = (signed char) dValue; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(signed char), "header", fragment="SWIG_SciDouble_FromSignedChar") { -#define SWIG_From_signed_SS_char(scilabValue) SWIG_SciDouble_FromSignedChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue) -} -%fragment("SWIG_SciDouble_FromSignedChar", "header") { -SWIGINTERN int -SWIG_SciDouble_FromSignedChar(void *pvApiCtx, int iVarOut, signed char scValue) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) scValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: signed char[] - * Scilab type: double or int8 matrix - */ -%fragment("SWIG_SciDoubleOrInt8_AsSignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt8_AsSignedCharArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, signed char **pscValue, char *fname) { - SciErr sciErr; - int iType = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *pscValue = (signed char*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*pscValue)[i] = (signed char) pdData[i]; - } - else if (iType == sci_ints) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT8) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfInteger8(pvApiCtx, piAddrVar, iRows, iCols, (char **)pscValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromSignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromSignedCharArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const signed char *pscValue) { - SciErr sciErr; - int i; - double *pdValues = NULL; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i struct traits_from_ptr { - static SwigSciObject from(Type *val, int owner = 0) { - return SWIG_OK; //SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static SwigSciObject from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static SwigSciObject from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static SwigSciObject from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline SwigSciObject from(const Type& val) { - return traits_from::from(val); - } - - template - inline SwigSciObject from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - // Traits that provides the asval/as/check method - template - struct traits_asptr { - static int asptr(const SwigSciObject& obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(const SwigSciObject& obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(const SwigSciObject& obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) - return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(const SwigSciObject& obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(const SwigSciObject& obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(const SwigSciObject& obj) { - Type v; - int res = asval(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - %type_error(swig::type_name()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type as(const SwigSciObject& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - %type_error(swig::type_name()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(const SwigSciObject& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - %type_error(swig::type_name()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(const SwigSciObject& obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(const SwigSciObject& obj) { - int res = asval(obj, (Type *)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(const SwigSciObject& obj) { - int res = asptr(obj, (Type **)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(const SwigSciObject& obj) { - return traits_check::category>::check(obj); - } -} -} - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(const SwigSciObject& obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static SwigSciObject from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(const SwigSciObject& obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef - - -#define specialize_std_vector(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_list(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_deque(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/scitypemaps.swg b/mac/bin/swig/share/swig/4.1.0/scilab/scitypemaps.swg deleted file mode 100755 index 99fdce7b..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/scitypemaps.swg +++ /dev/null @@ -1,259 +0,0 @@ -// Scilab fragments for primitive types -%include - -%include - -// Scilab object type -#define SWIG_Object int - -#define %append_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR -#define %set_constant(name, obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR // Name is managed by the function name -#define %raise(obj, type, desc) SWIG_Scilab_Raise(obj, type, desc) -#define %set_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR -#define %set_varoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR -#define %set_argoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR - -// Include the unified typemap library -%include - -/* ---------------------------------------------------------------------------*/ -/* Generic typmemaps */ -/* */ -/* This typemap is used when Scilab does not store this type directly */ -/* For example, a 'float' is stored in Scilab as a 'double' */ -/* So we read a 'double' in Scilab and cast it to a 'float' */ -/* ---------------------------------------------------------------------------*/ - -%define %scilab_in_typemap_withcast(TYPEMAPTYPE, FRAGMENTNAME, CTYPE, TEMPTYPE, TEMPINIT) -%typemap(TYPEMAPTYPE, fragment="FRAGMENTNAME") CTYPE { - TEMPTYPE tempValue = TEMPINIT; - if(FRAGMENTNAME(pvApiCtx, $input, &tempValue, SWIG_Scilab_GetFuncName()) != SWIG_OK) { - return SWIG_ERROR; - } - $1 = (CTYPE) tempValue; -} -%enddef -%define %scilab_inptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $input, %as_voidptrptr(&$1), SWIG_Scilab_GetFuncName()) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_out_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, $1) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_outptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, %as_voidptr($1)) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_varout_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, $value) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_varoutptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, %as_voidptr($value)) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_in_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $input, &$1, SWIG_Scilab_GetFuncName()) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - - -/* ---------------------------------------------------------------------------*/ -/* Array typmemaps */ -/* ---------------------------------------------------------------------------*/ - -%include - - -/* ---------------------------------------------------------------------------*/ -/* Enum typemaps */ -/* ---------------------------------------------------------------------------*/ - -%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Enum)) enum SWIGTYPE (int val) { - if (SWIG_AsVal_dec(Enum)($input, &val) != SWIG_OK) { - return SWIG_ERROR; - } - $1 = %static_cast(val, $1_ltype); -} - -%typemap(out, fragment=SWIG_From_frag(Enum)) enum SWIGTYPE { - if (SWIG_From_dec(Enum)($1) != SWIG_OK) { - return SWIG_ERROR; - } -} - -/* ---------------------------------------------------------------------------*/ -/* Typecheck typemaps */ -/* ---------------------------------------------------------------------------*/ - -%define %scilab_typecheck_generic(PRECEDENCE, TYPE_CHECK_FUNCTION, TYPE) -%typecheck(PRECEDENCE) TYPE { - int *piAddrVar = NULL; - SciErr sciErr = getVarAddressFromPosition(pvApiCtx, $input, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - $1 = TYPE_CHECK_FUNCTION(pvApiCtx, piAddrVar); -} -%enddef - -%fragment("SWIG_Check_SciDoubleOrInt", "header") { -SWIGINTERN int -SWIG_Check_SciDoubleOrInt(void *pvApiCtx, SwigSciObject iVar, int iIntegerType) { - int *piAddrVar = NULL; - int ret = 0; - SciErr sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return 0; - } - ret = isIntegerType(pvApiCtx, piAddrVar); - if (ret == 1) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return 0; - } - ret = (iPrec == iIntegerType) ? 1 : 0; - } - else { - ret = isDoubleType(pvApiCtx, piAddrVar); - } - return ret; -} -} - -/* Scilab equivalent for C integers can be sci_intXX or sci_matrix */ -%define %scilab_typecheck_integer(PRECEDENCE, INTTYPE, TYPE) -%typecheck(PRECEDENCE, fragment="SWIG_Check_SciDoubleOrInt") TYPE { - $1 = SWIG_Check_SciDoubleOrInt(pvApiCtx, $input, INTTYPE); -} -%enddef - -%define %scilab_typecheck_pointer(PRECEDENCE, TYPE) -%typecheck(PRECEDENCE) TYPE { - $1 = SwigScilabCheckPtr(pvApiCtx, $input, $descriptor, SWIG_Scilab_GetFuncName()); -} -%enddef - - -// Double (and Float) have priority over before Integer type. - -// Primitive types -%scilab_typecheck_pointer(SWIG_TYPECHECK_VOIDPTR, SWIGTYPE *) -%scilab_typecheck_pointer(SWIG_TYPECHECK_POINTER, SWIGTYPE *) -%scilab_typecheck_generic(SWIG_TYPECHECK_BOOL, isBooleanType, bool) -%scilab_typecheck_generic(16, isDoubleType, double) -%scilab_typecheck_generic(17, isDoubleType, float) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT8, SCI_INT8, signed char) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT8, SCI_UINT8, unsigned char) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT16, SCI_INT16, short) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT16, SCI_UINT16, unsigned short) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, int) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, long) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT32, SCI_UINT32, unsigned int) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT32, SCI_UINT32, unsigned long) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, enum SWIGTYPE) -%scilab_typecheck_generic(SWIG_TYPECHECK_CHAR, isStringType, char) - -// Arrays -%scilab_typecheck_generic(SWIG_TYPECHECK_BOOL_ARRAY, isBooleanType, bool) -%scilab_typecheck_generic(1016, isDoubleType, double [ANY]) -%scilab_typecheck_generic(1017, isDoubleType, float [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT8_ARRAY, SCI_INT8, signed char [ANY]) -%scilab_typecheck_integer(1026, SCI_UINT8, unsigned char [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT16_ARRAY, SCI_INT16, short [ANY]) -%scilab_typecheck_integer(1036, SCI_UINT16, unsigned short [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32_ARRAY, SCI_INT32, int [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32_ARRAY, SCI_INT32, long [ANY]) -%scilab_typecheck_integer(1046, SCI_UINT32, unsigned int [ANY]) -%scilab_typecheck_integer(1046, SCI_UINT32, unsigned long [ANY]) -%scilab_typecheck_generic(SWIG_TYPECHECK_CHAR_ARRAY, isStringType, char [ANY]) -%scilab_typecheck_generic(SWIG_TYPECHECK_STRING_ARRAY, isStringType, char *[ANY]) -%scilab_typecheck_generic(SWIG_TYPECHECK_STRING_ARRAY, isStringType, char **) - - -/* ---------------------------------------------------------------------------*/ -/* %scilabconstcode() feature typemaps */ -/* ---------------------------------------------------------------------------*/ - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(double)) double -%{ - if (SWIG_CreateScilabVariable_double(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(int)) int -%{ - if (SWIG_CreateScilabVariable_int(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(uint)) unsigned int -%{ - if (SWIG_CreateScilabVariable_uint(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(int)) long -%{ - if (SWIG_CreateScilabVariable_int(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(uint)) unsigned long -%{ - if (SWIG_CreateScilabVariable_uint(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(char)) char -%{ - if (SWIG_CreateScilabVariable_char(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(charptr)) char * -%{ - if (SWIG_CreateScilabVariable_charptr(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(double)) enum SWIGTYPE -%{ - if (SWIG_CreateScilabVariable_double(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - - -/* ---------------------------------------------------------------------------*/ -/* Exception typmemaps */ -/* ---------------------------------------------------------------------------*/ - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/sciunsignedchar.swg b/mac/bin/swig/share/swig/4.1.0/scilab/sciunsignedchar.swg deleted file mode 100755 index f7338958..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/sciunsignedchar.swg +++ /dev/null @@ -1,190 +0,0 @@ -/* - * C-type: unsigned char - * Scilab type: double or uint8 - */ -%fragment(SWIG_AsVal_frag(unsigned char), "header", fragment="SWIG_SciDoubleOrUint8_AsUnsignedChar", fragment="") { -#define SWIG_AsVal_unsigned_SS_char(scilabValue, valuePointer) SWIG_SciDoubleOrUint8_AsUnsignedChar(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDoubleOrUint8_AsUnsignedChar", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint8_AsUnsignedChar(void *pvApiCtx, int iVar, unsigned char *pucValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int iPrec = 0; - int *piAddrVar = NULL; - unsigned char *pucData = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - if (pucValue) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_UINT8) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger8(pvApiCtx, piAddrVar, &iRows, &iCols, &pucData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - *pucValue = *pucData; - } - } - else if (iType == sci_matrix) { - if (pucValue) { - double *pdData = NULL; - double dValue = 0.0f; - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 8-bit unsigned integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < 0) || (dValue > UCHAR_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 8-bit unsigned integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *pucValue = (unsigned char) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(unsigned char), "header", fragment="SWIG_SciDouble_FromUnsignedChar") { -#define SWIG_From_unsigned_SS_char(value) SWIG_SciDouble_FromUnsignedChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value) -} -%fragment("SWIG_SciDouble_FromUnsignedChar", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedChar(void *pvApiCtx, int iVarOut, unsigned char ucValue) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) ucValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: unsigned char[] - * Scilab type: double or uint8 matrix - */ -%fragment("SWIG_SciDoubleOrUint8_AsUnsignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint8_AsUnsignedCharArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, unsigned char **pucValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *pucValue = (unsigned char*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*pucValue)[i] = (unsigned char) pdData[i]; - } - else if (iType == sci_ints) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iPrec != SCI_UINT8) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger8(pvApiCtx, piAddrVar, iRows, iCols, pucValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromUnsignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedCharArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const unsigned char *pucValues) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i UINT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 32-bit unsigned integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *puiValue = (unsigned int) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(unsigned int), "header", fragment="SWIG_SciDouble_FromUnsignedInt") { -%#define SWIG_From_unsigned_SS_int(scilabValue) SWIG_SciDouble_FromUnsignedInt(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromUnsignedInt", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedInt(void *pvApiCtx, int iVarOut, unsigned int uiValue, char *fname) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) uiValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: unsigned int[] - * Scilab type: uint32 vector - */ -%fragment("SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, unsigned int **puiValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *puiValue = (unsigned int*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*puiValue)[i] = (unsigned int) pdData[i]; - } - else if (iType == sci_ints) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iPrec != SCI_UINT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger32(pvApiCtx, piAddrVar, iRows, iCols, puiValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromUnsignedIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, unsigned int *puiValues) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i USHRT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 16-bit unsigned integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *pusValue = (unsigned short) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(unsigned short), "header", fragment="SWIG_SciDouble_FromUnsignedShort") { -%#define SWIG_From_unsigned_SS_short(scilabValue) SWIG_SciDouble_FromUnsignedShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromUnsignedShort", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedShort(void *pvApiCtx, int iVarOut, unsigned short usValue, char *fname) { - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) usValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: unsigned short[] - * Scilab type: uint16 vector - */ -%fragment("SWIG_SciDoubleOrUint16_AsUnsignedShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint16_AsUnsignedShortArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, unsigned short **pusValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *pusValue = (unsigned short*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*pusValue)[i] = (unsigned short) pdData[i]; - } - else if (iType == sci_ints) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iPrec != SCI_UINT16) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger16(pvApiCtx, piAddrVar, iRows, iCols, pusValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromUnsignedShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedShortArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, unsigned short *pusValues) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_basic_string.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_basic_string.i deleted file mode 100755 index b5735381..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_basic_string.i +++ /dev/null @@ -1,45 +0,0 @@ -/* - * C++: basic_string - * Scilab: string - */ - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - -%fragment(SWIG_AsPtr_frag(std::basic_string), "header", fragment="SWIG_SciString_AsCharPtrAndLength") { -SWIGINTERN int -SWIG_AsPtr_dec(std::basic_string)(int _iVar, std::basic_string **_pstValue) { - char* buf = 0; - size_t len = 0; - int alloc = SWIG_OLDOBJ; - - if (SWIG_IsOK((SWIG_SciString_AsCharPtrAndSize(pvApiCtx, _iVar, &buf, &len, &alloc, SWIG_Scilab_GetFuncName())))) { - if (buf) { - if (_pstValue) { - *_pstValue = new std::string(buf, len - 1); - } - if (alloc == SWIG_NEWOBJ) { - delete[] buf; - } - return SWIG_NEWOBJ; - } else { - if (_pstValue) { - *_pstValue = NULL; - } - return SWIG_OLDOBJ; - } - } else { - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string), "header", fragment="SWIG_SciString_FromCharPtr") { -SWIGINTERN int -SWIG_From_dec(std::basic_string)(std::basic_string _pstValue) { - return SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), _pstValue.c_str()); -} -} - -%include - - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_char_traits.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_char_traits.i deleted file mode 100755 index bf4e6c47..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_common.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_common.i deleted file mode 100755 index 97cfa7b0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_common.i +++ /dev/null @@ -1,72 +0,0 @@ -%include -%include - - -// Generate the traits for a 'primitive' type, such as 'double', -// for which the SWIG_AsVal and SWIG_From methods are already defined. - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SwigSciObject obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SwigSciObject from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SwigSciObject obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SwigSciObject from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_container.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_container.i deleted file mode 100755 index a1e037b8..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_container.i +++ /dev/null @@ -1,3 +0,0 @@ -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_deque.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_deque.i deleted file mode 100755 index d2ca597a..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_deque.i +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * C++ type : STL deque - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdDequeTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::deque **deq) { - return traits_asptr_stdseq >::asptr(obj, deq); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::deque& deq) { - return traits_from_stdseq >::from(deq); - } - }; - } -%} - - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_except.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_list.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_list.i deleted file mode 100755 index 75d002d4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_list.i +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * C++ type : STL list - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdListTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(SwigSciObject obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::list &lis) { - return traits_from_stdseq >::from(lis); - } - }; - } -%} - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_map.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_map.i deleted file mode 100755 index 07eb63fd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_map.i +++ /dev/null @@ -1,79 +0,0 @@ -// -// SWIG typemaps for std::map -// -// Common implementation - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_multiset.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_multiset.i deleted file mode 100755 index 67e17926..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_multiset.i +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * C++ type : STL multiset - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdMultisetTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::multiset **multiset) { - return traits_asptr_stdseq >::asptr(obj, multiset); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::multiset& multiset) { - return traits_from_stdseq >::from(multiset); - } - }; - } -%} - -#define %swig_multiset_methods(Set...) %swig_sequence_methods(Type) -#define %swig_multiset_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_pair.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_pair.i deleted file mode 100755 index 39ef008d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * Typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_set.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_set.i deleted file mode 100755 index 9070e2d6..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_set.i +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * C++ type : STL set - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdSetTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::set **set) { - return traits_asptr_stdseq >::asptr(obj, set); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::set& set) { - return traits_from_stdseq >::from(set); - } - }; - } -%} - - -#define %swig_set_methods(Type...) %swig_sequence_methods(Type) -#define %swig_set_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_shared_ptr.i deleted file mode 100755 index df873679..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_string.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_string.i deleted file mode 100755 index 8736c2a2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_string.i +++ /dev/null @@ -1,47 +0,0 @@ -/* - * POINTER - */ -%fragment(SWIG_AsPtr_frag(std::string), "header", fragment="SWIG_SciString_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr_dec(std::string)(int iVar, std::string **pstValue) { - char* buf = 0; - size_t size = 0; - int alloc = SWIG_OLDOBJ; - - if (SWIG_IsOK((SWIG_SciString_AsCharPtrAndSize(pvApiCtx, iVar, &buf, &size, &alloc, SWIG_Scilab_GetFuncName())))) { - if (buf) { - if (pstValue) { - *pstValue = new std::string(buf, size); - } - if (alloc == SWIG_NEWOBJ) { - delete[] buf; - } - return SWIG_NEWOBJ; - } else { - if (pstValue) { - *pstValue = NULL; - } - return SWIG_OLDOBJ; - } - } else { - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::string), "header", fragment="SWIG_SciString_FromCharPtr") { -SWIGINTERN int -SWIG_From_dec(std::string)(std::string pstValue) { - return SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pstValue.c_str()); -} -} - -%include - -%typemap(throws, noblock=1) std::string { - SWIG_Scilab_Raise_Ex($1.c_str(), "$type", $&descriptor); -} - -%typemap(throws, noblock=1) const std::string & { - SWIG_Scilab_Raise_Ex($1.c_str(), "$type", $descriptor); -} diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/std_vector.i b/mac/bin/swig/share/swig/4.1.0/scilab/std_vector.i deleted file mode 100755 index 6eaeeca5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/std_vector.i +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * C++ type : STL vector - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdVectorTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/stl.i b/mac/bin/swig/share/swig/4.1.0/scilab/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/swigmove.i b/mac/bin/swig/share/swig/4.1.0/scilab/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/scilab/typemaps.i b/mac/bin/swig/share/swig/4.1.0/scilab/typemaps.i deleted file mode 100755 index 9d713874..00000000 --- a/mac/bin/swig/share/swig/4.1.0/scilab/typemaps.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps -%define %scilab_input_typemap(Type) -%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Type)) Type *INPUT(Type temp)(int ecode), Type &INPUT(Type temp)(int ecode) { - ecode = SWIG_AsVal_dec(Type)($input, &temp); - if (!SWIG_IsOK(ecode)) { - %argument_fail(ecode, "$type", $symname, $argnum); - } - $1 = &temp; -} - -%typemap(freearg, noblock=1) Type *INPUT, Type &INPUT { -} - -%typemap(typecheck) Type *INPUT, Type &INPUT { -} -%enddef - -// OUTPUT typemaps -%define %scilab_output_typemap(Type) -%typemap(argout, noblock=1, fragment=SWIG_From_frag(Type)) Type *OUTPUT, Type &OUTPUT { - %set_output(SWIG_From_dec(Type)(*$1)); -} -%enddef - -// INOUT typemaps -%define %scilab_inout_typemap(Type) - %typemap(in) Type *INOUT = Type *INPUT; - %typemap(in) Type &INOUT = Type &INPUT; - %typemap(argout) Type *INOUT = Type *OUTPUT; - %typemap(argout) Type &INOUT = Type &OUTPUT; -%enddef - - -%define %scilab_inout_typemaps(Type) - %scilab_input_typemap(%arg(Type)) - %scilab_output_typemap(%arg(Type)) - %scilab_inout_typemap(%arg(Type)) -%enddef - -%scilab_inout_typemaps(double); -%scilab_inout_typemaps(signed char); -%scilab_inout_typemaps(unsigned char); -%scilab_inout_typemaps(short); -%scilab_inout_typemaps(unsigned short); -%scilab_inout_typemaps(int); -%scilab_inout_typemaps(unsigned int); -%scilab_inout_typemaps(long); -%scilab_inout_typemaps(unsigned long); -%scilab_inout_typemaps(bool); -%scilab_inout_typemaps(float); - -//%apply_ctypes(%scilab_inout_typemaps); - - - - - diff --git a/mac/bin/swig/share/swig/4.1.0/shared_ptr.i b/mac/bin/swig/share/swig/4.1.0/shared_ptr.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/README b/mac/bin/swig/share/swig/4.1.0/std/README old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/_std_deque.i b/mac/bin/swig/share/swig/4.1.0/std/_std_deque.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_alloc.i b/mac/bin/swig/share/swig/4.1.0/std/std_alloc.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_array.i b/mac/bin/swig/share/swig/4.1.0/std/std_array.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_basic_string.i b/mac/bin/swig/share/swig/4.1.0/std/std_basic_string.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_carray.swg b/mac/bin/swig/share/swig/4.1.0/std/std_carray.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_char_traits.i b/mac/bin/swig/share/swig/4.1.0/std/std_char_traits.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_common.i b/mac/bin/swig/share/swig/4.1.0/std/std_common.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_container.i b/mac/bin/swig/share/swig/4.1.0/std/std_container.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_deque.i b/mac/bin/swig/share/swig/4.1.0/std/std_deque.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_except.i b/mac/bin/swig/share/swig/4.1.0/std/std_except.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_ios.i b/mac/bin/swig/share/swig/4.1.0/std/std_ios.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_iostream.i b/mac/bin/swig/share/swig/4.1.0/std/std_iostream.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_list.i b/mac/bin/swig/share/swig/4.1.0/std/std_list.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_map.i b/mac/bin/swig/share/swig/4.1.0/std/std_map.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_multimap.i b/mac/bin/swig/share/swig/4.1.0/std/std_multimap.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_multiset.i b/mac/bin/swig/share/swig/4.1.0/std/std_multiset.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_pair.i b/mac/bin/swig/share/swig/4.1.0/std/std_pair.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_queue.i b/mac/bin/swig/share/swig/4.1.0/std/std_queue.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_set.i b/mac/bin/swig/share/swig/4.1.0/std/std_set.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_sstream.i b/mac/bin/swig/share/swig/4.1.0/std/std_sstream.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_stack.i b/mac/bin/swig/share/swig/4.1.0/std/std_stack.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_streambuf.i b/mac/bin/swig/share/swig/4.1.0/std/std_streambuf.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_string.i b/mac/bin/swig/share/swig/4.1.0/std/std_string.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_unordered_map.i b/mac/bin/swig/share/swig/4.1.0/std/std_unordered_map.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_unordered_multimap.i b/mac/bin/swig/share/swig/4.1.0/std/std_unordered_multimap.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_unordered_multiset.i b/mac/bin/swig/share/swig/4.1.0/std/std_unordered_multiset.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_unordered_set.i b/mac/bin/swig/share/swig/4.1.0/std/std_unordered_set.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_vector.i b/mac/bin/swig/share/swig/4.1.0/std/std_vector.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_vectora.i b/mac/bin/swig/share/swig/4.1.0/std/std_vectora.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_wios.i b/mac/bin/swig/share/swig/4.1.0/std/std_wios.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_wiostream.i b/mac/bin/swig/share/swig/4.1.0/std/std_wiostream.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_wsstream.i b/mac/bin/swig/share/swig/4.1.0/std/std_wsstream.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_wstreambuf.i b/mac/bin/swig/share/swig/4.1.0/std/std_wstreambuf.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std/std_wstring.i b/mac/bin/swig/share/swig/4.1.0/std/std_wstring.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/std_except.i b/mac/bin/swig/share/swig/4.1.0/std_except.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/stdint.i b/mac/bin/swig/share/swig/4.1.0/stdint.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/stl.i b/mac/bin/swig/share/swig/4.1.0/stl.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swig.swg b/mac/bin/swig/share/swig/4.1.0/swig.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swigarch.i b/mac/bin/swig/share/swig/4.1.0/swigarch.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swigerrors.swg b/mac/bin/swig/share/swig/4.1.0/swigerrors.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swigfragments.swg b/mac/bin/swig/share/swig/4.1.0/swigfragments.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swiginit.swg b/mac/bin/swig/share/swig/4.1.0/swiginit.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swiglabels.swg b/mac/bin/swig/share/swig/4.1.0/swiglabels.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swigrun.i b/mac/bin/swig/share/swig/4.1.0/swigrun.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swigrun.swg b/mac/bin/swig/share/swig/4.1.0/swigrun.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swigwarn.swg b/mac/bin/swig/share/swig/4.1.0/swigwarn.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/swigwarnings.swg b/mac/bin/swig/share/swig/4.1.0/swigwarnings.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/Makefile.in b/mac/bin/swig/share/swig/4.1.0/tcl/Makefile.in deleted file mode 100755 index 019091c9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/Makefile.in +++ /dev/null @@ -1,122 +0,0 @@ -# --------------------------------------------------------------- -# SWIG Tcl Makefile -# -# This file can be used to build various Tcl extensions with SWIG. -# By default this file is set up for dynamic loading, but it can -# be easily customized for static extensions by modifying various -# portions of the file. -# -# SRCS = C source files -# CXXSRCS = C++ source files -# OBJCSRCS = Objective-C source files -# OBJS = Additional .o files (compiled previously) -# INTERFACE = SWIG interface file -# TARGET = Name of target module or executable -# -# Many portions of this file were created by the SWIG configure -# script and should already reflect your machine. However, you -# may need to modify the Makefile to reflect your specific -# application. -#---------------------------------------------------------------- - -SRCS = -CXXSRCS = -OBJCSRCS = -OBJS = -INTERFACE = -WRAPFILE = $(INTERFACE:.i=_wrap.c) -WRAPOBJ = $(INTERFACE:.i=_wrap.o) -TARGET = module@SO@ # Use this kind of target for dynamic loading -#TARGET = my_tclsh # Use this target for static linking - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -CC = @CC@ -CXX = @CXX@ -OBJC = @CC@ -Wno-import # -Wno-import needed for gcc -CFLAGS = -INCLUDES = -LIBS = - -# SWIG Options -# SWIG = location of the SWIG executable -# SWIGOPT = SWIG compiler options -# SWIGCC = Compiler used to compile the wrapper file - -SWIG = $(exec_prefix)/bin/swig -SWIGOPT = -tcl -SWIGCC = $(CC) - -# SWIG Library files. Uncomment if rebuilding tclsh -#SWIGLIBS = -ltclsh.i - -# Rules for creating .o files from source. - -COBJS = $(SRCS:.c=.o) -CXXOBJS = $(CXXSRCS:.cxx=.o) -OBJCOBJS = $(OBJCSRCS:.m=.o) -ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) - -# Command that will be used to build the final extension. -BUILD = $(SWIGCC) - -# Uncomment the following if you are using dynamic loading -CCSHARED = @CCSHARED@ -BUILD = @LDSHARED@ - -# Uncomment the following if you are using dynamic loading with C++ and -# need to provide additional link libraries (this is not always required). - -#DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ - -L/usr/local/lib -lg++ -lstdc++ -lgcc - -# Tcl installation (where is Tcl located) - -TCL_INCLUDE = @TCLINCLUDE@ -TCL_LIB = @TCLLIB@ - -# Build libraries (needed for static builds) - -LIBM = @LIBM@ -LIBC = @LIBC@ -SYSLIBS = $(LIBM) $(LIBC) @LIBS@ - -# Build options (uncomment only one of these) - -BUILD_LIBS = $(LIBS) # Dynamic loading -#BUILD_LIBS = $(TCL_LIB) -ltcl $(LIBS) $(SYSLIBS) # tclsh - -# Compilation rules for non-SWIG components - -.SUFFIXES: .c .cxx .m - -.c.o: - $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - -.cxx.o: - $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< - -.m.o: - $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - - -# ---------------------------------------------------------------------- -# Rules for building the extension -# ---------------------------------------------------------------------- - -all: $(TARGET) - -# Convert the wrapper file into an object file - -$(WRAPOBJ) : $(WRAPFILE) - $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDES) $(TCL_INCLUDE) - -$(WRAPFILE) : $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIBS) $(INTERFACE) - -$(TARGET): $(WRAPOBJ) $(ALLOBJS) - $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) - -clean: - rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/argcargv.i b/mac/bin/swig/share/swig/4.1.0/tcl/argcargv.i deleted file mode 100755 index bbe149ef..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/argcargv.i +++ /dev/null @@ -1,29 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - int i, nitems; - Tcl_Obj **listobjv; - if (Tcl_ListObjGetElements(interp, $input, &nitems, &listobjv) == TCL_ERROR) { - SWIG_exception_fail(SWIG_ValueError, "in method '$symname', Expecting list of argv"); - goto fail; - } - $1 = ($1_ltype) nitems; - $2 = (char **) malloc((nitems+1)*sizeof(char *)); - for (i = 0; i < nitems; i++) { - $2[i] = Tcl_GetStringFromObj(listobjv[i], NULL); - } - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - int len; - $1 = Tcl_ListObjLength(interp, $input, &len) == TCL_OK; -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/attribute.i b/mac/bin/swig/share/swig/4.1.0/tcl/attribute.i deleted file mode 100755 index 779716cd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/carrays.i b/mac/bin/swig/share/swig/4.1.0/tcl/carrays.i deleted file mode 100755 index 0236672d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/carrays.i +++ /dev/null @@ -1,4 +0,0 @@ -%include - - - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/cdata.i b/mac/bin/swig/share/swig/4.1.0/tcl/cdata.i deleted file mode 100755 index 36796599..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/cmalloc.i b/mac/bin/swig/share/swig/4.1.0/tcl/cmalloc.i deleted file mode 100755 index 248f06b9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/cpointer.i b/mac/bin/swig/share/swig/4.1.0/tcl/cpointer.i deleted file mode 100755 index d824792f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/cstring.i b/mac/bin/swig/share/swig/4.1.0/tcl/cstring.i deleted file mode 100755 index ede9c596..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/cwstring.i b/mac/bin/swig/share/swig/4.1.0/tcl/cwstring.i deleted file mode 100755 index b17ca763..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/cwstring.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/exception.i b/mac/bin/swig/share/swig/4.1.0/tcl/exception.i deleted file mode 100755 index 4d22797c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/exception.i +++ /dev/null @@ -1,6 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); return TCL_ERROR;)) -} diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/factory.i b/mac/bin/swig/share/swig/4.1.0/tcl/factory.i deleted file mode 100755 index 46a0a873..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_auto_ptr.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_auto_ptr.i deleted file mode 100755 index b24809af..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_common.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_common.i deleted file mode 100755 index 0718facb..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_common.i +++ /dev/null @@ -1,17 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%types(std::size_t); -%apply size_t { std::size_t }; -%apply const unsigned long& { const std::size_t& }; - -%types(std::ptrdiff_t); -%apply long { std::ptrdiff_t }; -%apply const long& { const std::ptrdiff_t& }; - - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_deque.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_deque.i deleted file mode 100755 index cb98f6c2..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_except.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_except.i deleted file mode 100755 index af98428f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_map.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_map.i deleted file mode 100755 index 2c7f40ac..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_map.i +++ /dev/null @@ -1,79 +0,0 @@ -// -// SWIG typemaps for std::map -// -// Common implementation - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_pair.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_pair.i deleted file mode 100755 index 39ef008d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * Typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_string.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_string.i deleted file mode 100755 index 5b31b28c..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_string.i +++ /dev/null @@ -1,2 +0,0 @@ -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_unique_ptr.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_unique_ptr.i deleted file mode 100755 index 0ea324cd..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_vector.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_vector.i deleted file mode 100755 index a74bf3a1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_vector.i +++ /dev/null @@ -1,436 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Tcl as much as possible, namely, to allow the user to pass and -// be returned Tcl lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector< T >), f(const std::vector< T >&), f(const std::vector< T >*): -// the parameter being read-only, either a Tcl list or a -// previously wrapped std::vector< T > can be passed. -// -- f(std::vector< T >&), f(std::vector< T >*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector< T > f(): -// the vector is returned by copy; therefore, a Tcl list of T:s -// is returned which is most easily used in other Tcl functions procs -// -- std::vector< T >& f(), std::vector< T >* f(), const std::vector< T >& f(), -// const std::vector< T >* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%fragment(""); -%fragment(""); -%fragment(""); -%{ -#include - -SWIGINTERN Tcl_Obj* SwigString_FromString(const std::string &s) { - return Tcl_NewStringObj(s.data(), (int)s.length()); -} - -SWIGINTERN int Tcl_GetBoolFromObj(Tcl_Interp *interp, Tcl_Obj *o, bool *val) { - int v; - int res = Tcl_GetBooleanFromObj(interp, o, &v); - if (res == TCL_OK) { - *val = v ? true : false; - } - return res; -} - -SWIGINTERN int SwigString_AsString(Tcl_Interp *interp, Tcl_Obj *o, std::string *val) { - int len; - const char* temp = Tcl_GetStringFromObj(o, &len); - (void)interp; - if (temp == NULL) - return TCL_ERROR; - val->assign(temp, len); - return TCL_OK; -} - -// behaviour of this is such as the real Tcl_GetIntFromObj -template -int SwigInt_As(Tcl_Interp *interp, Tcl_Obj *o, Type *val) { - int temp_val, return_val; - return_val = Tcl_GetIntFromObj(interp, o, &temp_val); - *val = (Type) temp_val; - return return_val; -} - -// behaviour of this is such as the real Tcl_GetDoubleFromObj -template -int SwigDouble_As(Tcl_Interp *interp, Tcl_Obj *o, Type *val) { - int return_val; - double temp_val; - return_val = Tcl_GetDoubleFromObj(interp, o, &temp_val); - *val = (Type) temp_val; - return return_val; -} - -%} - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector< T > (std::vector< T > *v) { - Tcl_Obj **listobjv; - int nitems; - int i; - T* temp; - - if (SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0){ - $1 = *v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - $1 = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if ((SWIG_ConvertPtr(listobjv[i],(void **) &temp, - $descriptor(T *),0)) != 0) { - char message[] = - "list of " #T " expected"; - Tcl_SetResult(interp, message, TCL_VOLATILE); - return TCL_ERROR; - } - $1.push_back(*temp); - } - } - } - - %typemap(in) const vector< T >* (std::vector< T > *v, std::vector< T > w), - const vector< T >& (std::vector< T > *v, std::vector< T > w) { - Tcl_Obj **listobjv; - int nitems; - int i; - T* temp; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0) { - $1 = v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - w = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if ((SWIG_ConvertPtr(listobjv[i],(void **) &temp, - $descriptor(T *),0)) != 0) { - char message[] = - "list of " #T " expected"; - Tcl_SetResult(interp, message, TCL_VOLATILE); - return TCL_ERROR; - } - w.push_back(*temp); - } - $1 = &w; - } - } - - %typemap(out) vector< T > { - for (unsigned int i=0; i<$1.size(); i++) { - T* ptr = new T((($1_type &)$1)[i]); - Tcl_ListObjAppendElement(interp, $result, - SWIG_NewInstanceObj(ptr, - $descriptor(T *), - 0)); - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) vector< T > { - Tcl_Obj **listobjv; - int nitems; - T* temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0) { - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if ((SWIG_ConvertPtr(listobjv[0], - (void **) &temp, - $descriptor(T *),0)) != 0) - $1 = 0; - else - $1 = 1; - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) const vector< T >&, - const vector< T >* { - Tcl_Obj **listobjv; - int nitems; - T* temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0){ - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if ((SWIG_ConvertPtr(listobjv[0], - (void **) &temp, - $descriptor(T *),0)) != 0) - $1 = 0; - else - $1 = 1; - } - } - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T& get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && isize()); - if (i<0) i+= size; - if (i>=0 && i class vector< T > { - - %typemap(in) vector< T > (std::vector< T > *v){ - Tcl_Obj **listobjv; - int nitems; - int i; - T temp; - - if(SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0) { - $1 = *v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - $1 = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if (CONVERT_FROM(interp, listobjv[i], &temp) == TCL_ERROR) - return TCL_ERROR; - $1.push_back(temp); - } - } - } - - %typemap(in) const vector< T >& (std::vector< T > *v,std::vector< T > w), - const vector< T >* (std::vector< T > *v,std::vector< T > w) { - Tcl_Obj **listobjv; - int nitems; - int i; - T temp; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0) { - $1 = v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - w = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if (CONVERT_FROM(interp, listobjv[i], &temp) == TCL_ERROR) - return TCL_ERROR; - w.push_back(temp); - } - $1 = &w; - } - } - - %typemap(out) vector< T > { - for (unsigned int i=0; i<$1.size(); i++) { - Tcl_ListObjAppendElement(interp, $result, - CONVERT_TO((($1_type &)$1)[i])); - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) vector< T > { - Tcl_Obj **listobjv; - int nitems; - T temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0){ - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if (CONVERT_FROM(interp, listobjv[0], &temp) == TCL_ERROR) - $1 = 0; - else - $1 = 1; - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) const vector< T >&, - const vector< T >*{ - Tcl_Obj **listobjv; - int nitems; - T temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0){ - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if (CONVERT_FROM(interp, listobjv[0], &temp) == TCL_ERROR) - $1 = 0; - else - $1 = 1; - } - } - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && isize()); - if (i<0) i+= size; - if (i>=0 && i,Tcl_NewIntObj); - specialize_std_vector(int, Tcl_GetIntFromObj,Tcl_NewIntObj); - specialize_std_vector(short, SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(long, SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned char, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned int, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned short, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned long, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(double, Tcl_GetDoubleFromObj, Tcl_NewDoubleObj); - specialize_std_vector(float, SwigDouble_As, Tcl_NewDoubleObj); - specialize_std_vector(std::string, - SwigString_AsString, SwigString_FromString); - -} - - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/std_wstring.i b/mac/bin/swig/share/swig/4.1.0/tcl/std_wstring.i deleted file mode 100755 index f1326149..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/std_wstring.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/stl.i b/mac/bin/swig/share/swig/4.1.0/tcl/stl.i deleted file mode 100755 index 04f86014..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/swigmove.i b/mac/bin/swig/share/swig/4.1.0/tcl/swigmove.i deleted file mode 100755 index 62ecca76..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tcl8.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tcl8.swg deleted file mode 100755 index 5da1bc07..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tcl8.swg +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tcl8.swg - * - * Tcl configuration module. - * ----------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Tcl keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Tcl initialization function - * ------------------------------------------------------------ */ -%include - - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclapi.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclapi.swg deleted file mode 100755 index 2187de52..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclapi.swg +++ /dev/null @@ -1,108 +0,0 @@ -/* ----------------------------------------------------------------------------- - * SWIG API. Portion that goes into the runtime - * ----------------------------------------------------------------------------- */ -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_TCL_POINTER 4 -#define SWIG_TCL_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -typedef int (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); -typedef int (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); -typedef char *(*swig_variable_func)(ClientData, Tcl_Interp *, char *, char *, int); -typedef void (*swig_delete_func)(ClientData); - -typedef struct swig_method { - const char *name; - swig_wrapper method; -} swig_method; - -typedef struct swig_attribute { - const char *name; - swig_wrapper getmethod; - swig_wrapper setmethod; -} swig_attribute; - -typedef struct swig_class { - const char *name; - swig_type_info **type; - swig_wrapper constructor; - void (*destructor)(void *); - swig_method *methods; - swig_attribute *attributes; - struct swig_class **bases; - const char **base_names; - swig_module_info *module; - Tcl_HashTable hashtable; -} swig_class; - -typedef struct swig_instance { - Tcl_Obj *thisptr; - void *thisvalue; - swig_class *classptr; - int destroy; - Tcl_Command cmdtok; -} swig_instance; - -/* Structure for command table */ -typedef struct { - const char *name; - int (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); - ClientData clientdata; -} swig_command_info; - -/* Structure for variable linking table */ -typedef struct { - const char *name; - void *addr; - char * (*get)(ClientData, Tcl_Interp *, char *, char *, int); - char * (*set)(ClientData, Tcl_Interp *, char *, char *, int); -} swig_var_info; - - -/* -----------------------------------------------------------------------------* - * Install a constant object - * -----------------------------------------------------------------------------*/ - -static Tcl_HashTable swigconstTable; -static int swigconstTableinit = 0; - -SWIGINTERN void -SWIG_Tcl_SetConstantObj(Tcl_Interp *interp, const char* name, Tcl_Obj *obj) { - int newobj; - Tcl_ObjSetVar2(interp,Tcl_NewStringObj(name,-1), NULL, obj, TCL_GLOBAL_ONLY); - Tcl_SetHashValue(Tcl_CreateHashEntry(&swigconstTable, name, &newobj), (ClientData) obj); -} - -SWIGINTERN Tcl_Obj * -SWIG_Tcl_GetConstantObj(const char *key) { - Tcl_HashEntry *entryPtr; - if (!swigconstTableinit) return 0; - entryPtr = Tcl_FindHashEntry(&swigconstTable, key); - if (entryPtr) { - return (Tcl_Obj *) Tcl_GetHashValue(entryPtr); - } - return 0; -} - -#ifdef __cplusplus -} -#endif - - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclerrors.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclerrors.swg deleted file mode 100755 index 889d3ad5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclerrors.swg +++ /dev/null @@ -1,76 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGINTERN const char* -SWIG_Tcl_ErrorType(int code) { - const char* type = 0; - switch(code) { - case SWIG_MemoryError: - type = "MemoryError"; - break; - case SWIG_IOError: - type = "IOError"; - break; - case SWIG_RuntimeError: - type = "RuntimeError"; - break; - case SWIG_IndexError: - type = "IndexError"; - break; - case SWIG_TypeError: - type = "TypeError"; - break; - case SWIG_DivisionByZero: - type = "ZeroDivisionError"; - break; - case SWIG_OverflowError: - type = "OverflowError"; - break; - case SWIG_SyntaxError: - type = "SyntaxError"; - break; - case SWIG_ValueError: - type = "ValueError"; - break; - case SWIG_SystemError: - type = "SystemError"; - break; - case SWIG_AttributeError: - type = "AttributeError"; - break; - default: - type = "RuntimeError"; - } - return type; -} - - -SWIGINTERN void -SWIG_Tcl_SetErrorObj(Tcl_Interp *interp, const char *ctype, Tcl_Obj *obj) -{ - Tcl_ResetResult(interp); - Tcl_SetObjResult(interp, obj); - Tcl_SetErrorCode(interp, "SWIG", ctype, NULL); -} - -SWIGINTERN void -SWIG_Tcl_SetErrorMsg(Tcl_Interp *interp, const char *ctype, const char *mesg) -{ - Tcl_ResetResult(interp); - Tcl_SetErrorCode(interp, "SWIG", ctype, NULL); - Tcl_AppendResult(interp, ctype, " ", mesg, NULL); - /* - Tcl_AddErrorInfo(interp, ctype); - Tcl_AddErrorInfo(interp, " "); - Tcl_AddErrorInfo(interp, mesg); - */ -} - -SWIGINTERNINLINE void -SWIG_Tcl_AddErrorMsg(Tcl_Interp *interp, const char* mesg) -{ - Tcl_AddErrorInfo(interp, mesg); -} - - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclfragments.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclfragments.swg deleted file mode 100755 index ba6398c7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclfragments.swg +++ /dev/null @@ -1,22 +0,0 @@ -/* - - Create a file with this name, 'tclfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the ones defined by default by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal_dec(int)(TclObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - -*/ diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclinit.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclinit.swg deleted file mode 100755 index cf14de88..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclinit.swg +++ /dev/null @@ -1,140 +0,0 @@ -/* ------------------------------------------------------------ - * The start of the Tcl initialization function - * ------------------------------------------------------------ */ - -%insert(init) "swiginit.swg" - -/* This initialization code exports the module initialization function */ - -%header %{ - -#ifdef __cplusplus -extern "C" { -#endif -#ifdef MAC_TCL -#pragma export on -#endif -SWIGEXPORT int SWIG_init(Tcl_Interp *); -#ifdef MAC_TCL -#pragma export off -#endif -#ifdef __cplusplus -} -#endif - -/* Compatibility version for TCL stubs */ -#ifndef SWIG_TCL_STUBS_VERSION -#define SWIG_TCL_STUBS_VERSION "8.4" -#endif - -%} - -%init %{ -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - -/* Install Constants */ - -SWIGINTERN void -SWIG_Tcl_InstallConstants(Tcl_Interp *interp, swig_const_info constants[]) { - size_t i; - Tcl_Obj *obj; - - if (!swigconstTableinit) { - Tcl_InitHashTable(&swigconstTable, TCL_STRING_KEYS); - swigconstTableinit = 1; - } - for (i = 0; constants[i].type; i++) { - switch(constants[i].type) { - case SWIG_TCL_POINTER: - obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_TCL_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - SWIG_Tcl_SetConstantObj(interp, constants[i].name, obj); - } - } -} - -/* Create fast method lookup tables */ - -SWIGINTERN void -SWIG_Tcl_InstallMethodLookupTables(void) { - size_t i; - - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = swig_module.type_initial[i]; - if (type->clientdata) { - swig_class* klass = (swig_class*) type->clientdata; - swig_method* meth; - Tcl_InitHashTable(&(klass->hashtable), TCL_STRING_KEYS); - for (meth = klass->methods; meth && meth->name; ++meth) { - int newEntry; - Tcl_HashEntry* hashentry = Tcl_CreateHashEntry(&(klass->hashtable), meth->name, &newEntry); - Tcl_SetHashValue(hashentry, (ClientData)meth->method); - } - } - } -} - -#ifdef __cplusplus -} -#endif - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -SWIGEXPORT int SWIG_init(Tcl_Interp *interp) { - size_t i; - if (interp == 0) return TCL_ERROR; -#ifdef USE_TCL_STUBS - if (Tcl_InitStubs(interp, SWIG_TCL_STUBS_VERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif -#ifdef USE_TK_STUBS - /* (char*) cast is required to avoid compiler warning/error. */ - if (Tk_InitStubs(interp, (char*)SWIG_TCL_STUBS_VERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif - - Tcl_PkgProvide(interp, (char*)SWIG_name, (char*)SWIG_version); - -#ifdef SWIG_namespace - Tcl_Eval(interp, "namespace eval " SWIG_namespace " { }"); -#endif - - SWIG_InitializeModule((void *) interp); - SWIG_PropagateClientData(); - - for (i = 0; swig_commands[i].name; i++) { - Tcl_CreateObjCommand(interp, (char *) swig_commands[i].name, (swig_wrapper_func) swig_commands[i].wrapper, - swig_commands[i].clientdata, NULL); - } - for (i = 0; swig_variables[i].name; i++) { - Tcl_SetVar(interp, (char *) swig_variables[i].name, (char *) "", TCL_GLOBAL_ONLY); - Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_READS | TCL_GLOBAL_ONLY, - (Tcl_VarTraceProc *) swig_variables[i].get, (ClientData) swig_variables[i].addr); - Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_WRITES | TCL_GLOBAL_ONLY, - (Tcl_VarTraceProc *) swig_variables[i].set, (ClientData) swig_variables[i].addr); - } - - SWIG_Tcl_InstallConstants(interp, swig_constants); - SWIG_Tcl_InstallMethodLookupTables(); - -%} - -/* Note: the initialization function is closed after all code is generated */ diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclinterp.i b/mac/bin/swig/share/swig/4.1.0/tcl/tclinterp.i deleted file mode 100755 index 3b45b6d4..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclinterp.i +++ /dev/null @@ -1,17 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclinterp.i - * - * Tcl_Interp *interp - * - * Passes the current Tcl_Interp value directly to a C function. - * This can be used to work with existing wrapper functions or - * if you just need the interp value for some reason. When used, - * the 'interp' parameter becomes hidden in the Tcl interface--that - * is, you don't specify it explicitly. SWIG fills in its value - * automatically. - * ----------------------------------------------------------------------------- */ - -%typemap(in,numinputs=0) Tcl_Interp *interp { - $1 = interp; -} - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclkw.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclkw.swg deleted file mode 100755 index e96e885d..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclkw.swg +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TCL_TCLKW_SWG_ -#define TCL_TCLKW_SWG_ - -// Some special reserved words in classes - -%keywordwarn("cget is a tcl reserved method name") *::cget; -%keywordwarn("configure is a tcl reserved method name") *::configure; - - -#endif //_TCL_TCLKW_SWG_ diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclmacros.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclmacros.swg deleted file mode 100755 index ab7bace5..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclmacros.swg +++ /dev/null @@ -1,4 +0,0 @@ -%include - - - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclopers.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclopers.swg deleted file mode 100755 index f113ccd1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclopers.swg +++ /dev/null @@ -1,43 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclopers.swg - * - * C++ overloaded operators. - * - * These declarations define how SWIG is going to rename C++ - * overloaded operators in Tcl. Since Tcl allows identifiers - * to be essentially any valid string, we'll just use the - * normal operator names. - * ----------------------------------------------------------------------------- */ - - -#ifdef __cplusplus -%rename("+") *::operator+; -//%rename("u+") *::operator+(); // Unary + -//%rename("u+") *::operator+() const; // Unary + -%rename("-") *::operator-; -//%rename("u-") *::operator-(); // Unary - -//%rename("u-") *::operator-() const; // Unary - -%rename("*") *::operator*; -%rename("/") *::operator/; -%rename("<<") *::operator<<; -%rename(">>") *::operator>>; -%rename("&") *::operator&; -%rename("|") *::operator|; -%rename("^") *::operator^; -%rename("%") *::operator%; -%rename("=") *::operator=; - -/* Ignored operators */ -%ignoreoperator(NOTEQUAL) operator!=; -%ignoreoperator(PLUSEQ) operator+=; -%ignoreoperator(MINUSEQ) operator-=; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; - -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclprimtypes.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclprimtypes.swg deleted file mode 100755 index febbffb7..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclprimtypes.swg +++ /dev/null @@ -1,230 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { - %define_as(SWIG_From_dec(bool), Tcl_NewBooleanObj) -} - -%fragment(SWIG_AsVal_frag(bool),"header") { -SWIGINTERN int -SWIG_AsVal_dec(bool)(Tcl_Obj *obj, bool *val) -{ - int v; - if (Tcl_GetBooleanFromObj(0, obj, &v) == TCL_OK) { - if (val) *val = v ? true : false; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header", - fragment="") { -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(long)(long value) -{ - if (((long) INT_MIN <= value) && (value <= (long) INT_MAX)) { - return Tcl_NewIntObj(%numeric_cast(value,int)); - } else { - return Tcl_NewLongObj(value); - } -} -} - -%fragment(SWIG_AsVal_frag(long),"header") { -SWIGINTERN int -SWIG_AsVal_dec(long)(Tcl_Obj *obj, long* val) -{ - long v; - if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) { - if (val) *val = (long) v; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long), - fragment="") { -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(unsigned long)(unsigned long value) -{ - if (value < (unsigned long) LONG_MAX) { - return SWIG_From(long)(%numeric_cast(value, long)); - } else { - char temp[256]; - sprintf(temp, "%lu", value); - return Tcl_NewStringObj(temp,-1); - } -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(Tcl_Obj *obj, unsigned long *val) { - long v; - if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) { - if (v >= 0) { - if (val) *val = (unsigned long) v; - return SWIG_OK; - } - /* If v is negative, then this could be a negative number, or an - unsigned value which doesn't fit in a signed long, so try to - get it as a string so we can distinguish these cases. */ - } - { - int len = 0; - const char *nptr = Tcl_GetStringFromObj(obj, &len); - if (nptr && len > 0) { - char *endptr; - unsigned long v; - if (*nptr == '-') return SWIG_OverflowError; - errno = 0; - v = strtoul(nptr, &endptr,0); - if (nptr[0] == '\0' || *endptr != '\0') - return SWIG_TypeError; - if (v == ULONG_MAX && errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_OK; - } - } - } - } - - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(long long)(long long value) -{ - if (((long long) LONG_MIN <= value) && (value <= (long long) LONG_MAX)) { - return SWIG_From(long)(%numeric_cast(value,long)); - } else { - char temp[256]; - sprintf(temp, "%lld", value); - return Tcl_NewStringObj(temp,-1); - } -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(Tcl_Obj *obj, long long *val) -{ - Tcl_WideInt v; - if (Tcl_GetWideIntFromObj(0, obj, &v) == TCL_OK) { - if (sizeof(v) > sizeof(*val) && (v < LLONG_MIN || v > LLONG_MAX)) { - return SWIG_OverflowError; - } - if (val) *val = v; - return SWIG_OK; - } - return SWIG_TypeError; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment=SWIG_From_frag(long long), - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - if (value < (unsigned long long) LONG_MAX) { - return SWIG_From(long long)(%numeric_cast(value, long long)); - } else { - char temp[256]; - sprintf(temp, "%llu", value); - return Tcl_NewStringObj(temp,-1); - } -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(Tcl_Obj *obj, unsigned long long *val) -{ - long v; - if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) { - if (val) *val = (unsigned long) v; - return SWIG_OK; - } else { - int len = 0; - const char *nptr = Tcl_GetStringFromObj(obj, &len); - if (nptr && len > 0) { - char *endptr; - unsigned long long v; - if (*nptr == '-') return SWIG_OverflowError; - errno = 0; - v = strtoull(nptr, &endptr,0); - if (nptr[0] == '\0' || *endptr != '\0') - return SWIG_TypeError; - if (v == ULLONG_MAX && errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_OK; - } - } - } - } - return SWIG_TypeError; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { - %define_as(SWIG_From(double), Tcl_NewDoubleObj) -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(Tcl_Obj *obj, double *val) -{ - double v; - if (Tcl_GetDoubleFromObj(0, obj, &v) == TCL_OK) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclresult.i b/mac/bin/swig/share/swig/4.1.0/tcl/tclresult.i deleted file mode 100755 index c63b3ee1..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclresult.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclresult.i - * ----------------------------------------------------------------------------- */ - -/* -int Tcl_Result - - Makes the integer return code of a function the return value - of a SWIG generated wrapper function. For example : - - int foo() { - ... do stuff ... - return TCL_OK; - } - - could be wrapped as follows : - - %include typemaps.i - %apply int Tcl_Result { int foo }; - int foo(); -*/ - -// If return code is a Tcl_Result, simply pass it on - -%typemap(out) int Tcl_Result { - return $1; -} diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclrun.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclrun.swg deleted file mode 100755 index e8136051..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclrun.swg +++ /dev/null @@ -1,722 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclrun.swg - * - * This file contains the runtime support for Tcl modules and includes - * code for managing global variables and pointer type checking. - * ----------------------------------------------------------------------------- */ - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_ConvertPtr(oc, ptr, ty, flags) SWIG_Tcl_ConvertPtr(interp, oc, ptr, ty, flags) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Tcl_NewPointerObj(ptr, type, flags) - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Tcl_ConvertPacked(interp, obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Tcl_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_Tcl_ConvertPtr(interp, obj, pptr, type, flags) -#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_Tcl_NewInstanceObj(interp, thisvalue, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Tcl_ConvertPtr(interp, obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Tcl_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Tcl_ConvertPacked(interp,obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Tcl_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Tcl_GetModule((Tcl_Interp *) (clientdata)) -#define SWIG_SetModule(clientdata, pointer) SWIG_Tcl_SetModule((Tcl_Interp *) (clientdata), pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Tcl_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Tcl_SetErrorMsg(interp, SWIG_Tcl_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Tcl-specific SWIG API */ - -#define SWIG_Acquire(ptr) SWIG_Tcl_Acquire(ptr) -#define SWIG_MethodCommand SWIG_Tcl_MethodCommand -#define SWIG_Disown(ptr) SWIG_Tcl_Disown(ptr) -#define SWIG_ConvertPtrFromString(c, ptr, ty, flags) SWIG_Tcl_ConvertPtrFromString(interp, c, ptr, ty, flags) -#define SWIG_MakePtr(c, ptr, ty, flags) SWIG_Tcl_MakePtr(c, ptr, ty, flags) -#define SWIG_PointerTypeFromString(c) SWIG_Tcl_PointerTypeFromString(c) -#define SWIG_GetArgs SWIG_Tcl_GetArgs -#define SWIG_GetConstantObj(key) SWIG_Tcl_GetConstantObj(key) -#define SWIG_ObjectConstructor SWIG_Tcl_ObjectConstructor -#define SWIG_Thisown(ptr) SWIG_Tcl_Thisown(ptr) -#define SWIG_ObjectDelete SWIG_Tcl_ObjectDelete - - -#define SWIG_TCL_DECL_ARGS_2(arg1, arg2) (Tcl_Interp *interp SWIGUNUSED, arg1, arg2) -#define SWIG_TCL_CALL_ARGS_2(arg1, arg2) (interp, arg1, arg2) -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_GetConstant SWIG_GetConstantObj -#define SWIG_Tcl_GetConstant SWIG_Tcl_GetConstantObj - -#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 5) -#define SWIG_TCL_HASHTABLE_INIT {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#else -#define SWIG_TCL_HASHTABLE_INIT {0} -#endif - -#include "assert.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Object support */ - -SWIGRUNTIME Tcl_HashTable* -SWIG_Tcl_ObjectTable(void) { - static Tcl_HashTable swigobjectTable; - static int swigobjectTableinit = 0; - if (!swigobjectTableinit) { - Tcl_InitHashTable(&swigobjectTable, TCL_ONE_WORD_KEYS); - swigobjectTableinit = 1; - } - return &swigobjectTable; -} - -/* Acquire ownership of a pointer */ -SWIGRUNTIME void -SWIG_Tcl_Acquire(void *ptr) { - int newobj; - Tcl_CreateHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr, &newobj); -} - -SWIGRUNTIME int -SWIG_Tcl_Thisown(void *ptr) { - if (Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr)) { - return 1; - } - return 0; -} - -/* Disown a pointer. Returns 1 if we owned it to begin with */ -SWIGRUNTIME int -SWIG_Tcl_Disown(void *ptr) { - Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr); - if (entryPtr) { - Tcl_DeleteHashEntry(entryPtr); - return 1; - } - return 0; -} - -/* Convert a pointer value */ -SWIGRUNTIME int -SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swig_type_info *ty, int flags) { - swig_cast_info *tc; - const char *cmd_name; - /* Pointer values must start with leading underscore */ - while (*c != '_') { - *ptr = (void *) 0; - if (strcmp(c,"NULL") == 0) - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - - /* Empty string: not a pointer */ - if (*c == 0) return SWIG_ERROR; - - /* Hmmm. It could be an object name. */ - - /* Check if this is a command at all. Prevents cget -this */ - /* from being called when c is not a command, firing the unknown proc */ - if (Tcl_VarEval(interp,"info commands ", c, (char *) NULL) == TCL_OK) { - Tcl_Obj *result = Tcl_GetObjResult(interp); - if (*(Tcl_GetStringFromObj(result, NULL)) == 0) { - /* It's not a command, so it can't be a pointer */ - Tcl_ResetResult(interp); - return SWIG_ERROR; - } - } else { - /* This will only fail if the argument is multiple words. */ - /* Multiple words are also not commands. */ - Tcl_ResetResult(interp); - return SWIG_ERROR; - } - - /* Check if this is really a SWIG pointer */ - if (Tcl_VarEval(interp,c," cget -this", (char *) NULL) != TCL_OK) { - Tcl_ResetResult(interp); - return SWIG_ERROR; - } - - c = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), NULL); - } - cmd_name = c; - - c++; - c = SWIG_UnpackData(c,ptr,sizeof(void *)); - - if (ty) { - tc = c ? SWIG_TypeCheck(c,ty) : 0; - if (tc) { - Tcl_CmdInfo info; - if (Tcl_GetCommandInfo(interp, cmd_name, &info)) { - swig_instance *inst = (swig_instance *)info.objClientData; - if (!inst->thisvalue) { - *ptr = 0; - } - assert(inst->thisvalue == *ptr); - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !SWIG_Thisown(inst->thisvalue)) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (flags & SWIG_POINTER_DISOWN) { - SWIG_Disown((void *) *ptr); - } - if (flags & SWIG_POINTER_CLEAR) { - inst->thisvalue = 0; - } - { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,(void *) *ptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } - } - } - } else { - return SWIG_ERROR; - } - } - - return SWIG_OK; -} - -/* Convert a pointer value */ -SWIGRUNTIMEINLINE int -SWIG_Tcl_ConvertPtr(Tcl_Interp *interp, Tcl_Obj *oc, void **ptr, swig_type_info *ty, int flags) { - return SWIG_Tcl_ConvertPtrFromString(interp, Tcl_GetStringFromObj(oc,NULL), ptr, ty, flags); -} - -/* Convert a pointer value */ -SWIGRUNTIME char * -SWIG_Tcl_PointerTypeFromString(char *c) { - char d; - /* Pointer values must start with leading underscore. NULL has no type */ - if (*c != '_') { - return 0; - } - c++; - /* Extract hex value from pointer */ - while ((d = *c)) { - if (!(((d >= '0') && (d <= '9')) || ((d >= 'a') && (d <= 'f')))) break; - c++; - } - return c; -} - -/* Convert a packed pointer value */ -SWIGRUNTIME int -SWIG_Tcl_ConvertPacked(Tcl_Interp *SWIGUNUSEDPARM(interp) , Tcl_Obj *obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c; - - if (!obj) goto type_error; - c = Tcl_GetStringFromObj(obj,NULL); - /* Pointer values must start with leading underscore */ - if (*c != '_') goto type_error; - c++; - c = SWIG_UnpackData(c,ptr,sz); - if (ty) { - tc = SWIG_TypeCheck(c,ty); - if (!tc) goto type_error; - } - return SWIG_OK; - - type_error: - - return SWIG_ERROR; -} - - -/* Take a pointer and convert it to a string */ -SWIGRUNTIME void -SWIG_Tcl_MakePtr(char *c, void *ptr, swig_type_info *ty, int SWIGUNUSEDPARM(flags)) { - if (ptr) { - *(c++) = '_'; - c = SWIG_PackData(c,&ptr,sizeof(void *)); - strcpy(c,ty->name); - } else { - strcpy(c,"NULL"); - } -} - -/* Create a new pointer object */ -SWIGRUNTIMEINLINE Tcl_Obj * -SWIG_Tcl_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - Tcl_Obj *robj; - char result[SWIG_BUFFER_SIZE]; - SWIG_MakePtr(result,ptr,type,flags); - robj = Tcl_NewStringObj(result,-1); - return robj; -} - -SWIGRUNTIME Tcl_Obj * -SWIG_Tcl_NewPackedObj(void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - strcpy(r,type->name); - return Tcl_NewStringObj(result,-1); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -SWIGRUNTIME swig_module_info * -SWIG_Tcl_GetModule(Tcl_Interp *interp) { - const char *data; - swig_module_info *ret = 0; - - /* first check if pointer already created */ - data = Tcl_GetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TCL_GLOBAL_ONLY); - if (data) { - SWIG_UnpackData(data, &ret, sizeof(swig_type_info **)); - } - - return ret; -} - -SWIGRUNTIME void -SWIG_Tcl_SetModule(Tcl_Interp *interp, swig_module_info *module) { - char buf[SWIG_BUFFER_SIZE]; - char *data; - - /* create a new pointer */ - data = SWIG_PackData(buf, &module, sizeof(swig_type_info **)); - *data = 0; - Tcl_SetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, buf, TCL_GLOBAL_ONLY); -} - -/* -----------------------------------------------------------------------------* - * Object auxiliaries - * -----------------------------------------------------------------------------*/ - - -SWIGRUNTIME void -SWIG_Tcl_ObjectDelete(ClientData clientData) { - swig_instance *si = (swig_instance *) clientData; - if (!si) return; - if (si->destroy && SWIG_Disown(si->thisvalue)) { - if (si->classptr->destructor) { - (si->classptr->destructor)(si->thisvalue); - } - } - Tcl_DecrRefCount(si->thisptr); - free(si); -} - -/* Function to invoke object methods given an instance */ -SWIGRUNTIME int -SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST _objv[]) { - char *method, *attrname; - swig_instance *inst = (swig_instance *) clientData; - swig_method *meth; - swig_attribute *attr; - Tcl_Obj *oldarg; - Tcl_Obj **objv; - int rcode; - swig_class *cls; - swig_class *cls_stack[64]; - int cls_stack_bi[64]; - int cls_stack_top = 0; - int numconf = 2; - int bi; - - objv = (Tcl_Obj **) _objv; - if (objc < 2) { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - method = Tcl_GetStringFromObj(objv[1],NULL); - if (strcmp(method,"-acquire") == 0) { - inst->destroy = 1; - SWIG_Acquire(inst->thisvalue); - return TCL_OK; - } - if (strcmp(method,"-disown") == 0) { - if (inst->destroy) { - SWIG_Disown(inst->thisvalue); - } - inst->destroy = 0; - return TCL_OK; - } - if (strcmp(method,"-delete") == 0) { - Tcl_DeleteCommandFromToken(interp,inst->cmdtok); - return TCL_OK; - } - cls_stack[cls_stack_top] = inst->classptr; - cls_stack_bi[cls_stack_top] = -1; - while (1) { - Tcl_HashEntry* hashentry; - bi = cls_stack_bi[cls_stack_top]; - cls = cls_stack[cls_stack_top]; - if (bi != -1) { - if (!cls->bases[bi] && cls->base_names[bi]) { - /* lookup and cache the base class */ - swig_type_info *info = SWIG_TypeQueryModule(cls->module, cls->module, cls->base_names[bi]); - if (info) cls->bases[bi] = (swig_class *) info->clientdata; - } - cls = cls->bases[bi]; - if (cls) { - cls_stack_bi[cls_stack_top]++; - cls_stack_top++; - cls_stack[cls_stack_top] = cls; - cls_stack_bi[cls_stack_top] = -1; - continue; - } - } - if (!cls) { - cls_stack_top--; - if (cls_stack_top < 0) break; - else continue; - } - cls_stack_bi[cls_stack_top]++; - - hashentry = Tcl_FindHashEntry(&(cls->hashtable), method); - if (hashentry) { - ClientData cd = Tcl_GetHashValue(hashentry); - swig_wrapper method_wrapper = (swig_wrapper)cd; - oldarg = objv[1]; - objv[1] = inst->thisptr; - Tcl_IncrRefCount(inst->thisptr); - rcode = (method_wrapper)(clientData,interp,objc,objv); - objv[1] = oldarg; - Tcl_DecrRefCount(inst->thisptr); - return rcode; - } - /* Check class methods for a match */ - if (strcmp(method,"cget") == 0) { - if (objc < 3) { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - attrname = Tcl_GetStringFromObj(objv[2],NULL); - attr = cls->attributes; - while (attr && attr->name) { - if ((strcmp(attr->name, attrname) == 0) && (attr->getmethod)) { - oldarg = objv[1]; - objv[1] = inst->thisptr; - Tcl_IncrRefCount(inst->thisptr); - rcode = (*attr->getmethod)(clientData,interp,2, objv); - objv[1] = oldarg; - Tcl_DecrRefCount(inst->thisptr); - return rcode; - } - attr++; - } - if (strcmp(attrname, "-this") == 0) { - Tcl_SetObjResult(interp, Tcl_DuplicateObj(inst->thisptr)); - return TCL_OK; - } - if (strcmp(attrname, "-thisown") == 0) { - if (SWIG_Thisown(inst->thisvalue)) { - Tcl_SetResult(interp,(char*)"1",TCL_STATIC); - } else { - Tcl_SetResult(interp,(char*)"0",TCL_STATIC); - } - return TCL_OK; - } - } else if (strcmp(method, "configure") == 0) { - int i; - if (objc < 4) { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - i = 2; - while (i < objc) { - attrname = Tcl_GetStringFromObj(objv[i],NULL); - attr = cls->attributes; - while (attr && attr->name) { - if ((strcmp(attr->name, attrname) == 0) && (attr->setmethod)) { - oldarg = objv[i]; - objv[i] = inst->thisptr; - Tcl_IncrRefCount(inst->thisptr); - rcode = (*attr->setmethod)(clientData,interp,3, &objv[i-1]); - objv[i] = oldarg; - Tcl_DecrRefCount(inst->thisptr); - if (rcode != TCL_OK) return rcode; - numconf += 2; - } - attr++; - } - i+=2; - } - } - } - if (strcmp(method,"configure") == 0) { - if (numconf >= objc) { - return TCL_OK; - } else { - Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC); - return TCL_ERROR; - } - } - if (strcmp(method,"cget") == 0) { - Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC); - return TCL_ERROR; - } - Tcl_SetResult(interp, (char *) "Invalid method. Must be one of: configure cget -acquire -disown -delete", TCL_STATIC); - cls = inst->classptr; - bi = 0; - while (cls) { - meth = cls->methods; - while (meth && meth->name) { - char *cr = (char *) Tcl_GetStringResult(interp); - size_t meth_len = strlen(meth->name); - char* where = strchr(cr,':'); - while(where) { - where = strstr(where, meth->name); - if(where) { - if(where[-1] == ' ' && (where[meth_len] == ' ' || where[meth_len]==0)) { - break; - } else { - where++; - } - } - } - - if (!where) - Tcl_AppendElement(interp, (char *) meth->name); - meth++; - } - cls = inst->classptr->bases[bi++]; - } - return TCL_ERROR; -} - -/* This function takes the current result and turns it into an object command */ -SWIGRUNTIME Tcl_Obj * -SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *type, int flags) { - Tcl_Obj *robj = SWIG_NewPointerObj(thisvalue, type,0); - /* Check to see if this pointer belongs to a class or not */ - if (thisvalue && (type->clientdata) && (interp)) { - Tcl_CmdInfo ci; - int has_command; - char *name; - name = Tcl_GetStringFromObj(robj,NULL); - has_command = Tcl_GetCommandInfo(interp, name, &ci); - if (!has_command || flags) { - swig_instance *newinst = (swig_instance *) malloc(sizeof(swig_instance)); - newinst->thisptr = Tcl_DuplicateObj(robj); - Tcl_IncrRefCount(newinst->thisptr); - newinst->thisvalue = thisvalue; - newinst->classptr = (swig_class *) type->clientdata; - newinst->destroy = flags; - newinst->cmdtok = Tcl_CreateObjCommand(interp, Tcl_GetStringFromObj(robj,NULL), (swig_wrapper_func) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); - if (flags) { - SWIG_Acquire(thisvalue); - } - } else { - swig_instance *inst = (swig_instance *)ci.objClientData; - /* Restore thisvalue as SWIG_POINTER_CLEAR may have been used to set it to zero. - Occurs when the C pointer is re-used by the memory allocator and the command has - been created and not destroyed - bug?? - see cpp11_std_unique_ptr_runme.tcl test. */ - if (inst->thisvalue != thisvalue) { - assert(inst->thisvalue == 0); - inst->thisvalue = thisvalue; - } - } - } - return robj; -} - -/* Function to create objects */ -SWIGRUNTIME int -SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - Tcl_Obj *newObj = 0; - void *thisvalue = 0; - swig_instance *newinst = 0; - swig_class *classptr = (swig_class *) clientData; - swig_wrapper cons = 0; - char *name = 0; - int firstarg = 0; - int thisarg = 0; - int destroy = 1; - - if (!classptr) { - Tcl_SetResult(interp, (char *) "swig: internal runtime error. No class object defined.", TCL_STATIC); - return TCL_ERROR; - } - cons = classptr->constructor; - if (objc > 1) { - char *s = Tcl_GetStringFromObj(objv[1],NULL); - if (strcmp(s,"-this") == 0) { - thisarg = 2; - cons = 0; - } else if (strcmp(s,"-args") == 0) { - firstarg = 1; - } else if (objc == 2) { - firstarg = 1; - name = s; - } else if (objc >= 3) { - char *s1; - name = s; - s1 = Tcl_GetStringFromObj(objv[2],NULL); - if (strcmp(s1,"-this") == 0) { - thisarg = 3; - cons = 0; - } else { - firstarg = 1; - } - } - } - if (cons) { - int result; - result = (*cons)(0, interp, objc-firstarg, &objv[firstarg]); - if (result != TCL_OK) { - return result; - } - newObj = Tcl_DuplicateObj(Tcl_GetObjResult(interp)); - if (!name) name = Tcl_GetStringFromObj(newObj,NULL); - } else if (thisarg > 0) { - if (thisarg < objc) { - destroy = 0; - newObj = Tcl_DuplicateObj(objv[thisarg]); - if (!name) name = Tcl_GetStringFromObj(newObj,NULL); - } else { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - } else { - Tcl_SetResult(interp, (char *) "No constructor available.", TCL_STATIC); - return TCL_ERROR; - } - if (SWIG_Tcl_ConvertPtr(interp,newObj, (void **) &thisvalue, *(classptr->type), 0) != SWIG_OK) { - Tcl_DecrRefCount(newObj); - return TCL_ERROR; - } - newinst = (swig_instance *) malloc(sizeof(swig_instance)); - newinst->thisptr = newObj; - Tcl_IncrRefCount(newObj); - newinst->thisvalue = thisvalue; - newinst->classptr = classptr; - newinst->destroy = destroy; - if (destroy) { - SWIG_Acquire(thisvalue); - } - newinst->cmdtok = Tcl_CreateObjCommand(interp,name, (swig_wrapper) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); - return TCL_OK; -} - -/* -----------------------------------------------------------------------------* - * Get arguments - * -----------------------------------------------------------------------------*/ -SWIGRUNTIME int -SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char *fmt, ...) { - int argno = 0, opt = 0; - long tempi; - double tempd; - const char *c; - va_list ap; - void *vptr; - Tcl_Obj *obj = 0; - swig_type_info *ty; - - va_start(ap,fmt); - for (c = fmt; (*c && (*c != ':') && (*c != ';')); c++,argno++) { - if (*c == '|') { - opt = 1; - c++; - } - if (argno >= (objc-1)) { - if (!opt) { - Tcl_SetResult(interp, (char *) "Wrong number of arguments ", TCL_STATIC); - goto argerror; - } else { - va_end(ap); - return TCL_OK; - } - } - - vptr = va_arg(ap,void *); - if (vptr) { - if (isupper(*c)) { - obj = SWIG_Tcl_GetConstantObj(Tcl_GetStringFromObj(objv[argno+1],0)); - if (!obj) obj = objv[argno+1]; - } else { - obj = objv[argno+1]; - } - switch(*c) { - case 'i': case 'I': - case 'l': case 'L': - case 'h': case 'H': - case 'b': case 'B': - if (Tcl_GetLongFromObj(interp,obj,&tempi) != TCL_OK) goto argerror; - if ((*c == 'i') || (*c == 'I')) *((int *)vptr) = (int)tempi; - else if ((*c == 'l') || (*c == 'L')) *((long *)vptr) = (long)tempi; - else if ((*c == 'h') || (*c == 'H')) *((short*)vptr) = (short)tempi; - else if ((*c == 'b') || (*c == 'B')) *((unsigned char *)vptr) = (unsigned char)tempi; - break; - case 'f': case 'F': - case 'd': case 'D': - if (Tcl_GetDoubleFromObj(interp,obj,&tempd) != TCL_OK) goto argerror; - if ((*c == 'f') || (*c == 'F')) *((float *) vptr) = (float)tempd; - else if ((*c == 'd') || (*c == 'D')) *((double*) vptr) = tempd; - break; - case 's': case 'S': - if (*(c+1) == '#') { - int *vlptr = (int *) va_arg(ap, void *); - *((char **) vptr) = Tcl_GetStringFromObj(obj, vlptr); - c++; - } else { - *((char **)vptr) = Tcl_GetStringFromObj(obj,NULL); - } - break; - case 'c': case 'C': - *((char *)vptr) = *(Tcl_GetStringFromObj(obj,NULL)); - break; - case 'p': case 'P': - ty = (swig_type_info *) va_arg(ap, void *); - if (SWIG_Tcl_ConvertPtr(interp, obj, (void **) vptr, ty, 0) != SWIG_OK) goto argerror; - break; - case 'o': case 'O': - *((Tcl_Obj **)vptr) = objv[argno+1]; - break; - default: - break; - } - } - } - - if ((*c != ';') && ((objc-1) > argno)) { - Tcl_SetResult(interp, (char *) "Wrong # args.", TCL_STATIC); - goto argerror; - } - va_end(ap); - return TCL_OK; - - argerror: - { - char temp[32]; - sprintf(temp,"%d", argno+1); - c = strchr(fmt,':'); - if (!c) c = strchr(fmt,';'); - if (!c) c = (char *)""; - Tcl_AppendResult(interp,c," argument ", temp, NULL); - va_end(ap); - return TCL_ERROR; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclruntime.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclruntime.swg deleted file mode 100755 index bb4edd74..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclruntime.swg +++ /dev/null @@ -1,15 +0,0 @@ -/* tcl.h has to appear first */ -%insert(runtime) %{ -#include -#include -#include -#include -#include -#include -%} - -%insert(runtime) "swigrun.swg"; /* Common C API type-checking code */ -%insert(runtime) "swigerrors.swg" /* SWIG errors */ -%insert(runtime) "tclerrors.swg"; /* Tcl Errors */ -%insert(runtime) "tclapi.swg"; /* Tcl API */ -%insert(runtime) "tclrun.swg"; /* Tcl run-time code */ diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclsh.i b/mac/bin/swig/share/swig/4.1.0/tcl/tclsh.i deleted file mode 100755 index 21dc35af..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclsh.i +++ /dev/null @@ -1,57 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclsh.i - * - * SWIG File for building new tclsh program - * ----------------------------------------------------------------------------- */ - -#ifdef AUTODOC -%subsection "tclsh.i" -%text %{ -This module provides the Tcl_AppInit() function needed to build a -new version of the tclsh executable. This file should not be used -when using dynamic loading. To make an interface file work with -both static and dynamic loading, put something like this in your -interface file : - - #ifdef STATIC - %include - #endif -%} -#endif - -%{ - -/* A TCL_AppInit() function that lets you build a new copy - * of tclsh. - * - * The macro SWIG_init contains the name of the initialization - * function in the wrapper file. - */ - -#ifndef SWIG_RcFileName -char *SWIG_RcFileName = "~/.myapprc"; -#endif - - -int Tcl_AppInit(Tcl_Interp *interp){ - - if (Tcl_Init(interp) == TCL_ERROR) - return TCL_ERROR; - - /* Now initialize our functions */ - - if (SWIG_init(interp) == TCL_ERROR) - return TCL_ERROR; - Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY); - - return TCL_OK; -} - -int main(int argc, char **argv) { - Tcl_Main(argc, argv, Tcl_AppInit); - return(0); - -} - -%} - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclstrings.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclstrings.swg deleted file mode 100755 index 540d6270..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclstrings.swg +++ /dev/null @@ -1,31 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsCharPtrAndSize","header") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(Tcl_Obj *obj, char** cptr, size_t* psize, int *alloc) -{ - int len = 0; - char *cstr = Tcl_GetStringFromObj(obj, &len); - if (cstr) { - if (cptr) *cptr = cstr; - if (psize) *psize = len + 1; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - - -%fragment("SWIG_FromCharPtrAndSize","header", - fragment="") { -SWIGINTERNINLINE Tcl_Obj * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - return (size < INT_MAX) ? Tcl_NewStringObj(carray, %numeric_cast(size,int)) : NULL; -} -} - - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tcltypemaps.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tcltypemaps.swg deleted file mode 100755 index 66cce47e..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tcltypemaps.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Tcl - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ - -/* - In Tcl we need to pass the interp value, so we define the decl/call - macros as needed. -*/ - -#define SWIG_AS_DECL_ARGS SWIG_TCL_DECL_ARGS_2 -#define SWIG_AS_CALL_ARGS SWIG_TCL_CALL_ARGS_2 - - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Tcl fragments for primitive types */ -%include - -/* Tcl fragments for char* strings */ -%include - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* No director support in Tcl */ -#ifdef SWIG_DIRECTOR_TYPEMAPS -#undef SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Tcl types */ -#define SWIG_Object Tcl_Obj * - -/* Overload of the output/constant/exception handling */ - -/* output */ -#define %set_output(obj) Tcl_SetObjResult(interp,obj) - -/* append output */ -#define %append_output(obj) Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) SWIG_Tcl_SetConstantObj(interp, name, obj) - -/* raise */ -#define SWIG_Raise(obj,type,desc) SWIG_Tcl_SetErrorObj(interp,type,obj) - - -/* Include the unified typemap library */ -%include - - -/* ------------------------------------------------------------ - * Tcl extra typemaps / typemap overrides - * ------------------------------------------------------------ */ - -#if 1 -// Old 1.3.25 typemaps needed to avoid premature object deletion -%typemap(out,noblock=1) SWIGTYPE *INSTANCE, SWIGTYPE &INSTANCE, SWIGTYPE &&INSTANCE, SWIGTYPE INSTANCE[] { - Tcl_SetObjResult(interp, SWIG_NewInstanceObj( %as_voidptr($1), $1_descriptor,0)); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,%as_voidptrptr(&$1)); - Tcl_SetObjResult(interp,SWIG_NewInstanceObj(%as_voidptr($1), ty,0)); -} - -#endif - -%typemap(out) SWIGTYPE = SWIGTYPE INSTANCE; -%typemap(out) SWIGTYPE * = SWIGTYPE *INSTANCE; -%typemap(out) SWIGTYPE *const = SWIGTYPE *; -%typemap(out) SWIGTYPE & = SWIGTYPE &INSTANCE; -%typemap(out) SWIGTYPE && = SWIGTYPE &&INSTANCE; -%typemap(out) SWIGTYPE [] = SWIGTYPE INSTANCE[]; -%typemap(varout) SWIGTYPE = SWIGTYPE INSTANCE; diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tcluserdir.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tcluserdir.swg deleted file mode 100755 index d5b41fb9..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tcluserdir.swg +++ /dev/null @@ -1,5 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Special user directives - * ----------------------------------------------------------------------------- */ - - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/tclwstrings.swg b/mac/bin/swig/share/swig/4.1.0/tcl/tclwstrings.swg deleted file mode 100755 index 09374c54..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/tclwstrings.swg +++ /dev/null @@ -1,68 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclwstrings.wg - * - * Utility methods for wchar strings - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -%fragment("SWIG_AsWCharPtrAndSize","header") { -SWIGINTERN int -SWIG_AsWCharPtrAndSize(Tcl_Obj *obj, wchar_t** cptr, size_t* psize, int *alloc) -{ - int len = 0; - Tcl_UniChar *ustr = Tcl_GetUnicodeFromObj(obj, &len); - if (ustr) { - if (cptr) { - Tcl_Encoding encoding = NULL; - char *src = (char *) ustr; - int srcLen = (len)*sizeof(Tcl_UniChar); - int dstLen = sizeof(wchar_t)*(len + 1); - char *dst = %new_array(dstLen, char); - int flags = 0; - Tcl_EncodingState *statePtr = 0; - int srcRead = 0; - int dstWrote = 0; - int dstChars = 0; - Tcl_UtfToExternal(0, encoding, src, srcLen, flags, statePtr, dst, - dstLen, &srcRead, &dstWrote, &dstChars); - - *cptr = (wchar_t*)dst; - if (alloc) *alloc = SWIG_NEWOBJ; - } - if (psize) *psize = len + 1; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromWCharPtrAndSize","header") { -SWIGINTERNINLINE Tcl_Obj * -SWIG_FromWCharPtrAndSize(const wchar_t* carray, size_t size) -{ - Tcl_Obj *res = NULL; - if (size < INT_MAX) { - Tcl_Encoding encoding = NULL; - char *src = (char *) carray; - int srcLen = (int)(size*sizeof(wchar_t)); - int dstLen = (int)(size*sizeof(Tcl_UniChar)); - char *dst = %new_array(dstLen, char); - int flags = 0; - Tcl_EncodingState *statePtr = 0; - int srcRead = 0; - int dstWrote = 0; - int dstChars = 0; - - Tcl_ExternalToUtf(0, encoding, src, srcLen, flags, statePtr, dst, - dstLen, &srcRead, &dstWrote, &dstChars); - - res = Tcl_NewUnicodeObj((Tcl_UniChar*)dst, (int)size); - %delete_array(dst); - } - return res; -} -} - diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/typemaps.i b/mac/bin/swig/share/swig/4.1.0/tcl/typemaps.i deleted file mode 100755 index 04a5c78f..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/typemaps.i +++ /dev/null @@ -1,464 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * SWIG typemap library for Tcl8. This file contains various sorts - * of typemaps for modifying SWIG's code generation. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_USE_OLD_TYPEMAPS) -%include -#else - -/* -The SWIG typemap library provides a language independent mechanism for -supporting output arguments, input values, and other C function -calling mechanisms. The primary use of the library is to provide a -better interface to certain C function--especially those involving -pointers. -*/ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -%typemap(in) double *INPUT(double temp), double &INPUT(double temp) -{ - if (Tcl_GetDoubleFromObj(interp,$input,&temp) == TCL_ERROR) { - SWIG_fail; - } - $1 = &temp; -} - -%typemap(in) float *INPUT(double dvalue, float temp), float &INPUT(double dvalue, float temp) -{ - if (Tcl_GetDoubleFromObj(interp,$input,&dvalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (float) dvalue; - $1 = &temp; -} - -%typemap(in) int *INPUT(int temp), int &INPUT(int temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&temp) == TCL_ERROR) { - SWIG_fail; - } - $1 = &temp; -} - -%typemap(in) short *INPUT(int ivalue, short temp), short &INPUT(int ivalue, short temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (short) ivalue; - $1 = &temp; -} - -%typemap(in) long *INPUT(int ivalue, long temp), long &INPUT(int ivalue, long temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (long) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned int *INPUT(int ivalue, unsigned int temp), - unsigned int &INPUT(int ivalue, unsigned int temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned int) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned short *INPUT(int ivalue, unsigned short temp), - unsigned short &INPUT(int ivalue, unsigned short temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned short) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned long *INPUT(int ivalue, unsigned long temp), - unsigned long &INPUT(int ivalue, unsigned long temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned long) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned char *INPUT(int ivalue, unsigned char temp), - unsigned char &INPUT(int ivalue, unsigned char temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned char) ivalue; - $1 = &temp; -} - -%typemap(in) signed char *INPUT(int ivalue, signed char temp), - signed char &INPUT(int ivalue, signed char temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (signed char) ivalue; - $1 = &temp; -} - -%typemap(in) bool *INPUT(int ivalue, bool temp), - bool &INPUT(int ivalue, bool temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = ivalue ? true : false; - $1 = &temp; -} - -%typemap(in) long long *INPUT($*1_ltype temp), - long long &INPUT($*1_ltype temp) -{ - temp = ($*1_ltype) strtoll(Tcl_GetStringFromObj($input,NULL),0,0); - $1 = &temp; -} - -%typemap(in) unsigned long long *INPUT($*1_ltype temp), - unsigned long long &INPUT($*1_ltype temp) -{ - temp = ($*1_ltype) strtoull(Tcl_GetStringFromObj($input,NULL),0,0); - $1 = &temp; -} - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Tcl list. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters).K: - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include typemaps.i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Tcl output of the function would be a list containing both -output values. - -*/ - -%typemap(in,numinputs=0) int *OUTPUT(int temp), - short *OUTPUT(short temp), - long *OUTPUT(long temp), - unsigned int *OUTPUT(unsigned int temp), - unsigned short *OUTPUT(unsigned short temp), - unsigned long *OUTPUT(unsigned long temp), - unsigned char *OUTPUT(unsigned char temp), - signed char *OUTPUT(signed char temp), - bool *OUTPUT(bool temp), - float *OUTPUT(float temp), - double *OUTPUT(double temp), - long long *OUTPUT($*1_ltype temp), - unsigned long long *OUTPUT($*1_ltype temp), - int &OUTPUT(int temp), - short &OUTPUT(short temp), - long &OUTPUT(long temp), - unsigned int &OUTPUT(unsigned int temp), - unsigned short &OUTPUT(unsigned short temp), - unsigned long &OUTPUT(unsigned long temp), - signed char &OUTPUT(signed char temp), - bool &OUTPUT(bool temp), - unsigned char &OUTPUT(unsigned char temp), - float &OUTPUT(float temp), - double &OUTPUT(double temp), - long long &OUTPUT($*1_ltype temp), - unsigned long long &OUTPUT($*1_ltype temp) -"$1 = &temp;"; - -%typemap(argout) int *OUTPUT, int &OUTPUT, - short *OUTPUT, short &OUTPUT, - long *OUTPUT, long &OUTPUT, - unsigned int *OUTPUT, unsigned int &OUTPUT, - unsigned short *OUTPUT, unsigned short &OUTPUT, - unsigned long *OUTPUT, unsigned long &OUTPUT, - unsigned char *OUTPUT, unsigned char &OUTPUT, - signed char *OUTPUT, signed char &OUTPUT, - bool *OUTPUT, bool &OUTPUT -{ - Tcl_Obj *o; - o = Tcl_NewIntObj((int) *($1)); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -%typemap(argout) float *OUTPUT, float &OUTPUT, - double *OUTPUT, double &OUTPUT -{ - Tcl_Obj *o; - o = Tcl_NewDoubleObj((double) *($1)); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -%typemap(argout) long long *OUTPUT, long long &OUTPUT -{ - char temp[256]; - Tcl_Obj *o; - sprintf(temp,"%lld",(long long)*($1)); - o = Tcl_NewStringObj(temp,-1); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -%typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT -{ - char temp[256]; - Tcl_Obj *o; - sprintf(temp,"%llu",(unsigned long long)*($1)); - o = Tcl_NewStringObj(temp,-1); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Tcl list. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - void neg(double *INOUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Tcl). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Tcl variable you might do this : - - set x [neg $x] - -*/ - - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) unsigned int *INOUT = unsigned int *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) unsigned int &INOUT = unsigned int &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) signed char &INOUT = signed char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) unsigned int *INOUT = unsigned int *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) unsigned int &INOUT = unsigned int &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) signed char &INOUT = signed char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; - - -/* Overloading information */ - -%typemap(typecheck) double *INPUT = double; -%typemap(typecheck) bool *INPUT = bool; -%typemap(typecheck) signed char *INPUT = signed char; -%typemap(typecheck) unsigned char *INPUT = unsigned char; -%typemap(typecheck) unsigned long *INPUT = unsigned long; -%typemap(typecheck) unsigned short *INPUT = unsigned short; -%typemap(typecheck) unsigned int *INPUT = unsigned int; -%typemap(typecheck) long *INPUT = long; -%typemap(typecheck) short *INPUT = short; -%typemap(typecheck) int *INPUT = int; -%typemap(typecheck) float *INPUT = float; -%typemap(typecheck) long long *INPUT = long long; -%typemap(typecheck) unsigned long long *INPUT = unsigned long long; - -%typemap(typecheck) double &INPUT = double; -%typemap(typecheck) bool &INPUT = bool; -%typemap(typecheck) signed char &INPUT = signed char; -%typemap(typecheck) unsigned char &INPUT = unsigned char; -%typemap(typecheck) unsigned long &INPUT = unsigned long; -%typemap(typecheck) unsigned short &INPUT = unsigned short; -%typemap(typecheck) unsigned int &INPUT = unsigned int; -%typemap(typecheck) long &INPUT = long; -%typemap(typecheck) short &INPUT = short; -%typemap(typecheck) int &INPUT = int; -%typemap(typecheck) float &INPUT = float; -%typemap(typecheck) long long &INPUT = long long; -%typemap(typecheck) unsigned long long &INPUT = unsigned long long; - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) bool *INOUT = bool; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) float *INOUT = float; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) bool &INOUT = bool; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) float &INOUT = float; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; - -#endif - -// -------------------------------------------------------------------- -// Special types -// -------------------------------------------------------------------- - -%include -%include diff --git a/mac/bin/swig/share/swig/4.1.0/tcl/wish.i b/mac/bin/swig/share/swig/4.1.0/tcl/wish.i deleted file mode 100755 index 42902850..00000000 --- a/mac/bin/swig/share/swig/4.1.0/tcl/wish.i +++ /dev/null @@ -1,113 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wish.i - * - * SWIG File for making wish - * ----------------------------------------------------------------------------- */ - -#ifdef AUTODOC -%subsection "wish.i" -%text %{ -This module provides the Tk_AppInit() function needed to build a -new version of the wish executable. Like tclsh.i, this file should -not be used with dynamic loading. To make an interface file work with -both static and dynamic loading, put something like this in your -interface file : - - #ifdef STATIC - %include - #endif - -A startup file may be specified by defining the symbol SWIG_RcFileName -as follows (this should be included in a code-block) : - - #define SWIG_RcFileName "~/.mywishrc" -%} -#endif - -%{ - - -/* Initialization code for wish */ - -#include - -#ifndef SWIG_RcFileName -char *SWIG_RcFileName = "~/.wishrc"; -#endif - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppInit -- - * - * This procedure performs application-specific initialization. - * Most applications, especially those that incorporate additional - * packages, will have their own version of this procedure. - * - * Results: - * Returns a standard Tcl completion code, and leaves an error - * message in interp->result if an error occurs. - * - * Side effects: - * Depends on the startup script. - * - *---------------------------------------------------------------------- - */ - -int Tcl_AppInit(Tcl_Interp *interp) -{ - Tk_Window main; - main = Tk_MainWindow(interp); - - /* - * Call the init procedures for included packages. Each call should - * look like this: - * - * if (Mod_Init(interp) == TCL_ERROR) { - * return TCL_ERROR; - * } - * - * where "Mod" is the name of the module. - */ - - if (Tcl_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - if (Tk_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - /* - * Call Tcl_CreateCommand for application-specific commands, if - * they weren't already created by the init procedures called above. - */ - - if (SWIG_init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - /* - * Specify a user-specific startup file to invoke if the application - * is run interactively. Typically the startup file is "~/.apprc" - * where "app" is the name of the application. If this line is deleted - * then no user-specific startup file will be run under any conditions. - */ - - Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY); - return TCL_OK; -} - -#if TK_MAJOR_VERSION >= 4 -int main(int argc, char **argv) { - Tk_Main(argc, argv, Tcl_AppInit); - return(0); -} -#else -extern int main(); -#endif - -%} - - - diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/README b/mac/bin/swig/share/swig/4.1.0/typemaps/README old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/attribute.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/attribute.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/carrays.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/carrays.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/cdata.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/cdata.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/cmalloc.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/cmalloc.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/cpointer.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/cpointer.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/cstring.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/cstring.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/cstrings.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/cstrings.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/cwstring.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/cwstring.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/enumint.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/enumint.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/exception.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/exception.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/factory.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/factory.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/fragments.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/fragments.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/implicit.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/implicit.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/inoutlist.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/inoutlist.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/misctypes.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/misctypes.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/primtypes.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/primtypes.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/ptrtypes.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/ptrtypes.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/std_except.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/std_except.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/std_string.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/std_string.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/std_strings.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/std_strings.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/std_wstring.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/std_wstring.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/string.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/string.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/strings.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/strings.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/swigmacros.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/swigmacros.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/swigmove.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/swigmove.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/swigobject.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/swigobject.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/swigtype.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/swigtype.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/swigtypemaps.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/swigtypemaps.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/typemaps.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/typemaps.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/valtypes.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/valtypes.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/void.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/void.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/typemaps/wstring.swg b/mac/bin/swig/share/swig/4.1.0/typemaps/wstring.swg old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/wchar.i b/mac/bin/swig/share/swig/4.1.0/wchar.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/windows.i b/mac/bin/swig/share/swig/4.1.0/windows.i old mode 100755 new mode 100644 diff --git a/mac/bin/swig/share/swig/4.1.0/xml/typemaps.i b/mac/bin/swig/share/swig/4.1.0/xml/typemaps.i deleted file mode 100755 index 29736135..00000000 --- a/mac/bin/swig/share/swig/4.1.0/xml/typemaps.i +++ /dev/null @@ -1,3 +0,0 @@ -// -------------------------------------------------------------------- -// Empty file for %include to work -// -------------------------------------------------------------------- diff --git a/mac/bin/swig/share/swig/4.1.0/xml/xml.swg b/mac/bin/swig/share/swig/4.1.0/xml/xml.swg deleted file mode 100755 index c7bdbad0..00000000 --- a/mac/bin/swig/share/swig/4.1.0/xml/xml.swg +++ /dev/null @@ -1 +0,0 @@ -/* nothing special */ \ No newline at end of file diff --git a/versions.txt b/versions.txt index 868a3028..58b29a39 100644 --- a/versions.txt +++ b/versions.txt @@ -131,3 +131,7 @@ glslang (Built using https://github.com/YunHsiao/glslang/tree/build) ios: 11.5.0 (commit: 1978c76) linux: 11.5.0 +swig (Built using https://github.com/dumganhar/swig/tree/cocos-se) + win64: cocos-v1.1.0 (commit: fac0dbb) + mac: cocos-v1.1.0 (commit: fac0dbb) + linux: cocos-v1.1.0 (commit: fac0dbb) diff --git a/win64/bin/swig/bin/swig.exe b/win64/bin/swig/bin/swig.exe old mode 100755 new mode 100644 index e67670a2..470cf025 Binary files a/win64/bin/swig/bin/swig.exe and b/win64/bin/swig/bin/swig.exe differ diff --git a/win64/bin/swig/share/swig/4.1.0/allkw.swg b/win64/bin/swig/share/swig/4.1.0/allkw.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/attribute.i b/win64/bin/swig/share/swig/4.1.0/attribute.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/carrays.i b/win64/bin/swig/share/swig/4.1.0/carrays.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/cdata.i b/win64/bin/swig/share/swig/4.1.0/cdata.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/cmalloc.i b/win64/bin/swig/share/swig/4.1.0/cmalloc.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/constraints.i b/win64/bin/swig/share/swig/4.1.0/constraints.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/cpointer.i b/win64/bin/swig/share/swig/4.1.0/cpointer.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/arrays_csharp.i b/win64/bin/swig/share/swig/4.1.0/csharp/arrays_csharp.i deleted file mode 100755 index b33277b3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/arrays_csharp.i +++ /dev/null @@ -1,179 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_csharp.i - * - * This file contains a two approaches to marshaling arrays. The first uses - * default p/invoke marshaling and the second uses pinning of the arrays. - * - * Default marshaling approach - * ---------------------------- - * Array typemaps using default p/invoke marshaling. The data is copied to a separately - * allocated buffer when passing over the managed-native boundary. - * - * There are separate typemaps for in, out and inout arrays to enable avoiding - * unnecessary copying. - * - * Example usage: - * - * %include "arrays_csharp.i" - * %apply int INPUT[] { int* sourceArray } - * %apply int OUTPUT[] { int* targetArray } - * void myArrayCopy( int* sourceArray, int* targetArray, int nitems ); - * - * %apply int INOUT[] { int* array1, int *array2 } - * void myArraySwap( int* array1, int* array2, int nitems ); - * - * If handling large arrays you should consider using the pinning array typemaps - * described next. - * - * Pinning approach - * ---------------- - * Array typemaps using pinning. These typemaps pin the managed array given - * as parameter and pass a pointer to it to the c/c++ side. This is very - * efficient as no copying is done (unlike in the default array marshaling), - * but it makes garbage collection more difficult. When considering using - * these typemaps, think carefully whether you have callbacks that may cause - * the control to re-enter the managed side from within the call (and produce - * garbage for the gc) or whether other threads may produce enough garbage to - * trigger gc while the call is being executed. In those cases it may be - * wiser to use the default marshaling typemaps. - * - * Please note that when using fixed arrays, you have to mark your corresponding - * module class method unsafe using - * %csmethodmodifiers "public unsafe" - * (the visibility of the method is up to you). - * - * Example usage: - * - * %include "arrays_csharp.i" - * %apply int FIXED[] { int* sourceArray, int *targetArray } - * %csmethodmodifiers myArrayCopy "public unsafe"; - * void myArrayCopy( int *sourceArray, int* targetArray, int nitems ); - * - * ----------------------------------------------------------------------------- */ - -%define CSHARP_ARRAYS( CTYPE, CSTYPE ) - -// input only arrays - -%typemap(ctype) CTYPE INPUT[] "CTYPE*" -%typemap(cstype) CTYPE INPUT[] "CSTYPE[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE INPUT[] "CSTYPE[]" -%typemap(csin) CTYPE INPUT[] "$csinput" - -%typemap(in) CTYPE INPUT[] "$1 = $input;" -%typemap(freearg) CTYPE INPUT[] "" -%typemap(argout) CTYPE INPUT[] "" - -// output only arrays - -%typemap(ctype) CTYPE OUTPUT[] "CTYPE*" -%typemap(cstype) CTYPE OUTPUT[] "CSTYPE[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE OUTPUT[] "CSTYPE[]" -%typemap(csin) CTYPE OUTPUT[] "$csinput" - -%typemap(in) CTYPE OUTPUT[] "$1 = $input;" -%typemap(freearg) CTYPE OUTPUT[] "" -%typemap(argout) CTYPE OUTPUT[] "" - -// inout arrays - -%typemap(ctype) CTYPE INOUT[] "CTYPE*" -%typemap(cstype) CTYPE INOUT[] "CSTYPE[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE INOUT[] "CSTYPE[]" -%typemap(csin) CTYPE INOUT[] "$csinput" - -%typemap(in) CTYPE INOUT[] "$1 = $input;" -%typemap(freearg) CTYPE INOUT[] "" -%typemap(argout) CTYPE INOUT[] "" - -%enddef // CSHARP_ARRAYS - -CSHARP_ARRAYS(signed char, sbyte) -CSHARP_ARRAYS(unsigned char, byte) -CSHARP_ARRAYS(short, short) -CSHARP_ARRAYS(unsigned short, ushort) -CSHARP_ARRAYS(int, int) -CSHARP_ARRAYS(unsigned int, uint) -// FIXME - on Unix 64 bit, long is 8 bytes but is 4 bytes on Windows 64 bit. -// How can this be handled sensibly? -// See e.g. http://www.xml.com/ldd/chapter/book/ch10.html -CSHARP_ARRAYS(long, int) -CSHARP_ARRAYS(unsigned long, uint) -CSHARP_ARRAYS(long long, long) -CSHARP_ARRAYS(unsigned long long, ulong) -CSHARP_ARRAYS(float, float) -CSHARP_ARRAYS(double, double) - -// By default C# will marshal bools as 4 bytes -// UnmanagedType.I1 will change this to 1 byte -// FIXME - When running on mono ArraySubType appears to be ignored and bools will be marshalled as 4-byte -// https://github.com/mono/mono/issues/15592 - -// input only arrays -%typemap(ctype) bool INPUT[] "bool*" -%typemap(cstype) bool INPUT[] "bool[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool INPUT[] "bool[]" -%typemap(csin) bool INPUT[] "$csinput" - -%typemap(in) bool INPUT[] %{ -$1 = $input; -%} -%typemap(freearg) bool INPUT[] "" -%typemap(argout) bool INPUT[] "" - -// output only arrays -%typemap(ctype) bool OUTPUT[] "bool*" -%typemap(cstype) bool OUTPUT[] "bool[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool OUTPUT[] "bool[]" -%typemap(csin) bool OUTPUT[] "$csinput" - -%typemap(in) bool OUTPUT[] %{ -$1 = $input; -%} -%typemap(freearg) bool OUTPUT[] "" -%typemap(argout) bool OUTPUT[] "" - -// inout arrays -%typemap(ctype) bool INOUT[] "bool*" -%typemap(cstype) bool INOUT[] "bool[]" -%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool INOUT[] "bool[]" -%typemap(csin) bool INOUT[] "$csinput" - -%typemap(in) bool INOUT[] %{ -$1 = $input; -%} -%typemap(freearg) bool INOUT[] "" -%typemap(argout) bool INOUT[] "" - - -%define CSHARP_ARRAYS_FIXED( CTYPE, CSTYPE ) - -%typemap(ctype) CTYPE FIXED[] "CTYPE*" -%typemap(imtype) CTYPE FIXED[] "global::System.IntPtr" -%typemap(cstype) CTYPE FIXED[] "CSTYPE[]" -%typemap(csin, - pre= " fixed ( CSTYPE* swig_ptrTo_$csinput = $csinput ) {", - terminator=" }") - CTYPE FIXED[] "(global::System.IntPtr)swig_ptrTo_$csinput" - -%typemap(in) CTYPE FIXED[] "$1 = $input;" -%typemap(freearg) CTYPE FIXED[] "" -%typemap(argout) CTYPE FIXED[] "" - - -%enddef // CSHARP_ARRAYS_FIXED - -CSHARP_ARRAYS_FIXED(signed char, sbyte) -CSHARP_ARRAYS_FIXED(unsigned char, byte) -CSHARP_ARRAYS_FIXED(short, short) -CSHARP_ARRAYS_FIXED(unsigned short, ushort) -CSHARP_ARRAYS_FIXED(int, int) -CSHARP_ARRAYS_FIXED(unsigned int, uint) -CSHARP_ARRAYS_FIXED(long, int) -CSHARP_ARRAYS_FIXED(unsigned long, uint) -CSHARP_ARRAYS_FIXED(long long, long) -CSHARP_ARRAYS_FIXED(unsigned long long, ulong) -CSHARP_ARRAYS_FIXED(float, float) -CSHARP_ARRAYS_FIXED(double, double) -CSHARP_ARRAYS_FIXED(bool, bool) - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/boost_intrusive_ptr.i b/win64/bin/swig/share/swig/4.1.0/csharp/boost_intrusive_ptr.i deleted file mode 100755 index ec2fee93..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/boost_intrusive_ptr.i +++ /dev/null @@ -1,517 +0,0 @@ -// Users can provide their own SWIG_INTRUSIVE_PTR_TYPEMAPS or SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP macros before including this file to change the -// visibility of the constructor and getCPtr method if desired to public if using multiple modules. -#ifndef SWIG_INTRUSIVE_PTR_TYPEMAPS -#define SWIG_INTRUSIVE_PTR_TYPEMAPS(CONST, TYPE...) SWIG_INTRUSIVE_PTR_TYPEMAPS_IMPLEMENTATION(internal, internal, CONST, TYPE) -#endif -#ifndef SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP -#define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(CONST, TYPE...) SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP_IMPLEMENTATION(internal, internal, CONST, TYPE) -#endif - -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - // plain value - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") CONST TYPE %{ - //plain value(out) - $1_ltype* resultp = new $1_ltype($1); - intrusive_ptr_add_ref(resultp); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(resultp, SWIG_intrusive_deleter< CONST TYPE >()); -%} - -%typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain pointer - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE * %{ - //plain pointer(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in, canthrow=1) CONST TYPE & %{ - // plain reference - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if(!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); - return $null; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE & %{ - //plain reference(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) %{ - // plain pointer by reference - temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") TYPE *CONST& %{ - // plain pointer by reference(out) - #if ($owner) - if (*$1) { - intrusive_ptr_add_ref(*$1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_0); - #endif -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by value - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if (smartarg) { - $1 = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ - if ($1) { - intrusive_ptr_add_ref($1.get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1.get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by reference - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - delete &($1); - if ($self) { - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * temp = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); - $1 = *temp; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - if (*$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - delete $1; - if ($self) $1 = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - if ($1 && *$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - if ($owner) delete $1; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& (SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > temp, $*1_ltype tempp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer reference - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if ($input) { - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } - tempp = &temp; - $1 = &tempp; -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if ($self) $1 = *$input; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if (*$1 && **$1) { - intrusive_ptr_add_ref((*$1)->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >((*$1)->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "void *" -%typemap (imtype, out="global::System.IntPtr") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(cstype, TYPE)" -%typemap(csin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(cstype, TYPE).getCPtr($csinput)" - -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ - get { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >& %{ - get { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >* %{ - get { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } %} - - -%typemap(csout, excode=SWIGEXCODE) CONST TYPE { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE & { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -// Base proxy classes -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnBase; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - -// CONST version needed ???? also for C# -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%template() SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; -%enddef - - -///////////////////////////////////////////////////////////////////// - - -%include - -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - - -// plain value -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -// plain pointer -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -// plain reference -%typemap(in, canthrow=1) CONST TYPE & %{ - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "void *" -%typemap (imtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "void *" -%typemap (cstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE)" -%typemap (csin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE).getCPtr($csinput)" -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true); - } - -%typemap(csout, excode=SWIGEXCODE) CONST TYPE { - return new $typemap(cstype, TYPE)($imcall, true); - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE & { - return new $typemap(cstype, TYPE)($imcall, true); - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE * { - global::System.IntPtr cPtr = $imcall; - return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true); - } -%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { - global::System.IntPtr cPtr = $imcall; - return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true); - } - -// Base proxy classes -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnBase; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - - -// CONST version needed ???? also for C# -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" -%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef" - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/boost_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/csharp/boost_shared_ptr.i deleted file mode 100755 index d53dd3c0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/boost_shared_ptr.i +++ /dev/null @@ -1,323 +0,0 @@ -// Users can provide their own SWIG_SHARED_PTR_TYPEMAPS macro before including this file to change the -// visibility of the constructor and getCPtr method if desired to public if using multiple modules. -#ifndef SWIG_SHARED_PTR_TYPEMAPS -#define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(internal, internal, CONST, TYPE) -#endif - -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - argp = ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -%typemap(directorin) CONST TYPE -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (new $1_ltype(SWIG_STD_MOVE($1))); %} - -%typemap(directorout) CONST TYPE -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg->get(); -%} - -// plain pointer -%typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - $result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -%typemap(directorin) CONST TYPE * -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) CONST TYPE * %{ -#error "typemaps for $1_type not available" -%} - -// plain reference -%typemap(in, canthrow=1) CONST TYPE & %{ - $1 = ($1_ltype)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) CONST TYPE & -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (&$1 SWIG_NO_NULL_DELETER_0); %} - -%typemap(directorout) CONST TYPE & %{ -#error "typemaps for $1_type not available" -%} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = (TYPE *)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) TYPE *CONST& -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) TYPE *CONST& %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) $1 = *($&1_ltype)$input; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $result = $1 ? new $1_ltype($1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg; - } -%} - -// shared_ptr by reference -%typemap(in, canthrow=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $result = *$1 ? new $*1_ltype(*$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out, fragment="SWIG_null_deleter") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; - if ($owner) delete $1; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) -%{ temp = $input ? *($1_ltype)&$input : &tempnull; - $1 = &temp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "typemaps for $1_type not available" -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void *" -%typemap (imtype, out="global::System.IntPtr") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(cstype, TYPE)" - -%typemap(csin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(cstype, TYPE).getCPtr($csinput)" - -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - - -%typemap(csout, excode=SWIGEXCODE) CONST TYPE { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE & { - $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) CONST TYPE * { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) CONST TYPE & %{ - get { - $csclassname ret = new $csclassname($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) CONST TYPE * %{ - get { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, true);$excode - return ret; - } %} - -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ - get { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ - get { - global::System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } %} - -%typemap(csdirectorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE).getCPtr($cscall).Handle" - -%typemap(csdirectorin) CONST TYPE, - CONST TYPE *, - CONST TYPE &, - TYPE *CONST& "($iminput == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)($iminput, true)" - -%typemap(csdirectorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "($iminput == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)($iminput, true)" - - -// Proxy classes (base classes, ie, not derived classes) -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnBase; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/complex.i b/win64/bin/swig/share/swig/4.1.0/csharp/complex.i deleted file mode 100755 index f978f72e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/complex.i +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __cplusplus -%include -#else -#error C# module only supports complex in C++ mode. -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/csharp.swg b/win64/bin/swig/share/swig/4.1.0/csharp/csharp.swg deleted file mode 100755 index ede9a28f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/csharp.swg +++ /dev/null @@ -1,1120 +0,0 @@ -/* ----------------------------------------------------------------------------- - * csharp.swg - * - * C# typemaps - * ----------------------------------------------------------------------------- */ - -%include - -/* The ctype, imtype and cstype typemaps work together and so there should be one of each. - * The ctype typemap contains the PInvoke type used in the PInvoke (C/C++) code. - * The imtype typemap contains the C# type used in the intermediary class. - * The cstype typemap contains the C# type used in the C# proxy classes, type wrapper classes and module class. */ - -/* SWIG 3 no longer inserts using directives into generated C# code. For backwards compatibility, the SWIG2_CSHARP - macro can be defined to have SWIG 3 generate using directives similar to those generated by SWIG 2. */ -#ifdef SWIG2_CSHARP - -%typemap(csimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "\nusing global::System;\nusing global::System.Runtime.InteropServices;\n" - -%pragma(csharp) moduleimports=%{ -using global::System; -using global::System.Runtime.InteropServices; -%} - -%pragma(csharp) imclassimports=%{ -using global::System; -using global::System.Runtime.InteropServices; -%} - -#endif - - -/* Fragments */ -%fragment("SWIG_PackData", "header") { -/* Pack binary data into a string */ -SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} -} - -%fragment("SWIG_UnPackData", "header") { -/* Unpack binary data from a string */ -SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} -} - -/* Primitive types */ -%typemap(ctype) bool, const bool & "unsigned int" -%typemap(ctype) char, const char & "char" -%typemap(ctype) signed char, const signed char & "signed char" -%typemap(ctype) unsigned char, const unsigned char & "unsigned char" -%typemap(ctype) short, const short & "short" -%typemap(ctype) unsigned short, const unsigned short & "unsigned short" -%typemap(ctype) int, const int & "int" -%typemap(ctype) unsigned int, const unsigned int & "unsigned int" -%typemap(ctype) long, const long & "long" -%typemap(ctype) unsigned long, const unsigned long & "unsigned long" -%typemap(ctype) long long, const long long & "long long" -%typemap(ctype) unsigned long long, const unsigned long long & "unsigned long long" -%typemap(ctype) float, const float & "float" -%typemap(ctype) double, const double & "double" -%typemap(ctype) void "void" - -%typemap(imtype) bool, const bool & "bool" -%typemap(imtype) char, const char & "char" -%typemap(imtype) signed char, const signed char & "sbyte" -%typemap(imtype) unsigned char, const unsigned char & "byte" -%typemap(imtype) short, const short & "short" -%typemap(imtype) unsigned short, const unsigned short & "ushort" -%typemap(imtype) int, const int & "int" -%typemap(imtype) unsigned int, const unsigned int & "uint" -%typemap(imtype) long, const long & "int" -%typemap(imtype) unsigned long, const unsigned long & "uint" -%typemap(imtype) long long, const long long & "long" -%typemap(imtype) unsigned long long, const unsigned long long & "ulong" -%typemap(imtype) float, const float & "float" -%typemap(imtype) double, const double & "double" -%typemap(imtype) void "void" - -%typemap(cstype) bool, const bool & "bool" -%typemap(cstype) char, const char & "char" -%typemap(cstype) signed char, const signed char & "sbyte" -%typemap(cstype) unsigned char, const unsigned char & "byte" -%typemap(cstype) short, const short & "short" -%typemap(cstype) unsigned short, const unsigned short & "ushort" -%typemap(cstype) int, const int & "int" -%typemap(cstype) unsigned int, const unsigned int & "uint" -%typemap(cstype) long, const long & "int" -%typemap(cstype) unsigned long, const unsigned long & "uint" -%typemap(cstype) long long, const long long & "long" -%typemap(cstype) unsigned long long, const unsigned long long & "ulong" -%typemap(cstype) float, const float & "float" -%typemap(cstype) double, const double & "double" -%typemap(cstype) void "void" - -%typemap(ctype) char *, char *&, char[ANY], char[] "char *" -%typemap(imtype) char *, char *&, char[ANY], char[] "string" -%typemap(cstype) char *, char *&, char[ANY], char[] "string" - -/* Non primitive types */ -%typemap(ctype) SWIGTYPE "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE "$&csclassname" - -%typemap(ctype) SWIGTYPE [] "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE [] "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE [] "$csclassname" - -%typemap(ctype) SWIGTYPE * "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE * "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE * "$csclassname" - -%typemap(ctype) SWIGTYPE & "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE & "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE & "$csclassname" - -%typemap(ctype) SWIGTYPE && "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE && "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE && "$csclassname" - -/* pointer to a class member */ -%typemap(ctype) SWIGTYPE (CLASS::*) "char *" -%typemap(imtype) SWIGTYPE (CLASS::*) "string" -%typemap(cstype) SWIGTYPE (CLASS::*) "$csclassname" - -/* The following are the in and out typemaps. These are the PInvoke code generating typemaps for converting from C# to C and visa versa. */ - -/* primitive types */ -%typemap(in) bool -%{ $1 = $input ? true : false; %} - -%typemap(directorout) bool -%{ $result = $input ? true : false; %} - -%typemap(csdirectorin) bool "$iminput" -%typemap(csdirectorout) bool "$cscall" - -%typemap(in) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $1 = ($1_ltype)$input; %} - -%typemap(directorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin) bool "$input = $1;" -%typemap(directorin) char "$input = $1;" -%typemap(directorin) signed char "$input = $1;" -%typemap(directorin) unsigned char "$input = $1;" -%typemap(directorin) short "$input = $1;" -%typemap(directorin) unsigned short "$input = $1;" -%typemap(directorin) int "$input = $1;" -%typemap(directorin) unsigned int "$input = $1;" -%typemap(directorin) long "$input = $1;" -%typemap(directorin) unsigned long "$input = (unsigned long)$1;" -%typemap(directorin) long long "$input = $1;" -%typemap(directorin) unsigned long long "$input = $1;" -%typemap(directorin) float "$input = $1;" -%typemap(directorin) double "$input = $1;" - -%typemap(csdirectorin) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double - "$iminput" - -%typemap(csdirectorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double - "$cscall" - -%typemap(out) bool %{ $result = $1; %} -%typemap(out) char %{ $result = $1; %} -%typemap(out) signed char %{ $result = $1; %} -%typemap(out) unsigned char %{ $result = $1; %} -%typemap(out) short %{ $result = $1; %} -%typemap(out) unsigned short %{ $result = $1; %} -%typemap(out) int %{ $result = $1; %} -%typemap(out) unsigned int %{ $result = $1; %} -%typemap(out) long %{ $result = $1; %} -%typemap(out) unsigned long %{ $result = (unsigned long)$1; %} -%typemap(out) long long %{ $result = $1; %} -%typemap(out) unsigned long long %{ $result = $1; %} -%typemap(out) float %{ $result = $1; %} -%typemap(out) double %{ $result = $1; %} - -/* char * - treat as String */ -%typemap(in) char * %{ $1 = ($1_ltype)$input; %} -%typemap(out) char * %{ $result = SWIG_csharp_string_callback((const char *)$1); %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char * %{ $input = SWIG_csharp_string_callback((const char *)$1); %} -%typemap(csdirectorin) char * "$iminput" -%typemap(csdirectorout) char * "$cscall" - -/* char *& - treat as String */ -%typemap(in) char *& ($*1_ltype temp = 0) %{ - temp = ($*1_ltype)$input; - $1 = &temp; -%} -%typemap(out) char *& %{ if ($1) $result = SWIG_csharp_string_callback((const char *)*$1); %} - -%typemap(out, null="") void "" -%typemap(csdirectorin) void "$iminput" -%typemap(csdirectorout) void "$cscall" -%typemap(directorin) void "" - -/* primitive types by const reference */ -%typemap(in) const bool & ($*1_ltype temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & -%{ static $*1_ltype temp; - temp = $input ? true : false; - $result = &temp; %} - -%typemap(csdirectorin) const bool & "$iminput" -%typemap(csdirectorout) const bool & "$cscall" - -%typemap(in) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ static $*1_ltype temp; - temp = ($*1_ltype)$input; - $result = &temp; %} - -%typemap(directorin) const bool & "$input = $1;" -%typemap(directorin) const char & "$input = $1;" -%typemap(directorin) const signed char & "$input = $1;" -%typemap(directorin) const unsigned char & "$input = $1;" -%typemap(directorin) const short & "$input = $1;" -%typemap(directorin) const unsigned short & "$input = $1;" -%typemap(directorin) const int & "$input = $1;" -%typemap(directorin) const unsigned int & "$input = $1;" -%typemap(directorin) const long & "$input = $1;" -%typemap(directorin) const unsigned long & "$input = $1;" -%typemap(directorin) const long long & "$input = $1;" -%typemap(directorin) const unsigned long long & "$input = $1;" -%typemap(directorin) const float & "$input = $1;" -%typemap(directorin) const double & "$input = $1;" - -%typemap(csdirectorin) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$iminput" - -%typemap(csdirectorout) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$cscall" - - -%typemap(out) const bool & %{ $result = *$1; %} -%typemap(out) const char & %{ $result = *$1; %} -%typemap(out) const signed char & %{ $result = *$1; %} -%typemap(out) const unsigned char & %{ $result = *$1; %} -%typemap(out) const short & %{ $result = *$1; %} -%typemap(out) const unsigned short & %{ $result = *$1; %} -%typemap(out) const int & %{ $result = *$1; %} -%typemap(out) const unsigned int & %{ $result = *$1; %} -%typemap(out) const long & %{ $result = *$1; %} -%typemap(out) const unsigned long & %{ $result = (unsigned long)*$1; %} -%typemap(out) const long long & %{ $result = *$1; %} -%typemap(out) const unsigned long long & %{ $result = *$1; %} -%typemap(out) const float & %{ $result = *$1; %} -%typemap(out) const double & %{ $result = *$1; %} - -/* Default handling. Object passed by value. Convert to a pointer */ -%typemap(in, canthrow=1) SWIGTYPE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - $1 = *argp; %} - -%typemap(directorout) SWIGTYPE -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); - return $null; - } - $result = *($&1_ltype)$input; %} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ $result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - $result = $1ptr; -} -#endif - -%typemap(directorin) SWIGTYPE -%{ $input = (void *)new $1_ltype(SWIG_STD_MOVE($1)); %} -%typemap(csdirectorin) SWIGTYPE "new $&csclassname($iminput, true)" -%typemap(csdirectorout) SWIGTYPE "$&csclassname.getCPtr($cscall).Handle" - -/* Generic pointers and references */ -%typemap(in) SWIGTYPE * %{ $1 = ($1_ltype)$input; %} -%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) %{ - SWIG_UnpackData($input, (void *)&$1, sizeof($1)); -%} -%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type is null", 0); - return $null; - } %} -%typemap(in, canthrow=1, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type is null", 0); - return $null; - } - rvrdeleter.reset($1); %} -%typemap(out) SWIGTYPE * %{ $result = (void *)$1; %} -%typemap(out, fragment="SWIG_PackData") SWIGTYPE (CLASS::*) %{ - char buf[128]; - char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); - *data = '\0'; - $result = SWIG_csharp_string_callback(buf); -%} -%typemap(out) SWIGTYPE & %{ $result = (void *)$1; %} -%typemap(out) SWIGTYPE && %{ $result = (void *)$1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * -%{ $result = ($1_ltype)$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin) SWIGTYPE * -%{ $input = (void *) $1; %} -%typemap(directorin) SWIGTYPE (CLASS::*) -%{ $input = (void *) $1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); - return $null; - } - $result = ($1_ltype)$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE && -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); - return $null; - } - $result = ($1_ltype)$input; %} -%typemap(directorin) SWIGTYPE & -%{ $input = ($1_ltype) &$1; %} -%typemap(directorin) SWIGTYPE && -%{ $input = ($1_ltype) &$1; %} - -%typemap(csdirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($iminput == global::System.IntPtr.Zero) ? null : new $csclassname($iminput, false)" -%typemap(csdirectorin) SWIGTYPE & "new $csclassname($iminput, false)" -%typemap(csdirectorin) SWIGTYPE && "new $csclassname($iminput, false)" -%typemap(csdirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE &, SWIGTYPE && "$csclassname.getCPtr($cscall).Handle" - -/* Default array handling */ -%typemap(in) SWIGTYPE [] %{ $1 = ($1_ltype)$input; %} -%typemap(out) SWIGTYPE [] %{ $result = $1; %} - -/* char arrays - treat as String */ -%typemap(in) char[ANY], char[] %{ $1 = ($1_ltype)$input; %} -%typemap(out) char[ANY], char[] %{ $result = SWIG_csharp_string_callback((const char *)$1); %} - -%typemap(directorout) char[ANY], char[] %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char[ANY], char[] %{ $input = SWIG_csharp_string_callback((const char *)$1); %} - -%typemap(csdirectorin) char[ANY], char[] "$iminput" -%typemap(csdirectorout) char[ANY], char[] "$cscall" - - -/* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions - * that cannot be overloaded in C# as more than one C++ type maps to a single C# type */ - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_UINT8) - unsigned char, - const unsigned char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) - short, - const short & - "" - -%typecheck(SWIG_TYPECHECK_UINT16) - unsigned short, - const unsigned short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) - int, - long, - const int &, - const long & - "" - -%typecheck(SWIG_TYPECHECK_UINT32) - unsigned int, - unsigned long, - const unsigned int &, - const unsigned long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) - long long, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_UINT64) - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) - char *, - char *&, - char[ANY], - char[] - "" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE *const&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - -/* Exception handling */ - -%typemap(throws, canthrow=1) int, - long, - short, - unsigned int, - unsigned long, - unsigned short -%{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, error_msg); - return $null; %} - -%typemap(throws, canthrow=1) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [ANY] -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(throws, canthrow=1) char * -%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1); - return $null; %} - - -/* Typemaps for code generation in proxy classes and C# type wrapper classes */ - -/* The csin typemap is used for converting function parameter types from the type - * used in the proxy, module or type wrapper class to the type used in the PInvoke class. */ -%typemap(csin) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double & - "$csinput" -%typemap(csin) char *, char *&, char[ANY], char[] "$csinput" -%typemap(csin) SWIGTYPE "$&csclassname.getCPtr($csinput)" -%typemap(csin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$csclassname.getCPtr($csinput)" -%typemap(csin) SWIGTYPE && "$csclassname.swigRelease($csinput)" -%typemap(csin) SWIGTYPE (CLASS::*) "$csclassname.getCMemberPtr($csinput)" - -/* The csout typemap is used for converting function return types from the return type - * used in the PInvoke class to the type returned by the proxy, module or type wrapper class. - * The $excode special variable is replaced by the excode typemap attribute code if the - * method can throw any exceptions from unmanaged code, otherwise replaced by nothing. */ - -// Macro used by the $excode special variable -%define SWIGEXCODE "\n if ($imclassname.SWIGPendingException.Pending) throw $imclassname.SWIGPendingException.Retrieve();" %enddef -%define SWIGEXCODE2 "\n if ($imclassname.SWIGPendingException.Pending) throw $imclassname.SWIGPendingException.Retrieve();" %enddef - -%typemap(csout, excode=SWIGEXCODE) bool, const bool & { - bool ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) char, const char & { - char ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) signed char, const signed char & { - sbyte ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned char, const unsigned char & { - byte ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) short, const short & { - short ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned short, const unsigned short & { - ushort ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) int, const int & { - int ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned int, const unsigned int & { - uint ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) long, const long & { - int ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned long, const unsigned long & { - uint ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) long long, const long long & { - long ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) unsigned long long, const unsigned long long & { - ulong ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) float, const float & { - float ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) double, const double & { - double ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) char *, char *&, char[ANY], char[] { - string ret = $imcall;$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) void { - $imcall;$excode - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE { - $&csclassname ret = new $&csclassname($imcall, true);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE & { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE && { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE *, SWIGTYPE [] { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode - return ret; - } -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE (CLASS::*) { - string cMemberPtr = $imcall; - $csclassname ret = (cMemberPtr == null) ? null : new $csclassname(cMemberPtr, $owner);$excode - return ret; - } - - -/* Properties */ -%typemap(csvarin, excode=SWIGEXCODE2) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ - set { - $imcall;$excode - } %} - -%typemap(csvarin, excode=SWIGEXCODE2) char *, char *&, char[ANY], char[] %{ - set { - $imcall;$excode - } %} - -%typemap(csvarout, excode=SWIGEXCODE2) bool, const bool & %{ - get { - bool ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) char, const char & %{ - get { - char ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) signed char, const signed char & %{ - get { - sbyte ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned char, const unsigned char & %{ - get { - byte ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) short, const short & %{ - get { - short ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned short, const unsigned short & %{ - get { - ushort ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) int, const int & %{ - get { - int ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned int, const unsigned int & %{ - get { - uint ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) long, const long & %{ - get { - int ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned long, const unsigned long & %{ - get { - uint ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) long long, const long long & %{ - get { - long ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) unsigned long long, const unsigned long long & %{ - get { - ulong ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) float, const float & %{ - get { - float ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) double, const double & %{ - get { - double ret = $imcall;$excode - return ret; - } %} - - -%typemap(csvarout, excode=SWIGEXCODE2) char *, char *&, char[ANY], char[] %{ - get { - string ret = $imcall;$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) void %{ - get { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE %{ - get { - $&csclassname ret = new $&csclassname($imcall, true);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE & %{ - get { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE && %{ - get { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ret; - } %} -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE *, SWIGTYPE [] %{ - get { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode - return ret; - } %} - -%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE (CLASS::*) %{ - get { - string cMemberPtr = $imcall; - $csclassname ret = (cMemberPtr == null) ? null : new $csclassname(cMemberPtr, $owner);$excode - return ret; - } %} - -/* Pointer reference typemaps */ -%typemap(ctype) SWIGTYPE *const& "void *" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE *const& "global::System.Runtime.InteropServices.HandleRef" -%typemap(cstype) SWIGTYPE *const& "$*csclassname" -%typemap(csin) SWIGTYPE *const& "$*csclassname.getCPtr($csinput)" -%typemap(csout, excode=SWIGEXCODE) SWIGTYPE *const& { - global::System.IntPtr cPtr = $imcall; - $*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode - return ret; - } -%typemap(csvarout, excode=SWIGEXCODE) SWIGTYPE *const& %{ - get { - global::System.IntPtr cPtr = $imcall; - $*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode - return ret; - } %} - -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)$input; - $1 = ($1_ltype)&temp; %} -%typemap(out) SWIGTYPE *const& -%{ $result = (void *)*$1; %} -%typemap(directorin) SWIGTYPE *const& -%{ $input = (void *) $1; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = ($*1_ltype)$input; - $result = &swig_temp; %} -%typemap(csdirectorin) SWIGTYPE *const& "($iminput == global::System.IntPtr.Zero) ? null : new $*csclassname($iminput, false)" -%typemap(csdirectorout) SWIGTYPE *const& "$*csclassname.getCPtr($cscall).Handle" - -/* Marshal C/C++ pointer to global::System.IntPtr */ -%typemap(ctype) void *VOID_INT_PTR "void *" -%typemap(imtype) void *VOID_INT_PTR "global::System.IntPtr" -%typemap(cstype) void *VOID_INT_PTR "global::System.IntPtr" -%typemap(in) void *VOID_INT_PTR %{ $1 = ($1_ltype)$input; %} -%typemap(out) void *VOID_INT_PTR %{ $result = (void *)$1; %} -%typemap(csin) void *VOID_INT_PTR "$csinput" -%typemap(csout, excode=SWIGEXCODE) void *VOID_INT_PTR { - global::System.IntPtr ret = $imcall;$excode - return ret; - } -%typemap(csvarin, excode=SWIGEXCODE2) void *VOID_INT_PTR %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) void *VOID_INT_PTR %{ - get { - global::System.IntPtr ret = $imcall;$excode - return ret; - } %} -%typemap(csdirectorin) void *VOID_INT_PTR "$iminput" -%typemap(csdirectorout) void *VOID_INT_PTR "$cscall" - -/* Typemaps used for the generation of proxy and type wrapper class code */ -%typemap(csbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class" -%typemap(cscode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csinterfaces) SWIGTYPE "global::System.IDisposable" -%typemap(csinterfaces) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csinterfaces_derived) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(csinterfacemodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public interface" - - -// csbody typemaps... these are in macros so that the visibility of the methods can be easily changed by users. - -%define SWIG_CSBODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Proxy classes (base classes, ie, not derived classes) -%typemap(csbody) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef swigRelease($csclassname obj) { - if (obj != null) { - if (!obj.swigCMemOwn) - throw new global::System.ApplicationException("Cannot release ownership as memory is not owned"); - global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.Dispose(); - return ptr; - } else { - return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } -%} - -// Derived proxy classes -%typemap(csbody_derived) TYPE %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGUpcast(cPtr), cMemoryOwn) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef swigRelease($csclassname obj) { - if (obj != null) { - if (!obj.swigCMemOwn) - throw new global::System.ApplicationException("Cannot release ownership as memory is not owned"); - global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.Dispose(); - return ptr; - } else { - return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } -%} -%enddef - -%define SWIG_CSBODY_TYPEWRAPPER(PTRCTOR_VISIBILITY, DEFAULTCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Typewrapper classes -%typemap(csbody) TYPE *, TYPE &, TYPE &&, TYPE [] %{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool futureUse) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - DEFAULTCTOR_VISIBILITY $csclassname() { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef swigRelease($csclassname obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } -%} - -%typemap(csbody) TYPE (CLASS::*) %{ - private string swigCMemberPtr; - - PTRCTOR_VISIBILITY $csclassname(string cMemberPtr, bool futureUse) { - swigCMemberPtr = cMemberPtr; - } - - DEFAULTCTOR_VISIBILITY $csclassname() { - swigCMemberPtr = null; - } - - CPTR_VISIBILITY static string getCMemberPtr($csclassname obj) { - return obj.swigCMemberPtr; - } -%} -%enddef - -/* Set the default csbody typemaps to use internal visibility. - Use the macros to change to public if using multiple modules. */ -SWIG_CSBODY_PROXY(internal, internal, SWIGTYPE) -SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE) - -%typemap(csdispose) SWIGTYPE %{ - ~$csclassname() { - Dispose(false); - } - - public void Dispose() { - Dispose(true); - global::System.GC.SuppressFinalize(this); - } -%} - -%typemap(csdispose_derived) SWIGTYPE "" - -%typemap(csconstruct, excode=SWIGEXCODE,directorconnect="\n SwigDirectorConnect();") SWIGTYPE %{: this($imcall, true) {$excode$directorconnect - } -%} - -%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } - } - -%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE { - lock(this) { - if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(disposing); - } - } - -%typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{ - protected void $methodname() { - swigCMemOwn = false; - $imcall; - } -%} - -/* C# specific directives */ -#define %csconst(flag) %feature("cs:const","flag") -#define %csconstvalue(value) %feature("cs:constvalue",value) -#define %csenum(wrapapproach) %feature("cs:enum","wrapapproach") -#define %csmethodmodifiers %feature("cs:methodmodifiers") -#define %csnothrowexception %feature("except") -#define %csattributes %feature("cs:attributes") -#define %proxycode %insert("proxycode") - -%pragma(csharp) imclassclassmodifiers="class" -%pragma(csharp) moduleclassmodifiers="public class" - -/* Some ANSI C typemaps */ - -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* csharp keywords */ -%include - -// Default enum handling -%include - -// For vararg handling in macros, from swigmacros.swg -#define %arg(X...) X - -/* -// Alternative char * typemaps. -%pragma(csharp) imclasscode=%{ - public class SWIGStringMarshal : global::System.IDisposable { - public readonly global::System.Runtime.InteropServices.HandleRef swigCPtr; - public SWIGStringMarshal(string str) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, global::System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(str)); - } - public virtual void Dispose() { - global::System.Runtime.InteropServices.Marshal.FreeHGlobal(swigCPtr.Handle); - global::System.GC.SuppressFinalize(this); - } - } -%} - -%typemap(imtype, out="global::System.IntPtr") char *, char[ANY], char[] "global::System.Runtime.InteropServices.HandleRef" -%typemap(out) char *, char[ANY], char[] %{ $result = $1; %} -%typemap(csin) char *, char[ANY], char[] "new $imclassname.SWIGStringMarshal($csinput).swigCPtr" -%typemap(csout, excode=SWIGEXCODE) char *, char[ANY], char[] { - string ret = global::System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode - return ret; - } -%typemap(csvarin, excode=SWIGEXCODE2) char *, char[ANY], char[] %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) char *, char[ANY], char[] %{ - get { - string ret = global::System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode - return ret; - } %} -*/ - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/csharphead.swg b/win64/bin/swig/share/swig/4.1.0/csharp/csharphead.swg deleted file mode 100755 index cd9da813..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/csharphead.swg +++ /dev/null @@ -1,339 +0,0 @@ -/* ----------------------------------------------------------------------------- - * csharphead.swg - * - * Support code for exceptions if the SWIG_CSHARP_NO_EXCEPTION_HELPER is not defined - * Support code for strings if the SWIG_CSHARP_NO_STRING_HELPER is not defined - * ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ -#include -#include -#include -%} - -#if !defined(SWIG_CSHARP_NO_EXCEPTION_HELPER) -%insert(runtime) %{ -/* Support for throwing C# exceptions from C/C++. There are two types: - * Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */ -typedef enum { - SWIG_CSharpApplicationException, - SWIG_CSharpArithmeticException, - SWIG_CSharpDivideByZeroException, - SWIG_CSharpIndexOutOfRangeException, - SWIG_CSharpInvalidCastException, - SWIG_CSharpInvalidOperationException, - SWIG_CSharpIOException, - SWIG_CSharpNullReferenceException, - SWIG_CSharpOutOfMemoryException, - SWIG_CSharpOverflowException, - SWIG_CSharpSystemException -} SWIG_CSharpExceptionCodes; - -typedef enum { - SWIG_CSharpArgumentException, - SWIG_CSharpArgumentNullException, - SWIG_CSharpArgumentOutOfRangeException -} SWIG_CSharpExceptionArgumentCodes; - -typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *); -typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *); - -typedef struct { - SWIG_CSharpExceptionCodes code; - SWIG_CSharpExceptionCallback_t callback; -} SWIG_CSharpException_t; - -typedef struct { - SWIG_CSharpExceptionArgumentCodes code; - SWIG_CSharpExceptionArgumentCallback_t callback; -} SWIG_CSharpExceptionArgument_t; - -static SWIG_CSharpException_t SWIG_csharp_exceptions[] = { - { SWIG_CSharpApplicationException, NULL }, - { SWIG_CSharpArithmeticException, NULL }, - { SWIG_CSharpDivideByZeroException, NULL }, - { SWIG_CSharpIndexOutOfRangeException, NULL }, - { SWIG_CSharpInvalidCastException, NULL }, - { SWIG_CSharpInvalidOperationException, NULL }, - { SWIG_CSharpIOException, NULL }, - { SWIG_CSharpNullReferenceException, NULL }, - { SWIG_CSharpOutOfMemoryException, NULL }, - { SWIG_CSharpOverflowException, NULL }, - { SWIG_CSharpSystemException, NULL } -}; - -static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = { - { SWIG_CSharpArgumentException, NULL }, - { SWIG_CSharpArgumentNullException, NULL }, - { SWIG_CSharpArgumentOutOfRangeException, NULL } -}; - -static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) { - SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback; - if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) { - callback = SWIG_csharp_exceptions[code].callback; - } - callback(msg); -} - -static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { - SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback; - if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) { - callback = SWIG_csharp_exceptions_argument[code].callback; - } - callback(msg, param_name); -} -%} - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_$module( - SWIG_CSharpExceptionCallback_t applicationCallback, - SWIG_CSharpExceptionCallback_t arithmeticCallback, - SWIG_CSharpExceptionCallback_t divideByZeroCallback, - SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback, - SWIG_CSharpExceptionCallback_t invalidCastCallback, - SWIG_CSharpExceptionCallback_t invalidOperationCallback, - SWIG_CSharpExceptionCallback_t ioCallback, - SWIG_CSharpExceptionCallback_t nullReferenceCallback, - SWIG_CSharpExceptionCallback_t outOfMemoryCallback, - SWIG_CSharpExceptionCallback_t overflowCallback, - SWIG_CSharpExceptionCallback_t systemCallback) { - SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback; - SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback; - SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback; - SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback; - SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback; - SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback; - SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback; - SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback; - SWIG_csharp_exceptions[SWIG_CSharpOutOfMemoryException].callback = outOfMemoryCallback; - SWIG_csharp_exceptions[SWIG_CSharpOverflowException].callback = overflowCallback; - SWIG_csharp_exceptions[SWIG_CSharpSystemException].callback = systemCallback; -} - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( - SWIG_CSharpExceptionArgumentCallback_t argumentCallback, - SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback, - SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) { - SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback; - SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback; - SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback; -} -%} - -%pragma(csharp) imclasscode=%{ - protected class SWIGExceptionHelper { - - public delegate void ExceptionDelegate(string message); - public delegate void ExceptionArgumentDelegate(string message, string paramName); - - static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException); - static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException); - static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException); - static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException); - static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException); - static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException); - static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException); - static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException); - static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException); - static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException); - static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException); - - static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException); - static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException); - static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException); - - [global::System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="SWIGRegisterExceptionCallbacks_$module")] - public static extern void SWIGRegisterExceptionCallbacks_$module( - ExceptionDelegate applicationDelegate, - ExceptionDelegate arithmeticDelegate, - ExceptionDelegate divideByZeroDelegate, - ExceptionDelegate indexOutOfRangeDelegate, - ExceptionDelegate invalidCastDelegate, - ExceptionDelegate invalidOperationDelegate, - ExceptionDelegate ioDelegate, - ExceptionDelegate nullReferenceDelegate, - ExceptionDelegate outOfMemoryDelegate, - ExceptionDelegate overflowDelegate, - ExceptionDelegate systemExceptionDelegate); - - [global::System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_$module")] - public static extern void SWIGRegisterExceptionCallbacksArgument_$module( - ExceptionArgumentDelegate argumentDelegate, - ExceptionArgumentDelegate argumentNullDelegate, - ExceptionArgumentDelegate argumentOutOfRangeDelegate); - - static void SetPendingApplicationException(string message) { - SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingArithmeticException(string message) { - SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingDivideByZeroException(string message) { - SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingIndexOutOfRangeException(string message) { - SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingInvalidCastException(string message) { - SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingInvalidOperationException(string message) { - SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingIOException(string message) { - SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingNullReferenceException(string message) { - SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingOutOfMemoryException(string message) { - SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingOverflowException(string message) { - SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve())); - } - static void SetPendingSystemException(string message) { - SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve())); - } - - static void SetPendingArgumentException(string message, string paramName) { - SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve())); - } - static void SetPendingArgumentNullException(string message, string paramName) { - global::System.Exception e = SWIGPendingException.Retrieve(); - if (e != null) message = message + " Inner Exception: " + e.Message; - SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message)); - } - static void SetPendingArgumentOutOfRangeException(string message, string paramName) { - global::System.Exception e = SWIGPendingException.Retrieve(); - if (e != null) message = message + " Inner Exception: " + e.Message; - SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message)); - } - - static SWIGExceptionHelper() { - SWIGRegisterExceptionCallbacks_$module( - applicationDelegate, - arithmeticDelegate, - divideByZeroDelegate, - indexOutOfRangeDelegate, - invalidCastDelegate, - invalidOperationDelegate, - ioDelegate, - nullReferenceDelegate, - outOfMemoryDelegate, - overflowDelegate, - systemDelegate); - - SWIGRegisterExceptionCallbacksArgument_$module( - argumentDelegate, - argumentNullDelegate, - argumentOutOfRangeDelegate); - } - } - - protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper(); - - public class SWIGPendingException { - [global::System.ThreadStatic] - private static global::System.Exception pendingException = null; - private static int numExceptionsPending = 0; - private static global::System.Object exceptionsLock = null; - - public static bool Pending { - get { - bool pending = false; - if (numExceptionsPending > 0) - if (pendingException != null) - pending = true; - return pending; - } - } - - public static void Set(global::System.Exception e) { - if (pendingException != null) - throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); - pendingException = e; - lock(exceptionsLock) { - numExceptionsPending++; - } - } - - public static global::System.Exception Retrieve() { - global::System.Exception e = null; - if (numExceptionsPending > 0) { - if (pendingException != null) { - e = pendingException; - pendingException = null; - lock(exceptionsLock) { - numExceptionsPending--; - } - } - } - return e; - } - - static SWIGPendingException() { - exceptionsLock = new global::System.Object(); - } - } -%} -#endif // SWIG_CSHARP_NO_EXCEPTION_HELPER - -#if !defined(SWIG_CSHARP_NO_STRING_HELPER) -%insert(runtime) %{ -/* Callback for returning strings to C# without leaking memory */ -typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *); -static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL; -%} - -%pragma(csharp) imclasscode=%{ - protected class SWIGStringHelper { - - public delegate string SWIGStringDelegate(string message); - static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString); - - [global::System.Runtime.InteropServices.DllImport("$dllimport", EntryPoint="SWIGRegisterStringCallback_$module")] - public static extern void SWIGRegisterStringCallback_$module(SWIGStringDelegate stringDelegate); - - static string CreateString(string cString) { - return cString; - } - - static SWIGStringHelper() { - SWIGRegisterStringCallback_$module(stringDelegate); - } - } - - static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper(); -%} - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_$module(SWIG_CSharpStringHelperCallback callback) { - SWIG_csharp_string_callback = callback; -} -%} -#endif // SWIG_CSHARP_NO_STRING_HELPER - -#if !defined(SWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR) -// Ensure the class is not marked beforefieldinit -%pragma(csharp) imclasscode=%{ - static $imclassname() { - } -%} -#endif - -%insert(runtime) %{ -/* Contract support */ - -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } } while (0) -%} diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/csharpkw.swg b/win64/bin/swig/share/swig/4.1.0/csharp/csharpkw.swg deleted file mode 100755 index ef20cd1a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/csharpkw.swg +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef CSHARP_CSHARPKW_SWG_ -#define CSHARP_CSHARPKW_SWG_ - -/* Warnings for C# keywords */ -#define CSHARPKW(x) %keywordwarn("'" `x` "' is a C# keyword",rename="%s_") `x` - -#define CSHARPCLASSKW(x) %keywordwarn("'" `x` "' is a special method name used in the C# wrapper classes",%$isclass,rename="%s_") `x` - -/* - from - http://www.jaggersoft.com/csharp_grammar.html#1.7%20Keywords - -*/ - -CSHARPKW(abstract); -CSHARPKW(as); -CSHARPKW(base); -CSHARPKW(bool); -CSHARPKW(break); -CSHARPKW(byte); -CSHARPKW(case); -CSHARPKW(catch); -CSHARPKW(char); -CSHARPKW(checked); -CSHARPKW(class); -CSHARPKW(const); -CSHARPKW(continue); -CSHARPKW(decimal); -CSHARPKW(default); -CSHARPKW(delegate); -CSHARPKW(do); -CSHARPKW(double); -CSHARPKW(else); -CSHARPKW(enum); -CSHARPKW(event); -CSHARPKW(explicit); -CSHARPKW(extern); -CSHARPKW(false); -CSHARPKW(finally); -CSHARPKW(fixed); -CSHARPKW(float); -CSHARPKW(for); -CSHARPKW(foreach); -CSHARPKW(goto); -CSHARPKW(if); -CSHARPKW(implicit); -CSHARPKW(in); -CSHARPKW(int); -CSHARPKW(interface); -CSHARPKW(internal); -CSHARPKW(is); -CSHARPKW(lock); -CSHARPKW(long); -CSHARPKW(namespace); -CSHARPKW(new); -CSHARPKW(null); -CSHARPKW(object); -CSHARPKW(operator); -CSHARPKW(out); -CSHARPKW(override); -CSHARPKW(params); -CSHARPKW(private); -CSHARPKW(protected); -CSHARPKW(public); -CSHARPKW(readonly); -CSHARPKW(ref); -CSHARPKW(return); -CSHARPKW(sbyte); -CSHARPKW(sealed); -CSHARPKW(short); -CSHARPKW(sizeof); -CSHARPKW(stackalloc); -CSHARPKW(static); -CSHARPKW(struct); -CSHARPKW(string); -CSHARPKW(switch); -CSHARPKW(this); -CSHARPKW(throw); -CSHARPKW(true); -CSHARPKW(try); -CSHARPKW(typeof); -CSHARPKW(uint); -CSHARPKW(ulong); -CSHARPKW(unchecked); -CSHARPKW(unsafe); -CSHARPKW(ushort); -CSHARPKW(using); -CSHARPKW(virtual); -CSHARPKW(void); -CSHARPKW(volatile); -CSHARPKW(while); - -CSHARPCLASSKW(delete); - -#undef CSHARPKW - -#endif //CSHARP_CSHARPKW_SWG_ diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/director.swg b/win64/bin/swig/share/swig/4.1.0/csharp/director.swg deleted file mode 100755 index fe74c283..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/director.swg +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that C# proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#if defined(DEBUG_DIRECTOR_OWNED) -#include -#endif -#include -#include - -namespace Swig { - /* Director base class - not currently used in C# directors */ - class Director { - }; - - /* Base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - - public: - DirectorException(const char *msg) : swig_msg(msg) { - } - - DirectorException(const std::string &msg) : swig_msg(msg) { - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - /* Pure virtual method exception */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; -} - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/enums.swg b/win64/bin/swig/share/swig/4.1.0/csharp/enums.swg deleted file mode 100755 index c06c5f0c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/enums.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enums.swg - * - * Include this file in order for C/C++ enums to be wrapped by proper C# enums. - * Note that the PINVOKE layer handles the enum as an int. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(cstype) const enum SWIGTYPE & "$*csclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(csdirectorin) const enum SWIGTYPE & "($*csclassname)$iminput" -%typemap(csdirectorout) const enum SWIGTYPE & "(int)$cscall" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws, canthrow=1) const enum SWIGTYPE & -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) const enum SWIGTYPE & "(int)$csinput" -%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { - $*csclassname ret = ($*csclassname)$imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ - get { - $*csclassname ret = ($*csclassname)$imcall;$excode - return ret; - } %} - - -// enum SWIGTYPE typemaps -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(cstype) enum SWIGTYPE "$csclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(csdirectorin) enum SWIGTYPE "($csclassname)$iminput" -%typemap(csdirectorout) enum SWIGTYPE "(int)$cscall" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws, canthrow=1) enum SWIGTYPE -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) enum SWIGTYPE "(int)$csinput" -%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { - $csclassname ret = ($csclassname)$imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ - get { - $csclassname ret = ($csclassname)$imcall;$excode - return ret; - } %} - -%typemap(csbase) enum SWIGTYPE "" -%typemap(csclassmodifiers) enum SWIGTYPE "public enum" -%typemap(cscode) enum SWIGTYPE "" -%typemap(csimports) enum SWIGTYPE "" -%typemap(csinterfaces) enum SWIGTYPE "" - -%typemap(csbody) enum SWIGTYPE "" - -%csenum(proper); - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/enumsimple.swg b/win64/bin/swig/share/swig/4.1.0/csharp/enumsimple.swg deleted file mode 100755 index 8da95f2c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/enumsimple.swg +++ /dev/null @@ -1,88 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumsimple.swg - * - * This file provides backwards compatible enum wrapping. SWIG versions 1.3.21 - * and earlier wrapped global enums with constant integers in the module - * class. Enums declared within a C++ class were wrapped by constant integers - * in the C# proxy class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(cstype) const enum SWIGTYPE & "int" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(csdirectorin) const enum SWIGTYPE & "$iminput" -%typemap(csdirectorout) const enum SWIGTYPE & "$cscall" - -%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" - -%typemap(throws, canthrow=1) const enum SWIGTYPE & -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) const enum SWIGTYPE & "$csinput" -%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { - int ret = $imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ - get { - int ret = $imcall;$excode - return ret; - } %} - - -// enum SWIGTYPE typemaps -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(cstype) enum SWIGTYPE "int" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(csdirectorin) enum SWIGTYPE "$iminput" -%typemap(csdirectorout) enum SWIGTYPE "$cscall" - -%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" - -%typemap(throws, canthrow=1) enum SWIGTYPE -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) enum SWIGTYPE "$csinput" -%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { - int ret = $imcall;$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ - get { - int ret = $imcall;$excode - return ret; - } %} - -%typemap(csbase) enum SWIGTYPE "" -%typemap(csclassmodifiers) enum SWIGTYPE "" -%typemap(cscode) enum SWIGTYPE "" -%typemap(csimports) enum SWIGTYPE "" -%typemap(csinterfaces) enum SWIGTYPE "" - -%typemap(csbody) enum SWIGTYPE "" - -%csenum(simple); - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/enumtypesafe.swg b/win64/bin/swig/share/swig/4.1.0/csharp/enumtypesafe.swg deleted file mode 100755 index e169492b..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/enumtypesafe.swg +++ /dev/null @@ -1,130 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumtypesafe.swg - * - * Include this file in order for C/C++ enums to be wrapped by the so called - * typesafe enum pattern. Each enum has an equivalent C# class named after the - * enum and each enum item is a static instance of this class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(cstype) const enum SWIGTYPE & "$*csclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(csdirectorin) const enum SWIGTYPE & "$*csclassname.swigToEnum($iminput)" -%typemap(csdirectorout) const enum SWIGTYPE & "$cscall.swigValue" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws, canthrow=1) const enum SWIGTYPE & -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) const enum SWIGTYPE & "$csinput.swigValue" -%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { - $*csclassname ret = $*csclassname.swigToEnum($imcall);$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ - get { - $*csclassname ret = $*csclassname.swigToEnum($imcall);$excode - return ret; - } %} - - -// enum SWIGTYPE typemaps -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(cstype) enum SWIGTYPE "$csclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(csdirectorin) enum SWIGTYPE "$csclassname.swigToEnum($iminput)" -%typemap(csdirectorout) enum SWIGTYPE "$cscall.swigValue" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws, canthrow=1) enum SWIGTYPE -%{ (void)$1; - SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(csin) enum SWIGTYPE "$csinput.swigValue" -%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { - $csclassname ret = $csclassname.swigToEnum($imcall);$excode - return ret; - } - -%typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ - get { - $csclassname ret = $csclassname.swigToEnum($imcall);$excode - return ret; - } %} - -%typemap(csbase) enum SWIGTYPE "" -%typemap(csclassmodifiers) enum SWIGTYPE "public sealed class" -%typemap(cscode) enum SWIGTYPE "" -%typemap(csimports) enum SWIGTYPE "" -%typemap(csinterfaces) enum SWIGTYPE "" - -/* - * The swigToEnum method is used to find the C# enum from a C++ enum integer value. The default one here takes - * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial - * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be - * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. - * The special variable, $enumvalues, is replaced with a comma separated list of all the enum values. - */ -%typemap(csbody) enum SWIGTYPE %{ - public readonly int swigValue; - - public static $csclassname swigToEnum(int swigValue) { - if (swigValue < swigValues.Length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.Length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new global::System.ArgumentOutOfRangeException("No enum $csclassname with value " + swigValue); - } - - public override string ToString() { - return swigName; - } - - private $csclassname(string swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private $csclassname(string swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private $csclassname(string swigName, $csclassname swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static $csclassname[] swigValues = { $enumvalues }; - private static int swigNext = 0; - private readonly string swigName; -%} - -%csenum(typesafe); - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_array.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_array.i deleted file mode 100755 index 6c5bc19b..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_array.i +++ /dev/null @@ -1,227 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_array.i - * - * SWIG typemaps for std::array - * C# implementation - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.IReadOnlyList<> collection. - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -#include -%} - -%include - - -%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" -%proxycode %{ - public $csclassname(global::System.Collections.ICollection c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - int end = global::System.Math.Min(this.Count, c.Count); - int i = 0; - foreach ($typemap(cstype, T) elem in c) { - if (i >= end) - break; - this[i++] = elem; - } - } - - public int Count { - get { - return (int)size(); - } - } - - public $typemap(cstype, T) this[int index] { - get { - return getitem(index); - } - set { - setitem(index, value); - } - } - - public bool IsEmpty { - get { - return empty(); - } - } - - public void CopyTo($typemap(cstype, T)[] array) - { - CopyTo(0, array, 0, this.Count); - } - - public void CopyTo($typemap(cstype, T)[] array, int arrayIndex) - { - CopyTo(0, array, arrayIndex, this.Count); - } - - public void CopyTo(int index, $typemap(cstype, T)[] array, int arrayIndex, int count) - { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (index < 0) - throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (count < 0) - throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (index+count > this.Count || arrayIndex+count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - for (int i=0; i global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator - , global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> - { - private $csclassname collectionRef; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, T) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, T))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - currentObject = collectionRef[currentIndex]; - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - array(); - array(const array &other); - - size_type size() const; - bool empty() const; - - %rename(Fill) fill; - void fill(const value_type& value); - - %rename(Swap) swap; - void swap(array& other); - - %extend { - T getitemcopy(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - const_reference getitem(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - void setitem(int index, const_reference val) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - (*$self)[index] = val; - else - throw std::out_of_range("index"); - } - void Reverse() { - std::reverse($self->begin(), $self->end()); - } - void Reverse(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - std::reverse($self->begin()+index, $self->begin()+index+count); - } - } -%enddef - - -%csmethodmodifiers std::array::empty "private" -%csmethodmodifiers std::array::getitemcopy "private" -%csmethodmodifiers std::array::getitem "private" -%csmethodmodifiers std::array::setitem "private" -%csmethodmodifiers std::array::size "private" - -namespace std { - template class array { - SWIG_STD_ARRAY_INTERNAL(T, N) - }; -} diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_auto_ptr.i deleted file mode 100755 index 59a47b62..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_auto_ptr.i +++ /dev/null @@ -1,38 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap (ctype) std::auto_ptr< TYPE > "void *" -%typemap (imtype, out="System.IntPtr") std::auto_ptr< TYPE > "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) std::auto_ptr< TYPE > "$typemap(cstype, TYPE)" - -%typemap(in) std::auto_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(csin) std::auto_ptr< TYPE > "$typemap(cstype, TYPE).swigRelease($csinput)" - -%typemap (out) std::auto_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(csout, excode=SWIGEXCODE) std::auto_ptr< TYPE > { - System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_common.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_common.i deleted file mode 100755 index c80263ae..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_complex.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_complex.i deleted file mode 100755 index 919d379b..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_complex.i +++ /dev/null @@ -1,95 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_complex.i - * - * Typemaps for handling std::complex and std::complex as a .NET - * System.Numerics.Complex type. Requires .NET 4 minimum. - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -%fragment("SwigSystemNumericsComplex", "header") { -extern "C" { -// Identical to the layout of System.Numerics.Complex, but does assume that it is -// LayoutKind.Sequential on the managed side -struct SwigSystemNumericsComplex { - double real; - double imag; -}; -} - -SWIGINTERN SwigSystemNumericsComplex SwigCreateSystemNumericsComplex(double real, double imag) { - SwigSystemNumericsComplex cpx; - cpx.real = real; - cpx.imag = imag; - return cpx; -} -} - -namespace std { - -%naturalvar complex; - -template -class complex -{ -public: - complex(T re = T(), T im = T()); -}; - -} - -%define SWIG_COMPLEX_TYPEMAPS(T) -%typemap(ctype, fragment="SwigSystemNumericsComplex") std::complex, const std::complex & "SwigSystemNumericsComplex" -%typemap(imtype) std::complex, const std::complex & "System.Numerics.Complex" -%typemap(cstype) std::complex, const std::complex & "System.Numerics.Complex" - -%typemap(in) std::complex -%{$1 = std::complex< double >($input.real, $input.imag);%} - -%typemap(in) const std::complex &($*1_ltype temp) -%{temp = std::complex< T >((T)$input.real, (T)$input.imag); - $1 = &temp;%} - -%typemap(out, null="SwigCreateSystemNumericsComplex(0.0, 0.0)") std::complex -%{$result = SwigCreateSystemNumericsComplex($1.real(), $1.imag());%} - -%typemap(out, null="SwigCreateSystemNumericsComplex(0.0, 0.0)") const std::complex & -%{$result = SwigCreateSystemNumericsComplex($1->real(), $1->imag());%} - -%typemap(cstype) std::complex, const std::complex & "System.Numerics.Complex" - -%typemap(csin) std::complex, const std::complex & "$csinput" - -%typemap(csout, excode=SWIGEXCODE) std::complex, const std::complex & { - System.Numerics.Complex ret = $imcall;$excode - return ret; - } - -%typemap(csvarin, excode=SWIGEXCODE2) const std::complex & %{ - set { - $imcall;$excode - } - %} - -%typemap(csvarout, excode=SWIGEXCODE2) const std::complex & %{ - get { - System.Numerics.Complex ret = $imcall;$excode - return ret; - } - %} - -%template() std::complex; -%enddef - -// By default, typemaps for both std::complex and std::complex -// are defined, but one of them can be disabled by predefining the -// corresponding symbol before including this file. -#ifndef SWIG_NO_STD_COMPLEX_DOUBLE -SWIG_COMPLEX_TYPEMAPS(double) -#endif - -#ifndef SWIG_NO_STD_COMPLEX_FLOAT -SWIG_COMPLEX_TYPEMAPS(float) -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_deque.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_except.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_except.i deleted file mode 100755 index b989d413..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_except.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. These typemaps are - * used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws, canthrow=1) std::bad_cast "SWIG_CSharpSetPendingException(SWIG_CSharpInvalidCastException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::bad_exception "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::domain_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::exception "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::invalid_argument "SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentException, $1.what(), \"\");\n return $null;" -%typemap(throws, canthrow=1) std::length_error "SWIG_CSharpSetPendingException(SWIG_CSharpIndexOutOfRangeException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::logic_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::out_of_range "SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::overflow_error "SWIG_CSharpSetPendingException(SWIG_CSharpOverflowException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::range_error "SWIG_CSharpSetPendingException(SWIG_CSharpIndexOutOfRangeException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::runtime_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::underflow_error "SWIG_CSharpSetPendingException(SWIG_CSharpOverflowException, $1.what());\n return $null;" - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_list.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_list.i deleted file mode 100755 index f8c632df..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_list.i +++ /dev/null @@ -1,519 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list - * C# implementation - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.LinkedList<> collection. - * - * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with - * C++ std::list wrappers. The ICollection<> interface is also implemented to provide enhanced functionality - * whenever we are confident that the required C++ operator== is available. This is the case for when - * T is a primitive type or a pointer. If T does define an operator==, then use the SWIG_STD_LIST_ENHANCED - * macro to obtain this enhanced functionality, for example: - * - * SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass) - * %template(ListKlass) std::list; - * ----------------------------------------------------------------------------- */ - -%include - -// MACRO for use within the std::list class body -%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" - -%apply void *VOID_INT_PTR { std::list< CTYPE >::iterator * }; - -%proxycode %{ - public $csclassname(global::System.Collections.IEnumerable c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - foreach ($typemap(cstype, CTYPE) element in c) { - this.AddLast(element); - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public int Count { - get { - return (int)size(); - } - } - - public $csclassnameNode First { - get { - if (Count == 0) - return null; - return new $csclassnameNode(getFirstIter(), this); - } - } - - public $csclassnameNode Last { - get { - if (Count == 0) - return null; - return new $csclassnameNode(getLastIter(), this); - } - } - - public $csclassnameNode AddFirst($typemap(cstype, CTYPE) value) { - push_front(value); - return new $csclassnameNode(getFirstIter(), this); - } - - public void AddFirst($csclassnameNode newNode) { - ValidateNewNode(newNode); - if (!newNode.inlist) { - push_front(newNode.csharpvalue); - newNode.iter = getFirstIter(); - newNode.inlist = true; - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public $csclassnameNode AddLast($typemap(cstype, CTYPE) value) { - push_back(value); - return new $csclassnameNode(getLastIter(), this); - } - - public void AddLast($csclassnameNode newNode) { - ValidateNewNode(newNode); - if (!newNode.inlist) { - push_back(newNode.csharpvalue); - newNode.iter = getLastIter(); - newNode.inlist = true; - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public $csclassnameNode AddBefore($csclassnameNode node, $typemap(cstype, CTYPE) value) { - return new $csclassnameNode(insertNode(node.iter, value), this); - } - - public void AddBefore($csclassnameNode node, $csclassnameNode newNode) { - ValidateNode(node); - ValidateNewNode(newNode); - if (!newNode.inlist) { - newNode.iter = insertNode(node.iter, newNode.csharpvalue); - newNode.inlist = true; - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public $csclassnameNode AddAfter($csclassnameNode node, $typemap(cstype, CTYPE) value) { - node = node.Next; - return new $csclassnameNode(insertNode(node.iter, value), this); - } - - public void AddAfter($csclassnameNode node, $csclassnameNode newNode) { - ValidateNode(node); - ValidateNewNode(newNode); - if (!newNode.inlist) { - if (node == this.Last) - AddLast(newNode); - else - { - node = node.Next; - newNode.iter = insertNode(node.iter, newNode.csharpvalue); - newNode.inlist = true; - } - } else { - throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); - } - } - - public void Add($typemap(cstype, CTYPE) value) { - AddLast(value); - } - - public void Remove($csclassnameNode node) { - ValidateNode(node); - eraseIter(node.iter); - } - - public void CopyTo($typemap(cstype, CTYPE)[] array, int index) { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (index < 0 || index > array.Length) - throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - $csclassnameNode node = this.First; - if (node != null) { - do { - array[index++] = node.Value; - node = node.Next; - } while (node != null); - } - } - - internal void ValidateNode($csclassnameNode node) { - if (node == null) { - throw new System.ArgumentNullException("node"); - } - if (!node.inlist || node.list != this) { - throw new System.InvalidOperationException("node"); - } - } - - internal void ValidateNewNode($csclassnameNode node) { - if (node == null) { - throw new System.ArgumentNullException("node"); - } - } - - global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, - global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> - { - private $csclassname collectionRef; - private $csclassnameNode currentNode; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - currentNode = collection.First; - currentIndex = 0; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, CTYPE) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, CTYPE))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - if (currentNode == null) { - currentIndex = collectionRef.Count + 1; - return false; - } - ++currentIndex; - currentObject = currentNode.Value; - currentNode = currentNode.Next; - return true; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } - - public sealed class $csclassnameNode { - internal $csclassname list; - internal System.IntPtr iter; - internal $typemap(cstype, CTYPE) csharpvalue; - internal bool inlist; - - public $csclassnameNode($typemap(cstype, CTYPE) value) { - csharpvalue = value; - inlist = false; - } - - internal $csclassnameNode(System.IntPtr iter, $csclassname list) { - this.list = list; - this.iter = iter; - inlist = true; - } - - public $csclassname List { - get { - return this.list; - } - } - - public $csclassnameNode Next { - get { - if (list.getNextIter(iter) == System.IntPtr.Zero) - return null; - return new $csclassnameNode(list.getNextIter(iter), list); - } - } - - public $csclassnameNode Previous { - get { - if (list.getPrevIter(iter) == System.IntPtr.Zero) - return null; - return new $csclassnameNode(list.getPrevIter(iter), list); - } - } - - public $typemap(cstype, CTYPE) Value { - get { - return list.getItem(this.iter); - } - set { - list.setItem(this.iter, value); - } - } - - public static bool operator==($csclassnameNode node1, $csclassnameNode node2) { - if (object.ReferenceEquals(node1, null) && object.ReferenceEquals(node2, null)) - return true; - if (object.ReferenceEquals(node1, null) || object.ReferenceEquals(node2, null)) - return false; - return node1.Equals(node2); - } - - public static bool operator!=($csclassnameNode node1, $csclassnameNode node2) { - if (node1 == null && node2 == null) - return false; - if (node1 == null || node2 == null) - return true; - return !node1.Equals(node2); - } - - public bool Equals($csclassnameNode node) { - if (node == null) - return false; - if (!node.inlist || !this.inlist) - return object.ReferenceEquals(this, node); - return list.equals(this.iter, node.iter); - } - - public override bool Equals(object node) { - return Equals(($csclassnameNode)node); - } - - public override int GetHashCode() { - int hash = 13; - if (inlist) { - hash = (hash * 7) + this.list.GetHashCode(); - hash = (hash * 7) + this.Value.GetHashCode(); - hash = (hash * 7) + this.list.getNextIter(this.iter).GetHashCode(); - hash = (hash * 7) + this.list.getPrevIter(this.iter).GetHashCode(); - } else { - hash = (hash * 7) + this.csharpvalue.GetHashCode(); - } - return hash; - } - - public void Dispose() { - list.deleteIter(this.iter); - } - } -%} - -public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - class iterator; - - void push_front(CTYPE const& x); - void push_back(CTYPE const& x); - %rename(RemoveFirst) pop_front; - void pop_front(); - %rename(RemoveLast) pop_back; - void pop_back(); - size_type size() const; - %rename(Clear) clear; - void clear(); - %extend { - const_reference getItem(iterator *iter) { - return **iter; - } - - void setItem(iterator *iter, CTYPE const& val) { - *(*iter) = val; - } - - iterator *getFirstIter() { - if ($self->size() == 0) - return NULL; - return new std::list< CTYPE >::iterator($self->begin()); - } - - iterator *getLastIter() { - if ($self->size() == 0) - return NULL; - return new std::list< CTYPE >::iterator(--$self->end()); - } - - iterator *getNextIter(iterator *iter) { - std::list< CTYPE >::iterator it = *iter; - if (std::distance(it, --$self->end()) != 0) { - std::list< CTYPE >::iterator* itnext = new std::list< CTYPE >::iterator(++it); - return itnext; - } - return NULL; - } - - iterator *getPrevIter(iterator *iter) { - std::list< CTYPE >::iterator it = *iter; - if (std::distance($self->begin(), it) != 0) { - std::list< CTYPE >::iterator* itprev = new std::list< CTYPE >::iterator(--it); - return itprev; - } - return NULL; - } - - iterator *insertNode(iterator *iter, CTYPE const& value) { - std::list< CTYPE >::iterator it = $self->insert(*iter, value); - return new std::list< CTYPE >::iterator(it); - } - - void eraseIter(iterator *iter) { - std::list< CTYPE >::iterator it = *iter; - $self->erase(it); - } - - void deleteIter(iterator *iter) { - delete iter; - } - - bool equals(iterator *iter1, iterator *iter2) { - if (iter1 == NULL && iter2 == NULL) - return true; - std::list< CTYPE >::iterator it1 = *iter1; - std::list< CTYPE >::iterator it2 = *iter2; - return it1 == it2; - } - } -%enddef - -// Extra methods added to the collection class if operator== is defined for the class being wrapped -// The class will then implement ICollection<>, which adds extra functionality -%define SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE...) - %extend { - bool Contains(CTYPE const& value) { - return std::find($self->begin(), $self->end(), value) != $self->end(); - } - - bool Remove(CTYPE const& value) { - std::list< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); - if (it != $self->end()) { - $self->erase(it); - return true; - } - return false; - } - - iterator *find(CTYPE const& value) { - if (std::find($self->begin(), $self->end(), value) != $self->end()) { - return new std::list< CTYPE >::iterator(std::find($self->begin(), $self->end(), value)); - } - return NULL; - } - } -%proxycode %{ - public $csclassnameNode Find($typemap(cstype, CTYPE) value) { - System.IntPtr tmp = find(value); - if (tmp != System.IntPtr.Zero) { - return new $csclassnameNode(tmp, this); - } - return null; - } -%} -%enddef - -// Macros for std::list class specializations/enhancements -%define SWIG_STD_LIST_ENHANCED(CTYPE...) -namespace std { - template<> class list< CTYPE > { - SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, %arg(CTYPE)); - SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE) - }; -} -%enddef - - -%{ -#include -#include -#include -%} - -%csmethodmodifiers std::list::size "private" -%csmethodmodifiers std::list::getItem "private" -%csmethodmodifiers std::list::setItem "private" -%csmethodmodifiers std::list::push_front "private" -%csmethodmodifiers std::list::push_back "private" -%csmethodmodifiers std::list::getFirstIter "private" -%csmethodmodifiers std::list::getNextIter "private" -%csmethodmodifiers std::list::getPrevIter "private" -%csmethodmodifiers std::list::getLastIter "private" -%csmethodmodifiers std::list::find "private" -%csmethodmodifiers std::list::deleteIter "private" - -namespace std { - // primary (unspecialized) class template for std::list - // does not require operator== to be defined - template - class list { - SWIG_STD_LIST_MINIMUM_INTERNAL(IEnumerable, T) - }; - // specialization for pointers - template - class list { - SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, T *) - SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(T *) - }; -} - -// template specializations for std::list -// these provide extra collections methods as operator== is defined -SWIG_STD_LIST_ENHANCED(char) -SWIG_STD_LIST_ENHANCED(signed char) -SWIG_STD_LIST_ENHANCED(unsigned char) -SWIG_STD_LIST_ENHANCED(short) -SWIG_STD_LIST_ENHANCED(unsigned short) -SWIG_STD_LIST_ENHANCED(int) -SWIG_STD_LIST_ENHANCED(unsigned int) -SWIG_STD_LIST_ENHANCED(long) -SWIG_STD_LIST_ENHANCED(unsigned long) -SWIG_STD_LIST_ENHANCED(long long) -SWIG_STD_LIST_ENHANCED(unsigned long long) -SWIG_STD_LIST_ENHANCED(float) -SWIG_STD_LIST_ENHANCED(double) -SWIG_STD_LIST_ENHANCED(std::string) // also requires a %include -SWIG_STD_LIST_ENHANCED(std::wstring) // also requires a %include diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_map.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_map.i deleted file mode 100755 index b6369c7a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_map.i +++ /dev/null @@ -1,312 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map< K, T, C > - * - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.IDictionary<>. - * - * Using this wrapper is fairly simple. For example, to create a map from integers to doubles use: - * - * %include - * %template(MapIntDouble) std::map - * - * Notes: - * 1) IEnumerable<> is implemented in the proxy class which is useful for using LINQ with - * C++ std::map wrappers. - * - * Warning: heavy macro usage in this file. Use swig -E to get a sane view on the real file contents! - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -#include -%} - -/* K is the C++ key type, T is the C++ value type */ -%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" -%proxycode %{ - - public $typemap(cstype, T) this[$typemap(cstype, K) key] { - get { - return getitem(key); - } - - set { - setitem(key, value); - } - } - - public bool TryGetValue($typemap(cstype, K) key, out $typemap(cstype, T) value) { - if (this.ContainsKey(key)) { - value = this[key]; - return true; - } - value = default($typemap(cstype, T)); - return false; - } - - public int Count { - get { - return (int)size(); - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public global::System.Collections.Generic.ICollection<$typemap(cstype, K)> Keys { - get { - global::System.Collections.Generic.ICollection<$typemap(cstype, K)> keys = new global::System.Collections.Generic.List<$typemap(cstype, K)>(); - int size = this.Count; - if (size > 0) { - global::System.IntPtr iter = create_iterator_begin(); - for (int i = 0; i < size; i++) { - keys.Add(get_next_key(iter)); - } - destroy_iterator(iter); - } - return keys; - } - } - - public global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Values { - get { - global::System.Collections.Generic.ICollection<$typemap(cstype, T)> vals = new global::System.Collections.Generic.List<$typemap(cstype, T)>(); - foreach (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> pair in this) { - vals.Add(pair.Value); - } - return vals; - } - } - - public void Add(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { - Add(item.Key, item.Value); - } - - public bool Remove(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { - if (Contains(item)) { - return Remove(item.Key); - } else { - return false; - } - } - - public bool Contains(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { - if (this[item.Key] == item.Value) { - return true; - } else { - return false; - } - } - - public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array) { - CopyTo(array, 0); - } - - public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array, int arrayIndex) { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (arrayIndex+this.Count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - - global::System.Collections.Generic.IList<$typemap(cstype, K)> keyList = new global::System.Collections.Generic.List<$typemap(cstype, K)>(this.Keys); - for (int i = 0; i < keyList.Count; i++) { - $typemap(cstype, K) currentKey = keyList[i]; - array.SetValue(new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, this[currentKey]), arrayIndex+i); - } - } - - global::System.Collections.Generic.IEnumerator> global::System.Collections.Generic.IEnumerable>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, - global::System.Collections.Generic.IEnumerator> - { - private $csclassname collectionRef; - private global::System.Collections.Generic.IList<$typemap(cstype, K)> keyCollection; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - keyCollection = new global::System.Collections.Generic.List<$typemap(cstype, K)>(collection.Keys); - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>)currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - $typemap(cstype, K) currentKey = keyCollection[currentIndex]; - currentObject = new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, collectionRef[currentKey]); - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } - -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - size_type size() const; - bool empty() const; - %rename(Clear) clear; - void clear(); - %extend { - const mapped_type& getitem(const key_type& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator iter = $self->find(key); - if (iter != $self->end()) - return iter->second; - else - throw std::out_of_range("key not found"); - } - - void setitem(const key_type& key, const mapped_type& x) { - (*$self)[key] = x; - } - - bool ContainsKey(const key_type& key) { - std::map< K, T, C >::iterator iter = $self->find(key); - return iter != $self->end(); - } - - void Add(const key_type& key, const mapped_type& value) throw (std::out_of_range) { - std::map< K, T, C >::iterator iter = $self->find(key); - if (iter != $self->end()) - throw std::out_of_range("key already exists"); - $self->insert(std::pair< K, T >(key, value)); - } - - bool Remove(const key_type& key) { - std::map< K, T, C >::iterator iter = $self->find(key); - if (iter != $self->end()) { - $self->erase(iter); - return true; - } - return false; - } - - // create_iterator_begin(), get_next_key() and destroy_iterator work together to provide a collection of keys to C# - %apply void *VOID_INT_PTR { std::map< K, T, C >::iterator *create_iterator_begin } - %apply void *VOID_INT_PTR { std::map< K, T, C >::iterator *swigiterator } - - std::map< K, T, C >::iterator *create_iterator_begin() { - return new std::map< K, T, C >::iterator($self->begin()); - } - - const key_type& get_next_key(std::map< K, T, C >::iterator *swigiterator) { - std::map< K, T, C >::iterator iter = *swigiterator; - (*swigiterator)++; - return (*iter).first; - } - - void destroy_iterator(std::map< K, T, C >::iterator *swigiterator) { - delete swigiterator; - } - } - - -%enddef - -%csmethodmodifiers std::map::size "private" -%csmethodmodifiers std::map::getitem "private" -%csmethodmodifiers std::map::setitem "private" -%csmethodmodifiers std::map::create_iterator_begin "private" -%csmethodmodifiers std::map::get_next_key "private" -%csmethodmodifiers std::map::destroy_iterator "private" - -// Default implementation -namespace std { - template > class map { - SWIG_STD_MAP_INTERNAL(K, T, C) - }; -} - - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_pair.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_pair.i deleted file mode 100755 index 539130ff..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_set.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_set.i deleted file mode 100755 index f21e3073..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_set.i +++ /dev/null @@ -1,311 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_set.i - * - * SWIG typemaps for std::set. - * - * Note that ISet<> used here requires .NET 4 or later. - * - * The C# wrapper implements ISet<> interface and shares performance - * characteristics of C# System.Collections.Generic.SortedSet<> class, but - * doesn't provide quite all of its methods. - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -#include -%} - -%csmethodmodifiers std::set::size "private" -%csmethodmodifiers std::set::getitem "private" -%csmethodmodifiers std::set::create_iterator_begin "private" -%csmethodmodifiers std::set::get_next "private" -%csmethodmodifiers std::set::destroy_iterator "private" - -namespace std { - -// TODO: Add support for comparator and allocator template parameters. -template -class set { - -%typemap(csinterfaces) std::set "global::System.IDisposable, global::System.Collections.Generic.ISet<$typemap(cstype, T)>\n" -%proxycode %{ - 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); - } - - public bool TryGetValue($typemap(cstype, T) equalValue, out $typemap(cstype, T) actualValue) { - try { - actualValue = getitem(equalValue); - return true; - } catch { - actualValue = default($typemap(cstype, T)); - return false; - } - } - - public int Count { - get { - return (int)size(); - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public void CopyTo($typemap(cstype, T)[] array) { - CopyTo(array, 0); - } - - public void CopyTo($typemap(cstype, T)[] array, int arrayIndex) { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (arrayIndex+this.Count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - - foreach ($typemap(cstype, T) item in this) { - array.SetValue(item, arrayIndex++); - } - } - - public void ExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - Remove(item); - } - } - - public void IntersectWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - $csclassname old = new $csclassname(this); - - Clear(); - foreach ($typemap(cstype, T) item in other) { - if (old.Contains(item)) - Add(item); - } - } - - private static int count_enum(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - int count = 0; - foreach ($typemap(cstype, T) item in other) { - count++; - } - - return count; - } - - public bool IsProperSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - return IsSubsetOf(other) && Count < count_enum(other); - } - - public bool IsProperSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - return IsSupersetOf(other) && Count > count_enum(other); - } - - public bool IsSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - int countContained = 0; - - foreach ($typemap(cstype, T) item in other) { - if (Contains(item)) - countContained++; - } - - return countContained == Count; - } - - public bool IsSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - if (!Contains(item)) - return false; - } - - return true; - } - - public bool Overlaps(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - if (Contains(item)) - return true; - } - - return false; - } - - public bool SetEquals(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - return IsSupersetOf(other) && Count == count_enum(other); - } - - public void SymmetricExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - if (!Remove(item)) - Add(item); - } - } - - public void UnionWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { - foreach ($typemap(cstype, T) item in other) { - Add(item); - } - } - - private global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Items { - get { - global::System.Collections.Generic.ICollection<$typemap(cstype, T)> items = new global::System.Collections.Generic.List<$typemap(cstype, T)>(); - int size = this.Count; - if (size > 0) { - global::System.IntPtr iter = create_iterator_begin(); - for (int i = 0; i < size; i++) { - items.Add(get_next(iter)); - } - destroy_iterator(iter); - } - return items; - } - } - - global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, - global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> - { - private $csclassname collectionRef; - private global::System.Collections.Generic.IList<$typemap(cstype, T)> ItemsCollection; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - ItemsCollection = new global::System.Collections.Generic.List<$typemap(cstype, T)>(collection.Items); - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, T) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, T))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - currentObject = ItemsCollection[currentIndex]; - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } - -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T key_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - set(); - set(const set& other); - size_type size() const; - bool empty() const; - %rename(Clear) clear; - void clear(); - %extend { - bool Add(const value_type& item) { - return $self->insert(item).second; - } - - bool Contains(const value_type& item) { - return $self->count(item) != 0; - } - - bool Remove(const value_type& item) { - return $self->erase(item) != 0; - } - - const value_type& getitem(const value_type& item) throw (std::out_of_range) { - std::set::iterator iter = $self->find(item); - if (iter == $self->end()) - throw std::out_of_range("item not found"); - - return *iter; - } - - // create_iterator_begin(), get_next() and destroy_iterator work together to provide a collection of items to C# - %apply void *VOID_INT_PTR { std::set::iterator *create_iterator_begin } - %apply void *VOID_INT_PTR { std::set::iterator *swigiterator } - - std::set::iterator *create_iterator_begin() { - return new std::set::iterator($self->begin()); - } - - const key_type& get_next(std::set::iterator *swigiterator) { - std::set::iterator iter = *swigiterator; - (*swigiterator)++; - return *iter; - } - - void destroy_iterator(std::set::iterator *swigiterator) { - delete swigiterator; - } - } -}; - -} diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_shared_ptr.i deleted file mode 100755 index 01a0e9dd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_string.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_string.i deleted file mode 100755 index d61ffba4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_string.i +++ /dev/null @@ -1,111 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a C# String and are passed around by value. - * - * To use non-const std::string references use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -// string -%typemap(ctype) string "const char *" -%typemap(imtype) string "string" -%typemap(cstype) string "string" - -%typemap(csdirectorin) string "$iminput" -%typemap(csdirectorout) string "$cscall" - -%typemap(in, canthrow=1) string -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - $1.assign($input); %} -%typemap(out) string %{ $result = SWIG_csharp_string_callback($1.c_str()); %} - -%typemap(directorout, canthrow=1) string -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - $result.assign($input); %} - -%typemap(directorin) string %{ $input = $1.c_str(); %} - -%typemap(csin) string "$csinput" -%typemap(csout, excode=SWIGEXCODE) string { - string ret = $imcall;$excode - return ret; - } - -%typemap(typecheck) string = char *; - -%typemap(throws, canthrow=1) string -%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str()); - return $null; %} - -// const string & -%typemap(ctype) const string & "const char *" -%typemap(imtype) const string & "string" -%typemap(cstype) const string & "string" - -%typemap(csdirectorin) const string & "$iminput" -%typemap(csdirectorout) const string & "$cscall" - -%typemap(in, canthrow=1) const string & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - $*1_ltype $1_str($input); - $1 = &$1_str; %} -%typemap(out) const string & %{ $result = SWIG_csharp_string_callback($1->c_str()); %} - -%typemap(csin) const string & "$csinput" -%typemap(csout, excode=SWIGEXCODE) const string & { - string ret = $imcall;$excode - return ret; - } - -%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); - return $null; - } - /* possible thread/reentrant code problem */ - static $*1_ltype $1_str; - $1_str = $input; - $result = &$1_str; %} - -%typemap(directorin) const string & %{ $input = $1.c_str(); %} - -%typemap(csvarin, excode=SWIGEXCODE2) const string & %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) const string & %{ - get { - string ret = $imcall;$excode - return ret; - } %} - -%typemap(typecheck) const string & = char *; - -%typemap(throws, canthrow=1) const string & -%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str()); - return $null; %} - -} - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_unique_ptr.i deleted file mode 100755 index fcf5797d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_unique_ptr.i +++ /dev/null @@ -1,38 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap (ctype) std::unique_ptr< TYPE > "void *" -%typemap (imtype, out="System.IntPtr") std::unique_ptr< TYPE > "global::System.Runtime.InteropServices.HandleRef" -%typemap (cstype) std::unique_ptr< TYPE > "$typemap(cstype, TYPE)" - -%typemap(in) std::unique_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(csin) std::unique_ptr< TYPE > "$typemap(cstype, TYPE).swigRelease($csinput)" - -%typemap (out) std::unique_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(csout, excode=SWIGEXCODE) std::unique_ptr< TYPE > { - System.IntPtr cPtr = $imcall; - $typemap(cstype, TYPE) ret = (cPtr == System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode - return ret; - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_vector.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_vector.i deleted file mode 100755 index 4fdd26aa..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_vector.i +++ /dev/null @@ -1,418 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector - * C# implementation - * The C# wrapper is made to look and feel like a C# System.Collections.Generic.List<> collection. - * - * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with - * C++ std::vector wrappers. The IList<> interface is also implemented to provide enhanced functionality - * whenever we are confident that the required C++ operator== is available. This is the case for when - * T is a primitive type or a pointer. If T does define an operator==, then use the SWIG_STD_VECTOR_ENHANCED - * macro to obtain this enhanced functionality, for example: - * - * SWIG_STD_VECTOR_ENHANCED(SomeNamespace::Klass) - * %template(VectKlass) std::vector; - * ----------------------------------------------------------------------------- */ - -%include - -// MACRO for use within the std::vector class body -%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" -%proxycode %{ - public $csclassname(global::System.Collections.IEnumerable c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - foreach ($typemap(cstype, CTYPE) element in c) { - this.Add(element); - } - } - - public $csclassname(global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)> c) : this() { - if (c == null) - throw new global::System.ArgumentNullException("c"); - foreach ($typemap(cstype, CTYPE) element in c) { - this.Add(element); - } - } - - public bool IsFixedSize { - get { - return false; - } - } - - public bool IsReadOnly { - get { - return false; - } - } - - public $typemap(cstype, CTYPE) this[int index] { - get { - return getitem(index); - } - set { - setitem(index, value); - } - } - - public int Capacity { - get { - return (int)capacity(); - } - set { - if (value < 0 || ($typemap(cstype, size_t))value < size()) - throw new global::System.ArgumentOutOfRangeException("Capacity"); - reserve(($typemap(cstype, size_t))value); - } - } - - public int Count { - get { - return (int)size(); - } - } - - public bool IsSynchronized { - get { - return false; - } - } - - public void CopyTo($typemap(cstype, CTYPE)[] array) - { - CopyTo(0, array, 0, this.Count); - } - - public void CopyTo($typemap(cstype, CTYPE)[] array, int arrayIndex) - { - CopyTo(0, array, arrayIndex, this.Count); - } - - public void CopyTo(int index, $typemap(cstype, CTYPE)[] array, int arrayIndex, int count) - { - if (array == null) - throw new global::System.ArgumentNullException("array"); - if (index < 0) - throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); - if (arrayIndex < 0) - throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); - if (count < 0) - throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero"); - if (array.Rank > 1) - throw new global::System.ArgumentException("Multi dimensional array.", "array"); - if (index+count > this.Count || arrayIndex+count > array.Length) - throw new global::System.ArgumentException("Number of elements to copy is too large."); - for (int i=0; i global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - public $csclassnameEnumerator GetEnumerator() { - return new $csclassnameEnumerator(this); - } - - // Type-safe enumerator - /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown - /// whenever the collection is modified. This has been done for changes in the size of the - /// collection but not when one of the elements of the collection is modified as it is a bit - /// tricky to detect unmanaged code that modifies the collection under our feet. - public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator - , global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> - { - private $csclassname collectionRef; - private int currentIndex; - private object currentObject; - private int currentSize; - - public $csclassnameEnumerator($csclassname collection) { - collectionRef = collection; - currentIndex = -1; - currentObject = null; - currentSize = collectionRef.Count; - } - - // Type-safe iterator Current - public $typemap(cstype, CTYPE) Current { - get { - if (currentIndex == -1) - throw new global::System.InvalidOperationException("Enumeration not started."); - if (currentIndex > currentSize - 1) - throw new global::System.InvalidOperationException("Enumeration finished."); - if (currentObject == null) - throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, CTYPE))currentObject; - } - } - - // Type-unsafe IEnumerator.Current - object global::System.Collections.IEnumerator.Current { - get { - return Current; - } - } - - public bool MoveNext() { - int size = collectionRef.Count; - bool moveOkay = (currentIndex+1 < size) && (size == currentSize); - if (moveOkay) { - currentIndex++; - currentObject = collectionRef[currentIndex]; - } else { - currentObject = null; - } - return moveOkay; - } - - public void Reset() { - currentIndex = -1; - currentObject = null; - if (collectionRef.Count != currentSize) { - throw new global::System.InvalidOperationException("Collection modified."); - } - } - - public void Dispose() { - currentIndex = -1; - currentObject = null; - } - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - %rename(Clear) clear; - void clear(); - %rename(Add) push_back; - void push_back(CTYPE const& x); - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %newobject GetRange(int index, int count); - %newobject Repeat(CTYPE const& value, int count); - - vector(); - vector(const vector &other); - - %extend { - vector(int capacity) throw (std::out_of_range) { - std::vector< CTYPE >* pv = 0; - if (capacity >= 0) { - pv = new std::vector< CTYPE >(); - pv->reserve(capacity); - } else { - throw std::out_of_range("capacity"); - } - return pv; - } - CTYPE getitemcopy(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - CONST_REFERENCE getitem(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - return (*$self)[index]; - else - throw std::out_of_range("index"); - } - void setitem(int index, CTYPE const& val) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - (*$self)[index] = val; - else - throw std::out_of_range("index"); - } - // Takes a deep copy of the elements unlike ArrayList.AddRange - void AddRange(const std::vector< CTYPE >& values) { - $self->insert($self->end(), values.begin(), values.end()); - } - // Takes a deep copy of the elements unlike ArrayList.GetRange - std::vector< CTYPE > *GetRange(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - return new std::vector< CTYPE >($self->begin()+index, $self->begin()+index+count); - } - void Insert(int index, CTYPE const& x) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()+1) - $self->insert($self->begin()+index, x); - else - throw std::out_of_range("index"); - } - // Takes a deep copy of the elements unlike ArrayList.InsertRange - void InsertRange(int index, const std::vector< CTYPE >& values) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()+1) - $self->insert($self->begin()+index, values.begin(), values.end()); - else - throw std::out_of_range("index"); - } - void RemoveAt(int index) throw (std::out_of_range) { - if (index>=0 && index<(int)$self->size()) - $self->erase($self->begin() + index); - else - throw std::out_of_range("index"); - } - void RemoveRange(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - $self->erase($self->begin()+index, $self->begin()+index+count); - } - static std::vector< CTYPE > *Repeat(CTYPE const& value, int count) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("count"); - return new std::vector< CTYPE >(count, value); - } - void Reverse() { - std::reverse($self->begin(), $self->end()); - } - void Reverse(int index, int count) throw (std::out_of_range, std::invalid_argument) { - if (index < 0) - throw std::out_of_range("index"); - if (count < 0) - throw std::out_of_range("count"); - if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) - throw std::invalid_argument("invalid range"); - std::reverse($self->begin()+index, $self->begin()+index+count); - } - // Takes a deep copy of the elements unlike ArrayList.SetRange - void SetRange(int index, const std::vector< CTYPE >& values) throw (std::out_of_range) { - if (index < 0) - throw std::out_of_range("index"); - if (index+values.size() > $self->size()) - throw std::out_of_range("index"); - std::copy(values.begin(), values.end(), $self->begin()+index); - } - } -%enddef - -// Extra methods added to the collection class if operator== is defined for the class being wrapped -// The class will then implement IList<>, which adds extra functionality -%define SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE...) - %extend { - bool Contains(CTYPE const& value) { - return std::find($self->begin(), $self->end(), value) != $self->end(); - } - int IndexOf(CTYPE const& value) { - int index = -1; - std::vector< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); - if (it != $self->end()) - index = (int)(it - $self->begin()); - return index; - } - int LastIndexOf(CTYPE const& value) { - int index = -1; - std::vector< CTYPE >::reverse_iterator rit = std::find($self->rbegin(), $self->rend(), value); - if (rit != $self->rend()) - index = (int)($self->rend() - 1 - rit); - return index; - } - bool Remove(CTYPE const& value) { - std::vector< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); - if (it != $self->end()) { - $self->erase(it); - return true; - } - return false; - } - } -%enddef - -// Macros for std::vector class specializations/enhancements -%define SWIG_STD_VECTOR_ENHANCED(CTYPE...) -namespace std { - template<> class vector< CTYPE > { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, %arg(CTYPE)) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE) - }; -} -%enddef - -// Legacy macros -%define SWIG_STD_VECTOR_SPECIALIZE(CSTYPE, CTYPE...) -#warning SWIG_STD_VECTOR_SPECIALIZE macro deprecated, please see csharp/std_vector.i and switch to SWIG_STD_VECTOR_ENHANCED -SWIG_STD_VECTOR_ENHANCED(CTYPE) -%enddef - -%define SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(CSTYPE, CTYPE...) -#warning SWIG_STD_VECTOR_SPECIALIZE_MINIMUM macro deprecated, it is no longer required -%enddef - -%{ -#include -#include -#include -%} - -%csmethodmodifiers std::vector::getitemcopy "private" -%csmethodmodifiers std::vector::getitem "private" -%csmethodmodifiers std::vector::setitem "private" -%csmethodmodifiers std::vector::size "private" -%csmethodmodifiers std::vector::capacity "private" -%csmethodmodifiers std::vector::reserve "private" - -namespace std { - // primary (unspecialized) class template for std::vector - // does not require operator== to be defined - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IEnumerable, const value_type&, T) - }; - // specialization for pointers - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, T *) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *) - }; - // bool is specialized in the C++ standard - const_reference in particular - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, bool, bool) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(bool) - }; -} - -// template specializations for std::vector -// these provide extra collections methods as operator== is defined -SWIG_STD_VECTOR_ENHANCED(char) -SWIG_STD_VECTOR_ENHANCED(signed char) -SWIG_STD_VECTOR_ENHANCED(unsigned char) -SWIG_STD_VECTOR_ENHANCED(short) -SWIG_STD_VECTOR_ENHANCED(unsigned short) -SWIG_STD_VECTOR_ENHANCED(int) -SWIG_STD_VECTOR_ENHANCED(unsigned int) -SWIG_STD_VECTOR_ENHANCED(long) -SWIG_STD_VECTOR_ENHANCED(unsigned long) -SWIG_STD_VECTOR_ENHANCED(long long) -SWIG_STD_VECTOR_ENHANCED(unsigned long long) -SWIG_STD_VECTOR_ENHANCED(float) -SWIG_STD_VECTOR_ENHANCED(double) -SWIG_STD_VECTOR_ENHANCED(std::string) // also requires a %include -SWIG_STD_VECTOR_ENHANCED(std::wstring) // also requires a %include - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/std_wstring.i b/win64/bin/swig/share/swig/4.1.0/csharp/std_wstring.i deleted file mode 100755 index b65f7323..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/std_wstring.i +++ /dev/null @@ -1,146 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_wstring.i - * - * Typemaps for std::wstring and const std::wstring& - * std::wstring is mapped to a C# Unicode string (UTF16) and is passed around by value. - * std::wstring support includes wchar_t as a 2 byte type (Windows) and a 4 byte type - * (most Unix systems). - * - * To use non-const std::wstring references use the following %apply. Note - * that they are passed by value. - * %apply const std::wstring & {std::wstring &}; - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -%} - -%fragment("Swig_csharp_UTF16ToWString", "header") %{ -/* For converting from .NET UTF16 (2 byte unicode) strings. wchar_t is 2 bytes on Windows, 4 bytes on Linux. */ -static std::wstring Swig_csharp_UTF16ToWString(const unsigned short *str) { - if (sizeof(wchar_t) == 2) { - return std::wstring((wchar_t *)str); - } else { - const unsigned short *pBegin(str); - const unsigned short *ptr(pBegin); - - while (*ptr != 0) - ++ptr; - - std::wstring result; - result.reserve(ptr - pBegin); - while(pBegin != ptr) - result.push_back(*pBegin++); - - return result; - } -} -%} - -namespace std { - -%naturalvar wstring; - -class wstring; - -// wstring -%typemap(ctype, out="void *") wstring "unsigned short *" -%typemap(imtype, - inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directorinattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directoroutattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]" - ) wstring "string" -%typemap(cstype) wstring "string" -%typemap(csdirectorin) wstring "$iminput" -%typemap(csdirectorout) wstring "$cscall" - -%typemap(in, canthrow=1, fragment="Swig_csharp_UTF16ToWString") wstring -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - $1 = Swig_csharp_UTF16ToWString($input); %} -%typemap(out) wstring %{ $result = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} - -%typemap(directorout, canthrow=1) wstring -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - $result = Swig_csharp_UTF16ToWString($input); %} - -%typemap(directorin) wstring %{ $input = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} - -%typemap(csin) wstring "$csinput" -%typemap(csout, excode=SWIGEXCODE) wstring { - string ret = $imcall;$excode - return ret; - } - -%typemap(typecheck) wstring = wchar_t *; - -%typemap(throws, canthrow=1) wstring -%{ SWIG_csharp_ApplicationException_callback($1.c_str(), (int)$1.size()); - return $null; %} - -// const wstring & -%typemap(ctype, out="void *") const wstring & "unsigned short *" -%typemap(imtype, - inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directorinattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]", - directoroutattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]" - ) const wstring & "string" -%typemap(cstype) const wstring & "string" - -%typemap(csdirectorin) const wstring & "$iminput" -%typemap(csdirectorout) const wstring & "$cscall" - -%typemap(in, canthrow=1, fragment="Swig_csharp_UTF16ToWString") const wstring & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - std::wstring $1_str(Swig_csharp_UTF16ToWString($input)); - $1 = &$1_str; %} -%typemap(out) const wstring & %{ $result = SWIG_csharp_wstring_with_length_callback($1->c_str(), (int)$1->size()); %} - -%typemap(csin) const wstring & "$csinput" -%typemap(csout, excode=SWIGEXCODE) const wstring & { - string ret = $imcall;$excode - return ret; - } - -%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring & -%{ if (!$input) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); - return $null; - } - /* possible thread/reentrant code problem */ - static std::wstring $1_str; - $1_str = Swig_csharp_UTF16ToWString($input); - $result = &$1_str; %} - -%typemap(directorin) const wstring & %{ $input = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} - -%typemap(csvarin, excode=SWIGEXCODE2) const wstring & %{ - set { - $imcall;$excode - } %} -%typemap(csvarout, excode=SWIGEXCODE2) const wstring & %{ - get { - string ret = $imcall;$excode - return ret; - } %} - -%typemap(typecheck) const wstring & = wchar_t *; - -%typemap(throws, canthrow=1) const wstring & -%{ SWIG_csharp_ApplicationException_callback($1.c_str(), (int)$1.size()); - return $null; %} - -} - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/stl.i b/win64/bin/swig/share/swig/4.1.0/csharp/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/swiginterface.i b/win64/bin/swig/share/swig/4.1.0/csharp/swiginterface.i deleted file mode 100755 index 8b0b880d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/swiginterface.i +++ /dev/null @@ -1,63 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swiginterface.i - * - * SWIG interface feature and typemaps implementation providing: - * %interface - * %interface_impl - * %interface_custom - * ----------------------------------------------------------------------------- */ - -%define INTERFACE_TYPEMAPS(CTYPE...) -%typemap(cstype) CTYPE "$&csinterfacename" -%typemap(cstype) CTYPE *, CTYPE [], CTYPE & "$csinterfacename" -%typemap(cstype) CTYPE *const& "$*csinterfacename" -%typemap(csin) CTYPE, CTYPE & "$csinput.GetInterfaceCPtr()" -%typemap(csin) CTYPE *, CTYPE *const&, CTYPE [] "$csinput == null ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : $csinput.GetInterfaceCPtr()" -%typemap(csout, excode=SWIGEXCODE) CTYPE { - $&csclassname ret = new $&csclassname($imcall, true);$excode - return ($&csinterfacename)ret; - } -%typemap(csout, excode=SWIGEXCODE) CTYPE & { - $csclassname ret = new $csclassname($imcall, $owner);$excode - return ($csinterfacename)ret; - } -%typemap(csout, excode=SWIGEXCODE) CTYPE *, CTYPE [] { - global::System.IntPtr cPtr = $imcall; - $csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode - return ($csinterfacename)ret; - } -%typemap(csout, excode=SWIGEXCODE) CTYPE *const& { - global::System.IntPtr cPtr = $imcall; - $*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode - return ($*csinterfacename)ret; - } -%typemap(csdirectorin) CTYPE "($&csinterfacename)new $&csclassname($iminput, true)" -%typemap(csdirectorin) CTYPE & "($csinterfacename)new $csclassname($iminput, false)" -%typemap(csdirectorin) CTYPE *, CTYPE [] "($iminput == global::System.IntPtr.Zero) ? null : ($csinterfacename)new $csclassname($iminput, false)" -%typemap(csdirectorin) CTYPE *const& "($iminput == global::System.IntPtr.Zero) ? null : ($*csinterfacename)new $*csclassname($iminput, false)" -%typemap(csdirectorout) CTYPE, CTYPE *, CTYPE *const&, CTYPE [], CTYPE & "$cscall.GetInterfaceCPtr()" -%typemap(csinterfacecode, declaration=" [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n global::System.Runtime.InteropServices.HandleRef GetInterfaceCPtr();\n", cptrmethod="$interfacename_GetInterfaceCPtr") CTYPE %{ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - global::System.Runtime.InteropServices.HandleRef $interfacename.GetInterfaceCPtr() { - return new global::System.Runtime.InteropServices.HandleRef(this, $imclassname.$csclazzname$interfacename_GetInterfaceCPtr(swigCPtr.Handle)); - } -%} -%enddef - -%define %interface(CTYPE...) -%feature("interface", name="%sSwigInterface") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_impl(CTYPE...) -%rename("%sSwigImpl") CTYPE; -%feature("interface", name="%(rstrip:[SwigImpl])s") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_custom(PROXY, INTERFACE, CTYPE...) -%rename(PROXY) CTYPE; -%feature("interface", name=INTERFACE) CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/swigmove.i b/win64/bin/swig/share/swig/4.1.0/csharp/swigmove.i deleted file mode 100755 index 564c47fa..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/swigmove.i +++ /dev/null @@ -1,16 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, canthrow=1, fragment="") SWIGTYPE MOVE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); - return $null; - } - SwigValueWrapper< $1_ltype >::reset($1, argp); %} - -%typemap(csin) SWIGTYPE MOVE "$&csclassname.swigRelease($csinput)" diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/swigtype_inout.i b/win64/bin/swig/share/swig/4.1.0/csharp/swigtype_inout.i deleted file mode 100755 index 9a30d4b6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/swigtype_inout.i +++ /dev/null @@ -1,34 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigtype_inout.i - * - * Pointer pointer and pointer reference handling typemap library for non-primitive types - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointer references and pointer to pointers. - * - * These are named typemaps (OUTPUT) and can be used like any named typemap. - * Alternatively they can be made the default by using %apply: - * %apply SWIGTYPE *& OUTPUT { SWIGTYPE *& } - * ----------------------------------------------------------------------------- */ - -/* - * OUTPUT typemaps. Example usage wrapping: - * - * void f(XXX *& x) { x = new XXX(111); } - * - * would be: - * - * XXX x = null; - * f(out x); - * // use x - * x.Dispose(); // manually clear memory or otherwise leave out and leave it to the garbage collector - */ -%typemap(ctype) SWIGTYPE *& OUTPUT "void **" -%typemap(imtype, out="global::System.IntPtr") SWIGTYPE *& OUTPUT "out global::System.IntPtr" -%typemap(cstype) SWIGTYPE *& OUTPUT "out $*csclassname" -%typemap(csin, - pre=" global::System.IntPtr cPtr_$csinput = global::System.IntPtr.Zero;", - post=" $csinput = (cPtr_$csinput == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr_$csinput, true);", - cshin="out $csinput") SWIGTYPE *& OUTPUT "out cPtr_$csinput" -%typemap(in) SWIGTYPE *& OUTPUT %{ $1 = ($1_ltype)$input; %} -%typemap(freearg) SWIGTYPE *& OUTPUT "" diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/typemaps.i b/win64/bin/swig/share/swig/4.1.0/csharp/typemaps.i deleted file mode 100755 index 9cbb752f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/typemaps.i +++ /dev/null @@ -1,253 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps are used for pointer/reference parameters that are input only -and are mapped to a C# input parameter. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In C# you could then use it like this: - double answer = modulename.fadd(10.0, 20.0); -*/ - -%define INPUT_TYPEMAP(TYPE, CTYPE, CSTYPE) -%typemap(ctype, out="void *") TYPE *INPUT, TYPE &INPUT "CTYPE" -%typemap(imtype, out="global::System.IntPtr") TYPE *INPUT, TYPE &INPUT "CSTYPE" -%typemap(cstype, out="$csclassname") TYPE *INPUT, TYPE &INPUT "CSTYPE" -%typemap(csin) TYPE *INPUT, TYPE &INPUT "$csinput" - -%typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(typecheck) TYPE *INPUT = TYPE; -%typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, unsigned int, bool) -//INPUT_TYPEMAP(char, char, char) -INPUT_TYPEMAP(signed char, signed char, sbyte) -INPUT_TYPEMAP(unsigned char, unsigned char, byte) -INPUT_TYPEMAP(short, short, short) -INPUT_TYPEMAP(unsigned short, unsigned short, ushort) -INPUT_TYPEMAP(int, int, int) -INPUT_TYPEMAP(unsigned int, unsigned int, uint) -INPUT_TYPEMAP(long, long, int) -INPUT_TYPEMAP(unsigned long, unsigned long, uint) -INPUT_TYPEMAP(long long, long long, long) -INPUT_TYPEMAP(unsigned long long, unsigned long long, ulong) -INPUT_TYPEMAP(float, float, float) -INPUT_TYPEMAP(double, double, double) - -#undef INPUT_TYPEMAP - -/* -OUTPUT typemaps ---------------- - -These typemaps are used for pointer/reference parameters that are output only and -are mapped to a C# output parameter. - -The following typemaps can be applied to turn a pointer or reference into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In C#, the 'out' keyword is -used when passing the parameter to a function that takes an output parameter. - - bool *OUTPUT, bool &OUTPUT - signed char *OUTPUT, signed char &OUTPUT - unsigned char *OUTPUT, unsigned char &OUTPUT - short *OUTPUT, short &OUTPUT - unsigned short *OUTPUT, unsigned short &OUTPUT - int *OUTPUT, int &OUTPUT - unsigned int *OUTPUT, unsigned int &OUTPUT - long *OUTPUT, long &OUTPUT - unsigned long *OUTPUT, unsigned long &OUTPUT - long long *OUTPUT, long long &OUTPUT - unsigned long long *OUTPUT, unsigned long long &OUTPUT - float *OUTPUT, float &OUTPUT - double *OUTPUT, double &OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters): - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The C# output of the function would be the function return value and the -value returned in the second output parameter. In C# you would use it like this: - - double dptr; - double fraction = modulename.modf(5, out dptr); -*/ - -%define OUTPUT_TYPEMAP(TYPE, CTYPE, CSTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *OUTPUT, TYPE &OUTPUT "CTYPE *" -%typemap(imtype, out="global::System.IntPtr") TYPE *OUTPUT, TYPE &OUTPUT "out CSTYPE" -%typemap(cstype, out="$csclassname") TYPE *OUTPUT, TYPE &OUTPUT "out CSTYPE" -%typemap(csin) TYPE *OUTPUT, TYPE &OUTPUT "out $csinput" - -%typemap(in) TYPE *OUTPUT, TYPE &OUTPUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *OUTPUT, TYPE &OUTPUT "" -%enddef - -OUTPUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//OUTPUT_TYPEMAP(char, char, char, CHAR_PTR) -OUTPUT_TYPEMAP(signed char, signed char, sbyte, INT8_PTR) -OUTPUT_TYPEMAP(unsigned char, unsigned char, byte, UINT8_PTR) -OUTPUT_TYPEMAP(short, short, short, INT16_PTR) -OUTPUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -OUTPUT_TYPEMAP(int, int, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long, long, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long long, long long, long, INT64_PTR) -OUTPUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -OUTPUT_TYPEMAP(float, float, float, FLOAT_PTR) -OUTPUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -#undef OUTPUT_TYPEMAP - -%typemap(in) bool *OUTPUT, bool &OUTPUT -%{ *$input = 0; - $1 = ($1_ltype)$input; %} - - -/* -INOUT typemaps --------------- - -These typemaps are for pointer/reference parameters that are both input and -output and are mapped to a C# reference parameter. - -The following typemaps can be applied to turn a pointer or reference into a -reference parameters, that is the parameter is both an input and an output. -In C#, the 'ref' keyword is used for reference parameters. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -The C# output of the function would be the new value returned by the -reference parameter. In C# you would use it like this: - - - double x = 5.0; - neg(ref x); - -The implementation of the OUTPUT and INOUT typemaps is different to the scripting -languages in that the scripting languages will return the output value as part -of the function return value. - -*/ - -%define INOUT_TYPEMAP(TYPE, CTYPE, CSTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *INOUT, TYPE &INOUT "CTYPE *" -%typemap(imtype, out="global::System.IntPtr") TYPE *INOUT, TYPE &INOUT "ref CSTYPE" -%typemap(cstype, out="$csclassname") TYPE *INOUT, TYPE &INOUT "ref CSTYPE" -%typemap(csin) TYPE *INOUT, TYPE &INOUT "ref $csinput" - -%typemap(in) TYPE *INOUT, TYPE &INOUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *INOUT, TYPE &INOUT "" -%enddef - -INOUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//INOUT_TYPEMAP(char, char, char, CHAR_PTR) -INOUT_TYPEMAP(signed char, signed char, sbyte, INT8_PTR) -INOUT_TYPEMAP(unsigned char, unsigned char, byte, UINT8_PTR) -INOUT_TYPEMAP(short, short, short, INT16_PTR) -INOUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -INOUT_TYPEMAP(int, int, int, INT32_PTR) -INOUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -INOUT_TYPEMAP(long, long, int, INT32_PTR) -INOUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) -INOUT_TYPEMAP(long long, long long, long, INT64_PTR) -INOUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -INOUT_TYPEMAP(float, float, float, FLOAT_PTR) -INOUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -#undef INOUT_TYPEMAP - diff --git a/win64/bin/swig/share/swig/4.1.0/csharp/wchar.i b/win64/bin/swig/share/swig/4.1.0/csharp/wchar.i deleted file mode 100755 index 5616ab9f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/csharp/wchar.i +++ /dev/null @@ -1,335 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wchar.i - * - * Typemaps for the wchar_t type - * wchar_t * is mapped to a C# Unicode string (UTF16) and is passed around by value. - * wchar_t * support includes wchar_t as a 2 byte type (Windows) and a 4 byte type - * (most Unix systems). - * - * Support code for wide strings can be turned off by defining SWIG_CSHARP_NO_WSTRING_HELPER - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_CSHARP_NO_WSTRING_HELPER) -#if !defined(SWIG_CSHARP_WSTRING_HELPER_) -#define SWIG_CSHARP_WSTRING_HELPER_ - -%fragment(""); // TODO: %fragment("") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) (new wchar_t[wcslen((const wchar_t *)$input)+1]); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,fragment="") wchar_t * { - delete [] $1; - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) (new wchar_t[wcslen((const wchar_t *)$input)+1]); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,warning=SWIGWARN_TYPEMAP_WCHARLEAK_MSG,fragment="") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) (new wchar_t[wcslen((const wchar_t *)$input)+1]); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -#else -%typemap(memberin,fragment="") wchar_t * { - free($1); - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(memberin,warning=SWIGWARN_TYPEMAP_WCHARLEAK_MSG,fragment="") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,fragment="") wchar_t * { - free($1); - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} -%typemap(globalin,warning=SWIGWARN_TYPEMAP_WCHARLEAK_MSG,fragment="") const wchar_t * { - if ($input && sizeof(wchar_t) == 2) { - $1 = ($1_type) malloc(wcslen((const wchar_t *)$input)+1); - wcscpy((wchar_t *)$1, (const wchar_t *)$input); - } else { - $1 = $input; - $input = 0; - } -} - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/cstring.i b/win64/bin/swig/share/swig/4.1.0/cstring.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/cwstring.i b/win64/bin/swig/share/swig/4.1.0/cwstring.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/d/boost_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/d/boost_shared_ptr.i deleted file mode 100755 index 9a664157..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/boost_shared_ptr.i +++ /dev/null @@ -1,293 +0,0 @@ -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ((*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\"))) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ - argp = ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0; - if (!argp) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -%typemap(directorin) CONST TYPE -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (new $1_ltype(SWIG_STD_MOVE($1))); %} - -%typemap(directorout) CONST TYPE -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg->get(); -%} - -// plain pointer -%typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - $result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -%typemap(directorin) CONST TYPE * -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) CONST TYPE * %{ -#error "typemaps for $1_type not available" -%} - -// plain reference -%typemap(in, canthrow=1) CONST TYPE & %{ - $1 = ($1_ltype)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - if (!$1) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "$1_type reference is null"); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) CONST TYPE & -%{ $input = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (&$1 SWIG_NO_NULL_DELETER_0); %} - -%typemap(directorout) CONST TYPE & %{ -#error "typemaps for $1_type not available" -%} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = (TYPE *)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin) TYPE *CONST& -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %} - -%typemap(directorout) TYPE *CONST& %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) $1 = *($&1_ltype)$input; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $result = $1 ? new $1_ltype($1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; - $result = *smartarg; - } -%} - -// shared_ptr by reference -%typemap(in, canthrow=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $result = *$1 ? new $*1_ltype(*$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $input = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) -%{ $1 = $input ? ($1_ltype)$input : &tempnull; %} -%typemap(out, fragment="SWIG_null_deleter") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; - if ($owner) delete $1; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) -%{ temp = $input ? *($1_ltype)&$input : &tempnull; - $1 = &temp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} - -%typemap(directorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ $input = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "typemaps for $1_type not available" -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void *" -%typemap (imtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void*" -%typemap (dtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(dtype, TYPE)" - -%typemap(din) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(dtype, TYPE).swigGetCPtr($dinput)" - -%typemap(ddirectorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(dtype, TYPE).swigGetCPtr($dcall)" - -%typemap(ddirectorin) CONST TYPE, - CONST TYPE *, - CONST TYPE &, - TYPE *CONST& "($winput is null) ? null : new $typemap(dtype, TYPE)($winput, true)" - -%typemap(ddirectorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "($winput is null) ? null : new $typemap(dtype, TYPE)($winput, true)" - - -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - - -%typemap(dout, excode=SWIGEXCODE) CONST TYPE { - auto ret = new $typemap(dtype, TYPE)($imcall, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) CONST TYPE & { - auto ret = new $typemap(dtype, TYPE)($imcall, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) CONST TYPE * { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} -%typemap(dout, excode=SWIGEXCODE) TYPE *CONST& { - void* cPtr = $imcall; - auto ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - -// Proxy classes (base classes, ie, not derived classes) -%typemap(dbody) SWIGTYPE %{ -private void* swigCPtr; -private bool swigCMemOwn; - -public this(void* cObject, bool ownCObject) { - swigCPtr = cObject; - swigCMemOwn = ownCObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} -%} - -// Derived proxy classes -%typemap(dbody_derived) SWIGTYPE %{ -private void* swigCPtr; -private bool swigCMemOwn; - -public this(void* cObject, bool ownCObject) { - super($imdmodule.$dclazznameSmartPtrUpcast(cObject), ownCObject); - swigCPtr = cObject; - swigCMemOwn = ownCObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} -%} - -%typemap(ddispose, methodname="dispose", methodmodifiers="public") TYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - } - } -} - -%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public") TYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - super.dispose(); - } - } -} - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/d/carrays.i b/win64/bin/swig/share/swig/4.1.0/d/carrays.i deleted file mode 100755 index 2f96fe2a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/carrays.i +++ /dev/null @@ -1,111 +0,0 @@ -/* ----------------------------------------------------------------------------- - * carrays.i - * - * D-specific version of ../carrays.i. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * %array_functions(TYPE,NAME) - * - * Generates functions for creating and accessing elements of a C array - * (as pointers). Creates the following functions: - * - * TYPE *new_NAME(int nelements) - * void delete_NAME(TYPE *); - * TYPE NAME_getitem(TYPE *, int index); - * void NAME_setitem(TYPE *, int index, TYPE value); - * - * ----------------------------------------------------------------------------- */ - -%define %array_functions(TYPE,NAME) -%{ -static TYPE *new_##NAME(int nelements) { %} -#ifdef __cplusplus -%{ return new TYPE[nelements](); %} -#else -%{ return (TYPE *) calloc(nelements,sizeof(TYPE)); %} -#endif -%{} - -static void delete_##NAME(TYPE *ary) { %} -#ifdef __cplusplus -%{ delete [] ary; %} -#else -%{ free(ary); %} -#endif -%{} - -static TYPE NAME##_getitem(TYPE *ary, int index) { - return ary[index]; -} -static void NAME##_setitem(TYPE *ary, int index, TYPE value) { - ary[index] = value; -} -%} - -TYPE *new_##NAME(int nelements); -void delete_##NAME(TYPE *ary); -TYPE NAME##_getitem(TYPE *ary, int index); -void NAME##_setitem(TYPE *ary, int index, TYPE value); - -%enddef - - -/* ----------------------------------------------------------------------------- - * %array_class(TYPE,NAME) - * - * Generates a class wrapper around a C array. The class has the following - * interface: - * - * struct NAME { - * NAME(int nelements); - * ~NAME(); - * TYPE getitem(int index); - * void setitem(int index, TYPE value); - * TYPE * ptr(); - * static NAME *frompointer(TYPE *t); - * } - * - * ----------------------------------------------------------------------------- */ - -%define %array_class(TYPE,NAME) -%{ -typedef TYPE NAME; -%} - -typedef struct {} NAME; - -%extend NAME { -#ifdef __cplusplus - NAME(int nelements) { - return new TYPE[nelements](); - } - ~NAME() { - delete [] self; - } -#else - NAME(int nelements) { - return (TYPE *) calloc(nelements,sizeof(TYPE)); - } - ~NAME() { - free(self); - } -#endif - - TYPE getitem(int index) { - return self[index]; - } - void setitem(int index, TYPE value) { - self[index] = value; - } - TYPE * ptr() { - return self; - } - static NAME *frompointer(TYPE *t) { - return (NAME *) t; - } -}; - -%types(NAME = TYPE); - -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/d/cpointer.i b/win64/bin/swig/share/swig/4.1.0/d/cpointer.i deleted file mode 100755 index af53feed..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/cpointer.i +++ /dev/null @@ -1,171 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cpointer.i - * - * D-specific version of ../cpointer.i. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * %pointer_class(type,name) - * - * Places a simple proxy around a simple type like 'int', 'float', or whatever. - * The proxy provides this interface: - * - * class type { - * public: - * type(); - * ~type(); - * type value(); - * void assign(type value); - * }; - * - * Example: - * - * %pointer_class(int, intp); - * - * int add(int *x, int *y) { return *x + *y; } - * - * In python (with proxies) - * - * >>> a = intp() - * >>> a.assign(10) - * >>> a.value() - * 10 - * >>> b = intp() - * >>> b.assign(20) - * >>> print add(a,b) - * 30 - * - * As a general rule, this macro should not be used on class/structures that - * are already defined in the interface. - * ----------------------------------------------------------------------------- */ - - -%define %pointer_class(TYPE, NAME) -%{ -typedef TYPE NAME; -%} - -typedef struct { -} NAME; - -%extend NAME { -#ifdef __cplusplus -NAME() { - return new TYPE(); -} -~NAME() { - delete self; -} -#else -NAME() { - return (TYPE *) calloc(1,sizeof(TYPE)); -} -~NAME() { - free(self); -} -#endif -} - -%extend NAME { - -void assign(TYPE value) { - *self = value; -} -TYPE value() { - return *self; -} -TYPE * ptr() { - return self; -} -static NAME * frompointer(TYPE *t) { - return (NAME *) t; -} - -} - -%types(NAME = TYPE); - -%enddef - -/* ----------------------------------------------------------------------------- - * %pointer_functions(type,name) - * - * Create functions for allocating/deallocating pointers. This can be used - * if you don't want to create a proxy class or if the pointer is complex. - * - * %pointer_functions(int, intp) - * - * int add(int *x, int *y) { return *x + *y; } - * - * In python (with proxies) - * - * >>> a = copy_intp(10) - * >>> intp_value(a) - * 10 - * >>> b = new_intp() - * >>> intp_assign(b,20) - * >>> print add(a,b) - * 30 - * >>> delete_intp(a) - * >>> delete_intp(b) - * - * ----------------------------------------------------------------------------- */ - -%define %pointer_functions(TYPE,NAME) -%{ -static TYPE *new_##NAME() { %} -#ifdef __cplusplus -%{ return new TYPE(); %} -#else -%{ return (TYPE *) calloc(1,sizeof(TYPE)); %} -#endif -%{} - -static TYPE *copy_##NAME(TYPE value) { %} -#ifdef __cplusplus -%{ return new TYPE(value); %} -#else -%{ TYPE *self = (TYPE *) calloc(1,sizeof(TYPE)); - *self = value; - return self; %} -#endif -%{} - -static void delete_##NAME(TYPE *self) { %} -#ifdef __cplusplus -%{ delete self; %} -#else -%{ free(self); %} -#endif -%{} - -static void NAME ##_assign(TYPE *self, TYPE value) { - *self = value; -} - -static TYPE NAME ##_value(TYPE *self) { - return *self; -} -%} - -TYPE *new_##NAME(); -TYPE *copy_##NAME(TYPE value); -void delete_##NAME(TYPE *self); -void NAME##_assign(TYPE *self, TYPE value); -TYPE NAME##_value(TYPE *self); - -%enddef - -/* ----------------------------------------------------------------------------- - * %pointer_cast(type1,type2,name) - * - * Generates a pointer casting function. - * ----------------------------------------------------------------------------- */ - -%define %pointer_cast(TYPE1,TYPE2,NAME) -%inline %{ -TYPE2 NAME(TYPE1 x) { - return (TYPE2) x; -} -%} -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/d/d.swg b/win64/bin/swig/share/swig/4.1.0/d/d.swg deleted file mode 100755 index 4d218279..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/d.swg +++ /dev/null @@ -1,46 +0,0 @@ -/* ----------------------------------------------------------------------------- - * d.swg - * - * Main library file for the D language module. See the D chapter in the SWIG - * manual for explanation on the typemaps, pragmas, etc. used. - * ----------------------------------------------------------------------------- */ - -// Typemaps for exception handling. -%include - -// Typemaps for primitive types. -%include - -// Typemaps for non-primitive types (C/C++ classes and structs). -%include - -// Typemaps for enumeration types. -%include - -// Typemaps for member function pointers. -%include - -// Typemaps for wrapping pointers to/arrays of C chars as D strings. -%include - -// Typemaps for handling void function return types and empty parameter lists. -%include - -// Typemaps containing D code used when generating D proxy classes. -%include - -// Mapping of C++ operator overloading methods to D. -%include - -// Helper code string and exception handling. -%include - -// Wrapper loader code for dynamically linking the C wrapper library from the D -// wrapper module. -%include - -// List of all reserved D keywords. -%include - -// D-specific directives. -%include diff --git a/win64/bin/swig/share/swig/4.1.0/d/dclassgen.swg b/win64/bin/swig/share/swig/4.1.0/d/dclassgen.swg deleted file mode 100755 index 7b419b89..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/dclassgen.swg +++ /dev/null @@ -1,172 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dclassgen.swg - * - * Typemaps containing D code used when generating D proxy classes. - * ----------------------------------------------------------------------------- */ - -%typemap(dbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "class" -%typemap(dcode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dinterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(dinterfaces_derived) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" - -// See . -%typemap(dclassmodifiers) enum SWIGTYPE "enum" -%typemap(dcode) enum SWIGTYPE "" - - -/* - * Proxy classes. - */ - -%typemap(dconstructor, excode=SWIGEXCODE,directorconnect="\n swigDirectorConnect();") SWIGTYPE { - this($imcall, true);$excode$directorconnect -} - -%typemap(ddestructor) SWIGTYPE %{ -~this() { - dispose(); -} -%} - -// We do not use »override« attribute for generated dispose() methods to stay -// somewhat compatible to Phobos and older Tango versions where Object.dispose() -// does not exist. -%typemap(ddispose, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - } - } -} - -%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE { - synchronized(this) { - if (swigCPtr !is null) { - if (swigCMemOwn) { - swigCMemOwn = false; - $imcall; - } - swigCPtr = null; - super.dispose(); - } - } -} - - -// Unfortunately, the »package« visibility attribute does not work in D when the -// module in question is in the root package (happens if no -package is specified -// at the SWIG command line), so we are stuck with public visibility for -// swigGetCPtr(). -%typemap(dbody) SWIGTYPE %{ -private void* swigCPtr; -protected bool swigCMemOwn; - -public this(void* cObject, bool ownCObject) { - swigCPtr = cObject; - swigCMemOwn = ownCObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -public static void* swigRelease(typeof(this) obj) { - if (obj !is null) { - if (!obj.swigCMemOwn) - throw new Exception("Cannot release ownership as memory is not owned"); - void* ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.dispose(); - return ptr; - } else { - return null; - } -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} - - -%typemap(dbody_derived) SWIGTYPE %{ -private void* swigCPtr; - -public this(void* cObject, bool ownCObject) { - super($imdmodule.$dclazznameUpcast(cObject), ownCObject); - swigCPtr = cObject; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -public static void* swigRelease(typeof(this) obj) { - if (obj !is null) { - if (!obj.swigCMemOwn) - throw new Exception("Cannot release ownership as memory is not owned"); - void* ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.dispose(); - return ptr; - } else { - return null; - } -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} - - -/* - * Type wrapper classes. - */ - -%typemap(dbody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] %{ -private void* swigCPtr; - -public this(void* cObject, bool futureUse) { - swigCPtr = cObject; -} - -protected this() { - swigCPtr = null; -} - -public static void* swigGetCPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -public static void* swigRelease(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} - - -/* - * Member function pointer wrapper classes (see ). - */ - -%typemap(dbody) SWIGTYPE (CLASS::*) %{ -private char* swigCPtr; - -public this(char* cMemberPtr, bool futureUse) { - swigCPtr = cMemberPtr; -} - -protected this() { - swigCPtr = null; -} - -package static char* swigGetCMemberPtr(typeof(this) obj) { - return (obj is null) ? null : obj.swigCPtr; -} - -mixin $imdmodule.SwigOperatorDefinitions; -%} diff --git a/win64/bin/swig/share/swig/4.1.0/d/ddirectives.swg b/win64/bin/swig/share/swig/4.1.0/d/ddirectives.swg deleted file mode 100755 index 3dfc5071..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/ddirectives.swg +++ /dev/null @@ -1,11 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ddirectives.swg - * - * D-specifiv directives. - * ----------------------------------------------------------------------------- */ - -#define %dmanifestconst %feature("d:manifestconst") -#define %dconstvalue(value) %feature("d:constvalue",value) -#define %dmethodmodifiers %feature("d:methodmodifiers") -#define %dnothrowexception %feature("except") -#define %proxycode %insert("proxycode") diff --git a/win64/bin/swig/share/swig/4.1.0/d/denums.swg b/win64/bin/swig/share/swig/4.1.0/d/denums.swg deleted file mode 100755 index 90792484..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/denums.swg +++ /dev/null @@ -1,60 +0,0 @@ -/* ----------------------------------------------------------------------------- - * denums.swg - * - * Typemaps for enumerations. - * ----------------------------------------------------------------------------- */ - - -/* - * Typemaps for enumeration types. - */ - -%typemap(ctype) enum SWIGTYPE "int" -%typemap(imtype) enum SWIGTYPE "int" -%typemap(dtype, cprimitive="1") enum SWIGTYPE "$dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin) enum SWIGTYPE "$input = (int)$1;" -%typemap(ddirectorin) enum SWIGTYPE "cast($dclassname)$winput" -%typemap(ddirectorout) enum SWIGTYPE "cast(int)$dcall" - -%typemap(din) enum SWIGTYPE "cast(int)$dinput" -%typemap(dout, excode=SWIGEXCODE) enum SWIGTYPE { - $dclassname ret = cast($dclassname)$imcall;$excode - return ret; -} - - -/* - * Typemaps for (const) references to enumeration types. - */ - -%typemap(ctype) const enum SWIGTYPE & "int" -%typemap(imtype) const enum SWIGTYPE & "int" -%typemap(dtype) const enum SWIGTYPE & "$*dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (int)*$1; %} - -%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;" -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} - -%typemap(ddirectorin) const enum SWIGTYPE & "cast($*dclassname)$winput" -%typemap(ddirectorout) const enum SWIGTYPE & "cast(int)$dcall" - -%typemap(din) const enum SWIGTYPE & "cast(int)$dinput" -%typemap(dout, excode=SWIGEXCODE) const enum SWIGTYPE & { - $*dclassname ret = cast($*dclassname)$imcall;$excode - return ret; -} diff --git a/win64/bin/swig/share/swig/4.1.0/d/dexception.swg b/win64/bin/swig/share/swig/4.1.0/d/dexception.swg deleted file mode 100755 index c3f364a6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/dexception.swg +++ /dev/null @@ -1,30 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dexception.swg - * - * Typemaps used for propagating C++ exceptions to D. - * ----------------------------------------------------------------------------- */ - -// Code which is inserted into the dout typemaps and class constructors via -// excode if exceptions can be thrown. -%define SWIGEXCODE "\n if ($imdmodule.SwigPendingException.isPending) throw $imdmodule.SwigPendingException.retrieve();" %enddef - -%typemap(throws, canthrow=1) int, - long, - short, - unsigned int, - unsigned long, - unsigned short -%{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_DSetPendingException(SWIG_DException, error_msg); - return $null; %} - -%typemap(throws, canthrow=1) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [ANY], - enum SWIGTYPE, const enum SWIGTYPE & -%{ (void)$1; - SWIG_DSetPendingException(SWIG_DException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(throws, canthrow=1) char * -%{ SWIG_DSetPendingException(SWIG_DException, $1); - return $null; %} diff --git a/win64/bin/swig/share/swig/4.1.0/d/dhead.swg b/win64/bin/swig/share/swig/4.1.0/d/dhead.swg deleted file mode 100755 index eb9a88dd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/dhead.swg +++ /dev/null @@ -1,298 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dhead.swg - * - * Support code for exceptions if the SWIG_D_NO_EXCEPTION_HELPER is not defined - * Support code for strings if the SWIG_D_NO_STRING_HELPER is not defined - * - * Support code for function pointers. ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ -#include -#include -#include - -/* Contract support. */ -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_DSetPendingException(SWIG_DException, msg); return nullreturn; } } while (0) -%} - - -/* - * Exception support code. - */ - -#if !defined(SWIG_D_NO_EXCEPTION_HELPER) -%insert(runtime) %{ -// Support for throwing D exceptions from C/C++. -typedef enum { - SWIG_DException = 0, - SWIG_DIllegalArgumentException, - SWIG_DIllegalElementException, - SWIG_DIOException, - SWIG_DNoSuchElementException -} SWIG_DExceptionCodes; - -typedef void (* SWIG_DExceptionCallback_t)(const char *); - -typedef struct { - SWIG_DExceptionCodes code; - SWIG_DExceptionCallback_t callback; -} SWIG_DException_t; - -static SWIG_DException_t SWIG_d_exceptions[] = { - { SWIG_DException, NULL }, - { SWIG_DIllegalArgumentException, NULL }, - { SWIG_DIllegalElementException, NULL }, - { SWIG_DIOException, NULL }, - { SWIG_DNoSuchElementException, NULL } -}; - -static void SWIGUNUSED SWIG_DSetPendingException(SWIG_DExceptionCodes code, const char *msg) { - if ((size_t)code < sizeof(SWIG_d_exceptions)/sizeof(SWIG_DException_t)) { - SWIG_d_exceptions[code].callback(msg); - } else { - SWIG_d_exceptions[SWIG_DException].callback(msg); - } -} - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGRegisterExceptionCallbacks_$module( - SWIG_DExceptionCallback_t exceptionCallback, - SWIG_DExceptionCallback_t illegalArgumentCallback, - SWIG_DExceptionCallback_t illegalElementCallback, - SWIG_DExceptionCallback_t ioCallback, - SWIG_DExceptionCallback_t noSuchElementCallback) { - SWIG_d_exceptions[SWIG_DException].callback = exceptionCallback; - SWIG_d_exceptions[SWIG_DIllegalArgumentException].callback = illegalArgumentCallback; - SWIG_d_exceptions[SWIG_DIllegalElementException].callback = illegalElementCallback; - SWIG_d_exceptions[SWIG_DIOException].callback = ioCallback; - SWIG_d_exceptions[SWIG_DNoSuchElementException].callback = noSuchElementCallback; -} -%} - -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports=%{ -// Exception throwing support currently requires Tango, but there is no reason -// why it could not support Phobos. -static import tango.core.Exception; -static import tango.core.Thread; -static import tango.stdc.stringz; -%} - -%pragma(d) imdmodulecode=%{ -private class SwigExceptionHelper { - static this() { - swigRegisterExceptionCallbacks$module( - &setException, - &setIllegalArgumentException, - &setIllegalElementException, - &setIOException, - &setNoSuchElementException); - } - - static void setException(char* message) { - auto exception = new object.Exception(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIllegalArgumentException(char* message) { - auto exception = new tango.core.Exception.IllegalArgumentException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIllegalElementException(char* message) { - auto exception = new tango.core.Exception.IllegalElementException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIOException(char* message) { - auto exception = new tango.core.Exception.IOException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setNoSuchElementException(char* message) { - auto exception = new tango.core.Exception.NoSuchElementException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } -} - -package class SwigPendingException { -public: - static this() { - m_sPendingException = new ThreadLocalData(null); - } - - static bool isPending() { - return m_sPendingException.val !is null; - } - - static void set(object.Exception e) { - auto pending = m_sPendingException.val; - if (pending !is null) { - e.next = pending; - throw new object.Exception("FATAL: An earlier pending exception from C/C++ " ~ - "code was missed and thus not thrown (" ~ pending.classinfo.name ~ ": " ~ - pending.msg ~ ")!", e); - } - m_sPendingException.val = e; - } - - static object.Exception retrieve() { - auto e = m_sPendingException.val; - m_sPendingException.val = null; - return e; - } - -private: - // The reference to the pending exception (if any) is stored thread-local. - alias tango.core.Thread.ThreadLocal!(object.Exception) ThreadLocalData; - static ThreadLocalData m_sPendingException; -} -alias void function(char* message) SwigExceptionCallback; -%} -#else -%pragma(d) imdmoduleimports=%{ -static import std.conv; -%} - -%pragma(d) imdmodulecode=%{ -private class SwigExceptionHelper { - static this() { - // The D1/Tango version maps C++ exceptions to multiple exception types. - swigRegisterExceptionCallbacks$module( - &setException, - &setException, - &setException, - &setException, - &setException - ); - } - - static void setException(const char* message) { - auto exception = new object.Exception(std.conv.to!string(message)); - SwigPendingException.set(exception); - } -} - -package struct SwigPendingException { -public: - static this() { - m_sPendingException = null; - } - - static bool isPending() { - return m_sPendingException !is null; - } - - static void set(object.Exception e) { - if (m_sPendingException !is null) { - e.next = m_sPendingException; - throw new object.Exception("FATAL: An earlier pending exception from C/C++ code " ~ - "was missed and thus not thrown (" ~ m_sPendingException.classinfo.name ~ - ": " ~ m_sPendingException.msg ~ ")!", e); - } - - m_sPendingException = e; - } - - static object.Exception retrieve() { - auto e = m_sPendingException; - m_sPendingException = null; - return e; - } - -private: - // The reference to the pending exception (if any) is stored thread-local. - static object.Exception m_sPendingException; -} -alias void function(const char* message) SwigExceptionCallback; -%} -#endif -// Callback registering function in wrapperloader.swg. -#endif // SWIG_D_NO_EXCEPTION_HELPER - - -/* - * String support code. - */ - -#if !defined(SWIG_D_NO_STRING_HELPER) -%insert(runtime) %{ -// Callback for returning strings to D without leaking memory. -typedef char * (* SWIG_DStringHelperCallback)(const char *); -static SWIG_DStringHelperCallback SWIG_d_string_callback = NULL; - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIGRegisterStringCallback_$module(SWIG_DStringHelperCallback callback) { - SWIG_d_string_callback = callback; -} -%} - -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports = "static import tango.stdc.stringz;"; - -%pragma(d) imdmodulecode = %{ -private class SwigStringHelper { - static this() { - swigRegisterStringCallback$module(&createString); - } - - static char* createString(char* cString) { - // We are effectively dup'ing the string here. - return tango.stdc.stringz.toStringz(tango.stdc.stringz.fromStringz(cString)); - } -} -alias char* function(char* cString) SwigStringCallback; -%} -#else -%pragma(d) imdmoduleimports = %{ -static import std.conv; -static import std.string; -%} - -%pragma(d) imdmodulecode = %{ -private class SwigStringHelper { - static this() { - swigRegisterStringCallback$module(&createString); - } - - static const(char)* createString(const(char*) cString) { - // We are effectively dup'ing the string here. - // TODO: Is this also correct for D2/Phobos? - return std.string.toStringz(std.conv.to!string(cString)); - } -} -alias const(char)* function(const(char*) cString) SwigStringCallback; -%} -#endif -// Callback registering function in wrapperloader.swg. -#endif // SWIG_D_NO_STRING_HELPER - - -/* - * Function pointer support code. - */ -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmodulecode = %{ -template SwigExternC(T) { - static if (is(typeof(*(T.init)) R == return)) { - static if (is(typeof(*(T.init)) P == function)) { - alias extern(C) R function(P) SwigExternC; - } - } -} -%} -#else -%pragma(d) imdmodulecode = %{ -template SwigExternC(T) if (is(typeof(*(T.init)) P == function)) { - static if (is(typeof(*(T.init)) R == return)) { - static if (is(typeof(*(T.init)) P == function)) { - alias extern(C) R function(P) SwigExternC; - } - } -} -%} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/d/director.swg b/win64/bin/swig/share/swig/4.1.0/d/director.swg deleted file mode 100755 index c35be8d2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/director.swg +++ /dev/null @@ -1,49 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that D proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#if defined(DEBUG_DIRECTOR_OWNED) -#include -#endif -#include -#include - -namespace Swig { - - // Director base class – not used in D directors. - class Director { - }; - - // Base class for director exceptions. - class DirectorException : public std::exception { - protected: - std::string swig_msg; - - public: - DirectorException(const std::string &msg) : swig_msg(msg) { - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - // Exception which is thrown when attempting to call a pure virtual method - // from D code through the director layer. - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg) : DirectorException(std::string("Attempted to invoke pure virtual method ") + msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; -} - diff --git a/win64/bin/swig/share/swig/4.1.0/d/dkw.swg b/win64/bin/swig/share/swig/4.1.0/d/dkw.swg deleted file mode 100755 index e8c67e52..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/dkw.swg +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef D_DKW_SWG_ -#define D_DKW_SWG_ - -/* Warnings for D keywords */ -#define DKEYWORD(x) %keywordwarn("'" `x` "' is a D keyword",rename="_%s") `x` - -// Source: http://www.digitalmars.com/d/{1.0,2.0}/lex.html and -DKEYWORD(Error); -DKEYWORD(Exception); -DKEYWORD(Object); -DKEYWORD(__FILE__); -DKEYWORD(__LINE__); -DKEYWORD(__gshared); -DKEYWORD(__thread); -DKEYWORD(__traits); -DKEYWORD(abstract); -DKEYWORD(alias); -DKEYWORD(align); -DKEYWORD(asm); -DKEYWORD(assert); -DKEYWORD(auto); -DKEYWORD(body); -DKEYWORD(bool); -DKEYWORD(break); -DKEYWORD(byte); -DKEYWORD(case); -DKEYWORD(cast); -DKEYWORD(catch); -DKEYWORD(cdouble); -DKEYWORD(cent); -DKEYWORD(cfloat); -DKEYWORD(char); -DKEYWORD(class); -DKEYWORD(const); -DKEYWORD(continue); -DKEYWORD(creal); -DKEYWORD(dchar); -DKEYWORD(debug); -DKEYWORD(default); -DKEYWORD(delegate); -DKEYWORD(delete); -DKEYWORD(deprecated); -DKEYWORD(do); -DKEYWORD(double); -DKEYWORD(dstring); -DKEYWORD(else); -DKEYWORD(enum); -DKEYWORD(export); -DKEYWORD(extern); -DKEYWORD(false); -DKEYWORD(final); -DKEYWORD(finally); -DKEYWORD(float); -DKEYWORD(for); -DKEYWORD(foreach); -DKEYWORD(foreach_reverse); -DKEYWORD(function); -DKEYWORD(goto); -DKEYWORD(idouble); -DKEYWORD(if); -DKEYWORD(ifloat); -DKEYWORD(immutable); -DKEYWORD(import); -DKEYWORD(in); -DKEYWORD(inout); -DKEYWORD(int); -DKEYWORD(interface); -DKEYWORD(invariant); -DKEYWORD(ireal); -DKEYWORD(is); -DKEYWORD(lazy); -DKEYWORD(long); -DKEYWORD(macro); -DKEYWORD(mixin); -DKEYWORD(module); -DKEYWORD(new); -DKEYWORD(nothrow); -DKEYWORD(null); -DKEYWORD(out); -DKEYWORD(override); -DKEYWORD(package); -DKEYWORD(pragma); -DKEYWORD(private); -DKEYWORD(protected); -DKEYWORD(public); -DKEYWORD(pure); -DKEYWORD(real); -DKEYWORD(ref); -DKEYWORD(return); -DKEYWORD(scope); -DKEYWORD(shared); -DKEYWORD(short); -DKEYWORD(static); -DKEYWORD(string); -DKEYWORD(struct); -DKEYWORD(super); -DKEYWORD(switch); -DKEYWORD(synchronized); -DKEYWORD(template); -DKEYWORD(this); -DKEYWORD(throw); -DKEYWORD(true); -DKEYWORD(try); -DKEYWORD(typedef); -DKEYWORD(typeid); -DKEYWORD(typeof); -DKEYWORD(ubyte); -DKEYWORD(ucent); -DKEYWORD(uint); -DKEYWORD(ulong); -DKEYWORD(union); -DKEYWORD(unittest); -DKEYWORD(ushort); -DKEYWORD(version); -DKEYWORD(void); -DKEYWORD(volatile); -DKEYWORD(wchar); -DKEYWORD(while); -DKEYWORD(with); -DKEYWORD(wstring); - -// Not really a keyword, but dispose() methods are generated in proxy classes -// and it's a special method name for D1/Tango. -DKEYWORD(dispose); - -#undef DKEYWORD - -#endif //D_DKW_SWG_ diff --git a/win64/bin/swig/share/swig/4.1.0/d/dmemberfunctionpointers.swg b/win64/bin/swig/share/swig/4.1.0/d/dmemberfunctionpointers.swg deleted file mode 100755 index 0a34fc35..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/dmemberfunctionpointers.swg +++ /dev/null @@ -1,94 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dmemberfunctionpointers.swg - * - * Typemaps for member function pointers. - * ----------------------------------------------------------------------------- */ - - -%typemap(ctype) SWIGTYPE (CLASS::*) "char *" -%typemap(imtype) SWIGTYPE (CLASS::*) "char*" -%typemap(dtype) SWIGTYPE (CLASS::*) "$dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE (CLASS::*) - "" - - -/* - * Conversion generation typemaps. - */ - -%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) %{ - SWIG_UnpackData($input, (void *)&$1, sizeof($1)); -%} -%typemap(out, fragment="SWIG_PackData") SWIGTYPE (CLASS::*) %{ - char buf[128]; - char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); - *data = '\0'; - $result = SWIG_d_string_callback(buf); -%} - -%typemap(directorin) SWIGTYPE (CLASS::*) "$input = (void *) $1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) - "$result = ($1_ltype)$input;" - -%typemap(ddirectorin) SWIGTYPE (CLASS::*) - "($winput is null) ? null : new $dclassname($winput, false)" -%typemap(ddirectorout) SWIGTYPE (CLASS::*) "$dclassname.swigGetCPtr($dcall)" - -%typemap(din) SWIGTYPE (CLASS::*) "$dclassname.swigGetCMemberPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE (CLASS::*) { - char* cMemberPtr = $imcall; - $dclassname ret = (cMemberPtr is null) ? null : new $dclassname(cMemberPtr, $owner);$excode - return ret; -} - -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* - * Helper functions to pack/unpack arbitrary binary data (member function - * pointers in this case) into a string. - */ - -%fragment("SWIG_PackData", "header") { -/* Pack binary data into a string */ -SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} -} - -%fragment("SWIG_UnPackData", "header") { -/* Unpack binary data from a string */ -SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/d/doperators.swg b/win64/bin/swig/share/swig/4.1.0/d/doperators.swg deleted file mode 100755 index 9578ae2c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/doperators.swg +++ /dev/null @@ -1,259 +0,0 @@ -/* ----------------------------------------------------------------------------- - * doperators.swg - * - * Mapping of C++ operator overloading methods to D. - * ----------------------------------------------------------------------------- */ - -#if (SWIG_D_VERSION == 1) - -%pragma(d) imdmodulecode=%{ -template SwigOperatorDefinitions() { - public override int opEquals(Object o) { - if (auto rhs = cast(typeof(this))o) { - if (swigCPtr == rhs.swigCPtr) return 1; - static if (is(typeof(swigOpEquals(rhs)))) { - return swigOpEquals(rhs) ? 1 : 0; - } else { - return 0; - } - } - return super.opEquals(o); - } -%} -// opEquals is emitted in pure C mode as well to define two proxy classes -// pointing to the same struct as equal. - -#ifdef __cplusplus -%rename(opPos) *::operator+(); -%rename(opPos) *::operator+() const; -%rename(opNeg) *::operator-(); -%rename(opNeg) *::operator-() const; -%rename(opCom) *::operator~(); -%rename(opCom) *::operator~() const; - -%rename(opAdd) *::operator+; -%rename(opAddAssign) *::operator+=; -%rename(opSub) *::operator-; -%rename(opSubAssign) *::operator-=; -%rename(opMul) *::operator*; -%rename(opMulAssign) *::operator*=; -%rename(opDiv) *::operator/; -%rename(opDivAssign) *::operator/=; -%rename(opMod) *::operator%; -%rename(opModAssign) *::operator%=; -%rename(opAnd) *::operator&; -%rename(opAndAssign) *::operator&=; -%rename(opOr) *::operator|; -%rename(opOrAssign) *::operator|=; -%rename(opXor) *::operator^; -%rename(opXorAssign) *::operator^=; -%rename(opShl) *::operator<<; -%rename(opShlAssign) *::operator<<=; -%rename(opShr) *::operator>>; -%rename(opShrAssign) *::operator>>=; - -%rename(opIndex) *::operator[](unsigned) const; -// opIndexAssign is not currently generated, it needs more extensive support -// mechanisms. - -%rename(opCall) *::operator(); - -// !a is not overridable in D1. -%ignoreoperator(LNOT) operator!; - -// opCmp is used in D. -%rename(swigOpEquals) *::operator==; -%rename(swigOpLt) *::operator<; -%rename(swigOpLtEquals) *::operator<=; -%rename(swigOpGt) *::operator>; -%rename(swigOpGtEquals) *::operator>=; - -// a != b is rewritten as !a.opEquals(b) in D. -%ignoreoperator(NOTEQUAL) operator!=; - -// The logic operators are not overridable in D. -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; - -// ++/--a is rewritten as a +/-= 1 in D1,so ignore the prefix operators. -%ignoreoperator(PLUSPLUS) *::operator++(); -%ignoreoperator(MINUSMINUS) *::operator--(); -%rename(swigOpInc) *::operator++(int); -%rename(swigOpDec) *::operator--(int); - -// The C++ assignment operator does not translate well to D where the proxy -// classes have reference semantics. -%ignoreoperator(EQ) operator=; - -%pragma(d) imdmodulecode=%{ - public override int opCmp(Object o) { - static if (is(typeof(swigOpLt(typeof(this).init) && - swigOpEquals(typeof(this).init)))) { - if (auto rhs = cast(typeof(this))o) { - if (swigOpLt(rhs)) { - return -1; - } else if (swigOpEquals(rhs)) { - return 0; - } else { - return 1; - } - } - } - return super.opCmp(o); - } - - public typeof(this) opPostInc(T = int)(T unused = 0) { - static assert( - is(typeof(swigOpInc(int.init))), - "opPostInc called on " ~ typeof(this).stringof ~ ", but no postfix " ~ - "increment operator exists in the corresponding C++ class." - ); - return swigOpInc(int.init); - } - - public typeof(this) opPostDec(T = int)(T unused = 0) { - static assert( - is(typeof(swigOpDec(int.init))), - "opPostInc called on " ~ typeof(this).stringof ~ ", but no postfix " ~ - "decrement operator exists in the corresponding C++ class." - ); - return swigOpDec(int.init); - } -%} -#endif - -%pragma(d) imdmodulecode=%{ -} -%} - -#else -%pragma(d) imdmodulecode=%{ -mixin template SwigOperatorDefinitions() { - public override bool opEquals(Object o) { - if (auto rhs = cast(typeof(this))o) { - if (swigCPtr == rhs.swigCPtr) return true; - static if (is(typeof(swigOpEquals(rhs)))) { - return swigOpEquals(rhs); - } else { - return false; - } - } - return super.opEquals(o); - } -%} -// opEquals is emitted in pure C mode as well to define two proxy classes -// pointing to the same struct as equal. - -#ifdef __cplusplus -%rename(swigOpPos) *::operator+(); -%rename(swigOpPos) *::operator+() const; -%rename(swigOpNeg) *::operator-(); -%rename(swigOpNeg) *::operator-() const; -%rename(swigOpCom) *::operator~(); -%rename(swigOpCom) *::operator~() const; -%rename(swigOpInc) *::operator++(); -%rename(swigOpDec) *::operator--(); -%ignoreoperator(PLUSPLUS) *::operator++(int); -%ignoreoperator(MINUSMINUS) *::operator--(int); -// The postfix increment/decrement operators are ignored because they are -// rewritten to (auto t = e, ++e, t) in D2. The unary * operator (used for -// pointer dereferencing in C/C++) isn't mapped to opUnary("*") by default, -// despite this would be possible in D2 – the difference in member access -// semantics would only lead to confusion in most cases. - -%rename(swigOpAdd) *::operator+; -%rename(swigOpSub) *::operator-; -%rename(swigOpMul) *::operator*; -%rename(swigOpDiv) *::operator/; -%rename(swigOpMod) *::operator%; -%rename(swigOpAnd) *::operator&; -%rename(swigOpOr) *::operator|; -%rename(swigOpXor) *::operator^; -%rename(swigOpShl) *::operator<<; -%rename(swigOpShr) *::operator>>; - -%rename(swigOpAddAssign) *::operator+=; -%rename(swigOpSubAssign) *::operator-=; -%rename(swigOpMulAssign) *::operator*=; -%rename(swigOpDivAssign) *::operator/=; -%rename(swigOpModAssign) *::operator%=; -%rename(swigOpAndAssign) *::operator&=; -%rename(swigOpOrAssign) *::operator|=; -%rename(swigOpXorAssign) *::operator^=; -%rename(swigOpShlAssign) *::operator<<=; -%rename(swigOpShrAssign) *::operator>>=; - -%rename(opIndex) *::operator[]; -// opIndexAssign is not currently generated, it needs more extensive support -// mechanisms. - -%rename(opCall) *::operator(); - -%rename(swigOpEquals) *::operator==; -%rename(swigOpLt) *::operator<; -%rename(swigOpLtEquals) *::operator<=; -%rename(swigOpGt) *::operator>; -%rename(swigOpGtEquals) *::operator>=; - -// a != b is rewritten as !a.opEquals(b) in D. -%ignoreoperator(NOTEQUAL) operator!=; - -// The logic operators are not overridable in D. -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; - -// The C++ assignment operator does not translate well to D where the proxy -// classes have reference semantics. -%ignoreoperator(EQ) operator=; - -%pragma(d) imdmodulecode=%{ - public override int opCmp(Object o) { - static if (__traits(compiles, swigOpLt(typeof(this).init) && - swigOpEquals(typeof(this).init))) { - if (auto rhs = cast(typeof(this))o) { - if (swigOpLt(rhs)) { - return -1; - } else if (swigOpEquals(rhs)) { - return 0; - } else { - return 1; - } - } - } - return super.opCmp(o); - } - - private template swigOpBinary(string operator, string name) { - enum swigOpBinary = `public void opOpAssign(string op, T)(T rhs) if (op == "` ~ operator ~ - `" && __traits(compiles, swigOp` ~ name ~ `Assign(rhs))) { swigOp` ~ name ~ `Assign(rhs);}` ~ - `public auto opBinary(string op, T)(T rhs) if (op == "` ~ operator ~ - `" && __traits(compiles, swigOp` ~ name ~ `(rhs))) { return swigOp` ~ name ~ `(rhs);}`; - } - mixin(swigOpBinary!("+", "Add")); - mixin(swigOpBinary!("-", "Sub")); - mixin(swigOpBinary!("*", "Mul")); - mixin(swigOpBinary!("/", "Div")); - mixin(swigOpBinary!("%", "Mod")); - mixin(swigOpBinary!("&", "And")); - mixin(swigOpBinary!("|", "Or")); - mixin(swigOpBinary!("^", "Xor")); - mixin(swigOpBinary!("<<", "Shl")); - mixin(swigOpBinary!(">>", "Shr")); - - private template swigOpUnary(string operator, string name) { - enum swigOpUnary = `public auto opUnary(string op)() if (op == "` ~ operator ~ - `" && __traits(compiles, swigOp` ~ name ~ `())) { return swigOp` ~ name ~ `();}`; - } - mixin(swigOpUnary!("+", "Pos")); - mixin(swigOpUnary!("-", "Neg")); - mixin(swigOpUnary!("~", "Com")); - mixin(swigOpUnary!("++", "Inc")); - mixin(swigOpUnary!("--", "Dec")); -%} -#endif - -%pragma(d) imdmodulecode=%{ -} -%} - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/d/dprimitives.swg b/win64/bin/swig/share/swig/4.1.0/d/dprimitives.swg deleted file mode 100755 index 1bfdca50..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/dprimitives.swg +++ /dev/null @@ -1,171 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dprimitves.swg - * - * Typemaps for primitive types. - * ----------------------------------------------------------------------------- */ - -// C long/ulong width depends on the target arch, use stdlib aliases for them. -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports = "static import tango.stdc.config;" -%pragma(d) globalproxyimports = "static import tango.stdc.config;" -#define SWIG_LONG_DTYPE tango.stdc.config.c_long -#define SWIG_ULONG_DTYPE tango.stdc.config.c_ulong -#else -%pragma(d) imdmoduleimports = "static import core.stdc.config;" -%pragma(d) globalproxyimports = "static import core.stdc.config;" -#define SWIG_LONG_DTYPE core.stdc.config.c_long -#define SWIG_ULONG_DTYPE core.stdc.config.c_ulong -#endif - -/* - * The SWIG_D_PRIMITIVE macro is used to define the typemaps for the primitive - * types, because are more or less the same for all of them. The few special - * cases are handled below. - */ -%define SWIG_D_PRIMITIVE(TYPE, DTYPE) -%typemap(ctype) TYPE, const TYPE & "TYPE" -%typemap(imtype) TYPE, const TYPE & "DTYPE" -%typemap(dtype, cprimitive="1") TYPE, const TYPE & "DTYPE" - -%typemap(in) TYPE "$1 = ($1_ltype)$input;" -%typemap(out) TYPE "$result = $1;" -%typemap(directorin) TYPE "$input = $1;" -%typemap(directorout) TYPE "$result = ($1_ltype)$input;" -%typemap(ddirectorin) TYPE "$winput" -%typemap(ddirectorout) TYPE "$dcall" - -%typemap(in) const TYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const TYPE & "$result = *$1;" -%typemap(directorin) const TYPE & "$input = $1;" -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const TYPE & -%{ static $*1_ltype temp; - temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(ddirectorin) const TYPE & "$winput" -%typemap(ddirectorout) const TYPE & "$dcall" - -%typemap(din) TYPE, const TYPE & "$dinput" -%typemap(dout, excode=SWIGEXCODE) TYPE, const TYPE & { - auto ret = $imcall;$excode - return ret; -} -%enddef - - -SWIG_D_PRIMITIVE(bool, bool) -SWIG_D_PRIMITIVE(char, char) -SWIG_D_PRIMITIVE(signed char, byte) -SWIG_D_PRIMITIVE(unsigned char, ubyte) -SWIG_D_PRIMITIVE(short, short) -SWIG_D_PRIMITIVE(unsigned short, ushort) -SWIG_D_PRIMITIVE(int, int) -SWIG_D_PRIMITIVE(unsigned int, uint) -SWIG_D_PRIMITIVE(long, SWIG_LONG_DTYPE) -SWIG_D_PRIMITIVE(unsigned long, SWIG_ULONG_DTYPE) -SWIG_D_PRIMITIVE(size_t, size_t) -SWIG_D_PRIMITIVE(long long, long) -SWIG_D_PRIMITIVE(unsigned long long, ulong) -SWIG_D_PRIMITIVE(float, float) -SWIG_D_PRIMITIVE(double, double) - - -// The C++ boolean type needs some special casing since it is not part of the -// C standard and is thus represented as unsigned int in the C wrapper layer. -%typemap(ctype) bool, const bool & "unsigned int" -%typemap(imtype) bool, const bool & "uint" - -%typemap(in) bool "$1 = $input ? true : false;" -%typemap(in) const bool & ($*1_ltype temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(directorout) bool - "$result = $input ? true : false;" -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & -%{ static $*1_ltype temp; - temp = $input ? true : false; - $result = &temp; %} - -%typemap(ddirectorin) bool "($winput ? true : false)" - -%typemap(dout, excode=SWIGEXCODE) bool, const bool & { - bool ret = $imcall ? true : false;$excode - return ret; -} - - -// Judging from the history of the C# module, the explicit casts are needed for -// certain versions of VC++. -%typemap(out) unsigned long "$result = (unsigned long)$1;" -%typemap(out) const unsigned long & "$result = (unsigned long)*$1;" - - -/* - * Typecheck typemaps. - */ - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_UINT8) - unsigned char, - const unsigned char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) - short, - const short & - "" - -%typecheck(SWIG_TYPECHECK_UINT16) - unsigned short, - const unsigned short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) - int, - long, - const int &, - const long & - "" - -%typecheck(SWIG_TYPECHECK_UINT32) - unsigned int, - unsigned long, - const unsigned int &, - const unsigned long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) - long long, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_UINT64) - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) - double, - const double & - "" diff --git a/win64/bin/swig/share/swig/4.1.0/d/dstrings.swg b/win64/bin/swig/share/swig/4.1.0/d/dstrings.swg deleted file mode 100755 index 99ad32fe..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/dstrings.swg +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dstrings.swg - * - * Typemaps for wrapping pointers to/arrays of C chars as D strings. - * ----------------------------------------------------------------------------- */ - -%define SWIGD_STRING_TYPEMAPS(DW_STRING_TYPE, DP_STRING_TYPE, FROM_STRINGZ, TO_STRINGZ) -%typemap(ctype) char *, char *&, char[ANY], char[] "char *" -%typemap(imtype) char *, char *&, char[ANY], char[] #DW_STRING_TYPE -%typemap(dtype) char *, char *&, char[ANY], char[] #DP_STRING_TYPE - - -/* - * char* typemaps. - */ - -%typemap(in) char * %{ $1 = ($1_ltype)$input; %} -%typemap(out) char * %{ $result = SWIG_d_string_callback((const char *)$1); %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char * %{ $input = SWIG_d_string_callback((const char *)$1); %} -%typemap(ddirectorin) char * "FROM_STRINGZ($winput)" -%typemap(ddirectorout) char * "TO_STRINGZ($dcall)" - - -/* - * char*& typemaps. - */ - -%typemap(in) char *& ($*1_ltype temp = 0) %{ - temp = ($*1_ltype)$input; - $1 = &temp; -%} -%typemap(out) char *& %{ if ($1) $result = SWIG_d_string_callback((const char *)*$1); %} - - -/* - * char array typemaps. - */ - -%typemap(in) char[ANY], char[] %{ $1 = ($1_ltype)$input; %} -%typemap(out) char[ANY], char[] %{ $result = SWIG_d_string_callback((const char *)$1); %} - -%typemap(directorout) char[ANY], char[] %{ $result = ($1_ltype)$input; %} -%typemap(directorin) char[ANY], char[] %{ $input = SWIG_d_string_callback((const char *)$1); %} - -%typemap(ddirectorin) char[ANY], char[] "$winput" -%typemap(ddirectorout) char[ANY], char[] "$dcall" - - -%typemap(din) char *, char *&, char[ANY], char[] "($dinput ? TO_STRINGZ($dinput) : null)" -%typemap(dout, excode=SWIGEXCODE) char *, char *&, char[ANY], char[] { - DP_STRING_TYPE ret = FROM_STRINGZ ## ($imcall);$excode - return ret; -} - -%typecheck(SWIG_TYPECHECK_STRING) - char *, - char *&, - char[ANY], - char[] - "" -%enddef - - -// We need to have the \0-terminated string conversion functions available in -// the D proxy modules. -#if (SWIG_D_VERSION == 1) -// Could be easily extended to support Phobos as well. -SWIGD_STRING_TYPEMAPS(char*, char[], tango.stdc.stringz.fromStringz, tango.stdc.stringz.toStringz) - -%pragma(d) globalproxyimports = "static import tango.stdc.stringz;"; -#else -SWIGD_STRING_TYPEMAPS(const(char)*, string, std.conv.to!string, std.string.toStringz) - -%pragma(d) globalproxyimports = %{ -static import std.conv; -static import std.string; -%} -#endif -#undef SWIGD_STRING_TYPEMAPS diff --git a/win64/bin/swig/share/swig/4.1.0/d/dswigtype.swg b/win64/bin/swig/share/swig/4.1.0/d/dswigtype.swg deleted file mode 100755 index 7ff9f20a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/dswigtype.swg +++ /dev/null @@ -1,241 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dswigtype.swg - * - * Typemaps for non-primitive types (C/C++ classes and structs). - * ----------------------------------------------------------------------------- */ - -%typemap(ctype) SWIGTYPE "void *" -%typemap(imtype) SWIGTYPE "void*" -%typemap(dtype) SWIGTYPE "$&dclassname" - -%typemap(ctype) SWIGTYPE [] "void *" -%typemap(imtype) SWIGTYPE [] "void*" -%typemap(dtype) SWIGTYPE [] "$dclassname" - -%typemap(ctype) SWIGTYPE * "void *" -%typemap(imtype) SWIGTYPE * "void*" -%typemap(dtype, nativepointer="$dtype") SWIGTYPE * "$dclassname" - -%typemap(ctype) SWIGTYPE & "void *" -%typemap(imtype) SWIGTYPE & "void*" -%typemap(dtype, nativepointer="$dtype") SWIGTYPE & "$dclassname" - -%typemap(ctype) SWIGTYPE && "void *" -%typemap(imtype) SWIGTYPE && "void*" -%typemap(dtype, nativepointer="$dtype") SWIGTYPE && "$dclassname" - -%typemap(ctype) SWIGTYPE *const& "void *" -%typemap(imtype) SWIGTYPE *const& "void*" -%typemap(dtype) SWIGTYPE *const& "$*dclassname" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [], - SWIGTYPE *const& - "" - - -/* - * By-value conversion typemaps (parameter is converted to a pointer). - */ - -%typemap(in, canthrow=1) SWIGTYPE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ $result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - $result = $1ptr; -} -#endif - -%typemap(directorin) SWIGTYPE - "$input = (void *)new $1_ltype(SWIG_STD_MOVE($1));" -%typemap(directorout) SWIGTYPE -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *($&1_ltype)$input; %} - -%typemap(ddirectorin) SWIGTYPE "new $&dclassname($winput, true)" -%typemap(ddirectorout) SWIGTYPE "$&dclassname.swigGetCPtr($dcall)" - -%typemap(din) SWIGTYPE "$&dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE { - $&dclassname ret = new $&dclassname($imcall, true);$excode - return ret; -} - - -/* - * Pointer conversion typemaps. - */ - -%typemap(in) SWIGTYPE * "$1 = ($1_ltype)$input;" -%typemap(out) SWIGTYPE * "$result = (void *)$1;" - -%typemap(directorin) SWIGTYPE * - "$input = (void *) $1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * - "$result = ($1_ltype)$input;" - -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE * "($winput is null) ? null : new $dclassname($winput, false)" - -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE * "$dclassname.swigGetCPtr($dcall)" - -%typemap(din, - nativepointer="cast(void*)$dinput" -) SWIGTYPE * "$dclassname.swigGetCPtr($dinput)" - -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}" -) SWIGTYPE * { - void* cPtr = $imcall; - $dclassname ret = (cPtr is null) ? null : new $dclassname(cPtr, $owner);$excode - return ret; -} - -// Use the same typemaps for const pointers. -%apply SWIGTYPE * { SWIGTYPE *const } - - -/* - * Reference conversion typemaps. - */ - -%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "$1_type is null"); - return $null; - } %} -%typemap(out) SWIGTYPE & "$result = (void *)$1;" - -%typemap(directorin) SWIGTYPE & - "$input = ($1_ltype) &$1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Unexpected null return for type $1_type"); - return $null; - } - $result = ($1_ltype)$input; %} - -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE & "new $dclassname($winput, false)" -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE & "$dclassname.swigGetCPtr($dcall)" - -%typemap(din, - nativepointer="cast(void*)$dinput" -) SWIGTYPE & "$dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}") SWIGTYPE & { - $dclassname ret = new $dclassname($imcall, $owner);$excode - return ret; -} - - -/* - * Rvalue reference conversion typemaps. - */ - -%typemap(in, canthrow=1, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ $1 = ($1_ltype)$input; - if (!$1) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "$1_type is null"); - return $null; - } - rvrdeleter.reset($1); %} -%typemap(out) SWIGTYPE && "$result = (void *)$1;" - -%typemap(directorin) SWIGTYPE && - "$input = ($1_ltype) &$1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE && -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Unexpected null return for type $1_type"); - return $null; - } - $result = ($1_ltype)$input; %} - -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE && "new $dclassname($winput, false)" -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE && "$dclassname.swigGetCPtr($dcall)" - -%typemap(din, - nativepointer="cast(void*)$dinput" -) SWIGTYPE && "$dclassname.swigRelease($dinput)" -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}") SWIGTYPE && { - $dclassname ret = new $dclassname($imcall, $owner);$excode - return ret; -} - - -/* - * Array conversion typemaps. - */ - -%typemap(in) SWIGTYPE [] %{ $1 = ($1_ltype)$input; %} -%typemap(out) SWIGTYPE [] %{ $result = $1; %} - -%typemap(din) SWIGTYPE [] "$dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE [] { - void* cPtr = $imcall; - $dclassname ret = (cPtr is null) ? null : new $dclassname(cPtr, $owner);$excode - return ret; -} - -// Treat references to arrays like references to a single element. -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - - -/* - * Pointer reference conversion typemaps. - */ - -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)$input; - $1 = ($1_ltype)&temp; %} -%typemap(out) SWIGTYPE *const& -%{ $result = (void *)*$1; %} - -%typemap(din) SWIGTYPE *const& "$*dclassname.swigGetCPtr($dinput)" -%typemap(dout, excode=SWIGEXCODE) SWIGTYPE *const& { - void* cPtr = $imcall; - $*dclassname ret = (cPtr is null) ? null : new $*dclassname(cPtr, $owner);$excode - return ret; -} -%typemap(directorin) SWIGTYPE *const& - "$input = (void *) $1;" -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = ($*1_ltype)$input; - $result = &swig_temp; %} -%typemap(ddirectorin, - nativepointer="cast($dtype)$winput" -) SWIGTYPE *const& "($winput is null) ? null : new $*dclassname($winput, false)" -%typemap(ddirectorout, - nativepointer="cast(void*)$dcall" -) SWIGTYPE *const& "$*dclassname.swigGetCPtr($dcall)" - diff --git a/win64/bin/swig/share/swig/4.1.0/d/dvoid.swg b/win64/bin/swig/share/swig/4.1.0/d/dvoid.swg deleted file mode 100755 index 32bb8e20..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/dvoid.swg +++ /dev/null @@ -1,18 +0,0 @@ -/* ----------------------------------------------------------------------------- - * dvoid.swg - * - * Typemaps for handling void function return types and empty parameter lists. - * ----------------------------------------------------------------------------- */ - -%typemap(ctype) void "void" -%typemap(imtype) void "void" -%typemap(dtype, cprimitive="1") void "void" - -%typemap(out, null="") void "" -%typemap(ddirectorin) void "$winput" -%typemap(ddirectorout) void "$dcall" -%typemap(directorin) void "" - -%typemap(dout, excode=SWIGEXCODE) void { - $imcall;$excode -} diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/d/std_auto_ptr.i deleted file mode 100755 index 84c819fa..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_auto_ptr.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap (ctype) std::auto_ptr< TYPE > "void *" -%typemap (imtype) std::auto_ptr< TYPE > "void*" -%typemap (dtype) std::auto_ptr< TYPE > "$typemap(dtype, TYPE)" - -%typemap(in) std::auto_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(din, - nativepointer="cast(void*)$dinput" -) std::auto_ptr< TYPE > "$typemap(dtype, TYPE).swigRelease($dinput)" - -%typemap (out) std::auto_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}" -) std::auto_ptr< TYPE > { - void* cPtr = $imcall; - $typemap(dtype, TYPE) ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_common.i b/win64/bin/swig/share/swig/4.1.0/d/std_common.i deleted file mode 100755 index c80263ae..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_deque.i b/win64/bin/swig/share/swig/4.1.0/d/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_except.i b/win64/bin/swig/share/swig/4.1.0/d/std_except.i deleted file mode 100755 index 209a27b6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_except.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. These typemaps are - * used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws, canthrow=1) std::bad_cast "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::bad_exception "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::domain_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::exception "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::invalid_argument "SWIG_DSetPendingException(SWIG_DIllegalArgumentException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::length_error "SWIG_DSetPendingException(SWIG_DNoSuchElementException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::logic_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::out_of_range "SWIG_DSetPendingException(SWIG_DNoSuchElementException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::overflow_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::range_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::runtime_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" -%typemap(throws, canthrow=1) std::underflow_error "SWIG_DSetPendingException(SWIG_DException, $1.what());\n return $null;" - diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_map.i b/win64/bin/swig/share/swig/4.1.0/d/std_map.i deleted file mode 100755 index f077b983..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_map.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -namespace std { - template > class map { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; -} diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_pair.i b/win64/bin/swig/share/swig/4.1.0/d/std_pair.i deleted file mode 100755 index 539130ff..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/d/std_shared_ptr.i deleted file mode 100755 index 01a0e9dd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_string.i b/win64/bin/swig/share/swig/4.1.0/d/std_string.i deleted file mode 100755 index 5795391d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_string.i +++ /dev/null @@ -1,98 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a D char[] and are passed around by value. - * - * To use non-const std::string references, use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -%define SWIGD_STD_STRING_TYPEMAPS(DW_STRING_TYPE, DP_STRING_TYPE, FROM_STRINGZ, TO_STRINGZ) -// string -%typemap(ctype) string, const string & "char *" -%typemap(imtype) string, const string & #DW_STRING_TYPE -%typemap(dtype) string, const string & #DP_STRING_TYPE - -%typemap(in, canthrow=1) string, const string & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - $1.assign($input); %} -%typemap(in, canthrow=1) const string & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - $*1_ltype $1_str($input); - $1 = &$1_str; %} - -%typemap(out) string %{ $result = SWIG_d_string_callback($1.c_str()); %} -%typemap(out) const string & %{ $result = SWIG_d_string_callback($1->c_str()); %} - -%typemap(din) string, const string & "($dinput ? TO_STRINGZ($dinput) : null)" -%typemap(dout, excode=SWIGEXCODE) string, const string & { - DP_STRING_TYPE ret = FROM_STRINGZ($imcall);$excode - return ret; -} - -%typemap(directorin) string, const string & %{ $input = SWIG_d_string_callback($1.c_str()); %} - -%typemap(directorout, canthrow=1) string -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - $result.assign($input); %} - -%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ if (!$input) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); - return $null; - } - /* possible thread/reentrant code problem */ - static $*1_ltype $1_str; - $1_str = $input; - $result = &$1_str; %} - -%typemap(ddirectorin) string, const string & "FROM_STRINGZ($winput)" -%typemap(ddirectorout) string, const string & "TO_STRINGZ($dcall)" - -%typemap(throws, canthrow=1) string, const string & -%{ SWIG_DSetPendingException(SWIG_DException, $1.c_str()); - return $null; %} - -%typemap(typecheck) string, const string & = char *; -%enddef - -// We need to have the \0-terminated string conversion functions available in -// the D proxy modules. -#if (SWIG_D_VERSION == 1) -// Could be easily extended to support Phobos as well. -SWIGD_STD_STRING_TYPEMAPS(char*, char[], tango.stdc.stringz.fromStringz, tango.stdc.stringz.toStringz) - -%pragma(d) globalproxyimports = "static import tango.stdc.stringz;"; -#else -SWIGD_STD_STRING_TYPEMAPS(const(char)*, string, std.conv.to!string, std.string.toStringz) - -%pragma(d) globalproxyimports = %{ -static import std.conv; -static import std.string; -%} -#endif - -#undef SWIGD_STD_STRING_TYPEMAPS - -} // namespace std diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/d/std_unique_ptr.i deleted file mode 100755 index 908258bc..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_unique_ptr.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap (ctype) std::unique_ptr< TYPE > "void *" -%typemap (imtype) std::unique_ptr< TYPE > "void*" -%typemap (dtype) std::unique_ptr< TYPE > "$typemap(dtype, TYPE)" - -%typemap(in) std::unique_ptr< TYPE > -%{ $1.reset((TYPE *)$input); %} - -%typemap(din, - nativepointer="cast(void*)$dinput" -) std::unique_ptr< TYPE > "$typemap(dtype, TYPE).swigRelease($dinput)" - -%typemap (out) std::unique_ptr< TYPE > %{ - $result = (void *)$1.release(); -%} - -%typemap(dout, excode=SWIGEXCODE, - nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}" -) std::unique_ptr< TYPE > { - void* cPtr = $imcall; - $typemap(dtype, TYPE) ret = (cPtr is null) ? null : new $typemap(dtype, TYPE)(cPtr, true);$excode - return ret; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/d/std_vector.i b/win64/bin/swig/share/swig/4.1.0/d/std_vector.i deleted file mode 100755 index 5dbef93b..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/std_vector.i +++ /dev/null @@ -1,605 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector, D implementation. - * - * The D wrapper is made to loosely resemble a tango.util.container.more.Vector - * and to provide built-in array-like access. - * - * If T does define an operator==, then use the SWIG_STD_VECTOR_ENHANCED - * macro to obtain enhanced functionality (none yet), for example: - * - * SWIG_STD_VECTOR_ENHANCED(SomeNamespace::Klass) - * %template(VectKlass) std::vector; - * - * Warning: heavy macro usage in this file. Use swig -E to get a sane view on - * the real file contents! - * ----------------------------------------------------------------------------- */ - -// Warning: Use the typemaps here in the expectation that the macros they are in will change name. - -%include - -// MACRO for use within the std::vector class body -%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CONST_REFERENCE, CTYPE...) -#if (SWIG_D_VERSION == 1) -%typemap(dimports) std::vector< CTYPE > "static import tango.core.Exception;" -%proxycode %{ -public this($typemap(dtype, CTYPE)[] values) { - this(); - append(values); -} - -alias push_back add; -alias push_back push; -alias push_back opCatAssign; -alias size length; -alias opSlice slice; - -public $typemap(dtype, CTYPE) opIndexAssign($typemap(dtype, CTYPE) value, size_t index) { - if (index >= size()) { - throw new tango.core.Exception.NoSuchElementException("Tried to assign to element out of vector bounds."); - } - setElement(index, value); - return value; -} - -public $typemap(dtype, CTYPE) opIndex(size_t index) { - if (index >= size()) { - throw new tango.core.Exception.NoSuchElementException("Tried to read from element out of vector bounds."); - } - return getElement(index); -} - -public void append($typemap(dtype, CTYPE)[] value...) { - foreach (v; value) { - add(v); - } -} - -public $typemap(dtype, CTYPE)[] opSlice() { - $typemap(dtype, CTYPE)[] array = new $typemap(dtype, CTYPE)[size()]; - foreach (i, ref value; array) { - value = getElement(i); - } - return array; -} - -public int opApply(int delegate(ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - result = dg(value); - setElement(i, value); - } - return result; -} - -public int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - - // Workaround for http://d.puremagic.com/issues/show_bug.cgi?id=2443. - auto index = i; - - result = dg(index, value); - setElement(i, value); - } - return result; -} - -public void capacity(size_t value) { - if (value < size()) { - throw new tango.core.Exception.IllegalArgumentException("Tried to make the capacity of a vector smaller than its size."); - } - - reserve(value); -} -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - void clear(); - void push_back(CTYPE const& x); - size_type size() const; - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - - vector(); - vector(const vector &other); - - %extend { - vector(size_type capacity) throw (std::length_error) { - std::vector< CTYPE >* pv = 0; - pv = new std::vector< CTYPE >(); - - // Might throw std::length_error. - pv->reserve(capacity); - - return pv; - } - - size_type unused() const { - return $self->capacity() - $self->size(); - } - - const_reference remove() throw (std::out_of_range) { - if ($self->empty()) { - throw std::out_of_range("Tried to remove last element from empty vector."); - } - - std::vector< CTYPE >::const_reference value = $self->back(); - $self->pop_back(); - return value; - } - - const_reference remove(size_type index) throw (std::out_of_range) { - if (index >= $self->size()) { - throw std::out_of_range("Tried to remove element with invalid index."); - } - - std::vector< CTYPE >::iterator it = $self->begin() + index; - std::vector< CTYPE >::const_reference value = *it; - $self->erase(it); - return value; - } - } - - // Wrappers for setting/getting items with the possibly thrown exception - // specified (important for SWIG wrapper generation). - %extend { - const_reference getElement(size_type index) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to get value of element with invalid index."); - } - return (*$self)[index]; - } - } - - // Use CTYPE const& instead of const_reference to work around SWIG code - // generation issue when using const pointers as vector elements (like - // std::vector< const int* >). - %extend { - void setElement(size_type index, CTYPE const& val) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to set value of element with invalid index."); - } - (*$self)[index] = val; - } - } - -%dmethodmodifiers std::vector::getElement "private" -%dmethodmodifiers std::vector::setElement "private" -%dmethodmodifiers std::vector::reserve "private" - -#else - -%typemap(dimports) std::vector< CTYPE > %{ -static import std.algorithm; -static import std.exception; -static import std.range; -static import std.traits; -%} -%proxycode %{ -alias size_t KeyType; -alias $typemap(dtype, CTYPE) ValueType; - -this(ValueType[] values...) { - this(); - reserve(values.length); - foreach (e; values) { - this ~= e; - } -} - -struct Range { - private $typemap(dtype, std::vector< CTYPE >) _outer; - private size_t _a, _b; - - this($typemap(dtype, std::vector< CTYPE >) data, size_t a, size_t b) { - _outer = data; - _a = a; - _b = b; - } - - @property bool empty() const { - assert((cast($typemap(dtype, std::vector< CTYPE >))_outer).length >= _b); - return _a >= _b; - } - - @property Range save() { - return this; - } - - @property ValueType front() { - std.exception.enforce(!empty); - return _outer[_a]; - } - - @property void front(ValueType value) { - std.exception.enforce(!empty); - _outer[_a] = std.algorithm.move(value); - } - - void popFront() { - std.exception.enforce(!empty); - ++_a; - } - - void opIndexAssign(ValueType value, size_t i) { - i += _a; - std.exception.enforce(i < _b && _b <= _outer.length); - _outer[i] = value; - } - - void opIndexOpAssign(string op)(ValueType value, size_t i) { - std.exception.enforce(_outer && _a + i < _b && _b <= _outer.length); - auto element = _outer[i]; - mixin("element "~op~"= value;"); - _outer[i] = element; - } -} - -// TODO: dup? - -Range opSlice() { - return Range(this, 0, length); -} - -Range opSlice(size_t a, size_t b) { - std.exception.enforce(a <= b && b <= length); - return Range(this, a, b); -} - -size_t opDollar() const { - return length; -} - -@property ValueType front() { - std.exception.enforce(!empty); - return getElement(0); -} - -@property void front(ValueType value) { - std.exception.enforce(!empty); - setElement(0, value); -} - -@property ValueType back() { - std.exception.enforce(!empty); - return getElement(length - 1); -} - -@property void back(ValueType value) { - std.exception.enforce(!empty); - setElement(length - 1, value); -} - -ValueType opIndex(size_t i) { - return getElement(i); -} - -void opIndexAssign(ValueType value, size_t i) { - setElement(i, value); -} - -void opIndexOpAssign(string op)(ValueType value, size_t i) { - auto element = this[i]; - mixin("element "~op~"= value;"); - this[i] = element; -} - -ValueType[] opBinary(string op, Stuff)(Stuff stuff) if (op == "~") { - ValueType[] result; - result ~= this[]; - assert(result.length == length); - result ~= stuff[]; - return result; -} - -void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~") { - static if (is(typeof(insertBack(stuff)))) { - insertBack(stuff); - } else if (is(typeof(insertBack(stuff[])))) { - insertBack(stuff[]); - } else { - static assert(false, "Cannot append " ~ Stuff.stringof ~ " to " ~ typeof(this).stringof); - } -} - -alias size length; - -alias remove removeAny; -alias removeAny stableRemoveAny; - -size_t insertBack(Stuff)(Stuff stuff) -if (std.traits.isImplicitlyConvertible!(Stuff, ValueType)){ - push_back(stuff); - return 1; -} -size_t insertBack(Stuff)(Stuff stuff) -if (std.range.isInputRange!Stuff && - std.traits.isImplicitlyConvertible!(std.range.ElementType!Stuff, ValueType)) { - size_t itemCount; - foreach(item; stuff) { - insertBack(item); - ++itemCount; - } - return itemCount; -} -alias insertBack insert; - -alias pop_back removeBack; -alias pop_back stableRemoveBack; - -size_t insertBefore(Stuff)(Range r, Stuff stuff) -if (std.traits.isImplicitlyConvertible!(Stuff, ValueType)) { - std.exception.enforce(r._outer.swigCPtr == swigCPtr && r._a < length); - insertAt(r._a, stuff); - return 1; -} - -size_t insertBefore(Stuff)(Range r, Stuff stuff) -if (std.range.isInputRange!Stuff && std.traits.isImplicitlyConvertible!(ElementType!Stuff, ValueType)) { - std.exception.enforce(r._outer.swigCPtr == swigCPtr && r._a <= length); - - size_t insertCount; - foreach(i, item; stuff) { - insertAt(r._a + i, item); - ++insertCount; - } - - return insertCount; -} - -size_t insertAfter(Stuff)(Range r, Stuff stuff) { - // TODO: optimize - immutable offset = r._a + r.length; - std.exception.enforce(offset <= length); - auto result = insertBack(stuff); - std.algorithm.bringToFront(this[offset .. length - result], - this[length - result .. length]); - return result; -} - -size_t replace(Stuff)(Range r, Stuff stuff) -if (std.range.isInputRange!Stuff && - std.traits.isImplicitlyConvertible!(ElementType!Stuff, ValueType)) { - immutable offset = r._a; - std.exception.enforce(offset <= length); - size_t result; - for (; !stuff.empty; stuff.popFront()) { - if (r.empty) { - // append the rest - return result + insertBack(stuff); - } - r.front = stuff.front; - r.popFront(); - ++result; - } - // Remove remaining stuff in r - remove(r); - return result; -} - -size_t replace(Stuff)(Range r, Stuff stuff) -if (std.traits.isImplicitlyConvertible!(Stuff, ValueType)) -{ - if (r.empty) - { - insertBefore(r, stuff); - } - else - { - r.front = stuff; - r.popFront(); - remove(r); - } - return 1; -} - -Range linearRemove(Range r) { - std.exception.enforce(r._a <= r._b && r._b <= length); - immutable tailLength = length - r._b; - linearRemove(r._a, r._b); - return this[length - tailLength .. length]; -} -alias remove stableLinearRemove; - -int opApply(int delegate(ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - result = dg(value); - setElement(i, value); - } - return result; -} - -int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - - // Workaround for http://d.puremagic.com/issues/show_bug.cgi?id=2443. - auto index = i; - - result = dg(index, value); - setElement(i, value); - } - return result; -} -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - bool empty() const; - void clear(); - void push_back(CTYPE const& x); - void pop_back(); - size_type size() const; - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - - vector(); - vector(const vector &other); - - %extend { - vector(size_type capacity) throw (std::length_error) { - std::vector< CTYPE >* pv = 0; - pv = new std::vector< CTYPE >(); - - // Might throw std::length_error. - pv->reserve(capacity); - - return pv; - } - - const_reference remove() throw (std::out_of_range) { - if ($self->empty()) { - throw std::out_of_range("Tried to remove last element from empty vector."); - } - - std::vector< CTYPE >::const_reference value = $self->back(); - $self->pop_back(); - return value; - } - - const_reference remove(size_type index) throw (std::out_of_range) { - if (index >= $self->size()) { - throw std::out_of_range("Tried to remove element with invalid index."); - } - - std::vector< CTYPE >::iterator it = $self->begin() + index; - std::vector< CTYPE >::const_reference value = *it; - $self->erase(it); - return value; - } - - void removeBack(size_type how_many) throw (std::out_of_range) { - std::vector< CTYPE >::iterator end = $self->end(); - std::vector< CTYPE >::iterator start = end - how_many; - $self->erase(start, end); - } - - void linearRemove(size_type start_index, size_type end_index) throw (std::out_of_range) { - std::vector< CTYPE >::iterator start = $self->begin() + start_index; - std::vector< CTYPE >::iterator end = $self->begin() + end_index; - $self->erase(start, end); - } - - void insertAt(size_type index, CTYPE const& x) throw (std::out_of_range) { - std::vector< CTYPE >::iterator it = $self->begin() + index; - $self->insert(it, x); - } - } - - // Wrappers for setting/getting items with the possibly thrown exception - // specified (important for SWIG wrapper generation). - %extend { - const_reference getElement(size_type index) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to get value of element with invalid index."); - } - return (*$self)[index]; - } - } - // Use CTYPE const& instead of const_reference to work around SWIG code - // generation issue when using const pointers as vector elements (like - // std::vector< const int* >). - %extend { - void setElement(size_type index, CTYPE const& val) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to set value of element with invalid index."); - } - (*$self)[index] = val; - } - } - -%dmethodmodifiers std::vector::getElement "private" -%dmethodmodifiers std::vector::setElement "private" -#endif -%enddef - -// Extra methods added to the collection class if operator== is defined for the class being wrapped -// The class will then implement IList<>, which adds extra functionality -%define SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE...) - %extend { - } -%enddef - -// For vararg handling in macros, from swigmacros.swg -#define %arg(X...) X - -// Macros for std::vector class specializations/enhancements -%define SWIG_STD_VECTOR_ENHANCED(CTYPE...) -namespace std { - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, %arg(CTYPE)) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE) - }; -} -%enddef - -%{ -#include -#include -%} - -namespace std { - // primary (unspecialized) class template for std::vector - // does not require operator== to be defined - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T) - }; - // specializations for pointers - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T *) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *) - }; - // bool is a bit different in the C++ standard - const_reference in particular - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(bool, bool) - SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(bool) - }; -} - -// template specializations for std::vector -// these provide extra collections methods as operator== is defined -SWIG_STD_VECTOR_ENHANCED(char) -SWIG_STD_VECTOR_ENHANCED(signed char) -SWIG_STD_VECTOR_ENHANCED(unsigned char) -SWIG_STD_VECTOR_ENHANCED(short) -SWIG_STD_VECTOR_ENHANCED(unsigned short) -SWIG_STD_VECTOR_ENHANCED(int) -SWIG_STD_VECTOR_ENHANCED(unsigned int) -SWIG_STD_VECTOR_ENHANCED(long) -SWIG_STD_VECTOR_ENHANCED(unsigned long) -SWIG_STD_VECTOR_ENHANCED(long long) -SWIG_STD_VECTOR_ENHANCED(unsigned long long) -SWIG_STD_VECTOR_ENHANCED(float) -SWIG_STD_VECTOR_ENHANCED(double) -SWIG_STD_VECTOR_ENHANCED(std::string) // also requires a %include diff --git a/win64/bin/swig/share/swig/4.1.0/d/stl.i b/win64/bin/swig/share/swig/4.1.0/d/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/d/swigmove.i b/win64/bin/swig/share/swig/4.1.0/d/swigmove.i deleted file mode 100755 index 897b0795..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/swigmove.i +++ /dev/null @@ -1,16 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, canthrow=1) SWIGTYPE MOVE ($&1_type argp) -%{ argp = ($&1_ltype)$input; - if (!argp) { - SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "Attempt to dereference null $1_type"); - return $null; - } - SwigValueWrapper< $1_ltype >::reset($1, argp); %} - -%typemap(din) SWIGTYPE MOVE "$dclassname.swigRelease($dinput)" diff --git a/win64/bin/swig/share/swig/4.1.0/d/typemaps.i b/win64/bin/swig/share/swig/4.1.0/d/typemaps.i deleted file mode 100755 index f23db022..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/typemaps.i +++ /dev/null @@ -1,261 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps are used for pointer/reference parameters that are input only -and are mapped to a D input parameter. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In D you could then use it like this: - double answer = fadd(10.0, 20.0); -*/ - -%define INPUT_TYPEMAP(TYPE, CTYPE, DTYPE) -%typemap(ctype, out="void *") TYPE *INPUT, TYPE &INPUT "CTYPE" -%typemap(imtype, out="void*") TYPE *INPUT, TYPE &INPUT "DTYPE" -%typemap(dtype, out="DTYPE*") TYPE *INPUT, TYPE &INPUT "DTYPE" -%typemap(din) TYPE *INPUT, TYPE &INPUT "$dinput" - -%typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(typecheck) TYPE *INPUT = TYPE; -%typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, unsigned int, bool) -//INPUT_TYPEMAP(char, char, char) // Why was this commented out? -INPUT_TYPEMAP(signed char, signed char, byte) -INPUT_TYPEMAP(unsigned char, unsigned char, ubyte) -INPUT_TYPEMAP(short, short, short) -INPUT_TYPEMAP(unsigned short, unsigned short, ushort) -INPUT_TYPEMAP(int, int, int) -INPUT_TYPEMAP(unsigned int, unsigned int, uint) -INPUT_TYPEMAP(long, long, SWIG_LONG_DTYPE) -INPUT_TYPEMAP(unsigned long, unsigned long, SWIG_ULONG_DTYPE) -INPUT_TYPEMAP(long long, long long, long) -INPUT_TYPEMAP(unsigned long long, unsigned long long, ulong) -INPUT_TYPEMAP(float, float, float) -INPUT_TYPEMAP(double, double, double) - -INPUT_TYPEMAP(enum SWIGTYPE, unsigned int, int) -%typemap(dtype) enum SWIGTYPE *INPUT, enum SWIGTYPE &INPUT "$*dclassname" - -#undef INPUT_TYPEMAP - - -/* -OUTPUT typemaps ---------------- - -These typemaps are used for pointer/reference parameters that are output only and -are mapped to a D output parameter. - -The following typemaps can be applied to turn a pointer or reference into an -"output" value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In D, the 'out' keyword is -used when passing the parameter to a function that takes an output parameter. - - bool *OUTPUT, bool &OUTPUT - signed char *OUTPUT, signed char &OUTPUT - unsigned char *OUTPUT, unsigned char &OUTPUT - short *OUTPUT, short &OUTPUT - unsigned short *OUTPUT, unsigned short &OUTPUT - int *OUTPUT, int &OUTPUT - unsigned int *OUTPUT, unsigned int &OUTPUT - long *OUTPUT, long &OUTPUT - unsigned long *OUTPUT, unsigned long &OUTPUT - long long *OUTPUT, long long &OUTPUT - unsigned long long *OUTPUT, unsigned long long &OUTPUT - float *OUTPUT, float &OUTPUT - double *OUTPUT, double &OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters): - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The D output of the function would be the function return value and the -value returned in the second output parameter. In D you would use it like this: - - double dptr; - double fraction = modf(5, dptr); -*/ - -%define OUTPUT_TYPEMAP(TYPE, CTYPE, DTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *OUTPUT, TYPE &OUTPUT "CTYPE *" -%typemap(imtype, out="void*") TYPE *OUTPUT, TYPE &OUTPUT "out DTYPE" -%typemap(dtype, out="DTYPE*") TYPE *OUTPUT, TYPE &OUTPUT "out DTYPE" -%typemap(din) TYPE *OUTPUT, TYPE &OUTPUT "$dinput" - -%typemap(in) TYPE *OUTPUT, TYPE &OUTPUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *OUTPUT, TYPE &OUTPUT "" -%enddef - -OUTPUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//OUTPUT_TYPEMAP(char, char, char, CHAR_PTR) // Why was this commented out? -OUTPUT_TYPEMAP(signed char, signed char, byte, INT8_PTR) -OUTPUT_TYPEMAP(unsigned char, unsigned char, ubyte, UINT8_PTR) -OUTPUT_TYPEMAP(short, short, short, INT16_PTR) -OUTPUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -OUTPUT_TYPEMAP(int, int, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long, long, SWIG_LONG_DTYPE,INT32_PTR) -OUTPUT_TYPEMAP(unsigned long, unsigned long, SWIG_ULONG_DTYPE,UINT32_PTR) -OUTPUT_TYPEMAP(long long, long long, long, INT64_PTR) -OUTPUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -OUTPUT_TYPEMAP(float, float, float, FLOAT_PTR) -OUTPUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -OUTPUT_TYPEMAP(enum SWIGTYPE, unsigned int, int, INT32_PTR) -%typemap(dtype) enum SWIGTYPE *OUTPUT, enum SWIGTYPE &OUTPUT "out $*dclassname" - -#undef OUTPUT_TYPEMAP - -%typemap(in) bool *OUTPUT, bool &OUTPUT -%{ *$input = 0; - $1 = ($1_ltype)$input; %} - - -/* -INOUT typemaps --------------- - -These typemaps are for pointer/reference parameters that are both input and -output and are mapped to a D reference parameter. - -The following typemaps can be applied to turn a pointer or reference into a -reference parameters, that is the parameter is both an input and an output. -In D, the 'ref' keyword is used for reference parameters. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -The D output of the function would be the new value returned by the -reference parameter. In D you would use it like this: - - - double x = 5.0; - neg(x); - -The implementation of the OUTPUT and INOUT typemaps is different to the scripting -languages in that the scripting languages will return the output value as part -of the function return value. -*/ - -%define INOUT_TYPEMAP(TYPE, CTYPE, DTYPE, TYPECHECKPRECEDENCE) -%typemap(ctype, out="void *") TYPE *INOUT, TYPE &INOUT "CTYPE *" -%typemap(imtype, out="void*") TYPE *INOUT, TYPE &INOUT "ref DTYPE" -%typemap(dtype, out="DTYPE*") TYPE *INOUT, TYPE &INOUT "ref DTYPE" -%typemap(din) TYPE *INOUT, TYPE &INOUT "$dinput" - -%typemap(in) TYPE *INOUT, TYPE &INOUT -%{ $1 = ($1_ltype)$input; %} - -%typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *INOUT, TYPE &INOUT "" -%enddef - -INOUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) -//INOUT_TYPEMAP(char, char, char, CHAR_PTR) -INOUT_TYPEMAP(signed char, signed char, byte, INT8_PTR) -INOUT_TYPEMAP(unsigned char, unsigned char, ubyte, UINT8_PTR) -INOUT_TYPEMAP(short, short, short, INT16_PTR) -INOUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) -INOUT_TYPEMAP(int, int, int, INT32_PTR) -INOUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -INOUT_TYPEMAP(long, long, SWIG_LONG_DTYPE,INT32_PTR) -INOUT_TYPEMAP(unsigned long, unsigned long, SWIG_ULONG_DTYPE,UINT32_PTR) -INOUT_TYPEMAP(long long, long long, long, INT64_PTR) -INOUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) -INOUT_TYPEMAP(float, float, float, FLOAT_PTR) -INOUT_TYPEMAP(double, double, double, DOUBLE_PTR) - -INOUT_TYPEMAP(enum SWIGTYPE, unsigned int, int, INT32_PTR) -%typemap(dtype) enum SWIGTYPE *INOUT, enum SWIGTYPE &INOUT "ref $*dclassname" - -#undef INOUT_TYPEMAP diff --git a/win64/bin/swig/share/swig/4.1.0/d/wrapperloader.swg b/win64/bin/swig/share/swig/4.1.0/d/wrapperloader.swg deleted file mode 100755 index 81445b09..00000000 --- a/win64/bin/swig/share/swig/4.1.0/d/wrapperloader.swg +++ /dev/null @@ -1,309 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wrapperloader.swg - * - * Support code for dynamically linking the C wrapper library from the D - * wrapper module. - * - * The loading code was adapted from the Derelict project and is used with - * permission from Michael Parker, the original author. - * ----------------------------------------------------------------------------- */ - -%pragma(d) wrapperloadercode = %{ -private { - version(linux) { - version = Nix; - } else version(darwin) { - version = Nix; - } else version(OSX) { - version = Nix; - } else version(FreeBSD) { - version = Nix; - version = freebsd; - } else version(freebsd) { - version = Nix; - } else version(Unix) { - version = Nix; - } else version(Posix) { - version = Nix; - } - - version(Tango) { - static import tango.stdc.string; - static import tango.stdc.stringz; - - version (PhobosCompatibility) { - } else { - alias char[] string; - alias wchar[] wstring; - alias dchar[] dstring; - } - } else { - version(D_Version2) { - static import std.conv; - } else { - static import std.c.string; - } - static import std.string; - } - - version(D_Version2) { - mixin("alias const(char)* CCPTR;"); - } else { - alias char* CCPTR; - } - - CCPTR swigToCString(string str) { - version(Tango) { - return tango.stdc.stringz.toStringz(str); - } else { - return std.string.toStringz(str); - } - } - - string swigToDString(CCPTR cstr) { - version(Tango) { - return tango.stdc.stringz.fromStringz(cstr); - } else { - version(D_Version2) { - mixin("return std.conv.to!string(cstr);"); - } else { - return std.c.string.toString(cstr); - } - } - } -} - -class SwigSwigSharedLibLoadException : Exception { - this(in string[] libNames, in string[] reasons) { - string msg = "Failed to load one or more shared libraries:"; - foreach(i, n; libNames) { - msg ~= "\n\t" ~ n ~ " - "; - if(i < reasons.length) - msg ~= reasons[i]; - else - msg ~= "Unknown"; - } - super(msg); - } -} - -class SwigSymbolLoadException : Exception { - this(string SwigSharedLibName, string symbolName) { - super("Failed to load symbol " ~ symbolName ~ " from shared library " ~ SwigSharedLibName); - _symbolName = symbolName; - } - - string symbolName() { - return _symbolName; - } - -private: - string _symbolName; -} - -private { - version(Nix) { - version(freebsd) { - // the dl* functions are in libc on FreeBSD - } - else { - pragma(lib, "dl"); - } - - version(Tango) { - import tango.sys.Common; - } else version(linux) { - import core.sys.posix.dlfcn; - } else { - extern(C) { - const RTLD_NOW = 2; - - void *dlopen(CCPTR file, int mode); - int dlclose(void* handle); - void *dlsym(void* handle, CCPTR name); - CCPTR dlerror(); - } - } - - alias void* SwigSharedLibHandle; - - SwigSharedLibHandle swigLoadSharedLib(string libName) { - return dlopen(swigToCString(libName), RTLD_NOW); - } - - void swigUnloadSharedLib(SwigSharedLibHandle hlib) { - dlclose(hlib); - } - - void* swigGetSymbol(SwigSharedLibHandle hlib, string symbolName) { - return dlsym(hlib, swigToCString(symbolName)); - } - - string swigGetErrorStr() { - CCPTR err = dlerror(); - if (err is null) { - return "Unknown Error"; - } - return swigToDString(err); - } - } else version(Windows) { - alias ushort WORD; - alias uint DWORD; - alias CCPTR LPCSTR; - alias void* HMODULE; - alias void* HLOCAL; - alias int function() FARPROC; - struct VA_LIST {} - - extern (Windows) { - HMODULE LoadLibraryA(LPCSTR); - FARPROC GetProcAddress(HMODULE, LPCSTR); - void FreeLibrary(HMODULE); - DWORD GetLastError(); - DWORD FormatMessageA(DWORD, in void*, DWORD, DWORD, LPCSTR, DWORD, VA_LIST*); - HLOCAL LocalFree(HLOCAL); - } - - DWORD MAKELANGID(WORD p, WORD s) { - return (((cast(WORD)s) << 10) | cast(WORD)p); - } - - enum { - LANG_NEUTRAL = 0, - SUBLANG_DEFAULT = 1, - FORMAT_MESSAGE_ALLOCATE_BUFFER = 256, - FORMAT_MESSAGE_IGNORE_INSERTS = 512, - FORMAT_MESSAGE_FROM_SYSTEM = 4096 - } - - alias HMODULE SwigSharedLibHandle; - - SwigSharedLibHandle swigLoadSharedLib(string libName) { - return LoadLibraryA(swigToCString(libName)); - } - - void swigUnloadSharedLib(SwigSharedLibHandle hlib) { - FreeLibrary(hlib); - } - - void* swigGetSymbol(SwigSharedLibHandle hlib, string symbolName) { - return GetProcAddress(hlib, swigToCString(symbolName)); - } - - string swigGetErrorStr() { - DWORD errcode = GetLastError(); - - LPCSTR msgBuf; - DWORD i = FormatMessageA( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - null, - errcode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - cast(LPCSTR)&msgBuf, - 0, - null); - - string text = swigToDString(msgBuf); - LocalFree(cast(HLOCAL)msgBuf); - - if (i >= 2) { - i -= 2; - } - return text[0 .. i]; - } - } else { - static assert(0, "Operating system not supported by the wrapper loading code."); - } - - final class SwigSharedLib { - void load(string[] names) { - if (_hlib !is null) return; - - string[] failedLibs; - string[] reasons; - - foreach(n; names) { - _hlib = swigLoadSharedLib(n); - if (_hlib is null) { - failedLibs ~= n; - reasons ~= swigGetErrorStr(); - continue; - } - _name = n; - break; - } - - if (_hlib is null) { - throw new SwigSwigSharedLibLoadException(failedLibs, reasons); - } - } - - void* loadSymbol(string symbolName, bool doThrow = true) { - void* sym = swigGetSymbol(_hlib, symbolName); - if(doThrow && (sym is null)) { - throw new SwigSymbolLoadException(_name, symbolName); - } - return sym; - } - - void unload() { - if(_hlib !is null) { - swigUnloadSharedLib(_hlib); - _hlib = null; - } - } - - private: - string _name; - SwigSharedLibHandle _hlib; - } -} - -static this() { - string[] possibleFileNames; - version (Posix) { - version (OSX) { - possibleFileNames ~= ["lib$wraplibrary.dylib", "lib$wraplibrary.bundle"]; - } - possibleFileNames ~= ["lib$wraplibrary.so"]; - } else version (Windows) { - possibleFileNames ~= ["$wraplibrary.dll", "lib$wraplibrary.so"]; - } else { - static assert(false, "Operating system not supported by the wrapper loading code."); - } - - auto library = new SwigSharedLib; - library.load(possibleFileNames); - - string bindCode(string functionPointer, string symbol) { - return functionPointer ~ " = cast(typeof(" ~ functionPointer ~ - "))library.loadSymbol(`" ~ symbol ~ "`);"; - } - - //#if !defined(SWIG_D_NO_EXCEPTION_HELPER) - mixin(bindCode("swigRegisterExceptionCallbacks$module", "SWIGRegisterExceptionCallbacks_$module")); - //#endif // SWIG_D_NO_EXCEPTION_HELPER - //#if !defined(SWIG_D_NO_STRING_HELPER) - mixin(bindCode("swigRegisterStringCallback$module", "SWIGRegisterStringCallback_$module")); - //#endif // SWIG_D_NO_STRING_HELPER - $wrapperloaderbindcode -} - -//#if !defined(SWIG_D_NO_EXCEPTION_HELPER) -extern(C) void function( - SwigExceptionCallback exceptionCallback, - SwigExceptionCallback illegalArgumentCallback, - SwigExceptionCallback illegalElementCallback, - SwigExceptionCallback ioCallback, - SwigExceptionCallback noSuchElementCallback) swigRegisterExceptionCallbacks$module; -//#endif // SWIG_D_NO_EXCEPTION_HELPER - -//#if !defined(SWIG_D_NO_STRING_HELPER) -extern(C) void function(SwigStringCallback callback) swigRegisterStringCallback$module; -//#endif // SWIG_D_NO_STRING_HELPER -%} - -%pragma(d) wrapperloaderbindcommand = %{ - mixin(bindCode("$function", "$symbol"));%} diff --git a/win64/bin/swig/share/swig/4.1.0/director_common.swg b/win64/bin/swig/share/swig/4.1.0/director_common.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/exception.i b/win64/bin/swig/share/swig/4.1.0/exception.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/go/cdata.i b/win64/bin/swig/share/swig/4.1.0/go/cdata.i deleted file mode 100755 index 9ed0ef14..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/cdata.i +++ /dev/null @@ -1,97 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cdata.i - * - * SWIG library file containing macros for manipulating raw C data as strings. - * ----------------------------------------------------------------------------- */ - -%{ -typedef struct SWIGCDATA { - char *data; - intgo len; -} SWIGCDATA; -%} - -%fragment("cdata", "header") %{ -struct swigcdata { - intgo size; - void *data; -}; -%} - -%typemap(gotype) SWIGCDATA "[]byte" - -%typemap(imtype) SWIGCDATA "uint64" - -%typemap(out, fragment="cdata") SWIGCDATA(struct swigcdata *swig_out) %{ - swig_out = (struct swigcdata *)malloc(sizeof(*swig_out)); - if (swig_out) { - swig_out->size = $1.len; - swig_out->data = malloc(swig_out->size); - if (swig_out->data) { - memcpy(swig_out->data, $1.data, swig_out->size); - } - } - $result = *(long long *)(void **)&swig_out; -%} - -%typemap(goout) SWIGCDATA %{ - { - type swigcdata struct { size int; data uintptr } - p := (*swigcdata)(unsafe.Pointer(uintptr($1))) - if p == nil || p.data == 0 { - $result = nil - } else { - b := make([]byte, p.size) - a := (*[0x7fffffff]byte)(unsafe.Pointer(p.data))[:p.size] - copy(b, a) - Swig_free(p.data) - Swig_free(uintptr(unsafe.Pointer(p))) - $result = b - } - } -%} - -/* ----------------------------------------------------------------------------- - * %cdata(TYPE [, NAME]) - * - * Convert raw C data to a binary string. - * ----------------------------------------------------------------------------- */ - -%define %cdata(TYPE,NAME...) - -%insert("header") { -#if #NAME == "" -static SWIGCDATA cdata_##TYPE(TYPE *ptr, int nelements) { -#else -static SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements) { -#endif - SWIGCDATA d; - d.data = (char *) ptr; -#if #TYPE != "void" - d.len = nelements*sizeof(TYPE); -#else - d.len = nelements; -#endif - return d; -} -} - -%typemap(default) int nelements "$1 = 1;" - -#if #NAME == "" -SWIGCDATA cdata_##TYPE(TYPE *ptr, int nelements); -#else -SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements); -#endif -%enddef - -%typemap(default) int nelements; - -%rename(cdata) ::cdata_void(void *ptr, int nelements); - -%cdata(void); - -/* Memory move function. Due to multi-argument typemaps this appears - to be wrapped as - void memmove(void *data, const char *s); */ -void memmove(void *data, char *indata, int inlen); diff --git a/win64/bin/swig/share/swig/4.1.0/go/director.swg b/win64/bin/swig/share/swig/4.1.0/go/director.swg deleted file mode 100755 index cc369df5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/director.swg +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Go proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#include -#include - -namespace Swig { - - class DirectorException : public std::exception { - }; -} - -/* Handle memory management for directors. */ - -namespace { - struct GCItem { - virtual ~GCItem() {} - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem* operator->() { - return _item; - } - - private: - GCItem *_item; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; -} - -class Swig_memory { -public: - template - void swig_acquire_pointer(Type* vptr) { - if (vptr) { - swig_owner[vptr] = new GCItem_T(vptr); - } - } -private: - typedef std::map swig_ownership_map; - swig_ownership_map swig_owner; -}; - -template -static void swig_acquire_pointer(Swig_memory** pmem, Type* ptr) { - if (!pmem) { - *pmem = new Swig_memory; - } - (*pmem)->swig_acquire_pointer(ptr); -} diff --git a/win64/bin/swig/share/swig/4.1.0/go/exception.i b/win64/bin/swig/share/swig/4.1.0/go/exception.i deleted file mode 100755 index b0d9151f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/exception.i +++ /dev/null @@ -1,7 +0,0 @@ -%typemap(throws,noblock=1) (...) { - SWIG_exception(SWIG_RuntimeError,"unknown exception"); -} - -%insert("runtime") %{ -#define SWIG_exception(code, msg) _swig_gopanic(msg) -%} diff --git a/win64/bin/swig/share/swig/4.1.0/go/go.swg b/win64/bin/swig/share/swig/4.1.0/go/go.swg deleted file mode 100755 index 67f49c7f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/go.swg +++ /dev/null @@ -1,744 +0,0 @@ -/* ------------------------------------------------------------ - * go.swg - * - * Go configuration module. - * ------------------------------------------------------------ */ - -%include - -/* Code insertion directives */ -#define %go_import(...) %insert(go_imports) %{__VA_ARGS__%} - -/* Basic types */ - -%typemap(gotype) bool, const bool & "bool" -%typemap(gotype) char, const char & "byte" -%typemap(gotype) signed char, const signed char & "int8" -%typemap(gotype) unsigned char, const unsigned char & "byte" -%typemap(gotype) short, const short & "int16" -%typemap(gotype) unsigned short, const unsigned short & "uint16" -%typemap(gotype) int, const int & "int" -%typemap(gotype) unsigned int, const unsigned int & "uint" -%typemap(gotype) long, const long & "int64" -%typemap(gotype) unsigned long, const unsigned long & "uint64" -%typemap(gotype) long long, const long long & "int64" -%typemap(gotype) unsigned long long, const unsigned long long & "uint64" -%typemap(gotype) float, const float & "float32" -%typemap(gotype) double, const double & "float64" - -%typemap(in) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $1 = ($1_ltype)$input; %} - -%typemap(in) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ $1 = ($1_ltype)&$input; %} - -%typemap(in) const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = ($1_ltype)&temp; %} - -%typemap(out) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $result = $1; %} - -%typemap(goout) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -"" - -%typemap(out) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ $result = ($*1_ltype)*$1; %} - -%typemap(goout) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -"" - -%typemap(out) void "" - -%typemap(goout) void "" - -%typemap(directorin) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $input = ($1_ltype)$1; %} - -%typemap(godirectorin) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -"" - -%typemap(directorin) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ $input = ($*1_ltype)$1; %} - -%typemap(godirectorin) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -"" - -%typemap(directorout) bool, - char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double -%{ $result = ($1_ltype)$input; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) const bool &, - const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const unsigned long long &, - const float &, - const double & -%{ - $result = new $*1_ltype($input); - swig_acquire_pointer(&swig_mem, $result); -%} - -/* The size_t type. */ - -%typemap(gotype) size_t, const size_t & %{int64%} - -%typemap(in) size_t -%{ $1 = (size_t)$input; %} - -%typemap(in) const size_t & -%{ $1 = ($1_ltype)&$input; %} - -%typemap(out) size_t -%{ $result = $1; %} - -%typemap(goout) size_t "" - -%typemap(out) const size_t & -%{ $result = ($*1_ltype)*$1; %} - -%typemap(goout) const size_t & "" - -%typemap(directorin) size_t -%{ $input = (size_t)$1; %} - -%typemap(godirectorin) size_t "" - -%typemap(directorin) const size_t & -%{ $input = ($*1_ltype)$1; %} - -%typemap(godirectorin) const size_t & "" - -%typemap(directorout) size_t -%{ $result = ($1_ltype)$input; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) const size_t & -%{ - $result = new $*1_ltype($input); - swig_acquire_pointer(&swig_mem, $result); -%} - -/* Member pointers. */ - -%typemap(gotype) SWIGTYPE (CLASS::*) -%{$gotypename%} - -%typemap(in) SWIGTYPE (CLASS::*) -%{ $1 = *($&1_ltype)$input; %} - -%typemap(out) SWIGTYPE (CLASS::*) -%{ - struct swig_out_type { intgo size; void* val; } *swig_out; - swig_out = (struct swig_out_type*)malloc(sizeof(*swig_out)); - if (swig_out) { - swig_out->size = sizeof($1_ltype); - swig_out->val = malloc(swig_out->size); - if (swig_out->val) { - *($&1_ltype)(swig_out->val) = $1; - } - } - $result = swig_out; -%} - -%typemap(goout) SWIGTYPE (CLASS::*) -%{ - { - type swig_out_type struct { size int; val uintptr } - p := (*swig_out_type)(unsafe.Pointer($1)) - if p == nil || p.val == 0 { - $result = nil - } else { - m := make([]byte, p.size) - a := (*[1024]byte)(unsafe.Pointer(p.val))[:p.size] - copy(m, a) - Swig_free(p.val) - Swig_free(uintptr(unsafe.Pointer(p))) - $result = &m[0] - } - } -%} - -%typemap(directorin) SWIGTYPE (CLASS::*) -%{ $input = *($&1_ltype)$1; %} - -%typemap(godirectorin) SWIGTYPE (CLASS::*) "" - -%typemap(directorout) SWIGTYPE (CLASS::*) -%{ - $result = new $1_ltype($input); - swig_acquire_pointer(&swig_mem, $result); -%} - -/* Pointers. */ - -/* We can't translate pointers using a typemap, so that is handled in - the C++ code. */ -%typemap(gotype) SWIGTYPE * -%{$gotypename%} - -%typemap(in) SWIGTYPE * -%{ $1 = *($&1_ltype)&$input; %} - -%typemap(out) SWIGTYPE * -%{ *($&1_ltype)&$result = ($1_ltype)$1; %} - -%typemap(goout) SWIGTYPE * "" - -%typemap(directorin) SWIGTYPE * -%{ *($&1_ltype)&$input = ($1_ltype)$1; %} - -%typemap(godirectorin) SWIGTYPE * "" - -%typemap(directorout) SWIGTYPE * -%{ $result = *($&1_ltype)&$input; %} - -/* Pointer references. */ - -%typemap(gotype) SWIGTYPE *const& -%{$gotypename%} - -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ - temp = *($1_ltype)&$input; - $1 = ($1_ltype)&temp; -%} - -%typemap(out) SWIGTYPE *const& -%{ *($1_ltype)&$result = *$1; %} - -%typemap(goout) SWIGTYPE *const& "" - -/* References. */ - -/* Converting a C++ reference to Go has to be handled in the C++ - code. */ -%typemap(gotype) SWIGTYPE & -%{$gotypename%} - -%typemap(in) SWIGTYPE & -%{ $1 = *($&1_ltype)&$input; %} - -%typemap(out) SWIGTYPE & -%{ *($&1_ltype)&$result = $1; %} - -%typemap(goout) SWIGTYPE & "" - -%typemap(directorin) SWIGTYPE & -%{ $input = ($1_ltype)&$1; %} - -%typemap(godirectorin) SWIGTYPE & "" - -%typemap(directorout) SWIGTYPE & -%{ *($&1_ltype)&$result = $input; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = *($1_ltype)&$input; - $result = &swig_temp; %} - -%typemap(gotype) SWIGTYPE && -%{$gotypename%} - -%typemap(in, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) -%{ $1 = *($&1_ltype)&$input; -rvrdeleter.reset($1); %} - -%typemap(out) SWIGTYPE && -%{ *($&1_ltype)&$result = $1; %} - -%typemap(goout) SWIGTYPE && "" - -%typemap(directorin) SWIGTYPE && -%{ $input = ($1_ltype)&$1_name; %} - -%typemap(godirectorin) SWIGTYPE && "" - -%typemap(directorout) SWIGTYPE && -%{ *($&1_ltype)&$result = $input; %} - -/* C arrays turn into Go pointers. If we know the length we can use a - slice. */ - -%typemap(gotype) SWIGTYPE [] -%{$gotypename%} - -%typemap(in) SWIGTYPE [] -%{ $1 = *($&1_ltype)&$input; %} - -%typemap(out) SWIGTYPE [] -%{ *($&1_ltype)&$result = $1; %} - -%typemap(goout) SWIGTYPE [] "" - -%typemap(directorin) SWIGTYPE [] -%{ $input = *($1_ltype)&$1; %} - -%typemap(godirectorin) SWIGTYPE [] "" - -%typemap(directorout) SWIGTYPE [] -%{ *($&1_ltype)&$result = $input; %} - -/* Strings. */ - -%typemap(gotype) - char *, char *&, char[ANY], char[] "string" - -/* Needed to avoid confusion with the way the go module handles - references. */ -%typemap(gotype) char&, unsigned char& "*byte" -%typemap(gotype) signed char& "*int8" - -%typemap(in) - char *, char[ANY], char[] -%{ - $1 = ($1_ltype)malloc($input.n + 1); - memcpy($1, $input.p, $input.n); - $1[$input.n] = '\0'; -%} - -%typemap(in) char *& (char *temp) -%{ - temp = (char *)malloc($input.n + 1); - memcpy(temp, $input.p, $input.n); - temp[$input.n] = '\0'; - $1 = ($1_ltype)&temp; -%} - -%typemap(freearg) - char *, char[ANY], char[] -%{ free($1); %} - -%typemap(freearg) char *& -%{ free(temp$argnum); %} - -%typemap(out,fragment="AllocateString") - char *, char *&, char[ANY], char[] -%{ $result = Swig_AllocateString((char*)$1, $1 ? strlen((char*)$1) : 0); %} - -%typemap(goout,fragment="CopyString") - char *, char *&, char[ANY], char[] -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") - char *, char *&, char[ANY], char[] -%{ - $input = Swig_AllocateString((char*)$1, $1 ? strlen((char*)$1) : 0); -%} - -%typemap(godirectorin,fragment="CopyString") - char *, char *&, char[ANY], char[] -%{ - $result = swigCopyString($input) -%} - -%typemap(godirectorout) - char *, char *&, char[ANY], char[] -%{ - { - p := Swig_malloc(len($input) + 1) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len($input) + 1] - copy(s, $input) - s[len($input)] = 0 - $result = *(*string)(unsafe.Pointer(&s)) - } -%} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) - char *, char *&, char[ANY], char[] -%{ $result = ($1_ltype)$input.p; %} - -/* String & length */ - -%typemap(gotype) (char *STRING, size_t LENGTH) "string" - -%typemap(in) (char *STRING, size_t LENGTH) -%{ - $1 = ($1_ltype)$input.p; - $2 = ($2_ltype)$input.n; -%} - -%typemap(out,fragment="AllocateString") (char *STRING, size_t LENGTH) -%{ $result = Swig_AllocateString((char*)$1, (size_t)$2); %} - -%typemap(goout,fragment="CopyString") (char *STRING, size_t LENGTH) -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") (char *STRING, size_t LENGTH) -%{ $input = Swig_AllocateString((char*)$1, $2); %} - -%typemap(godirectorin,fragment="CopyString") (char *STRING, size_t LENGTH) -%{ $result = swigCopyString($input) %} - -%typemap(directorout) (char *STRING, size_t LENGTH) -%{ - $1 = ($1_ltype)$input.p; - $2 = ($2_ltype)$input.n; -%} - -/* The int & type needs to convert to intgo. */ - -%typemap(gotype) int & "*int" - -%typemap(in) int & (int e) -%{ - e = (int)*$input; - $1 = &e; -%} - -%typemap(out) int & -%{ $result = new intgo(*$1); %} - -%typemap(argout) int & -%{ *$input = (intgo)e$argnum; %} - -%typemap(goout) int & "" - -%typemap(directorin) int & (intgo e) -%{ - e = (intgo)$1; - $input = &e; -%} - -%typemap(godirectorin) int & "" - -%typemap(directorout) int & -%{ - $*1_ltype f = ($*1_ltype)*$input; - $result = ($1_ltype)&f; -%} - -%typemap(directorargout) int & -%{ $1 = (int)*$input; %} - -%typemap(argout) const int & "" -%typemap(directorargout) const int & "" - -/* Enums. We can't do the right thing for enums in typemap(gotype) so - we deliberately don't define them. The right thing would be to - capitalize the name. This is instead done in go.cxx. */ - -%typemap(gotype) enum SWIGTYPE -%{$gotypename%} - -%typemap(in) enum SWIGTYPE -%{ $1 = ($1_ltype)$input; %} - -%typemap(out) enum SWIGTYPE -%{ $result = (intgo)$1; %} - -%typemap(goout) enum SWIGTYPE "" - -%typemap(directorin) enum SWIGTYPE -%{ $input = (intgo)$1; %} - -%typemap(godirectorin) enum SWIGTYPE "" - -%typemap(directorout) enum SWIGTYPE -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin) enum SWIGTYPE & (intgo e) -%{ - e = (intgo)$1; - $input = ($1_ltype)&e; -%} - -%typemap(godirectorin) enum SWIGTYPE & "" - -%typemap(directorout) enum SWIGTYPE & -%{ $result = $input; %} - -/* Arbitrary type. This is a type passed by value in the C/C++ code. - We convert it to a pointer for the Go code. Note that all basic - types are explicitly handled above. */ - -%typemap(gotype) SWIGTYPE -%{$gotypename%} - -%typemap(in) SWIGTYPE ($&1_type argp) -%{ - argp = ($&1_ltype)$input; - if (argp == NULL) { - _swig_gopanic("Attempt to dereference null $1_type"); - } - $1 = ($1_ltype)*argp; -%} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ *($&1_ltype*)&$result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype)malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - *($&1_ltype*)&$result = $1ptr; -} -#endif - -%typemap(goout) SWIGTYPE "" - -%typemap(directorin) SWIGTYPE -%{ $input = new $1_ltype(SWIG_STD_MOVE($1)); %} - -%typemap(godirectorin) SWIGTYPE "" - -%typemap(directorout) SWIGTYPE -%{ $result = *($&1_ltype)$input; %} - -/* Exception handling */ - -%typemap(throws) char * -%{ _swig_gopanic($1); %} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] -%{ - (void)$1; - _swig_gopanic("C++ $1_type exception thrown"); -%} - -/* Typecheck typemaps. The purpose of these is merely to issue a - warning for overloaded C++ functions that cannot be overloaded in - Go as more than one C++ type maps to a single Go type. */ - -%typecheck(SWIG_TYPECHECK_BOOL) /* Go bool */ - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) /* Go byte */ - char, - const char &, - unsigned char, - const unsigned char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) /* Go int8 */ - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Go int16 */ - short, - const short & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Go uint16 */ - unsigned short, - const unsigned short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Go int */ - int, - const int & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Go uint */ - unsigned int, - const unsigned int & - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Go int64 */ - long, - const long &, - long long, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Go uint64 */ - unsigned long, - const unsigned long &, - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) /* Go float32 */ - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) /* Go float64 */ - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) /* Go string */ - char *, - char *&, - char[ANY], - char [], - signed char *, - signed char *&, - signed char[ANY], - signed char [], - unsigned char *, - unsigned char *&, - unsigned char[ANY], - unsigned char [] - "" - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE *const&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* Go keywords. */ -%include - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/go/gokw.swg b/win64/bin/swig/share/swig/4.1.0/go/gokw.swg deleted file mode 100755 index 3cc77d1e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/gokw.swg +++ /dev/null @@ -1,33 +0,0 @@ -/* Rename keywords. */ - -#define GOKW(x) %keywordwarn("'" `x` "' is a Go keyword",rename="X%s") `x` -#define GOBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in Go") "::"`x` - -GOKW(break); -GOKW(case); -GOKW(chan); -GOKW(const); -GOKW(continue); -GOKW(default); -GOKW(defer); -GOKW(else); -GOKW(fallthrough); -GOKW(for); -GOKW(func); -GOKW(go); -GOKW(goto); -GOKW(if); -GOKW(import); -GOKW(interface); -GOKW(package); -GOKW(range); -GOKW(return); -GOKW(select); -GOKW(struct); -GOKW(switch); -GOKW(type); -GOKW(var); - -GOBN(map); - -#undef GOKW diff --git a/win64/bin/swig/share/swig/4.1.0/go/goruntime.swg b/win64/bin/swig/share/swig/4.1.0/go/goruntime.swg deleted file mode 100755 index b6574c6a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/goruntime.swg +++ /dev/null @@ -1,217 +0,0 @@ -/* ------------------------------------------------------------ - * goruntime.swg - * - * Go runtime code for the various generated files. - * ------------------------------------------------------------ */ - -%inline %{ -static void Swig_free(void* p) { - free(p); -} - -static void* Swig_malloc(int c) { - return malloc(c); -} -%} - -%insert(runtime) %{ -#include -#include -#include -#include -#include - -%} - -%insert(cgo_comment_typedefs) %{ -#include -#include -%} - -#if SWIGGO_INTGO_SIZE == 32 -%insert(runtime) %{ -typedef int intgo; -typedef unsigned int uintgo; -%} -%insert(cgo_comment_typedefs) %{ -typedef int intgo; -typedef unsigned int uintgo; -%} -#elif SWIGGO_INTGO_SIZE == 64 -%insert(runtime) %{ -typedef long long intgo; -typedef unsigned long long uintgo; -%} -%insert(cgo_comment_typedefs) %{ -typedef long long intgo; -typedef unsigned long long uintgo; -%} -#else -%insert(runtime) %{ -typedef ptrdiff_t intgo; -typedef size_t uintgo; -%} -%insert(cgo_comment_typedefs) %{ -typedef ptrdiff_t intgo; -typedef size_t uintgo; -%} -#endif - -#ifndef SWIGGO_GCCGO -// Set the host compiler struct attribute that will be -// used to match gc's struct layout. For example, on 386 Windows, -// gcc wants to 8-align int64s, but gc does not. -// Use __gcc_struct__ to work around http://gcc.gnu.org/PR52991 on x86, -// and https://golang.org/issue/5603. -// See: https://github.com/golang/go/blob/fcbf04f9b93b4cd8addd05c2ed784118eb50a46c/src/cmd/cgo/out.go#L663 -%insert(runtime) %{ -# if !defined(__clang__) && (defined(__i386__) || defined(__x86_64__)) -# define SWIGSTRUCTPACKED __attribute__((__packed__, __gcc_struct__)) -# else -# define SWIGSTRUCTPACKED __attribute__((__packed__)) -# endif -%} -#else -# define SWIGSTRUCTPACKED -#endif - -%insert(runtime) %{ - -typedef struct { char *p; intgo n; } _gostring_; -typedef struct { void* array; intgo len; intgo cap; } _goslice_; - -%} - -%insert(cgo_comment_typedefs) %{ - -typedef struct { char *p; intgo n; } _gostring_; -typedef struct { void* array; intgo len; intgo cap; } _goslice_; - -%} - -#ifdef SWIGGO_GCCGO - -/* Boilerplate for C/C++ code when using gccgo. */ -%insert(runtime) %{ -#define SWIGGO_GCCGO - -#ifdef __cplusplus -extern "C" { -#endif -extern void *_cgo_allocate(size_t); -extern void _cgo_panic(const char *); -#ifdef __cplusplus -} -#endif - -#define _swig_goallocate _cgo_allocate -#define _swig_gopanic _cgo_panic -%} - -#endif - -#ifndef SWIGGO_GCCGO - -%go_import("unsafe", _ "runtime/cgo") - -#else - -%go_import("syscall", "unsafe") - -%insert(go_header) %{ - -type _ syscall.Sockaddr - -%} - -#endif - -%insert(go_header) %{ - -type _ unsafe.Pointer - -%} - -/* Swig_always_false is used to conditionally assign parameters to - Swig_escape_val so that the compiler thinks that they escape. We - only assign them if Swig_always_false is true, which it never is. - We export the variable so that the compiler doesn't realize that it - is never set. */ -%insert(go_header) %{ -var Swig_escape_always_false bool -var Swig_escape_val interface{} -%} - -/* Function pointers are translated by the code in go.cxx into - _swig_fnptr. Member pointers are translated to _swig_memberptr. */ - -%insert(go_header) %{ -type _swig_fnptr *byte -type _swig_memberptr *byte -%} - -/* Convert a Go interface value into a C++ pointer. */ - -%insert(go_header) %{ -func getSwigcptr(v interface { Swigcptr() uintptr }) uintptr { - if v == nil { - return 0 - } - return v.Swigcptr() -} -%} - -/* For directors we need C++ to track a Go pointer. Since we can't - pass a Go pointer into C++, we use a map to track the pointers on - the Go side. */ - -%go_import("sync") - -%insert(go_header) %{ -type _ sync.Mutex -%} - -%insert(go_director) %{ - -var swigDirectorTrack struct { - sync.Mutex - m map[int]interface{} - c int -} - -func swigDirectorAdd(v interface{}) int { - swigDirectorTrack.Lock() - defer swigDirectorTrack.Unlock() - if swigDirectorTrack.m == nil { - swigDirectorTrack.m = make(map[int]interface{}) - } - swigDirectorTrack.c++ - ret := swigDirectorTrack.c - swigDirectorTrack.m[ret] = v - return ret -} - -func swigDirectorLookup(c int) interface{} { - swigDirectorTrack.Lock() - defer swigDirectorTrack.Unlock() - ret := swigDirectorTrack.m[c] - if ret == nil { - panic("C++ director pointer not found (possible use-after-free)") - } - return ret -} - -func swigDirectorDelete(c int) { - swigDirectorTrack.Lock() - defer swigDirectorTrack.Unlock() - if swigDirectorTrack.m[c] == nil { - if c > swigDirectorTrack.c { - panic("C++ director pointer invalid (possible memory corruption") - } else { - panic("C++ director pointer not found (possible use-after-free)") - } - } - delete(swigDirectorTrack.m, c) -} - -%} diff --git a/win64/bin/swig/share/swig/4.1.0/go/gostring.swg b/win64/bin/swig/share/swig/4.1.0/go/gostring.swg deleted file mode 100755 index 48351634..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/gostring.swg +++ /dev/null @@ -1,29 +0,0 @@ -/* ------------------------------------------------------------ - * gostring.swg - * - * Support for returning strings from C to Go. - * ------------------------------------------------------------ */ - -// C/C++ code to convert a memory buffer into a Go string allocated in -// C/C++ memory. -%fragment("AllocateString", "runtime") %{ -static _gostring_ Swig_AllocateString(const char *p, size_t l) { - _gostring_ ret; - ret.p = (char*)malloc(l); - memcpy(ret.p, p, l); - ret.n = l; - return ret; -} -%} - -// Go code to convert a string allocated in C++ memory to one -// allocated in Go memory. -%fragment("CopyString", "go_runtime") %{ -type swig_gostring struct { p uintptr; n int } -func swigCopyString(s string) string { - p := *(*swig_gostring)(unsafe.Pointer(&s)) - r := string((*[0x7fffffff]byte)(unsafe.Pointer(p.p))[:p.n]) - Swig_free(p.p) - return r -} -%} diff --git a/win64/bin/swig/share/swig/4.1.0/go/std_array.i b/win64/bin/swig/share/swig/4.1.0/go/std_array.i deleted file mode 100755 index b3c84714..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/std_array.i +++ /dev/null @@ -1,43 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_array.i - * ----------------------------------------------------------------------------- */ - -%include - -namespace std { - - template class array { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - array(); - array(const array& other); - - size_type size() const; - %rename(isEmpty) empty; - bool empty() const; - void fill(const T& u); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; diff --git a/win64/bin/swig/share/swig/4.1.0/go/std_deque.i b/win64/bin/swig/share/swig/4.1.0/go/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/go/std_except.i b/win64/bin/swig/share/swig/4.1.0/go/std_except.i deleted file mode 100755 index 6de13ee0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/std_except.i +++ /dev/null @@ -1,31 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. - * These typemaps are used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws) std::bad_cast %{_swig_gopanic($1.what());%} -%typemap(throws) std::bad_exception %{_swig_gopanic($1.what());%} -%typemap(throws) std::domain_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::exception %{_swig_gopanic($1.what());%} -%typemap(throws) std::invalid_argument %{_swig_gopanic($1.what());%} -%typemap(throws) std::length_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::logic_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::out_of_range %{_swig_gopanic($1.what());%} -%typemap(throws) std::overflow_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::range_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::runtime_error %{_swig_gopanic($1.what());%} -%typemap(throws) std::underflow_error %{_swig_gopanic($1.what());%} diff --git a/win64/bin/swig/share/swig/4.1.0/go/std_list.i b/win64/bin/swig/share/swig/4.1.0/go/std_list.i deleted file mode 100755 index 1245c089..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/std_list.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std { - - template - class list { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - list(); - list(const list& other); - - size_type size() const; - bool empty() const; - %rename(isEmpty) empty; - void clear(); - void push_front(const value_type& x); - void pop_front(); - void push_back(const value_type& x); - void pop_back(); - void remove(value_type x); - void reverse(); - void unique(); - void sort(); - void merge(list& x); - }; - -} diff --git a/win64/bin/swig/share/swig/4.1.0/go/std_map.i b/win64/bin/swig/share/swig/4.1.0/go/std_map.i deleted file mode 100755 index a639a47a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/std_map.i +++ /dev/null @@ -1,66 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; -} diff --git a/win64/bin/swig/share/swig/4.1.0/go/std_pair.i b/win64/bin/swig/share/swig/4.1.0/go/std_pair.i deleted file mode 100755 index 539130ff..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/go/std_string.i b/win64/bin/swig/share/swig/4.1.0/go/std_string.i deleted file mode 100755 index 9ee86ef9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/std_string.i +++ /dev/null @@ -1,162 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a Go string and are passed around by value. - * - * To use non-const std::string references use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -%typemap(gotype) string, const string & "string" - -%typemap(in) string -%{ $1.assign($input.p, $input.n); %} - -%typemap(godirectorout) string -%{ - { - p := Swig_malloc(len($input)) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len($input)] - copy(s, $input) - $result = *(*string)(unsafe.Pointer(&s)) - } -%} - -%typemap(directorout) string -%{ - $result.assign($input.p, $input.n); - free($input.p); -%} - -%typemap(out,fragment="AllocateString") string -%{ $result = Swig_AllocateString($1.data(), $1.length()); %} - -%typemap(goout,fragment="CopyString") string -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") string -%{ $input = Swig_AllocateString($1.data(), $1.length()); %} - -%typemap(godirectorin,fragment="CopyString") string -%{ $result = swigCopyString($input) %} - -%typemap(throws) string -%{ _swig_gopanic($1.c_str()); %} - -%typemap(in) const string & -%{ - $*1_ltype $1_str($input.p, $input.n); - $1 = &$1_str; -%} - -%typemap(godirectorout) const string & -%{ - { - p := Swig_malloc(len($input)) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len($input)] - copy(s, $input) - $result = *(*string)(unsafe.Pointer(&s)) - } -%} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ - static $*1_ltype $1_str; - $1_str.assign($input.p, $input.n); - free($input.p); - $result = &$1_str; -%} - -%typemap(out,fragment="AllocateString") const string & -%{ $result = Swig_AllocateString((*$1).data(), (*$1).length()); %} - -%typemap(goout,fragment="CopyString") const string & -%{ $result = swigCopyString($1) %} - -%typemap(directorin,fragment="AllocateString") const string & -%{ $input = Swig_AllocateString($1.data(), $1.length()); %} - -%typemap(godirectorin,fragment="CopyString") const string & -%{ $result = swigCopyString($input) %} - -%typemap(throws) const string & -%{ _swig_gopanic($1.c_str()); %} - - -%typemap(gotype) string * "*string" - -%typemap(in) string * (string temp) -%{ - if ($input) { - temp.assign($input->p, $input->n); - $1 = &temp; - } else - $1 = 0; -%} - -%typemap(godirectorout) string * -%{ - if $input != nil { - p := Swig_malloc(len(*$input)) - s := (*[1<<30]byte)(unsafe.Pointer(p))[:len(*$input)] - copy(s, *$input) - $result = (*string)(unsafe.Pointer(&s)) - } else { - $result = nil - } -%} - -%typemap(directorout) string * (string temp) -%{ - temp.assign($input->p, $input->n); - $result = &temp; - free($input.p); -%} - -%typemap(out,fragment="AllocateString") string * (_gostring_ temp) -%{ - temp = Swig_AllocateString($1->data(), $1->length()); - $result = &temp; -%} - -%typemap(goout,fragment="CopyString") string * -%{ *$result = swigCopyString(*$1) %} - -%typemap(directorin,fragment="AllocateString") string * (_gostring_ temp) -%{ - if ($1) { - temp = Swig_AllocateString($1->data(), $1->length()); - $input = &temp; - } else - $input = 0; -%} - -%typemap(godirectorin,fragment="CopyString") string * -%{ *$result = swigCopyString(*$input); %} - -%typemap(argout,fragment="AllocateString") string * -%{ - if ($1) - *$input = Swig_AllocateString($1->data(), $1->length()); -%} - -%typemap(goargout,fragment="CopyString") string * -%{ - if $input != nil { - *$1 = swigCopyString(*$input) - } -%} - -} diff --git a/win64/bin/swig/share/swig/4.1.0/go/std_vector.i b/win64/bin/swig/share/swig/4.1.0/go/std_vector.i deleted file mode 100755 index 34998d97..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/std_vector.i +++ /dev/null @@ -1,92 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/go/swigmove.i b/win64/bin/swig/share/swig/4.1.0/go/swigmove.i deleted file mode 100755 index ef2f65e3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/swigmove.i +++ /dev/null @@ -1,15 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in) SWIGTYPE MOVE ($&1_type argp) -%{ - argp = ($&1_ltype)$input; - if (argp == NULL) { - _swig_gopanic("Attempt to dereference null $1_type"); - } - SwigValueWrapper< $1_ltype >::reset($1, argp); -%} diff --git a/win64/bin/swig/share/swig/4.1.0/go/typemaps.i b/win64/bin/swig/share/swig/4.1.0/go/typemaps.i deleted file mode 100755 index f1546cff..00000000 --- a/win64/bin/swig/share/swig/4.1.0/go/typemaps.i +++ /dev/null @@ -1,298 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps remap a C pointer or C++ reference to be an "INPUT" value which is -passed by value instead of reference. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In Go you could then use it like this: - answer := modulename.Fadd(10.0, 20.0) - -There are no char *INPUT typemaps, however you can apply the signed -char * typemaps instead: - %include - %apply signed char *INPUT {char *input}; - void f(char *input); -*/ - -%define INPUT_TYPEMAP(TYPE, GOTYPE) -%typemap(gotype) TYPE *INPUT, TYPE &INPUT "GOTYPE" - - %typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(out) TYPE *INPUT, TYPE &INPUT "" - -%typemap(goout) TYPE *INPUT, TYPE &INPUT "" - -%typemap(freearg) TYPE *INPUT, TYPE &INPUT "" - -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" - -// %typemap(typecheck) TYPE *INPUT = TYPE; -// %typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, bool); -INPUT_TYPEMAP(signed char, int8); -INPUT_TYPEMAP(char, byte); -INPUT_TYPEMAP(unsigned char, byte); -INPUT_TYPEMAP(short, int16); -INPUT_TYPEMAP(unsigned short, uint16); -INPUT_TYPEMAP(int, int); -INPUT_TYPEMAP(unsigned int, uint); -INPUT_TYPEMAP(long, int64); -INPUT_TYPEMAP(unsigned long, uint64); -INPUT_TYPEMAP(long long, int64); -INPUT_TYPEMAP(unsigned long long, uint64); -INPUT_TYPEMAP(float, float32); -INPUT_TYPEMAP(double, float64); - -#undef INPUT_TYPEMAP - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. An array replaces the c pointer or reference parameter. -// The output value is returned in this array passed in. - -/* -OUTPUT typemaps ---------------- - -The following typemaps can be applied to turn a pointer or reference -into an "output" value. When calling a function, no input value would -be given for a parameter, but an output value would be returned. This -works by a Go slice being passed as a parameter where a c pointer or -reference is required. As with any Go function, the array is passed -by reference so that any modifications to the array will be picked up -in the calling function. Note that the array passed in MUST have at -least one element, but as the c function does not require any input, -the value can be set to anything. - - bool *OUTPUT, bool &OUTPUT - signed char *OUTPUT, signed char &OUTPUT - unsigned char *OUTPUT, unsigned char &OUTPUT - short *OUTPUT, short &OUTPUT - unsigned short *OUTPUT, unsigned short &OUTPUT - int *OUTPUT, int &OUTPUT - unsigned int *OUTPUT, unsigned int &OUTPUT - long *OUTPUT, long &OUTPUT - unsigned long *OUTPUT, unsigned long &OUTPUT - long long *OUTPUT, long long &OUTPUT - unsigned long long *OUTPUT, unsigned long long &OUTPUT - float *OUTPUT, float &OUTPUT - double *OUTPUT, double &OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters): - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Go output of the function would be the function return value and the -value in the single element array. In Go you would use it like this: - - ptr := []float64{0.0} - fraction := modulename.Modf(5.0,ptr) - -There are no char *OUTPUT typemaps, however you can apply the signed -char * typemaps instead: - %include - %apply signed char *OUTPUT {char *output}; - void f(char *output); -*/ - -%define OUTPUT_TYPEMAP(TYPE, GOTYPE) -%typemap(gotype) TYPE *OUTPUT, TYPE &OUTPUT %{[]GOTYPE%} - -%typemap(in) TYPE *OUTPUT($*1_ltype temp), TYPE &OUTPUT($*1_ltype temp) -{ - if ($input.len == 0) { - _swig_gopanic("array must contain at least 1 element"); - } - $1 = &temp; -} - -%typemap(out) TYPE *OUTPUT, TYPE &OUTPUT "" - -%typemap(goout) TYPE *INPUT, TYPE &INPUT "" - -%typemap(freearg) TYPE *OUTPUT, TYPE &OUTPUT "" - -%typemap(argout) TYPE *OUTPUT, TYPE &OUTPUT -{ - TYPE* a = (TYPE *) $input.array; - a[0] = temp$argnum; -} - -%enddef - -OUTPUT_TYPEMAP(bool, bool); -OUTPUT_TYPEMAP(signed char, int8); -OUTPUT_TYPEMAP(char, byte); -OUTPUT_TYPEMAP(unsigned char, byte); -OUTPUT_TYPEMAP(short, int16); -OUTPUT_TYPEMAP(unsigned short, uint16); -OUTPUT_TYPEMAP(int, int); -OUTPUT_TYPEMAP(unsigned int, uint); -OUTPUT_TYPEMAP(long, int64); -OUTPUT_TYPEMAP(unsigned long, uint64); -OUTPUT_TYPEMAP(long long, int64); -OUTPUT_TYPEMAP(unsigned long long, uint64); -OUTPUT_TYPEMAP(float, float32); -OUTPUT_TYPEMAP(double, float64); - -#undef OUTPUT_TYPEMAP - -/* -INOUT typemaps --------------- - -Mappings for a parameter that is both an input and an output parameter - -The following typemaps can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" typemaps described earlier. Output values are -returned as an element in a Go slice. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -This works similarly to C in that the mapping directly modifies the -input value - the input must be an array with a minimum of one element. -The element in the array is the input and the output is the element in -the array. - - x := []float64{5.0} - Neg(x); - -The implementation of the OUTPUT and INOUT typemaps is different to -other languages in that other languages will return the output value -as part of the function return value. This difference is due to Go -being a typed language. - -There are no char *INOUT typemaps, however you can apply the signed -char * typemaps instead: - %include - %apply signed char *INOUT {char *inout}; - void f(char *inout); -*/ - -%define INOUT_TYPEMAP(TYPE, GOTYPE) -%typemap(gotype) TYPE *INOUT, TYPE &INOUT %{[]GOTYPE%} - -%typemap(in) TYPE *INOUT, TYPE &INOUT { - if ($input.len == 0) { - _swig_gopanic("array must contain at least 1 element"); - } - $1 = ($1_ltype) $input.array; -} - -%typemap(out) TYPE *INOUT, TYPE &INOUT "" - -%typemap(goout) TYPE *INOUT, TYPE &INOUT "" - -%typemap(freearg) TYPE *INOUT, TYPE &INOUT "" - -%typemap(argout) TYPE *INOUT, TYPE &INOUT "" - -%enddef - -INOUT_TYPEMAP(bool, bool); -INOUT_TYPEMAP(signed char, int8); -INOUT_TYPEMAP(char, byte); -INOUT_TYPEMAP(unsigned char, byte); -INOUT_TYPEMAP(short, int16); -INOUT_TYPEMAP(unsigned short, uint16); -INOUT_TYPEMAP(int, int); -INOUT_TYPEMAP(unsigned int, uint); -INOUT_TYPEMAP(long, int64); -INOUT_TYPEMAP(unsigned long, uint64); -INOUT_TYPEMAP(long long, int64); -INOUT_TYPEMAP(unsigned long long, uint64); -INOUT_TYPEMAP(float, float32); -INOUT_TYPEMAP(double, float64); - -#undef INOUT_TYPEMAP diff --git a/win64/bin/swig/share/swig/4.1.0/guile/Makefile b/win64/bin/swig/share/swig/4.1.0/guile/Makefile deleted file mode 100755 index c18c4dc2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/Makefile +++ /dev/null @@ -1,3 +0,0 @@ - -co: - co RCS/*.i* RCS/*.swg* diff --git a/win64/bin/swig/share/swig/4.1.0/guile/common.scm b/win64/bin/swig/share/swig/4.1.0/guile/common.scm deleted file mode 100755 index a6bf7999..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/common.scm +++ /dev/null @@ -1,70 +0,0 @@ -;;;************************************************************************ -;;;*common.scm -;;;* -;;;* This file contains generic SWIG GOOPS classes for generated -;;;* GOOPS file support -;;;************************************************************************ - -(define-module (Swig swigrun)) - -(define-module (Swig common) - #:use-module (oop goops) - #:use-module (Swig swigrun)) - -(define-class () - (new-function #:init-value #f)) - -(define-method (initialize (class ) initargs) - (slot-set! class 'new-function (get-keyword #:new-function initargs #f)) - (next-method)) - -(define-class () - (swig-smob #:init-value #f) - #:metaclass -) - -(define-method (initialize (obj ) initargs) - (next-method) - (slot-set! obj 'swig-smob - (let ((arg (get-keyword #:init-smob initargs #f))) - (if arg - arg - (let ((ret (apply (slot-ref (class-of obj) 'new-function) (get-keyword #:args initargs '())))) - ;; if the class is registered with runtime environment, - ;; new-Function will return a goops class. In that case, extract the smob - ;; from that goops class and set it as the current smob. - (if (slot-exists? ret 'swig-smob) - (slot-ref ret 'swig-smob) - ret)))))) - -(define (display-address o file) - (display (number->string (object-address o) 16) file)) - -(define (display-pointer-address o file) - ;; Don't fail if the function SWIG-PointerAddress is not present. - (let ((address (false-if-exception (SWIG-PointerAddress o)))) - (if address - (begin - (display " @ " file) - (display (number->string address 16) file))))) - -(define-method (write (o ) file) - ;; We display _two_ addresses to show the object's identity: - ;; * first the address of the GOOPS proxy object, - ;; * second the pointer address. - ;; The reason is that proxy objects are created and discarded on the - ;; fly, so different proxy objects for the same C object will appear. - (let ((class (class-of o))) - (if (slot-bound? class 'name) - (begin - (display "#<" file) - (display (class-name class) file) - (display #\space file) - (display-address o file) - (display-pointer-address o file) - (display ">" file)) - (next-method)))) - -(export ) - -;;; common.scm ends here diff --git a/win64/bin/swig/share/swig/4.1.0/guile/cplusplus.i b/win64/bin/swig/share/swig/4.1.0/guile/cplusplus.i deleted file mode 100755 index 0908e30d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/cplusplus.i +++ /dev/null @@ -1,22 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cplusplus.i - * - * SWIG typemaps for C++ - * ----------------------------------------------------------------------------- */ - -%typemap(guile,out) string, std::string { - $result = SWIG_str02scm(const_cast($1.c_str())); -} -%typemap(guile,in) string, std::string { - $1 = SWIG_scm2str($input); -} - -%typemap(guile,out) complex, complex, std::complex { - $result = scm_make_rectangular( scm_from_double ($1.real ()), - scm_from_double ($1.imag ()) ); -} -%typemap(guile,in) complex, complex, std::complex { - $1 = std::complex( scm_to_double (scm_real_part ($input)), - scm_to_double (scm_imag_part ($input)) ); -} - diff --git a/win64/bin/swig/share/swig/4.1.0/guile/extra-install.list b/win64/bin/swig/share/swig/4.1.0/guile/extra-install.list deleted file mode 100755 index d9420291..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/extra-install.list +++ /dev/null @@ -1,2 +0,0 @@ -# see top-level Makefile.in -common.scm diff --git a/win64/bin/swig/share/swig/4.1.0/guile/guile.i b/win64/bin/swig/share/swig/4.1.0/guile/guile.i deleted file mode 100755 index ecf9c241..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/guile.i +++ /dev/null @@ -1,33 +0,0 @@ -/* ----------------------------------------------------------------------------- - * guile.i - * - * SWIG Configuration File for Guile. - * ----------------------------------------------------------------------------- */ - -/* Macro for inserting Scheme code into the stub */ -#define %scheme %insert("scheme") -#define %goops %insert("goops") - -/* Return-styles */ -%pragma(guile) return_nothing_doc = "Returns unspecified." -%pragma(guile) return_one_doc = "Returns $values." - -%define %values_as_list - %pragma(guile) beforereturn = "" - %pragma(guile) return_multi_doc = "Returns a list of $num_values values: $values." -%enddef -%values_as_list /* the default style */ - -%define %values_as_vector - %pragma(guile) beforereturn = "GUILE_MAYBE_VECTOR" - %pragma(guile) return_multi_doc = "Returns a vector of $num_values values: $values." -%enddef - -%define %multiple_values - %pragma(guile) beforereturn = "GUILE_MAYBE_VALUES" - %pragma(guile) return_multi_doc = "Returns $num_values values: $values." -%enddef - -#define GUILE_APPEND_RESULT SWIG_APPEND_VALUE - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/guile/guile_scm.swg b/win64/bin/swig/share/swig/4.1.0/guile/guile_scm.swg deleted file mode 100755 index cad47f92..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/guile_scm.swg +++ /dev/null @@ -1,46 +0,0 @@ -/* ----------------------------------------------------------------------------- - * guile_scm.swg - * - * This SWIG interface file is processed if the Guile module is run - * with SCM_ flavor. - * ----------------------------------------------------------------------------- */ - -#define SWIGGUILE_SCM - -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors - -%runtime "guile_scm_run.swg" -%include - -%runtime %{ - -#define GUILE_MAYBE_VALUES \ - if (gswig_list_p) gswig_result = scm_values(gswig_result); - -#define GUILE_MAYBE_VECTOR \ - if (gswig_list_p) gswig_result = scm_vector(gswig_result); - -#define SWIG_APPEND_VALUE(object) \ - if (gswig_result == SCM_UNSPECIFIED) \ - gswig_result = object; \ - else { \ - if (!gswig_list_p) { \ - gswig_list_p = 1; \ - gswig_result = scm_list_n(gswig_result, object, SCM_UNDEFINED); \ - } \ - else \ - gswig_result = scm_append(scm_list_n(gswig_result, scm_list_n(object, SCM_UNDEFINED), SCM_UNDEFINED)); \ - } - -%} - -%insert(init) "swiginit.swg" - -%init %{ -SWIG_GUILE_INIT_STATIC void -SWIG_init(void) -{ - SWIG_InitializeModule(0); - SWIG_PropagateClientData(); -%} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/guile_scm_run.swg b/win64/bin/swig/share/swig/4.1.0/guile/guile_scm_run.swg deleted file mode 100755 index 0ed17ee6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/guile_scm_run.swg +++ /dev/null @@ -1,532 +0,0 @@ -/* ----------------------------------------------------------------------------- - * guile_scm_run.swg - * ----------------------------------------------------------------------------- */ - -#if __GNUC__ >= 10 -#if defined(__cplusplus) -#pragma GCC diagnostic ignored "-Wvolatile" /* For 'volatile SCM *' in at least Guile 3.0 and earlier */ -#endif -#endif - -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/* In the code below, use guile 2.0 compatible functions where possible. - Functions that don't exist in older versions will be mapped to - a deprecated equivalent for those versions only */ -#if defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION < 2) - -static SCM -scm_module_variable (SCM module, SCM sym) -{ - return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F); -} - -#define scm_to_utf8_string scm_to_locale_string -#define scm_from_utf8_string scm_from_locale_string -#endif - -#if SCM_MAJOR_VERSION >= 2 -/* scm_c_define_gsubr takes a different parameter type depending on the guile version */ - -typedef scm_t_subr swig_guile_proc; -#else -typedef SCM (*swig_guile_proc)(); -#endif -typedef SCM (*guile_destructor)(SCM); - -typedef struct swig_guile_clientdata { - guile_destructor destroy; - SCM goops_class; -} swig_guile_clientdata; - -#define SWIG_scm2str(s) \ - SWIG_Guile_scm2newstr(s, NULL) -#define SWIG_str02scm(str) \ - str ? scm_from_utf8_string(str) : SCM_BOOL_F -# define SWIG_malloc(size) \ - scm_malloc(size) -# define SWIG_free(mem) \ - free(mem) -#define SWIG_ConvertPtr(s, result, type, flags) \ - SWIG_Guile_ConvertPtr(s, result, type, flags) -#define SWIG_MustGetPtr(s, type, argnum, flags) \ - SWIG_Guile_MustGetPtr(s, type, argnum, flags, FUNC_NAME) -#define SWIG_NewPointerObj(ptr, type, owner) \ - SWIG_Guile_NewPointerObj((void*)ptr, type, owner) -#define SWIG_PointerAddress(object) \ - SWIG_Guile_PointerAddress(object) -#define SWIG_PointerType(object) \ - SWIG_Guile_PointerType(object) -#define SWIG_IsPointerOfType(object, type) \ - SWIG_Guile_IsPointerOfType(object, type) -#define SWIG_IsPointer(object) \ - SWIG_Guile_IsPointer(object) -#define SWIG_contract_assert(expr, msg) \ - do { \ - if (!(expr)) \ - scm_error(scm_from_locale_symbol("swig-contract-assertion-failed"), \ - (char *) FUNC_NAME, (char *) msg, \ - SCM_EOL, SCM_BOOL_F); \ - } while (0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) \ - SWIG_Guile_ConvertMember(obj, ptr, sz, ty, FUNC_NAME) -#define SWIG_NewMemberObj(ptr, sz, type) \ - SWIG_Guile_NewMemberObj(ptr, sz, type, FUNC_NAME) - -/* Runtime API */ -static swig_module_info *SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata)); -#define SWIG_GetModule(clientdata) SWIG_Guile_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer) - -SWIGINTERN char * -SWIG_Guile_scm2newstr(SCM str, size_t *len) { -#define FUNC_NAME "SWIG_Guile_scm2newstr" - char *ret; - - SCM_ASSERT (scm_is_string(str), str, 1, FUNC_NAME); - - ret = scm_to_utf8_string(str); - if (!ret) return NULL; - - if (len) *len = strlen(ret) - 1; - return ret; -#undef FUNC_NAME -} - -static int swig_initialized = 0; -static scm_t_bits swig_tag = 0; -static scm_t_bits swig_collectable_tag = 0; -static scm_t_bits swig_finalized_tag = 0; -static scm_t_bits swig_destroyed_tag = 0; -static scm_t_bits swig_member_function_tag = 0; -static SCM swig_make_func = SCM_EOL; -static SCM swig_keyword = SCM_EOL; -static SCM swig_symbol = SCM_EOL; - -#define SWIG_Guile_GetSmob(x) \ - ( !scm_is_null(x) && SCM_INSTANCEP(x) && scm_is_true(scm_slot_exists_p(x, swig_symbol)) \ - ? scm_slot_ref(x, swig_symbol) : (x) ) - -SWIGINTERN void SWIG_Guile_MarkPointerNoncollectable(SCM s); - -SWIGINTERN SCM -SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner) -{ - if (ptr == NULL) - return SCM_EOL; - else { - SCM smob; - swig_guile_clientdata *cdata = (swig_guile_clientdata *) type->clientdata; - if (owner) - SCM_NEWSMOB2(smob, swig_collectable_tag, ptr, (void *) type); - else - SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); - - if (!cdata || scm_is_null(cdata->goops_class) || swig_make_func == SCM_EOL ) { - return smob; - } else { - /* the scm_make() C function only handles the creation of gf, - methods and classes (no instances) the (make ...) function is - later redefined in goops.scm. So we need to call that - Scheme function. */ - return scm_apply(swig_make_func, - scm_list_3(cdata->goops_class, - swig_keyword, - smob), - SCM_EOL); - } - } -} - -SWIGINTERN unsigned long -SWIG_Guile_PointerAddress(SCM object) -{ - SCM smob = SWIG_Guile_GetSmob(object); - if (scm_is_null(smob)) return 0; - else if (SCM_SMOB_PREDICATE(swig_tag, smob) - || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) - || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { - return (unsigned long) (void *) SCM_CELL_WORD_1(smob); - } - else scm_wrong_type_arg("SWIG-Guile-PointerAddress", 1, object); -} - -SWIGINTERN swig_type_info * -SWIG_Guile_PointerType(SCM object) -{ - SCM smob = SWIG_Guile_GetSmob(object); - if (scm_is_null(smob)) return NULL; - else if (SCM_SMOB_PREDICATE(swig_tag, smob) - || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) - || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { - return (swig_type_info *) SCM_CELL_WORD_2(smob); - } - else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object); -} - -SWIGINTERN int -SWIG_Guile_IsValidSmob(SCM smob) -{ - /* We do not accept smobs representing destroyed pointers, but we have to - allow finalized smobs because Guile >= 2.0.12 sets all smob instances - to the 'finalized' type before calling their 'free' function. This change - was introduced to Guile in commit 8dff3af087c6eaa83ae0d72aa8b22aef5c65d65d */ - return SCM_SMOB_PREDICATE(swig_tag, smob) - || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) - || SCM_SMOB_PREDICATE(swig_finalized_tag, smob); -} - -SWIGINTERN int -SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags) -{ - swig_cast_info *cast; - swig_type_info *from; - SCM smob = SWIG_Guile_GetSmob(s); - int ret = SWIG_ERROR; - - if (scm_is_null(smob)) { - *result = NULL; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; -#if SCM_MAJOR_VERSION >= 2 - } else if (SCM_POINTER_P(s)) { - *result = SCM_POINTER_VALUE(s); - return SWIG_OK; -#endif /* if SCM_MAJOR_VERSION >= 2 */ - } else if (SWIG_Guile_IsValidSmob(smob)) { - from = (swig_type_info *) SCM_CELL_WORD_2(smob); - if (!from) return SWIG_ERROR; - - if ((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) { - if ((SCM_CELL_TYPE(smob) == swig_collectable_tag && SCM_CELL_WORD_1(smob) == 0) || SCM_CELL_TYPE(smob) == swig_tag) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - } - - if (type) { - cast = SWIG_TypeCheckStruct(from, type); - if (cast) { - int newmemory = 0; - *result = SWIG_TypeCast(cast, (void *) SCM_CELL_WORD_1(smob), &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - ret = SWIG_OK; - } else { - return SWIG_ERROR; - } - } else { - *result = (void *) SCM_CELL_WORD_1(smob); - ret = SWIG_OK; - } - - if (flags & SWIG_POINTER_DISOWN) { - SWIG_Guile_MarkPointerNoncollectable(smob); - } - if (flags & SWIG_POINTER_CLEAR) { - SCM_SET_CELL_WORD_1(smob, 0); - } - } - return ret; -} - -SWIGINTERNINLINE void * -SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type, - int argnum, int flags, const char *func_name) -{ - void *result; - int res = SWIG_Guile_ConvertPtr(s, &result, type, flags); - if (!SWIG_IsOK(res)) { - /* type mismatch */ - scm_wrong_type_arg((char *) func_name, argnum, s); - } - return result; -} - -SWIGINTERNINLINE int -SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type) -{ - void *result; - if (SWIG_Guile_ConvertPtr(s, &result, type, 0)) { - /* type mismatch */ - return 0; - } - else return 1; -} - -SWIGINTERNINLINE int -SWIG_Guile_IsPointer (SCM s) -{ - /* module might not be initialized yet, so initialize it */ - SWIG_GetModule(0); - return SWIG_Guile_IsPointerOfType (s, NULL); -} - -/* Mark a pointer object non-collectable */ -SWIGINTERN void -SWIG_Guile_MarkPointerNoncollectable(SCM s) -{ - SCM smob = SWIG_Guile_GetSmob(s); - if (!scm_is_null(smob)) { - if (SWIG_Guile_IsValidSmob(smob)) { - SCM_SET_CELL_TYPE(smob, swig_tag); - } - else scm_wrong_type_arg(NULL, 0, s); - } -} - -/* Mark a pointer object destroyed */ -SWIGINTERN void -SWIG_Guile_MarkPointerDestroyed(SCM s) -{ - SCM smob = SWIG_Guile_GetSmob(s); - if (!scm_is_null(smob)) { - if (SWIG_Guile_IsValidSmob(smob)) { - SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); - } - else scm_wrong_type_arg(NULL, 0, s); - } -} - -/* Member functions */ - -SWIGINTERN SCM -SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type, - const char *func_name) -{ - SCM smob; - void *copy = malloc(sz); - memcpy(copy, ptr, sz); - SCM_NEWSMOB2(smob, swig_member_function_tag, copy, (void *) type); - return smob; -} - -SWIGINTERN int -SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type, - const char *func_name) -{ - swig_cast_info *cast; - swig_type_info *from; - - if (SCM_SMOB_PREDICATE(swig_member_function_tag, smob)) { - from = (swig_type_info *) SCM_CELL_WORD_2(smob); - if (!from) return SWIG_ERROR; - if (type) { - cast = SWIG_TypeCheckStruct(from, type); - if (!cast) return SWIG_ERROR; - } - memcpy(ptr, (void *) SCM_CELL_WORD_1(smob), sz); - return SWIG_OK; - } - return SWIG_ERROR; -} - - -/* Init */ - -SWIGINTERN int -print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate, - const char *attribute) -{ - swig_type_info *type; - - type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); - if (type) { - scm_puts((char *) "#<", port); - scm_puts((char *) attribute, port); - scm_puts((char *) "swig-pointer ", port); - scm_puts((char *) SWIG_TypePrettyName(type), port); - scm_puts((char *) " ", port); - scm_intprint((long) SCM_CELL_WORD_1(swig_smob), 16, port); - scm_puts((char *) ">", port); - /* non-zero means success */ - return 1; - } else { - return 0; - } -} - - -SWIGINTERN int -print_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - return print_swig_aux(swig_smob, port, pstate, ""); -} - -SWIGINTERN int -print_collectable_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - return print_swig_aux(swig_smob, port, pstate, "collectable-"); -} - -SWIGINTERN int -print_destroyed_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - return print_swig_aux(swig_smob, port, pstate, "destroyed-"); -} - -SWIGINTERN int -print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate) -{ - swig_type_info *type; - type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); - if (type) { - scm_puts((char *) "#<", port); - scm_puts((char *) "swig-member-function-pointer ", port); - scm_puts((char *) SWIG_TypePrettyName(type), port); - scm_puts((char *) " >", port); - /* non-zero means success */ - return 1; - } else { - return 0; - } -} - -SWIGINTERN SCM -equalp_swig (SCM A, SCM B) -{ - if (SCM_CELL_WORD_0(A) == SCM_CELL_WORD_0(B) && SCM_CELL_WORD_1(A) == SCM_CELL_WORD_1(B) - && SCM_CELL_WORD_2(A) == SCM_CELL_WORD_2(B)) - return SCM_BOOL_T; - else return SCM_BOOL_F; -} - -SWIGINTERN size_t -free_swig(SCM A) -{ - swig_type_info *type = (swig_type_info *) SCM_CELL_WORD_2(A); - if (type) { - if (type->clientdata && ((swig_guile_clientdata *)type->clientdata)->destroy) - ((swig_guile_clientdata *)type->clientdata)->destroy(A); - } - return 0; -} - -SWIGINTERN size_t -free_swig_member_function(SCM A) -{ - free((swig_type_info *) SCM_CELL_WORD_1(A)); - return 0; -} - -SWIGINTERN int -ensure_smob_tag(SCM swig_module, - scm_t_bits *tag_variable, - const char *smob_name, - const char *scheme_variable_name) -{ - SCM variable = scm_module_variable(swig_module, - scm_from_locale_symbol(scheme_variable_name)); - if (scm_is_false(variable)) { - *tag_variable = scm_make_smob_type((char*)scheme_variable_name, 0); - scm_c_module_define(swig_module, scheme_variable_name, - scm_from_ulong(*tag_variable)); - return 1; - } - else { - *tag_variable = scm_to_ulong(SCM_VARIABLE_REF(variable)); - return 0; - } -} - -SWIGINTERN SCM -SWIG_Guile_Init () -{ - static SCM swig_module; - - if (swig_initialized) return swig_module; - swig_initialized = 1; - - swig_module = scm_c_resolve_module("Swig swigrun"); - if (ensure_smob_tag(swig_module, &swig_tag, - "swig-pointer", "swig-pointer-tag")) { - scm_set_smob_print(swig_tag, print_swig); - scm_set_smob_equalp(swig_tag, equalp_swig); - } - if (ensure_smob_tag(swig_module, &swig_collectable_tag, - "collectable-swig-pointer", "collectable-swig-pointer-tag")) { - scm_set_smob_print(swig_collectable_tag, print_collectable_swig); - scm_set_smob_equalp(swig_collectable_tag, equalp_swig); - scm_set_smob_free(swig_collectable_tag, free_swig); - /* For Guile >= 2.0.12. See libguile/smob.c:clear_smobnum */ - swig_finalized_tag = swig_collectable_tag & ~0xff00; - } - if (ensure_smob_tag(swig_module, &swig_destroyed_tag, - "destroyed-swig-pointer", "destroyed-swig-pointer-tag")) { - scm_set_smob_print(swig_destroyed_tag, print_destroyed_swig); - scm_set_smob_equalp(swig_destroyed_tag, equalp_swig); - } - if (ensure_smob_tag(swig_module, &swig_member_function_tag, - "swig-member-function-pointer", "swig-member-function-pointer-tag")) { - scm_set_smob_print(swig_member_function_tag, print_member_function_swig); - scm_set_smob_free(swig_member_function_tag, free_swig_member_function); - } - swig_make_func = scm_permanent_object( - scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make"))); - swig_keyword = scm_permanent_object(scm_from_locale_keyword((char*) "init-smob")); - swig_symbol = scm_permanent_object(scm_from_locale_symbol("swig-smob")); -#ifdef SWIG_INIT_RUNTIME_MODULE - SWIG_INIT_RUNTIME_MODULE -#endif - - return swig_module; -} - -SWIGINTERN swig_module_info * -SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata)) -{ - SCM module = SWIG_Guile_Init(); - SCM variable = scm_module_variable(module, scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME)); - if (scm_is_false(variable)) { - return NULL; - } else { - return (swig_module_info *) scm_to_ulong(SCM_VARIABLE_REF(variable)); - } -} - -SWIGINTERN void -SWIG_Guile_SetModule(swig_module_info *swig_module) -{ - SCM module = SWIG_Guile_Init(); - scm_module_define(module, - scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME), - scm_from_ulong((unsigned long) swig_module)); -} - -SWIGINTERN int -SWIG_Guile_GetArgs (SCM *dest, SCM rest, - int reqargs, int optargs, - const char *procname) -{ - int i; - int num_args_passed = 0; - for (i = 0; i - -#ifdef __cplusplus -extern "C" { -#endif - -static void -inner_main(void *closure, int argc, char **argv) -{ -#ifdef SWIGINIT - SWIGINIT -#else - SWIG_init(); /* SWIG init function */ -#endif - scm_shell(argc, argv); /* scheme interpreter */ - /* never reached: scm_shell will perform an exit */ -} - -#ifdef __cplusplus -} -#endif - -int -main(int argc, char **argv) -{ - /* put any default initialisation code here: e.g. exit handlers */ - scm_boot_guile(argc, argv, inner_main, 0); /* make a stack entry for the - garbage collector */ - return 0; /* never reached, but avoids a warning */ -} -%} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/interpreter.i b/win64/bin/swig/share/swig/4.1.0/guile/interpreter.i deleted file mode 100755 index d43871db..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/interpreter.i +++ /dev/null @@ -1,59 +0,0 @@ -/* ----------------------------------------------------------------------------- - * interpreter.i - * - * SWIG file for a simple Guile interpreter - * ----------------------------------------------------------------------------- */ - -%{ - -#include -GSCM_status guile_init(); - -int main(int argc, char **argv) { - GSCM_status status; - GSCM_top_level toplev; - char *eval_answer; - char input_str[16384]; - int done; - - /* start a scheme interpreter */ - status = gscm_run_scm(argc, argv, 0, stdout, stderr, guile_init, 0, "#t"); - if (status != GSCM_OK) { - fputs(gscm_error_msg(status), stderr); - fputc('\n', stderr); - printf("Error in startup.\n"); - exit(1); - } - - /* create the top level environment */ - status = gscm_create_top_level(&toplev); - if (status != GSCM_OK) { - fputs(gscm_error_msg(status), stderr); - fputc('\n', stderr); - exit(1); - } - - /* now sit in a scheme eval loop: I input the expressions, have guile - * evaluate them, and then get another expression. - */ - done = 0; - fprintf(stdout,"Guile > "); - while (!done) { - if (fgets(input_str,16384,stdin) == NULL) { - exit(1); - } else { - if (strncmp(input_str,"quit",4) == 0) exit(1); - status = gscm_eval_str(&eval_answer, toplev, input_str); - fprintf(stdout,"%s\n", eval_answer); - fprintf(stdout,"Guile > "); - } - } - - /* now clean up and quit */ - gscm_destroy_top_level(toplev); -} - -%} - - - diff --git a/win64/bin/swig/share/swig/4.1.0/guile/list-vector.i b/win64/bin/swig/share/swig/4.1.0/guile/list-vector.i deleted file mode 100755 index 963bacf5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/list-vector.i +++ /dev/null @@ -1,488 +0,0 @@ -/* ----------------------------------------------------------------------------- - * list_vector.i - * - * Guile typemaps for converting between arrays and Scheme lists or vectors - * ----------------------------------------------------------------------------- */ - -/* Here is a macro that will define typemaps for converting between C - arrays and Scheme lists or vectors when passing arguments to the C - function. - - TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - - Supported calling conventions: - - func(int VECTORLENINPUT, [const] C_TYPE *VECTORINPUT) - - Scheme wrapper will take one argument, a vector. A temporary C - array of elements of type C_TYPE will be allocated and filled - with the elements of the vectors, converted to C with the - SCM_TO_C function. Length and address of the array are passed - to the C function. - - SCM_TYPE is used to describe the Scheme type of the elements in - the Guile procedure documentation. - - func(int LISTLENINPUT, [const] C_TYPE *LISTINPUT) - - Likewise, but the Scheme wrapper will take one argument, a list. - - func(int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - - Scheme wrapper will take no arguments. Addresses of an integer - and a C_TYPE * variable will be passed to the C function. The - C function is expected to return address and length of a - freshly allocated array of elements of type C_TYPE through - these pointers. The elements of this array are converted to - Scheme with the C_TO_SCM function and returned as a Scheme - vector. - - If the function has a void return value, the vector constructed - by this typemap becomes the return value of the Scheme wrapper. - Otherwise, the function returns multiple values. (See - the documentation on how to deal with multiple values.) - - func(int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - - Likewise, but the Scheme wrapper will return a list instead of - a vector. - - It is also allowed to use "size_t LISTLENINPUT" rather than "int - LISTLENINPUT". */ - -%define TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - - /* input */ - - /* We make use of the new multi-dispatch typemaps here. */ - - %typemap(in, doc="$NAME is a vector of " #SCM_TYPE " values") - (int VECTORLENINPUT, C_TYPE *VECTORINPUT), - (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT) - { - SCM_VALIDATE_VECTOR($argnum, $input); - $1 = scm_c_vector_length($input); - if ($1 > 0) { - $1_ltype i; - $2 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * $1); - for (i = 0; i<$1; i++) { - SCM swig_scm_value = scm_vector_ref($input, scm_from_long(i)); - $2[i] = SCM_TO_C_EXPR; - } - } - else $2 = NULL; - } - - %typemap(in, doc="$NAME is a list of " #SCM_TYPE " values") - (int LISTLENINPUT, C_TYPE *LISTINPUT), - (size_t LISTLENINPUT, C_TYPE *LISTINPUT) - { - SCM_VALIDATE_LIST($argnum, $input); - $1 = scm_to_ulong(scm_length($input)); - if ($1 > 0) { - $1_ltype i; - SCM rest; - $2 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * $1); - for (i = 0, rest = $input; - i<$1; - i++, rest = SCM_CDR(rest)) { - SCM swig_scm_value = SCM_CAR(rest); - $2[i] = SCM_TO_C_EXPR; - } - } - else $2 = NULL; - } - - /* Do not check for NULL pointers (override checks). */ - - %typemap(check) (int VECTORLENINPUT, C_TYPE *VECTORINPUT), - (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT), - (int LISTLENINPUT, C_TYPE *LISTINPUT), - (size_t LISTLENINPUT, C_TYPE *LISTINPUT) - "/* no check for NULL pointer */"; - - /* Discard the temporary array after the call. */ - - %typemap(freearg) (int VECTORLENINPUT, C_TYPE *VECTORINPUT), - (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT), - (int LISTLENINPUT, C_TYPE *LISTINPUT), - (size_t LISTLENINPUT, C_TYPE *LISTINPUT) - {SWIG_free($2);} - -%enddef - - /* output */ - -%define TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) - - /* First we make temporary variables ARRAYLENTEMP and ARRAYTEMP, - whose addresses we pass to the C function. We ignore both - arguments for Scheme. */ - - %typemap(in,numinputs=0) (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - (int arraylentemp, C_TYPE *arraytemp), - (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - (int arraylentemp, C_TYPE *arraytemp), - (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - (size_t arraylentemp, C_TYPE *arraytemp), - (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - (size_t arraylentemp, C_TYPE *arraytemp) - %{ - $1 = &arraylentemp; - $2 = &arraytemp; - %} - - /* In the ARGOUT typemaps, we convert the array into a vector or - a list and append it to the results. */ - - %typemap(argout, doc="$NAME (a vector of " #SCM_TYPE " values)") - (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) - { - $*1_ltype i; - SCM res = scm_make_vector(scm_from_long(*$1), - SCM_BOOL_F); - for (i = 0; i<*$1; i++) { - C_TYPE swig_c_value = (*$2)[i]; - SCM elt = C_TO_SCM_EXPR; - scm_vector_set_x(res, scm_from_long(i), elt); - } - SWIG_APPEND_VALUE(res); - } - - %typemap(argout, doc="$NAME (a list of " #SCM_TYPE " values)") - (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT), - (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - { - int i; - SCM res = SCM_EOL; - for (i = ((int)(*$1)) - 1; i>=0; i--) { - C_TYPE swig_c_value = (*$2)[i]; - SCM elt = C_TO_SCM_EXPR; - res = scm_cons(elt, res); - } - SWIG_APPEND_VALUE(res); - } - - /* In the FREEARG typemaps, get rid of the C vector. - (This can be overridden if you want to keep the C vector.) */ - - %typemap(freearg) - (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), - (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT), - (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) - { - free(*$2); - } - -%enddef - -%define TYPEMAP_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_TYPE) - TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) -%enddef - -%define TYPEMAP_LIST_VECTOR_INPUT(C_TYPE, SCM_TO_C, SCM_TYPE) - TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), SCM_TYPE) -%enddef - -%define TYPEMAP_LIST_VECTOR_OUTPUT(C_TYPE, C_TO_SCM, SCM_TYPE) - TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR - (C_TYPE, C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -%define TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - TYPEMAP_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -/* We use the macro to define typemaps for some standard types. */ - -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(bool, scm_is_true, scm_from_bool, boolean); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(int, scm_to_int, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(short, scm_to_int, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(long, scm_to_long, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(ptrdiff_t, scm_to_long, scm_from_long, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned int, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned short, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned long, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(size_t, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(float, scm_to_double, scm_from_double, real); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(double, scm_to_double, scm_from_double, real); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(char *, SWIG_scm2str, SWIG_str02scm, string); -TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(const char *, SWIG_scm2str, SWIG_str02scm, string); - -/* For the char *, free all strings after converting */ - - %typemap(freearg) - (int *VECTORLENOUTPUT, char ***VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, char ***VECTOROUTPUT), - (int *LISTLENOUTPUT, char ***LISTOUTPUT), - (size_t *LISTLENOUTPUT, char ***LISTOUTPUT), - (int *VECTORLENOUTPUT, const char ***VECTOROUTPUT), - (size_t *VECTORLENOUTPUT, const char ***VECTOROUTPUT), - (int *LISTLENOUTPUT, const char ***LISTOUTPUT), - (size_t *LISTLENOUTPUT, const char ***LISTOUTPUT) - { - if ((*$2)!=NULL) { - int i; - for (i = 0; i < *$1; i++) { - free((*$2)[i]); - } - free(*$2); - } - } - -%typemap(freearg) (int VECTORLENINPUT, char **VECTORINPUT), - (size_t VECTORLENINPUT, char **VECTORINPUT), - (int LISTLENINPUT, char **LISTINPUT), - (size_t LISTLENINPUT, char **LISTINPUT), - (int VECTORLENINPUT, const char **VECTORINPUT), - (size_t VECTORLENINPUT, const char **VECTORINPUT), - (int LISTLENINPUT, const char **LISTINPUT), - (size_t LISTLENINPUT, const char **LISTINPUT) -{ - if (($2)!=NULL) { - int i; - for (i = 0; i< $1; i++) - free(($2)[i]); - free($2); - } -} - - -/* Following is a macro that emits typemaps that are much more - flexible. (They are also messier.) It supports multiple parallel - lists and vectors (sharing one length argument each). - - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - - Supported calling conventions: - - func(int PARALLEL_VECTORLENINPUT, [const] C_TYPE *PARALLEL_VECTORINPUT, ...) or - func([const] C_TYPE *PARALLEL_VECTORINPUT, ..., int PARALLEL_VECTORLENINPUT) - - func(int PARALLEL_LISTLENINPUT, [const] C_TYPE *PARALLEL_LISTINPUT, ...) or - func([const] C_TYPE *PARALLEL_LISTINPUT, ..., int PARALLEL_LISTLENINPUT) - - func(int *PARALLEL_VECTORLENOUTPUT, C_TYPE **PARALLEL_VECTOROUTPUT, ...) or - func(C_TYPE **PARALLEL_VECTOROUTPUT, int *PARALLEL_VECTORLENOUTPUT, ...) - - func(int *PARALLEL_LISTLENOUTPUT, C_TYPE **PARALLEL_LISTOUTPUT) or - func(C_TYPE **PARALLEL_LISTOUTPUT, int *PARALLEL_LISTLENOUTPUT) - - It is also allowed to use "size_t PARALLEL_LISTLENINPUT" rather than "int - PARALLEL_LISTLENINPUT". */ - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - - /* input */ - - /* Passing data is a little complicated here; just remember: - IGNORE typemaps come first, then IN, then CHECK. But if - IGNORE is given, IN won't be used for this type. - - We need to "ignore" one of the parameters because there shall - be only one argument on the Scheme side. Here we only - initialize the array length to 0 but save its address for a - later change. */ - - %typemap(in,numinputs=0) int PARALLEL_VECTORLENINPUT (int *_global_vector_length), - size_t PARALLEL_VECTORLENINPUT (size_t *_global_vector_length) - { - $1 = 0; - _global_vector_length = &$1; - } - - %typemap(in,numinputs=0) int PARALLEL_LISTLENINPUT (int *_global_list_length), - size_t PARALLEL_LISTLENINPUT (size_t *_global_list_length) - { - $1 = 0; - _global_list_length = &$1; - } - - /* All the work is done in IN. */ - - %typemap(in, doc="$NAME is a vector of " #SCM_TYPE " values") - C_TYPE *PARALLEL_VECTORINPUT, - const C_TYPE *PARALLEL_VECTORINPUT - { - SCM_VALIDATE_VECTOR($argnum, $input); - *_global_vector_length = scm_c_vector_length($input); - if (*_global_vector_length > 0) { - int i; - $1 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) - * (*_global_vector_length)); - for (i = 0; i<*_global_vector_length; i++) { - SCM swig_scm_value = scm_vector_ref($input, scm_from_long(i)); - $1[i] = SCM_TO_C_EXPR; - } - } - else $1 = NULL; - } - - %typemap(in, doc="$NAME is a list of " #SCM_TYPE " values") - C_TYPE *PARALLEL_LISTINPUT, - const C_TYPE *PARALLEL_LISTINPUT - { - SCM_VALIDATE_LIST($argnum, $input); - *_global_list_length = scm_to_ulong(scm_length($input)); - if (*_global_list_length > 0) { - int i; - SCM rest; - $1 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) - * (*_global_list_length)); - for (i = 0, rest = $input; - i<*_global_list_length; - i++, rest = SCM_CDR(rest)) { - SCM swig_scm_value = SCM_CAR(rest); - $1[i] = SCM_TO_C_EXPR; - } - } - else $1 = NULL; - } - - /* Don't check for NULL pointers (override checks). */ - - %typemap(check) C_TYPE *PARALLEL_VECTORINPUT, - const C_TYPE *PARALLEL_VECTORINPUT, - C_TYPE *PARALLEL_LISTINPUT, - const C_TYPE *PARALLEL_LISTINPUT - "/* no check for NULL pointer */"; - - /* Discard the temporary array after the call. */ - - %typemap(freearg) C_TYPE *PARALLEL_VECTORINPUT, - const C_TYPE *PARALLEL_VECTORINPUT, - C_TYPE *PARALLEL_LISTINPUT, - const C_TYPE *PARALLEL_LISTINPUT - {SWIG_free($1);} - -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) - - /* output */ - - /* First we make a temporary variable ARRAYLENTEMP, use its - address as the ...LENOUTPUT argument for the C function and - "ignore" the ...LENOUTPUT argument for Scheme. */ - - %typemap(in,numinputs=0) int *PARALLEL_VECTORLENOUTPUT (int _global_arraylentemp), - size_t *PARALLEL_VECTORLENOUTPUT (size_t _global_arraylentemp), - int *PARALLEL_LISTLENOUTPUT (int _global_arraylentemp), - size_t *PARALLEL_LISTLENOUTPUT (size_t _global_arraylentemp) - "$1 = &_global_arraylentemp;"; - - /* We also need to ignore the ...OUTPUT argument. */ - - %typemap(in,numinputs=0) C_TYPE **PARALLEL_VECTOROUTPUT (C_TYPE *arraytemp), - C_TYPE **PARALLEL_LISTOUTPUT (C_TYPE *arraytemp) - "$1 = &arraytemp;"; - - /* In the ARGOUT typemaps, we convert the array into a vector or - a list and append it to the results. */ - - %typemap(argout, doc="$NAME (a vector of " #SCM_TYPE " values)") - C_TYPE **PARALLEL_VECTOROUTPUT - { - int i; - SCM res = scm_make_vector(scm_from_long(_global_arraylentemp), - SCM_BOOL_F); - for (i = 0; i<_global_arraylentemp; i++) { - C_TYPE swig_c_value = (*$1)[i]; - SCM elt = C_TO_SCM_EXPR; - scm_vector_set_x(res, scm_from_long(i), elt); - } - SWIG_APPEND_VALUE(res); - } - - %typemap(argout, doc="$NAME (a list of " #SCM_TYPE " values)") - C_TYPE **PARALLEL_LISTOUTPUT - { - int i; - SCM res = SCM_EOL; - if (_global_arraylentemp > 0) { - for (i = _global_arraylentemp - 1; i>=0; i--) { - C_TYPE swig_c_value = (*$1)[i]; - SCM elt = C_TO_SCM_EXPR; - res = scm_cons(elt, res); - } - } - SWIG_APPEND_VALUE(res); - } - - /* In the FREEARG typemaps, get rid of the C vector. - (This can be overridden if you want to keep the C vector.) */ - - %typemap(freearg) C_TYPE **PARALLEL_VECTOROUTPUT, - C_TYPE **PARALLEL_LISTOUTPUT - { - free(*$1); - } - -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT(C_TYPE, SCM_TO_C, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), SCM_TYPE) -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT(C_TYPE, C_TO_SCM, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR - (C_TYPE, C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -%define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) - TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR - (C_TYPE, SCM_TO_C(swig_scm_value), C_TO_SCM(swig_c_value), SCM_TYPE) -%enddef - -/* We use the macro to define typemaps for some standard types. */ - -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(bool, scm_is_true, scm_from_bool, boolean); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned char, SCM_CHAR, SCM_MAKE_CHAR, char); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(int, scm_to_int, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(short, scm_to_int, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(long, scm_to_long, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(ptrdiff_t, scm_to_long, scm_from_long, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned int, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned short, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned long, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(size_t, scm_to_ulong, scm_from_ulong, integer); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(float, scm_to_double, scm_from_double, real); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(double, scm_to_double, scm_from_double, real); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(char *, SWIG_scm2str, SWIG_str02scm, string); -TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(const char *, SWIG_scm2str, SWIG_str02scm, string); - -%typemap(freearg) char **PARALLEL_LISTINPUT, char **PARALLEL_VECTORINPUT, - const char **PARALLEL_LISTINPUT, const char **PARALLEL_VECTORINPUT -{ - if (($1)!=NULL) { - int i; - for (i = 0; i<*_global_list_length; i++) - SWIG_free(($1)[i]); - SWIG_free($1); - } -} - -%typemap(freearg) char ***PARALLEL_LISTOUTPUT, char ***PARALLEL_VECTOROUTPUT, - const char ***PARALLEL_LISTOUTPUT, const char ***PARALLEL_VECTOROUTPUT -{ - if ((*$1)!=NULL) { - int i; - for (i = 0; i<_global_arraylentemp; i++) - free((*$1)[i]); - free(*$1); - } -} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/pointer-in-out.i b/win64/bin/swig/share/swig/4.1.0/guile/pointer-in-out.i deleted file mode 100755 index 3a70d5ce..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/pointer-in-out.i +++ /dev/null @@ -1,102 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pointer-in-out.i - * - * Guile typemaps for passing pointers indirectly - * ----------------------------------------------------------------------------- */ - -/* Here is a macro that will define typemaps for passing C pointers indirectly. - - TYPEMAP_POINTER_INPUT_OUTPUT(PTRTYPE, SCM_TYPE) - - Supported calling conventions (in this example, PTRTYPE is int *): - - func(int **INPUT) - - Scheme wrapper will take one argument, a wrapped C pointer. - The address of a variable containing this pointer will be - passed to the function. - - func(int **INPUT_CONSUMED) - - Likewise, but mark the pointer object as not garbage - collectable. - - func(int **INPUT_DESTROYED) - - Likewise, but mark the pointer object as destroyed. - - func(int **OUTPUT) - - Scheme wrapper will take no arguments. The address of an int * - variable will be passed to the function. The function is - expected to modify the variable; its value is wrapped and - becomes an extra return value. (See the documentation on how - to deal with multiple values.) - - func(int **OUTPUT_NONCOLLECTABLE) - - Likewise, but make the pointer object not garbage collectable. - - func(int **BOTH) - func(int **INOUT) - - This annotation combines INPUT and OUTPUT. - -*/ - -%define TYPEMAP_POINTER_INPUT_OUTPUT(PTRTYPE, SCM_TYPE) - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE ">") PTRTYPE *INPUT(PTRTYPE temp) -{ - if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); - } - $1 = &temp; -} - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE "> and is consumed by the function") PTRTYPE *INPUT_CONSUMED(PTRTYPE temp) -{ - if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); - } - SWIG_Guile_MarkPointerNoncollectable($input); - $1 = &temp; -} - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE "> and is consumed by the function") PTRTYPE *INPUT_DESTROYED(PTRTYPE temp) -{ - if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); - } - SWIG_Guile_MarkPointerDestroyed($input); - $1 = &temp; -} - -%typemap(in, numinputs=0) PTRTYPE *OUTPUT(PTRTYPE temp), - PTRTYPE *OUTPUT_NONCOLLECTABLE(PTRTYPE temp) - "$1 = &temp;"; - -%typemap(argout, doc="<" #SCM_TYPE ">") PTRTYPE *OUTPUT - "SWIG_APPEND_VALUE(SWIG_NewPointerObj(*$1, $*descriptor, 1));"; - -%typemap(argout, doc="<" #SCM_TYPE ">") PTRTYPE *OUTPUT_NONCOLLECTABLE - "SWIG_APPEND_VALUE(SWIG_NewPointerObj(*$1, $*descriptor, 0));"; - -%typemap(in) PTRTYPE *BOTH = PTRTYPE *INPUT; -%typemap(argout) PTRTYPE *BOTH = PTRTYPE *OUTPUT; -%typemap(in) PTRTYPE *INOUT = PTRTYPE *INPUT; -%typemap(argout) PTRTYPE *INOUT = PTRTYPE *OUTPUT; - -/* As a special convenience measure, also attach docs involving - SCM_TYPE to the standard pointer typemaps */ - -%typemap(in, doc="$NAME is of type <" #SCM_TYPE ">") PTRTYPE { - if (SWIG_ConvertPtr($input, (void **) &$1, $descriptor, 0)) - scm_wrong_type_arg(FUNC_NAME, $argnum, $input); -} - -%typemap(out, doc="<" #SCM_TYPE ">") PTRTYPE { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/guile/ports.i b/win64/bin/swig/share/swig/4.1.0/guile/ports.i deleted file mode 100755 index e5c813db..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/ports.i +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ports.i - * - * Guile typemaps for handling ports - * ----------------------------------------------------------------------------- */ - -%{ - #ifndef _POSIX_SOURCE - /* This is needed on Solaris for fdopen(). */ - # define _POSIX_SOURCE 199506L - #endif - #include - #include - #include -%} - -/* This typemap for FILE * accepts - (1) FILE * pointer objects, - (2) Scheme file ports. In this case, it creates a temporary C stream - which reads or writes from a dup'ed file descriptor. - */ - -%typemap(in, doc="$NAME is a file port or a FILE * pointer") FILE * -{ - if (SWIG_ConvertPtr($input, (void**) &($1), $1_descriptor, 0) != 0) { - if (!(SCM_FPORTP($input))) { - scm_wrong_type_arg("$symname", $argnum, $input); - } else { - int fd; - if (SCM_OUTPUT_PORT_P($input)) { - scm_force_output($input); - } - fd=dup(SCM_FPORT_FDES($input)); - if (fd==-1) { - scm_misc_error("$symname", strerror(errno), SCM_EOL); - } - $1=fdopen(fd, SCM_OUTPUT_PORT_P($input) ? (SCM_INPUT_PORT_P($input) ? "r+" : "w") : "r"); - if ($1==NULL) { - scm_misc_error("$symname", strerror(errno), SCM_EOL); - } - } - } -} - -%typemap(freearg) FILE* { - if ($1) { - fclose($1); - } -} - diff --git a/win64/bin/swig/share/swig/4.1.0/guile/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/guile/std_auto_ptr.i deleted file mode 100755 index 7b2d5eef..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scm_misc_error(FUNC_NAME, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'", SCM_EOL); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/std_common.i b/win64/bin/swig/share/swig/4.1.0/guile/std_common.i deleted file mode 100755 index 8a94e574..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/std_common.i +++ /dev/null @@ -1,25 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; - -#define SWIG_bool2scm(b) scm_from_bool(b ? 1 : 0) -#define SWIG_string2scm(s) SWIG_str02scm(s.c_str()) - -%{ -#include - -SWIGINTERNINLINE -std::string SWIG_scm2string(SCM x) { - char* temp; - temp = SWIG_scm2str(x); - std::string s(temp); - SWIG_free(temp); - return s; -} -%} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/std_deque.i b/win64/bin/swig/share/swig/4.1.0/guile/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/guile/std_except.i b/win64/bin/swig/share/swig/4.1.0/guile/std_except.i deleted file mode 100755 index db55dcb9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/std_except.i +++ /dev/null @@ -1,13 +0,0 @@ -// TODO: STL exception handling -// Note that the generic std_except.i file did not work -%{ -#include -#include -%} - -namespace std { - %ignore exception; - struct exception { - }; -} - diff --git a/win64/bin/swig/share/swig/4.1.0/guile/std_map.i b/win64/bin/swig/share/swig/4.1.0/guile/std_map.i deleted file mode 100755 index bd48657c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/std_map.i +++ /dev/null @@ -1,1370 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// -// The aim of all that follows would be to integrate std::map with -// Guile as much as possible, namely, to allow the user to pass and -// be returned Scheme association lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::map), f(const std::map&), f(const std::map*): -// the parameter being read-only, either a Scheme alist or a -// previously wrapped std::map can be passed. -// -- f(std::map&), f(std::map*): -// the parameter must be modified; therefore, only a wrapped std::map -// can be passed. -// -- std::map f(): -// the map is returned by copy; therefore, a Scheme alist -// is returned which is most easily used in other Scheme functions -// -- std::map& f(), std::map* f(), const std::map& f(), -// const std::map* f(): -// the map is returned by reference; therefore, a wrapped std::map -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[*k] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[*k] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - K* key = new K(i->first); - T* val = new T(i->second); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - /* native sequence? */ - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - K* k; - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - /* native sequence? */ - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - K* k; - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, const T& x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scm_cons(k,result); - } - return result; - } - } - }; - - - // specializations for built-ins - - %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) - - template class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[CONVERT_FROM(key)] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[CONVERT_FROM(key)] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - T* val = new T(i->second); - SCM k = CONVERT_TO(i->first); - SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, const T& x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - SCM k = CONVERT_TO(i->first); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) - template class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[*k] = CONVERT_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[*k] = CONVERT_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - SCM x = CONVERT_TO(i->second); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - K* k; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - K* k; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, T x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, - T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) - template<> class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[CONVERT_K_FROM(key)] = - CONVERT_T_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - SCM k = CONVERT_K_TO(i->first); - SCM x = CONVERT_T_TO(i->second); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, T x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - SCM k = CONVERT_K_TO(i->first); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - - specialize_std_map_on_key(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_key(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_key(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_key(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_map_on_value(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_value(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_value(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_value(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); -} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/std_pair.i b/win64/bin/swig/share/swig/4.1.0/guile/std_pair.i deleted file mode 100755 index 53491552..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/std_pair.i +++ /dev/null @@ -1,867 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// -// See std_vector.i for the rationale of typemap application -// ------------------------------------------------------------------------ - -%{ -#include -%} - -// exported class - -namespace std { - - template struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(*x,*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = new std::pair< T, U >(*x,*y); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - T* x = new T($1.first); - U* y = new U($1.second); - SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scm_cons(first,second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - - // specializations for built-ins - - %define specialize_std_pair_on_first(T,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(CONVERT_FROM(first),*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - U* y; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = new std::pair< T, U >(CONVERT_FROM(first),*y); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - U* y = new U($1.second); - SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scm_cons(CONVERT_TO($1.first),second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - U* y; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) == 0) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_second(U,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - T* x; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = std::make_pair(*x,CONVERT_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - T* x; - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = new std::pair< T, U >(*x,CONVERT_FROM(second)); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - T* x = new T($1.first); - SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - $result = scm_cons(first,CONVERT_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - T* x; - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) == 0 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_both(T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO, - U,CHECK_U,CONVERT_U_FROM,CONVERT_U_TO) - template<> struct pair { - %typemap(in) pair %{ - if (scm_is_pair($input)) { - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = std::make_pair(CONVERT_T_FROM(first), - CONVERT_U_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - %} - %typemap(in) const pair& (std::pair *temp = 0), - const pair* (std::pair *temp = 0) %{ - if (scm_is_pair($input)) { - SCM first, second; - first = SCM_CAR($input); - second = SCM_CDR($input); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = new std::pair< T, U >(CONVERT_T_FROM(first), CONVERT_U_FROM(second)); - $1 = temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - %} - %typemap(freearg) const pair&, const pair* %{ delete temp$argnum; %} - %typemap(out) pair { - $result = scm_cons(CONVERT_T_TO($1.first), - CONVERT_U_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (scm_is_pair($input)) { - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (scm_is_pair($input)) { - SCM first = SCM_CAR($input); - SCM second = SCM_CDR($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair< T, U >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - - specialize_std_pair_on_first(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_first(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_first(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_first(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_first(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_first(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_first(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_first(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_first(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_first(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_pair_on_second(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_second(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_second(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_second(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_second(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_second(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_second(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_second(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_second(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_second(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_pair_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); -} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/std_string.i b/win64/bin/swig/share/swig/4.1.0/guile/std_string.i deleted file mode 100755 index 33f42822..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/std_string.i +++ /dev/null @@ -1,95 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - %typemap(typecheck) string = char *; - %typemap(typecheck) const string & = char *; - - %typemap(in) string (char * tempptr) { - if (scm_is_string($input)) { - tempptr = SWIG_scm2str($input); - $1.assign(tempptr); - SWIG_free(tempptr); - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(in) const string & ($*1_ltype temp, char *tempptr) { - if (scm_is_string($input)) { - tempptr = SWIG_scm2str($input); - temp.assign(tempptr); - SWIG_free(tempptr); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(in) string * (char *tempptr) { - if (scm_is_string($input)) { - tempptr = SWIG_scm2str($input); - $1 = new $*1_ltype(tempptr); - SWIG_free(tempptr); - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(out) string { - $result = SWIG_str02scm($1.c_str()); - } - - %typemap(out) const string & { - $result = SWIG_str02scm($1->c_str()); - } - - %typemap(out) string * { - $result = SWIG_str02scm($1->c_str()); - } - - %typemap(varin) string { - if (scm_is_string($input)) { - char *tempptr = SWIG_scm2str($input); - $1.assign(tempptr); - SWIG_free(tempptr); - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(varout) string { - $result = SWIG_str02scm($1.c_str()); - } - - %typemap(throws) string { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); - } - - %typemap(throws) const string & { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); - } -} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/guile/std_unique_ptr.i deleted file mode 100755 index cc517682..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scm_misc_error(FUNC_NAME, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'", SCM_EOL); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/std_vector.i b/win64/bin/swig/share/swig/4.1.0/guile/std_vector.i deleted file mode 100755 index 180fc66d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/std_vector.i +++ /dev/null @@ -1,424 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Guile as much as possible, namely, to allow the user to pass and -// be returned Guile vectors or lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a Guile sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a Guile vector of T:s -// is returned which is most easily used in other Guile functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - $1 = std::vector< T >(size); - for (unsigned long i=0; i(); - } else if (scm_is_pair($input)) { - SCM head, tail; - $1 = std::vector< T >(); - tail = $input; - while (!scm_is_null(tail)) { - head = SCM_CAR(tail); - tail = SCM_CDR(tail); - $1.push_back(*((T*)SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const vector& (std::vector temp), - const vector* (std::vector temp) { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - temp = std::vector< T >(size); - $1 = &temp; - for (unsigned long i=0; i(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::vector< T >(); - $1 = &temp; - SCM head, tail; - tail = $input; - while (!scm_is_null(tail)) { - head = SCM_CAR(tail); - tail = SCM_CDR(tail); - temp.push_back(*((T*) SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) vector { - $result = scm_make_vector(scm_from_long($1.size()),SCM_UNSPECIFIED); - for (unsigned int i=0; i<$1.size(); i++) { - T* x = new T((($1_type &)$1)[i]); - scm_vector_set_x($result,scm_from_long(i), - SWIG_NewPointerObj(x, $descriptor(T *), 1)); - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - T* x; - if (SWIG_ConvertPtr(o,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - T* x; - SCM head = SCM_CAR($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - if (SWIG_ConvertPtr(o,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - T* x; - SCM head = SCM_CAR($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - const T& ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - $1 = std::vector< T >(size); - for (unsigned long i=0; i(); - } else if (scm_is_pair($input)) { - SCM v = scm_vector($input); - unsigned long size = scm_c_vector_length(v); - $1 = std::vector< T >(size); - for (unsigned long i=0; i& (std::vector temp), - const vector* (std::vector temp) { - if (scm_is_vector($input)) { - unsigned long size = scm_c_vector_length($input); - temp = std::vector< T >(size); - $1 = &temp; - for (unsigned long i=0; i(); - $1 = &temp; - } else if (scm_is_pair($input)) { - SCM v = scm_vector($input); - unsigned long size = scm_c_vector_length(v); - temp = std::vector< T >(size); - $1 = &temp; - for (unsigned long i=0; i { - $result = scm_make_vector(scm_from_long($1.size()),SCM_UNSPECIFIED); - for (unsigned int i=0; i<$1.size(); i++) { - SCM x = CONVERT_TO((($1_type &)$1)[i]); - scm_vector_set_x($result,scm_from_long(i),x); - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - $1 = CHECK(o) ? 1 : 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - SCM head = SCM_CAR($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) ? 1 : 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (scm_is_vector($input)) { - unsigned int size = scm_c_vector_length($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SCM o = scm_vector_ref($input,scm_from_ulong(0)); - $1 = CHECK(o) ? 1 : 0; - } - } else if (scm_is_null($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - SCM head = SCM_CAR($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector< T >* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) ? 1 : 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/guile/swigmove.i b/win64/bin/swig/share/swig/4.1.0/guile/swigmove.i deleted file mode 100755 index 72848b60..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/swigmove.i +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "$1_type", $symname, $argnum); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/win64/bin/swig/share/swig/4.1.0/guile/swigrun.i b/win64/bin/swig/share/swig/4.1.0/guile/swigrun.i deleted file mode 100755 index 309dc408..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/swigrun.i +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- mode: c -*- */ - -%module swigrun - -#ifdef SWIGGUILE_SCM - -%runtime %{ -/* Hook the runtime module initialization - into the shared initialization function SWIG_Guile_Init. */ -#include -#ifdef __cplusplus -extern "C" -#endif -SCM scm_init_Swig_swigrun_module (void); -#define SWIG_INIT_RUNTIME_MODULE scm_init_Swig_swigrun_module(); -%} - -/* The runtime type system from common.swg */ - -typedef struct swig_type_info swig_type_info; - -const char * -SWIG_TypeName(const swig_type_info *type); - -const char * -SWIG_TypePrettyName(const swig_type_info *type); - -swig_type_info * -SWIG_TypeQuery(const char *); - -/* Language-specific stuff */ - -%apply bool { int }; - -int -SWIG_IsPointer(SCM object); - -int -SWIG_IsPointerOfType(SCM object, swig_type_info *type); - -unsigned long -SWIG_PointerAddress(SCM object); - -swig_type_info * -SWIG_PointerType(SCM object); - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/guile/typemaps.i b/win64/bin/swig/share/swig/4.1.0/guile/typemaps.i deleted file mode 100755 index 5ef1081d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/guile/typemaps.i +++ /dev/null @@ -1,501 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Guile-specific typemaps - * ----------------------------------------------------------------------------- */ - -/* These are defined with a view to eventually merging with those defined for other target languages in swigtypemaps.swg and exception.swg */ -#define %set_output(obj) $result = obj -#define %set_varoutput(obj) $result = obj -#define %argument_fail(_code, _type, _name, _argn) scm_wrong_type_arg((char *) FUNC_NAME, _argn, $input) -#define %as_voidptr(ptr) (void*)(ptr) -#define %argument_nullref(_type, _name, _argn) scm_misc_error(FUNC_NAME, "invalid null reference for argument " #_argn " of type '" _type "'", SCM_EOL) -#define %releasenotowned_fail(_code, _type, _name, _argn) scm_misc_error(FUNC_NAME, "cannot release ownership as memory is not owned for argument " #_argn " of type '" _type "'", SCM_EOL) - -/* Pointers */ - -%typemap(in) SWIGTYPE *, SWIGTYPE [] { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} -%typemap(in) SWIGTYPE & ($1_ltype argp) { - argp = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - $1 = argp; -} -%typemap(in, noblock=1, fragment="") SWIGTYPE && (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) { - res = SWIG_ConvertPtr($input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "$1_type", $symname, $argnum); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -} -%typemap(freearg) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] "" - -%typemap(in) void * { - $1 = ($1_ltype)SWIG_MustGetPtr($input, NULL, $argnum, 0); -} -%typemap(freearg) void * "" - -%typemap(varin) SWIGTYPE * { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0); -} - -%typemap(varin) SWIGTYPE & { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE && { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE [] { - scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); -} - -%typemap(varin) SWIGTYPE [ANY] { - void *temp; - int ii; - $1_basetype *b = 0; - temp = SWIG_MustGetPtr($input, $1_descriptor, 1, 0); - b = ($1_basetype *) $1; - for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii); -} - -%typemap(varin) void * { - $1 = SWIG_MustGetPtr($input, NULL, 1, 0); -} - -%typemap(out) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj ($1, ty, $owner); -} - -%typemap(varout) SWIGTYPE *, SWIGTYPE [] { - $result = SWIG_NewPointerObj ($1, $descriptor, 0); -} - -%typemap(varout) SWIGTYPE & { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -%typemap(varout) SWIGTYPE && { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -%typemap(throws) SWIGTYPE { - $<ype temp = new $ltype($1); - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj(temp, $&descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE & { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj(&$1, $descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE && { - scm_throw(gh_symbol2scm((char *) "swig-exception"), - gh_list(SWIG_NewPointerObj(&$1, $descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE * { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj($1, $descriptor, 1), - SCM_UNDEFINED)); -} - -%typemap(throws) SWIGTYPE [] { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_NewPointerObj($1, $descriptor, 1), - SCM_UNDEFINED)); -} - -/* Change of object ownership, and interaction of destructor-like functions and the - garbage-collector */ - -%typemap(in, doc="$NAME is of type <$type> and gets destroyed by the function") SWIGTYPE *DESTROYED { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} - -%typemap(freearg) SWIGTYPE *DESTROYED { - SWIG_Guile_MarkPointerDestroyed($input); -} - -%typemap(in, doc="$NAME is of type <$type> and is consumed by the function") SWIGTYPE *CONSUMED { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); - SWIG_Guile_MarkPointerNoncollectable($input); -} - -/* Pass-by-value */ - -%typemap(in) SWIGTYPE ($&1_ltype argp) { - argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0); - if (!argp) { %argument_nullref("$1_type", $symname, $argnum); } - $1 = *argp; -} - -%typemap(varin) SWIGTYPE { - $&1_ltype argp; - argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, 1, 0); - $1 = *argp; -} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype($1); - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 1); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1); -} -#endif - -%typemap(varout) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr = ($&1_ltype)&$1; - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 0); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0); -} -#endif - -/* Enums */ - -%typemap(in) enum SWIGTYPE { $1 = ($1_type) scm_to_int($input); } -/* The complicated construction below needed to deal with anonymous - enums, which cannot be cast to. */ -%typemap(varin) enum SWIGTYPE { - if (sizeof(int) != sizeof($1)) { - scm_error(scm_from_locale_symbol("swig-error"), - (char *) FUNC_NAME, - (char *) "enum variable '$name' cannot be set", - SCM_EOL, SCM_BOOL_F); - } - * (int *) &($1) = scm_to_int($input); -} -%typemap(out) enum SWIGTYPE { $result = scm_from_long((int)$1); } -%typemap(varout) enum SWIGTYPE { $result = scm_from_long((int)$1); } -%typemap(throws) enum SWIGTYPE { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(scm_from_long((int)$1), SCM_UNDEFINED)); -} - -/* The SIMPLE_MAP_WITH_EXPR macro below defines the whole set of - typemaps needed for simple types. - -- SCM_TO_C_EXPR is a C expression that translates the Scheme value - "swig_scm_value" to a C value. - -- C_TO_SCM_EXPR is a C expression that translates the C value - "swig_c_value" to a Scheme value. */ - -%define SIMPLE_MAP_WITH_EXPR(C_NAME, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_NAME) - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">") C_NAME - { SCM swig_scm_value = $input; - $1 = SCM_TO_C_EXPR; } - %typemap (varin, doc="NEW-VALUE is of type <" #SCM_NAME ">") C_NAME - { SCM swig_scm_value = $input; - $1 = SCM_TO_C_EXPR; } - %typemap (out, doc="<" #SCM_NAME ">") C_NAME - { C_NAME swig_c_value = $1; - $result = C_TO_SCM_EXPR; } - %typemap (varout, doc="<" #SCM_NAME ">") C_NAME - { C_NAME swig_c_value = $1; - $result = C_TO_SCM_EXPR; } - /* INPUT and OUTPUT */ - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">)") - C_NAME *INPUT(C_NAME temp) { - SCM swig_scm_value = $input; - temp = (C_NAME) SCM_TO_C_EXPR; $1 = &temp; } - %typemap (in,numinputs=0) C_NAME *OUTPUT (C_NAME temp) - {$1 = &temp;} - %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT - { C_NAME swig_c_value = *$1; - SWIG_APPEND_VALUE(C_TO_SCM_EXPR); } - %typemap (in) C_NAME *BOTH = C_NAME *INPUT; - %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; - %typemap (in) C_NAME *INOUT = C_NAME *INPUT; - %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; - /* Const primitive references. Passed by value */ - %typemap(in, doc="$NAME is of type <" #SCM_NAME ">") const C_NAME & (C_NAME temp) - { SCM swig_scm_value = $input; - temp = SCM_TO_C_EXPR; - $1 = &temp; } - %typemap(out, doc="<" #SCM_NAME ">") const C_NAME & - { C_NAME swig_c_value = *$1; - $result = C_TO_SCM_EXPR; } - /* Throw typemap */ - %typemap(throws) C_NAME { - C_NAME swig_c_value = $1; - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(C_TO_SCM_EXPR, SCM_UNDEFINED)); - } -%enddef - -/* The SIMPLE_MAP macro below defines the whole set of typemaps needed - for simple types. It generates slightly simpler code than the - macro above, but it is only suitable for very simple conversion - expressions. */ - -%define SIMPLE_MAP(C_NAME, SCM_TO_C, C_TO_SCM, SCM_NAME) - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">") - C_NAME {$1 = ($1_ltype) SCM_TO_C($input);} - %typemap (varin, doc="NEW-VALUE is of type <" #SCM_NAME ">") - C_NAME {$1 = ($1_ltype) SCM_TO_C($input);} - %typemap (out, doc="<" #SCM_NAME ">") - C_NAME {$result = C_TO_SCM($1);} - %typemap (varout, doc="<" #SCM_NAME ">") - C_NAME {$result = C_TO_SCM($1);} - /* INPUT and OUTPUT */ - %typemap (in, doc="$NAME is of type <" #SCM_NAME ">)") - C_NAME *INPUT(C_NAME temp), C_NAME &INPUT(C_NAME temp) { - temp = (C_NAME) SCM_TO_C($input); $1 = &temp; - } - %typemap (in,numinputs=0) C_NAME *OUTPUT (C_NAME temp), C_NAME &OUTPUT(C_NAME temp) - {$1 = &temp;} - %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT, C_NAME &OUTPUT - {SWIG_APPEND_VALUE(C_TO_SCM(*$1));} - %typemap (in) C_NAME *BOTH = C_NAME *INPUT; - %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; - %typemap (in) C_NAME *INOUT = C_NAME *INPUT; - %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; - %typemap (in) C_NAME &INOUT = C_NAME &INPUT; - %typemap (argout) C_NAME &INOUT = C_NAME &OUTPUT; - /* Const primitive references. Passed by value */ - %typemap(in, doc="$NAME is of type <" #SCM_NAME ">") const C_NAME & (C_NAME temp) { - temp = SCM_TO_C($input); - $1 = ($1_ltype) &temp; - } - %typemap(out, doc="<" #SCM_NAME ">") const C_NAME & { - $result = C_TO_SCM(*$1); - } - /* Throw typemap */ - %typemap(throws) C_NAME { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(C_TO_SCM($1), SCM_UNDEFINED)); - } -%enddef - - SIMPLE_MAP(bool, scm_is_true, scm_from_bool, boolean); - SIMPLE_MAP(char, SCM_CHAR, SCM_MAKE_CHAR, char); - SIMPLE_MAP(unsigned char, SCM_CHAR, SCM_MAKE_CHAR, char); - SIMPLE_MAP(signed char, SCM_CHAR, SCM_MAKE_CHAR, char); - SIMPLE_MAP(int, scm_to_int, scm_from_long, integer); - SIMPLE_MAP(short, scm_to_short, scm_from_long, integer); - SIMPLE_MAP(long, scm_to_long, scm_from_long, integer); - SIMPLE_MAP(ptrdiff_t, scm_to_long, scm_from_long, integer); - SIMPLE_MAP(unsigned int, scm_to_uint, scm_from_ulong, integer); - SIMPLE_MAP(unsigned short, scm_to_ushort, scm_from_ulong, integer); - SIMPLE_MAP(unsigned long, scm_to_ulong, scm_from_ulong, integer); - SIMPLE_MAP(size_t, scm_to_ulong, scm_from_ulong, integer); - SIMPLE_MAP(float, scm_to_double, scm_from_double, real); - SIMPLE_MAP(double, scm_to_double, scm_from_double, real); -// SIMPLE_MAP(char *, SWIG_scm2str, SWIG_str02scm, string); -// SIMPLE_MAP(const char *, SWIG_scm2str, SWIG_str02scm, string); - -/* Define long long typemaps -- uses functions that are only defined - in recent versions of Guile, availability also depends on Guile's - configuration. */ - -SIMPLE_MAP(long long, scm_to_long_long, scm_from_long_long, integer); -SIMPLE_MAP(unsigned long long, scm_to_ulong_long, scm_from_ulong_long, integer); - -/* Strings */ - - %typemap (in, doc="$NAME is a string") char *(int must_free = 0) { - $1 = ($1_ltype)SWIG_scm2str($input); - must_free = 1; - } - %typemap (varin, doc="NEW-VALUE is a string") char * {$1 = ($1_ltype)SWIG_scm2str($input);} - %typemap (out, doc="") char * {$result = SWIG_str02scm((const char *)$1);} - %typemap (varout, doc="") char * {$result = SWIG_str02scm($1);} - %typemap (in, doc="$NAME is a string") char **INPUT(char * temp, int must_free = 0) { - temp = (char *) SWIG_scm2str($input); $1 = &temp; - must_free = 1; - } - %typemap (in,numinputs=0) char **OUTPUT (char * temp) - {$1 = &temp;} - %typemap (argout,doc="$NAME (a string)") char **OUTPUT - {SWIG_APPEND_VALUE(SWIG_str02scm(*$1));} - %typemap (in) char **BOTH = char **INPUT; - %typemap (argout) char **BOTH = char **OUTPUT; - %typemap (in) char **INOUT = char **INPUT; - %typemap (argout) char **INOUT = char **OUTPUT; - -/* SWIG_scm2str makes a malloc'ed copy of the string, so get rid of it after - the function call. */ - -%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 **OUTPUT "SWIG_free(*$1);" - -/* But this shall not apply if we try to pass a single char by - reference. */ - -%typemap (freearg) char *OUTPUT, char *BOTH "" - -/* If we set a string variable, delete the old result first, unless const. */ - -%typemap (varin) char * { - free($1); - $1 = ($1_ltype) SWIG_scm2str($input); -} - -%typemap (varin) const char * { - $1 = ($1_ltype) SWIG_scm2str($input); -} - -%typemap(throws) char * { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), - scm_list_n(SWIG_str02scm($1), SCM_UNDEFINED)); -} - -/* Void */ - -%typemap (out,doc="") void "gswig_result = SCM_UNSPECIFIED;" - -/* SCM is passed through */ - -typedef unsigned long SCM; -%typemap (in) SCM "$1=$input;" -%typemap (out) SCM "$result=$1;" -%typecheck(SWIG_TYPECHECK_POINTER) SCM "$1=1;"; - -/* ------------------------------------------------------------ - * String & length - * ------------------------------------------------------------ */ - -%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) { - size_t temp; - $1 = ($1_ltype) SWIG_Guile_scm2newstr($input, &temp); - $2 = ($2_ltype) temp; -} - -/* ------------------------------------------------------------ - * CLASS::* (member function pointer) typemaps - * taken from typemaps/swigtype.swg - * ------------------------------------------------------------ */ - -%typemap(in) SWIGTYPE (CLASS::*) { - int res = SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($1), $descriptor); - if (!SWIG_IsOK(res)) { - %argument_fail(res,"$type",$symname, $argnum); - } -} - -%typemap(out,noblock=1) SWIGTYPE (CLASS::*) { - %set_output(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($1), $descriptor)); -} - -%typemap(varin) SWIGTYPE (CLASS::*) { - int res = SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($1), $descriptor); - if (!SWIG_IsOK(res)) { - scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); - } -} - -%typemap(varout,noblock=1) SWIGTYPE (CLASS::*) { - %set_varoutput(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($1), $descriptor)); -} - -/* ------------------------------------------------------------ - * Typechecking rules - * ------------------------------------------------------------ */ - -/* adapted from python.swg */ - -%typecheck(SWIG_TYPECHECK_INTEGER) - int, short, long, - unsigned int, unsigned short, unsigned long, - signed char, unsigned char, - long long, unsigned long long, - size_t, ptrdiff_t, - std::size_t, std::ptrdiff_t, - const int &, const short &, const long &, - const unsigned int &, const unsigned short &, const unsigned long &, - const long long &, const unsigned long long &, - const size_t &, const ptrdiff_t &, - const std::size_t &, const std::ptrdiff_t &, - enum SWIGTYPE -{ - $1 = scm_is_true(scm_integer_p($input)) && scm_is_true(scm_exact_p($input))? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, bool&, const bool& -{ - $1 = scm_is_bool($input) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) - float, double, - const float &, const double & -{ - $1 = scm_is_true(scm_real_p($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_CHAR) char { - $1 = SCM_CHARP($input) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - $1 = scm_is_string($input) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $1_descriptor, 0); - $1 = SWIG_CheckState(res); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE &, SWIGTYPE && { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $1_descriptor, SWIG_POINTER_NO_NULL); - $1 = SWIG_CheckState(res); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $&descriptor, SWIG_POINTER_NO_NULL); - $1 = SWIG_CheckState(res); -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, 0, 0); - $1 = SWIG_CheckState(res); -} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* typemaps.i ends here */ diff --git a/win64/bin/swig/share/swig/4.1.0/intrusive_ptr.i b/win64/bin/swig/share/swig/4.1.0/intrusive_ptr.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/inttypes.i b/win64/bin/swig/share/swig/4.1.0/inttypes.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/java/arrays_java.i b/win64/bin/swig/share/swig/4.1.0/java/arrays_java.i deleted file mode 100755 index 7a417b07..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/arrays_java.i +++ /dev/null @@ -1,392 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_java.i - * - * These typemaps give more natural support for arrays. The typemaps are not efficient - * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from Java and vice versa. The Java array is expected to be the same size as the C array. - * An exception is thrown if they are not. - * - * Example usage: - * Wrapping: - * - * %include - * %inline %{ - * short FiddleSticks[3]; - * %} - * - * Use from Java like this: - * - * short[] fs = new short[] {10, 11, 12}; - * example.setFiddleSticks(fs); - * fs = example.getFiddleSticks(); - * ----------------------------------------------------------------------------- */ - -/* Primitive array support is a combination of SWIG macros and functions in order to reduce - * code bloat and aid maintainability. The SWIG preprocessor expands the macros into functions - * for inclusion in the generated code. */ - -/* Array support functions declarations macro */ -%define JAVA_ARRAYS_DECL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) -%{ -static int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input); -static void SWIG_JavaArrayArgout##JFUNCNAME (JNIEnv *jenv, JNITYPE *jarr, CTYPE *carr, JNITYPE##Array input); -static JNITYPE##Array SWIG_JavaArrayOut##JFUNCNAME (JNIEnv *jenv, CTYPE *result, jsize sz); -%} -%enddef - -/* Array support functions macro */ -%define JAVA_ARRAYS_IMPL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) -%{ -/* CTYPE[] support */ -static int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input) { - int i; - jsize sz; - if (!input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); - return 0; - } - sz = JCALL1(GetArrayLength, jenv, input); - *jarr = JCALL2(Get##JAVATYPE##ArrayElements, jenv, input, 0); - if (!*jarr) - return 0; %} -#ifdef __cplusplus -%{ *carr = new CTYPE[sz]; %} -#else -%{ *carr = (CTYPE*) malloc(sz * sizeof(CTYPE)); %} -#endif -%{ if (!*carr) { - SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); - return 0; - } - for (i=0; i - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -%typemap(in) CONST TYPE ($&1_type argp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain value - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") CONST TYPE %{ - //plain value(out) - $1_ltype* resultp = new $1_ltype($1); - intrusive_ptr_add_ref(resultp); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(resultp, SWIG_intrusive_deleter< CONST TYPE >()); -%} - -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain pointer - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE * %{ - //plain pointer(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in) CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain reference - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if(!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - return $null; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE & %{ - //plain reference(out) - #if ($owner) - if ($1) { - intrusive_ptr_add_ref($1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - #endif -%} - -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - // plain pointer by reference - temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; -%} -%typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") TYPE *CONST& %{ - // plain pointer by reference(out) - #if ($owner) - if (*$1) { - intrusive_ptr_add_ref(*$1); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1, SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - #else - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_0); - #endif -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > ($&1_type argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by value - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if (smartarg) { - $1 = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ - if ($1) { - intrusive_ptr_add_ref(result.get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(result.get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by reference - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - delete &($1); - if ($self) { - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * temp = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); - $1 = *temp; - } -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ - if (*$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer - if ( $input ) { - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - $1 = &temp; - } else { - $1 = &tempnull; - } -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - delete $1; - if ($self) $1 = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ - if ($1 && *$1) { - intrusive_ptr_add_ref($1->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } - if ($owner) delete $1; -%} - -%typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& (SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > temp, $*1_ltype tempp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ - // intrusive_ptr by pointer reference - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; - if ($input) { - temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); - } - tempp = &temp; - $1 = &tempp; -%} -%typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if ($self) $1 = *$input; -%} -%typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ - if (*$1 && **$1) { - intrusive_ptr_add_ref((*$1)->get()); - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >((*$1)->get(), SWIG_intrusive_deleter< CONST TYPE >()); - } else { - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; - } -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (jni) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "jlong" -%typemap (jtype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "long" -%typemap (jstype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(jstype, TYPE)" -%typemap(javain) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, - SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(jstype, TYPE).getCPtr($javainput)" - -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - - -%typemap(javaout) CONST TYPE { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE & { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) TYPE *CONST& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnBase; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { - if(swigCPtr != 0 && swigCMemOwnBase) { - swigCMemOwnBase = false; - $jnicall; - } - swigCPtr = 0; - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { - if(swigCPtr != 0 && swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $jnicall; - } - swigCPtr = 0; - super.delete(); - } - -// CONST version needed ???? also for C# -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "long" -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "long" - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%template() SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; -%enddef - - -///////////////////////////////////////////////////////////////////// - - -%include - -%define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor mods -%feature("unref") TYPE "(void)arg1; delete smartarg1;" - - -// plain value -%typemap(in) CONST TYPE ($&1_type argp = 0) %{ - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -// plain pointer -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -// plain reference -%typemap(in) CONST TYPE & %{ - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ - // shared_ptr by value - smartarg = *($&1_ltype*)&$input; - if (smartarg) $1 = *smartarg; -%} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ - *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (jni) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "jlong" -%typemap (jtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "long" -%typemap (jstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE)" -%typemap (javain) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE).getCPtr($javainput)" -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(javaout) CONST TYPE { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE & { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) TYPE *CONST& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnBase; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwnBase = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwnBase) { - swigCMemOwnBase = false; - $jnicall; - } - swigCPtr = 0; - } - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $jnicall; - } - swigCPtr = 0; - } - super.delete(); - } - -// CONST version needed ???? also for C# -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "long" -%typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "long" - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef - diff --git a/win64/bin/swig/share/swig/4.1.0/java/boost_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/java/boost_shared_ptr.i deleted file mode 100755 index 70dcfc2a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/boost_shared_ptr.i +++ /dev/null @@ -1,337 +0,0 @@ -// Users can provide their own SWIG_SHARED_PTR_TYPEMAPS macro before including this file to change the -// visibility of the constructor and getCPtr method if desired to public if using multiple modules. -#ifndef SWIG_SHARED_PTR_TYPEMAPS -#define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(protected, protected, CONST, TYPE) -#endif - -%include - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS_IMPLEMENTATION(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE ($&1_type argp = 0) %{ - argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} -%typemap(out) CONST TYPE -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); %} - -%typemap(directorin,descriptor="L$packagepath/$&javaclassname;") CONST TYPE -%{ $input = 0; - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (new $1_ltype(SWIG_STD_MOVE($1))); %} - -%typemap(directorout) CONST TYPE -%{ if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $result = *smartarg->get(); - %} - -// plain pointer -%typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ - *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; -%} - -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") CONST TYPE * -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($1 SWIG_NO_NULL_DELETER_0); - } %} - -%typemap(directorout) CONST TYPE * %{ -#error "typemaps for $1_type not available" -%} - -// plain reference -%typemap(in) CONST TYPE & %{ - $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - return $null; - } %} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") CONST TYPE & -%{ $input = 0; - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (&$1 SWIG_NO_NULL_DELETER_0); %} - -%typemap(directorout) CONST TYPE & %{ -#error "typemaps for $1_type not available" -%} - -// plain pointer by reference -%typemap(in) TYPE *CONST& ($*1_ltype temp = 0) -%{ temp = (TYPE *)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); - $1 = &temp; %} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& -%{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} - -%typemap(directorin,descriptor="L$packagepath/$*javaclassname;") TYPE *CONST& -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($1 SWIG_NO_NULL_DELETER_0); - } %} - -%typemap(directorout) TYPE *CONST& %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (argp) $1 = *argp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > -%{ if ($input) { - $&1_type smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; - $result = *smartarg; - } %} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) -%{ $1 = $input ? *($&1_ltype)&$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ *($&1_ltype)&$result = *$1 ? new $*1_ltype(*$1) : 0; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & -%{ $input = 0; - if ($1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) -%{ $1 = $input ? *($&1_ltype)&$input : &tempnull; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ *($&1_ltype)&$result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; - if ($owner) delete $1; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * -%{ $input = 0; - if ($1 && *$1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "typemaps for $1_type not available" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) -%{ temp = $input ? *($1_ltype)&$input : &tempnull; - $1 = &temp; %} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} - -%typemap(directorin,descriptor="L$packagepath/$typemap(jstype, TYPE);") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& -%{ $input = 0; - if ($1 && *$1) { - *((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1); - } %} - -%typemap(directorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "typemaps for $1_type not available" -%} - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%typemap (jni) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "jlong" -%typemap (jtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "long" -%typemap (jstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(jstype, TYPE)" - -%typemap(javain) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(jstype, TYPE).getCPtr($javainput)" - -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - - -%typemap(javaout) CONST TYPE { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE & { - return new $typemap(jstype, TYPE)($jnicall, true); - } -%typemap(javaout) CONST TYPE * { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } -%typemap(javaout) TYPE *CONST& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(javadirectorout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE).getCPtr($javacall)" - -%typemap(javadirectorin) CONST TYPE, - CONST TYPE *, - CONST TYPE &, - TYPE *CONST& "($jniinput == 0) ? null : new $typemap(jstype, TYPE)($jniinput, true)" - -%typemap(javadirectorin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "($jniinput == 0) ? null : new $typemap(jstype, TYPE)($jniinput, true)" - -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwn; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY void swigSetCMemOwn(boolean own) { - swigCMemOwn = own; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - private transient boolean swigCMemOwnDerived; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); - swigCMemOwnDerived = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY void swigSetCMemOwn(boolean own) { - swigCMemOwnDerived = own; - super.swigSetCMemOwn(own); - } -%} - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - $jnicall; - } - swigCPtr = 0; - } - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { - if (swigCPtr != 0) { - if (swigCMemOwnDerived) { - swigCMemOwnDerived = false; - $jnicall; - } - swigCPtr = 0; - } - super.delete(); - } - -%typemap(directordisconnect, methodname="swigDirectorDisconnect") TYPE %{ - protected void $methodname() { - swigSetCMemOwn(false); - $jnicall; - } -%} - -%typemap(directorowner_release, methodname="swigReleaseOwnership") TYPE %{ - public void $methodname() { - swigSetCMemOwn(false); - $jnicall; - } -%} - -%typemap(directorowner_take, methodname="swigTakeOwnership") TYPE %{ - public void $methodname() { - swigSetCMemOwn(true); - $jnicall; - } -%} - -// Typecheck typemaps -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "" - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; -%enddef - diff --git a/win64/bin/swig/share/swig/4.1.0/java/director.swg b/win64/bin/swig/share/swig/4.1.0/java/director.swg deleted file mode 100755 index f87c6f7c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/director.swg +++ /dev/null @@ -1,541 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Java proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#if defined(DEBUG_DIRECTOR_OWNED) || defined(DEBUG_DIRECTOR_EXCEPTION) || defined(DEBUG_DIRECTOR_THREAD_NAME) -#include -#endif - -#include - -#if defined(SWIG_JAVA_USE_THREAD_NAME) - -#if !defined(SWIG_JAVA_GET_THREAD_NAME) -namespace Swig { - SWIGINTERN int GetThreadName(char *name, size_t len); -} - -#if defined(__linux__) - -#include -SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { - (void)len; -#if defined(PR_GET_NAME) - return prctl(PR_GET_NAME, (unsigned long)name, 0, 0, 0); -#else - (void)name; - return 1; -#endif -} - -#elif defined(__unix__) || defined(__APPLE__) - -#include -SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { - return pthread_getname_np(pthread_self(), name, len); -} - -#else - -SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { - (void)len; - (void)name; - return 1; -} -#endif - -#endif - -#endif - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) -#include -#endif - -namespace Swig { - - /* Java object wrapper */ - class JObjectWrapper { - public: - JObjectWrapper() : jthis_(NULL), weak_global_(true) { - } - - ~JObjectWrapper() { - jthis_ = NULL; - weak_global_ = true; - } - - bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) { - if (!jthis_) { - weak_global_ = weak_global || !mem_own; // hold as weak global if explicitly requested or not owned - if (jobj) - jthis_ = weak_global_ ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj); -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl; -#endif - return true; - } else { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl; -#endif - return false; - } - } - - jobject get(JNIEnv *jenv) const { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::get("; - if (jthis_) - std::cout << jthis_; - else - std::cout << "null"; - std::cout << ") -> return new local ref" << std::endl; -#endif - return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_); - } - - void release(JNIEnv *jenv) { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl; -#endif - if (jthis_) { - if (weak_global_) { - if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE) - jenv->DeleteWeakGlobalRef((jweak)jthis_); - } else - jenv->DeleteGlobalRef(jthis_); - } - - jthis_ = NULL; - weak_global_ = true; - } - - /* Only call peek if you know what you are doing wrt to weak/global references */ - jobject peek() { - return jthis_; - } - - /* Java proxy releases ownership of C++ object, C++ object is now - responsible for destruction (creates NewGlobalRef to pin Java proxy) */ - void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { - if (take_or_release) { /* Java takes ownership of C++ object's lifetime. */ - if (!weak_global_) { - jenv->DeleteGlobalRef(jthis_); - jthis_ = jenv->NewWeakGlobalRef(jself); - weak_global_ = true; - } - } else { - /* Java releases ownership of C++ object's lifetime */ - if (weak_global_) { - jenv->DeleteWeakGlobalRef((jweak)jthis_); - jthis_ = jenv->NewGlobalRef(jself); - weak_global_ = false; - } - } - } - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) - static void detach(void *jvm) { - static_cast(jvm)->DetachCurrentThread(); - } - - static void make_detach_key() { - pthread_key_create(&detach_key_, detach); - } - - /* thread-local key to register a destructor */ - static pthread_key_t detach_key_; -#endif - - private: - /* pointer to Java object */ - jobject jthis_; - /* Local or global reference flag */ - bool weak_global_; - }; - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) - pthread_key_t JObjectWrapper::detach_key_; -#endif - - /* Local JNI reference deleter */ - class LocalRefGuard { - JNIEnv *jenv_; - jobject jobj_; - - // non-copyable - LocalRefGuard(const LocalRefGuard &); - LocalRefGuard &operator=(const LocalRefGuard &); - public: - LocalRefGuard(JNIEnv *jenv, jobject jobj): jenv_(jenv), jobj_(jobj) {} - ~LocalRefGuard() { - if (jobj_) - jenv_->DeleteLocalRef(jobj_); - } - }; - - /* director base class */ - class Director { - /* pointer to Java virtual machine */ - JavaVM *swig_jvm_; - - protected: -#if defined (_MSC_VER) && (_MSC_VER<1300) - class JNIEnvWrapper; - friend class JNIEnvWrapper; -#endif - /* Utility class for managing the JNI environment */ - class JNIEnvWrapper { - const Director *director_; - JNIEnv *jenv_; - int env_status; - public: - JNIEnvWrapper(const Director *director) : director_(director), jenv_(0), env_status(0) { -#if defined(__ANDROID__) - JNIEnv **jenv = &jenv_; -#else - void **jenv = (void **)&jenv_; -#endif - env_status = director_->swig_jvm_->GetEnv((void **)&jenv_, JNI_VERSION_1_2); - JavaVMAttachArgs args; - args.version = JNI_VERSION_1_2; - args.group = NULL; - args.name = NULL; -#if defined(SWIG_JAVA_USE_THREAD_NAME) - char thread_name[64]; // MAX_TASK_COMM_LEN=16 is hard-coded in the Linux kernel and MacOS has MAXTHREADNAMESIZE=64. - if (Swig::GetThreadName(thread_name, sizeof(thread_name)) == 0) { - args.name = thread_name; -#if defined(DEBUG_DIRECTOR_THREAD_NAME) - std::cout << "JNIEnvWrapper: thread name: " << thread_name << std::endl; - } else { - std::cout << "JNIEnvWrapper: Couldn't set Java thread name" << std::endl; -#endif - } -#endif -#if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON) - // Attach a daemon thread to the JVM. Useful when the JVM should not wait for - // the thread to exit upon shutdown. Only for jdk-1.4 and later. - director_->swig_jvm_->AttachCurrentThreadAsDaemon(jenv, &args); -#else - director_->swig_jvm_->AttachCurrentThread(jenv, &args); -#endif - -#if defined(SWIG_JAVA_DETACH_ON_THREAD_END) - // At least on Android 6, detaching after every call causes a memory leak. - // Instead, register a thread desructor and detach only when the thread ends. - // See https://developer.android.com/training/articles/perf-jni#threads - static pthread_once_t once = PTHREAD_ONCE_INIT; - - pthread_once(&once, JObjectWrapper::make_detach_key); - pthread_setspecific(JObjectWrapper::detach_key_, director->swig_jvm_); -#endif - } - ~JNIEnvWrapper() { -#if !defined(SWIG_JAVA_DETACH_ON_THREAD_END) && !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD) - // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call. - // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak. - if (env_status == JNI_EDETACHED) - director_->swig_jvm_->DetachCurrentThread(); -#endif - } - JNIEnv *getJNIEnv() const { - return jenv_; - } - }; - - struct SwigDirectorMethod { - const char *name; - const char *desc; - jmethodID methid; - SwigDirectorMethod(JNIEnv *jenv, jclass baseclass, const char *name, const char *desc) : name(name), desc(desc) { - methid = jenv->GetMethodID(baseclass, name, desc); - } - }; - - /* Java object wrapper */ - JObjectWrapper swig_self_; - - /* Disconnect director from Java object */ - void swig_disconnect_director_self(const char *disconn_method) { - JNIEnvWrapper jnienv(this) ; - JNIEnv *jenv = jnienv.getJNIEnv() ; - jobject jobj = swig_self_.get(jenv); - LocalRefGuard ref_deleter(jenv, jobj); -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl; -#endif - if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) { - jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V"); - if (disconn_meth) { -#if defined(DEBUG_DIRECTOR_OWNED) - std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl; -#endif - jenv->CallVoidMethod(jobj, disconn_meth); - } - } - } - - jclass swig_new_global_ref(JNIEnv *jenv, const char *classname) { - jclass clz = jenv->FindClass(classname); - return clz ? (jclass)jenv->NewGlobalRef(clz) : 0; - } - - public: - Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() { - /* Acquire the Java VM pointer */ - jenv->GetJavaVM(&swig_jvm_); - } - - virtual ~Director() { - JNIEnvWrapper jnienv(this) ; - JNIEnv *jenv = jnienv.getJNIEnv() ; - swig_self_.release(jenv); - } - - bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global) { - return swig_self_.set(jenv, jself, mem_own, weak_global); - } - - jobject swig_get_self(JNIEnv *jenv) const { - return swig_self_.get(jenv); - } - - // Change C++ object's ownership, relative to Java - void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { - swig_self_.java_change_ownership(jenv, jself, take_or_release); - } - }; - - // Zero initialized bool array - template class BoolArray { - bool array_[N]; - public: - BoolArray() { - memset(array_, 0, sizeof(array_)); - } - bool& operator[](size_t n) { - return array_[n]; - } - bool operator[](size_t n) const { - return array_[n]; - } - }; - - // Utility classes and functions for exception handling. - - // Simple holder for a Java string during exception handling, providing access to a c-style string - class JavaString { - public: - JavaString(JNIEnv *jenv, jstring jstr) : jenv_(jenv), jstr_(jstr), cstr_(0) { - if (jenv_ && jstr_) - cstr_ = (const char *) jenv_->GetStringUTFChars(jstr_, NULL); - } - - ~JavaString() { - if (jenv_ && jstr_ && cstr_) - jenv_->ReleaseStringUTFChars(jstr_, cstr_); - } - - const char *c_str(const char *null_string = "null JavaString") const { - return cstr_ ? cstr_ : null_string; - } - - private: - // non-copyable - JavaString(const JavaString &); - JavaString &operator=(const JavaString &); - - JNIEnv *jenv_; - jstring jstr_; - const char *cstr_; - }; - - // Helper class to extract the exception message from a Java throwable - class JavaExceptionMessage { - public: - JavaExceptionMessage(JNIEnv *jenv, jthrowable throwable) : message_(jenv, exceptionMessageFromThrowable(jenv, throwable)) { - } - - // Return a C string of the exception message in the jthrowable passed in the constructor - // If no message is available, null_string is return instead - const char *message(const char *null_string = "Could not get exception message in JavaExceptionMessage") const { - return message_.c_str(null_string); - } - - private: - // non-copyable - JavaExceptionMessage(const JavaExceptionMessage &); - JavaExceptionMessage &operator=(const JavaExceptionMessage &); - - // Get exception message by calling Java method Throwable.getMessage() - static jstring exceptionMessageFromThrowable(JNIEnv *jenv, jthrowable throwable) { - jstring jmsg = NULL; - if (jenv && throwable) { - jenv->ExceptionClear(); // Cannot invoke methods with any pending exceptions - jclass throwclz = jenv->GetObjectClass(throwable); - if (throwclz) { - // All Throwable classes have a getMessage() method, so call it to extract the exception message - jmethodID getMessageMethodID = jenv->GetMethodID(throwclz, "getMessage", "()Ljava/lang/String;"); - if (getMessageMethodID) - jmsg = (jstring)jenv->CallObjectMethod(throwable, getMessageMethodID); - } - if (jmsg == NULL && jenv->ExceptionCheck()) - jenv->ExceptionClear(); - } - return jmsg; - } - - JavaString message_; - }; - - // C++ Exception class for handling Java exceptions thrown during a director method Java upcall - class DirectorException : public std::exception { - public: - - // Construct exception from a Java throwable - DirectorException(JNIEnv *jenv, jthrowable throwable) : jenv_(jenv), throwable_(throwable), classname_(0), msg_(0) { - - // Call Java method Object.getClass().getName() to obtain the throwable's class name (delimited by '/') - if (jenv && throwable) { - jenv->ExceptionClear(); // Cannot invoke methods with any pending exceptions - jclass throwclz = jenv->GetObjectClass(throwable); - if (throwclz) { - jclass clzclz = jenv->GetObjectClass(throwclz); - if (clzclz) { - jmethodID getNameMethodID = jenv->GetMethodID(clzclz, "getName", "()Ljava/lang/String;"); - if (getNameMethodID) { - jstring jstr_classname = (jstring)(jenv->CallObjectMethod(throwclz, getNameMethodID)); - // Copy strings, since there is no guarantee that jenv will be active when handled - if (jstr_classname) { - JavaString jsclassname(jenv, jstr_classname); - const char *classname = jsclassname.c_str(0); - if (classname) - classname_ = copypath(classname); - } - } - } - } - } - - JavaExceptionMessage exceptionmsg(jenv, throwable); - msg_ = copystr(exceptionmsg.message(0)); - } - - // More general constructor for handling as a java.lang.RuntimeException - DirectorException(const char *msg) : jenv_(0), throwable_(0), classname_(0), msg_(msg ? copystr(msg) : 0) { - } - - ~DirectorException() throw() { - delete[] classname_; - delete[] msg_; - } - - const char *what() const throw() { - return msg_ ? msg_ : "Unspecified DirectorException message"; - } - - // Reconstruct and raise/throw the Java Exception that caused the DirectorException - // Note that any error in the JNI exception handling results in a Java RuntimeException - void throwException(JNIEnv *jenv) const { - if (jenv) { - if (jenv == jenv_ && throwable_) { - // Throw original exception if not already pending - jthrowable throwable = jenv->ExceptionOccurred(); - if (throwable && jenv->IsSameObject(throwable, throwable_) == JNI_FALSE) { - jenv->ExceptionClear(); - throwable = 0; - } - if (!throwable) - jenv->Throw(throwable_); - } else { - // Try and reconstruct original exception, but original stacktrace is not reconstructed - jenv->ExceptionClear(); - - jmethodID ctorMethodID = 0; - jclass throwableclass = 0; - if (classname_) { - throwableclass = jenv->FindClass(classname_); - if (throwableclass) - ctorMethodID = jenv->GetMethodID(throwableclass, "", "(Ljava/lang/String;)V"); - } - - if (ctorMethodID) { - jenv->ThrowNew(throwableclass, what()); - } else { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, what()); - } - } - } - } - - // Deprecated - use throwException - void raiseJavaException(JNIEnv *jenv) const { - throwException(jenv); - } - - // Create and throw the DirectorException - static void raise(JNIEnv *jenv, jthrowable throwable) { - throw DirectorException(jenv, throwable); - } - - private: - static char *copypath(const char *srcmsg) { - char *target = copystr(srcmsg); - for (char *c=target; *c; ++c) { - if ('.' == *c) - *c = '/'; - } - return target; - } - - static char *copystr(const char *srcmsg) { - char *target = 0; - if (srcmsg) { - size_t msglen = strlen(srcmsg) + 1; - target = new char[msglen]; - strncpy(target, srcmsg, msglen); - } - return target; - } - - JNIEnv *jenv_; - jthrowable throwable_; - const char *classname_; - const char *msg_; - }; - - // Helper method to determine if a Java throwable matches a particular Java class type - // Note side effect of clearing any pending exceptions - SWIGINTERN bool ExceptionMatches(JNIEnv *jenv, jthrowable throwable, const char *classname) { - bool matches = false; - - if (throwable && jenv && classname) { - // Exceptions need to be cleared for correct behavior. - // The caller of ExceptionMatches should restore pending exceptions if desired - - // the caller already has the throwable. - jenv->ExceptionClear(); - - jclass clz = jenv->FindClass(classname); - if (clz) { - jclass classclz = jenv->GetObjectClass(clz); - jmethodID isInstanceMethodID = jenv->GetMethodID(classclz, "isInstance", "(Ljava/lang/Object;)Z"); - if (isInstanceMethodID) { - matches = jenv->CallBooleanMethod(clz, isInstanceMethodID, throwable) != 0; - } - } - -#if defined(DEBUG_DIRECTOR_EXCEPTION) - if (jenv->ExceptionCheck()) { - // Typically occurs when an invalid classname argument is passed resulting in a ClassNotFoundException - JavaExceptionMessage exc(jenv, jenv->ExceptionOccurred()); - std::cout << "Error: ExceptionMatches: class '" << classname << "' : " << exc.message() << std::endl; - } -#endif - } - return matches; - } -} - diff --git a/win64/bin/swig/share/swig/4.1.0/java/enums.swg b/win64/bin/swig/share/swig/4.1.0/java/enums.swg deleted file mode 100755 index b3d3df8e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/enums.swg +++ /dev/null @@ -1,116 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enums.swg - * - * Include this file in order for C/C++ enums to be wrapped by proper Java enums. - * Note that the JNI layer handles the enum as an int. The Java enum has extra - * code generated to store the C++ int value. This is required for C++ enums that - * specify a value for the enum item, as native Java enums do not support this. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "$*javaclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$*javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) const enum SWIGTYPE & "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput.swigValue()" -%typemap(javaout) const enum SWIGTYPE & { - return $*javaclassname.swigToEnum($jnicall); - } - - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "$javaclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="L$packagepath/$javaclassname;") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) enum SWIGTYPE "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -%typemap(javaclassmodifiers) enum SWIGTYPE "public enum" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" - -/* - * SwigNext static inner class used instead of a static int as static fields cannot be accessed from enum initialisers. - * The swigToEnum method is used to find the Java enum from a C++ enum integer value. The default one here takes - * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial - * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be - * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. - */ -%typemap(javabody) enum SWIGTYPE %{ - public final int swigValue() { - return swigValue; - } - - public static $javaclassname swigToEnum(int swigValue) { - $javaclassname[] swigValues = $javaclassname.class.getEnumConstants(); - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for ($javaclassname swigEnum : swigValues) - if (swigEnum.swigValue == swigValue) - return swigEnum; - throw new IllegalArgumentException("No enum " + $javaclassname.class + " with value " + swigValue); - } - - @SuppressWarnings("unused") - private $javaclassname() { - this.swigValue = SwigNext.next++; - } - - @SuppressWarnings("unused") - private $javaclassname(int swigValue) { - this.swigValue = swigValue; - SwigNext.next = swigValue+1; - } - - @SuppressWarnings("unused") - private $javaclassname($javaclassname swigEnum) { - this.swigValue = swigEnum.swigValue; - SwigNext.next = this.swigValue+1; - } - - private final int swigValue; - - private static class SwigNext { - private static int next = 0; - } -%} - -%javaenum(proper); - diff --git a/win64/bin/swig/share/swig/4.1.0/java/enumsimple.swg b/win64/bin/swig/share/swig/4.1.0/java/enumsimple.swg deleted file mode 100755 index 31505f75..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/enumsimple.swg +++ /dev/null @@ -1,71 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumsimple.swg - * - * This file provides backwards compatible enum wrapping. SWIG versions 1.3.21 - * and earlier wrapped global enums with constant integers in the module class - * or Constants interface. Enums declared within a C++ class were wrapped by - * constant integers in the Java proxy class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "int" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$jniinput" -%typemap(javadirectorout) const enum SWIGTYPE & "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput" -%typemap(javaout) const enum SWIGTYPE & { - return $jnicall; - } - - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "int" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$jniinput" -%typemap(javadirectorout) enum SWIGTYPE "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput" -%typemap(javaout) enum SWIGTYPE { - return $jnicall; - } - -%typemap(javaclassmodifiers) enum SWIGTYPE "" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" -%typemap(javabody) enum SWIGTYPE "" - -%javaenum(simple); - diff --git a/win64/bin/swig/share/swig/4.1.0/java/enumtypesafe.swg b/win64/bin/swig/share/swig/4.1.0/java/enumtypesafe.swg deleted file mode 100755 index 62af9502..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/enumtypesafe.swg +++ /dev/null @@ -1,117 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumtypesafe.swg - * - * Include this file in order for C/C++ enums to be wrapped by the so called - * typesafe enum pattern. Each enum has an equivalent Java class named after the - * enum and each enum item is a static instance of this class. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "$*javaclassname" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$*javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) const enum SWIGTYPE & "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput.swigValue()" -%typemap(javaout) const enum SWIGTYPE & { - return $*javaclassname.swigToEnum($jnicall); - } - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "$javaclassname" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="L$packagepath/$javaclassname;") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$javaclassname.swigToEnum($jniinput)" -%typemap(javadirectorout) enum SWIGTYPE "($javacall).swigValue()" - -%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -// '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not -%typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" - -/* - * The swigToEnum method is used to find the Java enum from a C++ enum integer value. The default one here takes - * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial - * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be - * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. - * The special variable, $enumvalues, is replaced with a comma separated list of all the enum values. - */ -%typemap(javabody) enum SWIGTYPE %{ - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static $javaclassname swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + $javaclassname.class + " with value " + swigValue); - } - - private $javaclassname(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private $javaclassname(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private $javaclassname(String swigName, $javaclassname swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static $javaclassname[] swigValues = { $enumvalues }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -%} - -%javaenum(typesafe); - diff --git a/win64/bin/swig/share/swig/4.1.0/java/enumtypeunsafe.swg b/win64/bin/swig/share/swig/4.1.0/java/enumtypeunsafe.swg deleted file mode 100755 index 4af5ed7e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/enumtypeunsafe.swg +++ /dev/null @@ -1,72 +0,0 @@ -/* ----------------------------------------------------------------------------- - * enumtypeunsafe.swg - * - * Include this file in order for C/C++ enums to be wrapped by integers values. - * Each enum has an equivalent class named after the enum and the enum items are - * wrapped by constant integers within this class. The enum items are not - * typesafe as they are all integers. - * ----------------------------------------------------------------------------- */ - -// const enum SWIGTYPE & typemaps -%typemap(jni) const enum SWIGTYPE & "jint" -%typemap(jtype) const enum SWIGTYPE & "int" -%typemap(jstype) const enum SWIGTYPE & "int" - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} -%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & -%{ static $*1_ltype temp = ($*1_ltype)$input; - $result = &temp; %} -%typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1;" -%typemap(javadirectorin) const enum SWIGTYPE & "$jniinput" -%typemap(javadirectorout) const enum SWIGTYPE & "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" - -%typemap(throws) const enum SWIGTYPE & -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) const enum SWIGTYPE & "$javainput" -%typemap(javaout) const enum SWIGTYPE & { - return $jnicall; - } - - -// enum SWIGTYPE typemaps -%typemap(jni) enum SWIGTYPE "jint" -%typemap(jtype) enum SWIGTYPE "int" -%typemap(jstype) enum SWIGTYPE "int" - -%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} -%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} - -%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} -%typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;" -%typemap(javadirectorin) enum SWIGTYPE "$jniinput" -%typemap(javadirectorout) enum SWIGTYPE "$javacall" - -%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" - -%typemap(throws) enum SWIGTYPE -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} - -%typemap(javain) enum SWIGTYPE "$javainput" -%typemap(javaout) enum SWIGTYPE { - return $jnicall; - } - -// '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not -%typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" -%typemap(javabase) enum SWIGTYPE "" -%typemap(javacode) enum SWIGTYPE "" -%typemap(javaimports) enum SWIGTYPE "" -%typemap(javainterfaces) enum SWIGTYPE "" -%typemap(javabody) enum SWIGTYPE "" - -%javaenum(typeunsafe); - diff --git a/win64/bin/swig/share/swig/4.1.0/java/java.swg b/win64/bin/swig/share/swig/4.1.0/java/java.swg deleted file mode 100755 index 08a1d032..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/java.swg +++ /dev/null @@ -1,1458 +0,0 @@ -/* ----------------------------------------------------------------------------- - * java.swg - * - * Java typemaps - * ----------------------------------------------------------------------------- */ - -%include - -/* The jni, jtype and jstype typemaps work together and so there should be one of each. - * The jni typemap contains the JNI type used in the JNI (C/C++) code. - * The jtype typemap contains the Java type used in the JNI intermediary class. - * The jstype typemap contains the Java type used in the Java proxy classes, type wrapper classes and module class. */ - -/* Fragments */ -%fragment("SWIG_PackData", "header") { -/* Pack binary data into a string */ -SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} -} - -%fragment("SWIG_UnPackData", "header") { -/* Unpack binary data from a string */ -SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} -} - -%fragment("SWIG_JavaIntFromSize_t", "header") { -/* Check for overflow converting to Java int (always signed 32-bit) from (unsigned variable-bit) size_t */ -SWIGINTERN jint SWIG_JavaIntFromSize_t(size_t size) { - static const jint JINT_MAX = 0x7FFFFFFF; - return (size > (size_t)JINT_MAX) ? -1 : (jint)size; -} -} - -/* Primitive types */ -%typemap(jni) bool, const bool & "jboolean" -%typemap(jni) char, const char & "jchar" -%typemap(jni) signed char, const signed char & "jbyte" -%typemap(jni) unsigned char, const unsigned char & "jshort" -%typemap(jni) short, const short & "jshort" -%typemap(jni) unsigned short, const unsigned short & "jint" -%typemap(jni) int, const int & "jint" -%typemap(jni) unsigned int, const unsigned int & "jlong" -%typemap(jni) long, const long & "jint" -%typemap(jni) unsigned long, const unsigned long & "jlong" -%typemap(jni) long long, const long long & "jlong" -%typemap(jni) unsigned long long, const unsigned long long & "jobject" -%typemap(jni) float, const float & "jfloat" -%typemap(jni) double, const double & "jdouble" -%typemap(jni) void "void" - -%typemap(jtype) bool, const bool & "boolean" -%typemap(jtype) char, const char & "char" -%typemap(jtype) signed char, const signed char & "byte" -%typemap(jtype) unsigned char, const unsigned char & "short" -%typemap(jtype) short, const short & "short" -%typemap(jtype) unsigned short, const unsigned short & "int" -%typemap(jtype) int, const int & "int" -%typemap(jtype) unsigned int, const unsigned int & "long" -%typemap(jtype) long, const long & "int" -%typemap(jtype) unsigned long, const unsigned long & "long" -%typemap(jtype) long long, const long long & "long" -%typemap(jtype) unsigned long long, const unsigned long long & "java.math.BigInteger" -%typemap(jtype) float, const float & "float" -%typemap(jtype) double, const double & "double" -%typemap(jtype) void "void" - -%typemap(jstype) bool, const bool & "boolean" -%typemap(jstype) char, const char & "char" -%typemap(jstype) signed char, const signed char & "byte" -%typemap(jstype) unsigned char, const unsigned char & "short" -%typemap(jstype) short, const short & "short" -%typemap(jstype) unsigned short, const unsigned short & "int" -%typemap(jstype) int, const int & "int" -%typemap(jstype) unsigned int, const unsigned int & "long" -%typemap(jstype) long, const long & "int" -%typemap(jstype) unsigned long, const unsigned long & "long" -%typemap(jstype) long long, const long long & "long" -%typemap(jstype) unsigned long long, const unsigned long long & "java.math.BigInteger" -%typemap(jstype) float, const float & "float" -%typemap(jstype) double, const double & "double" -%typemap(jstype) void "void" - -%typemap(jboxtype) bool, const bool & "Boolean" -%typemap(jboxtype) char, const char & "Character" -%typemap(jboxtype) signed char, const signed char & "Byte" -%typemap(jboxtype) unsigned char, const unsigned char & "Short" -%typemap(jboxtype) short, const short & "Short" -%typemap(jboxtype) unsigned short, const unsigned short & "Integer" -%typemap(jboxtype) int, const int & "Integer" -%typemap(jboxtype) unsigned int, const unsigned int & "Long" -%typemap(jboxtype) long, const long & "Integer" -%typemap(jboxtype) unsigned long, const unsigned long & "Long" -%typemap(jboxtype) long long, const long long & "Long" -%typemap(jboxtype) unsigned long long, const unsigned long long & "java.math.BigInteger" -%typemap(jboxtype) float, const float & "Float" -%typemap(jboxtype) double, const double & "Double" - -%typemap(jni) char *, char *&, char[ANY], char[] "jstring" -%typemap(jtype) char *, char *&, char[ANY], char[] "String" -%typemap(jstype) char *, char *&, char[ANY], char[] "String" - -/* JNI types */ -%typemap(jni) jboolean "jboolean" -%typemap(jni) jchar "jchar" -%typemap(jni) jbyte "jbyte" -%typemap(jni) jshort "jshort" -%typemap(jni) jint "jint" -%typemap(jni) jlong "jlong" -%typemap(jni) jfloat "jfloat" -%typemap(jni) jdouble "jdouble" -%typemap(jni) jstring "jstring" -%typemap(jni) jobject "jobject" -%typemap(jni) jbooleanArray "jbooleanArray" -%typemap(jni) jcharArray "jcharArray" -%typemap(jni) jbyteArray "jbyteArray" -%typemap(jni) jshortArray "jshortArray" -%typemap(jni) jintArray "jintArray" -%typemap(jni) jlongArray "jlongArray" -%typemap(jni) jfloatArray "jfloatArray" -%typemap(jni) jdoubleArray "jdoubleArray" -%typemap(jni) jobjectArray "jobjectArray" - -%typemap(jtype) jboolean "boolean" -%typemap(jtype) jchar "char" -%typemap(jtype) jbyte "byte" -%typemap(jtype) jshort "short" -%typemap(jtype) jint "int" -%typemap(jtype) jlong "long" -%typemap(jtype) jfloat "float" -%typemap(jtype) jdouble "double" -%typemap(jtype) jstring "String" -%typemap(jtype) jobject "java.lang.Object" -%typemap(jtype) jbooleanArray "boolean[]" -%typemap(jtype) jcharArray "char[]" -%typemap(jtype) jbyteArray "byte[]" -%typemap(jtype) jshortArray "short[]" -%typemap(jtype) jintArray "int[]" -%typemap(jtype) jlongArray "long[]" -%typemap(jtype) jfloatArray "float[]" -%typemap(jtype) jdoubleArray "double[]" -%typemap(jtype) jobjectArray "java.lang.Object[]" - -%typemap(jstype) jboolean "boolean" -%typemap(jstype) jchar "char" -%typemap(jstype) jbyte "byte" -%typemap(jstype) jshort "short" -%typemap(jstype) jint "int" -%typemap(jstype) jlong "long" -%typemap(jstype) jfloat "float" -%typemap(jstype) jdouble "double" -%typemap(jstype) jstring "String" -%typemap(jstype) jobject "java.lang.Object" -%typemap(jstype) jbooleanArray "boolean[]" -%typemap(jstype) jcharArray "char[]" -%typemap(jstype) jbyteArray "byte[]" -%typemap(jstype) jshortArray "short[]" -%typemap(jstype) jintArray "int[]" -%typemap(jstype) jlongArray "long[]" -%typemap(jstype) jfloatArray "float[]" -%typemap(jstype) jdoubleArray "double[]" -%typemap(jstype) jobjectArray "java.lang.Object[]" - -/* Non primitive types */ -%typemap(jni) SWIGTYPE "jlong" -%typemap(jtype) SWIGTYPE "long" -%typemap(jstype) SWIGTYPE "$&javaclassname" -%typemap(jboxtype) SWIGTYPE "$typemap(jstype, $1_type)" - -%typemap(jni) SWIGTYPE [] "jlong" -%typemap(jtype) SWIGTYPE [] "long" -%typemap(jstype) SWIGTYPE [] "$javaclassname" - -%typemap(jni) SWIGTYPE * "jlong" -%typemap(jtype) SWIGTYPE * "long" -%typemap(jstype) SWIGTYPE * "$javaclassname" - -%typemap(jni) SWIGTYPE & "jlong" -%typemap(jtype) SWIGTYPE & "long" -%typemap(jstype) SWIGTYPE & "$javaclassname" - -%typemap(jni) SWIGTYPE && "jlong" -%typemap(jtype) SWIGTYPE && "long" -%typemap(jstype) SWIGTYPE && "$javaclassname" - -/* pointer to a class member */ -%typemap(jni) SWIGTYPE (CLASS::*) "jstring" -%typemap(jtype) SWIGTYPE (CLASS::*) "String" -%typemap(jstype) SWIGTYPE (CLASS::*) "$javaclassname" - -/* The following are the in, out, freearg, argout typemaps. These are the JNI code generating typemaps for converting from Java to C and visa versa. */ - -/* primitive types */ -%typemap(in) bool -%{ $1 = $input ? true : false; %} - -%typemap(directorout) bool -%{ $result = $input ? true : false; %} - -%typemap(javadirectorin) bool "$jniinput" -%typemap(javadirectorout) bool "$javacall" - -%typemap(in) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double -%{ $1 = ($1_ltype)$input; %} - -%typemap(directorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double -%{ $result = ($1_ltype)$input; %} - -%typemap(directorin, descriptor="Z") bool "$input = (jboolean) $1;" -%typemap(directorin, descriptor="C") char "$input = (jint) $1;" -%typemap(directorin, descriptor="B") signed char "$input = (jbyte) $1;" -%typemap(directorin, descriptor="S") unsigned char "$input = (jshort) $1;" -%typemap(directorin, descriptor="S") short "$input = (jshort) $1;" -%typemap(directorin, descriptor="I") unsigned short "$input = (jint) $1;" -%typemap(directorin, descriptor="I") int "$input = (jint) $1;" -%typemap(directorin, descriptor="J") unsigned int "$input = (jlong) $1;" -%typemap(directorin, descriptor="I") long "$input = (jint) $1;" -%typemap(directorin, descriptor="J") unsigned long "$input = (jlong) $1;" -%typemap(directorin, descriptor="J") long long "$input = (jlong) $1;" -%typemap(directorin, descriptor="F") float "$input = (jfloat) $1;" -%typemap(directorin, descriptor="D") double "$input = (jdouble) $1;" - -%typemap(javadirectorin) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double - "$jniinput" - -%typemap(javadirectorout) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - float, - double - "$javacall" - -%typemap(out) bool %{ $result = (jboolean)$1; %} -%typemap(out) char %{ $result = (jchar)$1; %} -%typemap(out) signed char %{ $result = (jbyte)$1; %} -%typemap(out) unsigned char %{ $result = (jshort)$1; %} -%typemap(out) short %{ $result = (jshort)$1; %} -%typemap(out) unsigned short %{ $result = (jint)$1; %} -%typemap(out) int %{ $result = (jint)$1; %} -%typemap(out) unsigned int %{ $result = (jlong)$1; %} -%typemap(out) long %{ $result = (jint)$1; %} -%typemap(out) unsigned long %{ $result = (jlong)$1; %} -%typemap(out) long long %{ $result = (jlong)$1; %} -%typemap(out) float %{ $result = (jfloat)$1; %} -%typemap(out) double %{ $result = (jdouble)$1; %} - -/* unsigned long long */ -/* Convert from BigInteger using the toByteArray member function */ -%typemap(in) unsigned long long { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, $input); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - $1 = 0; - if (sz > 0) { - $1 = ($1_type)(signed char)bae[0]; - for(i=1; i 0) { - $result = ($1_type)(signed char)bae[0]; - for(i=1; i", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)($1>>8*(8-i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - $result = bigint; -} - -/* Convert to BigInteger (see out typemap) */ -%typemap(directorin, descriptor="Ljava/math/BigInteger;", noblock=1) 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"); - jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "", "([B)V"); - jobject bigint; - int swig_i; - - bae[0] = 0; - for(swig_i=1; swig_i<9; swig_i++ ) { - bae[swig_i] = (jbyte)($1>>8*(8-swig_i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - $input = bigint; -} -Swig::LocalRefGuard $1_refguard(jenv, $input); } - -%typemap(javadirectorin) unsigned long long "$jniinput" -%typemap(javadirectorout) unsigned long long "$javacall" - -/* char * - treat as String */ -%typemap(in, noblock=1) char * { - $1 = 0; - if ($input) { - $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$1) return $null; - } -} - -%typemap(directorout, noblock=1, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * { - $1 = 0; - if ($input) { - $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$result) return $null; - } -} - -%typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char * { - $input = 0; - if ($1) { - $input = JCALL1(NewStringUTF, jenv, (const char *)$1); - if (!$input) return $null; - } - Swig::LocalRefGuard $1_refguard(jenv, $input); -} - -%typemap(freearg, noblock=1) char * { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); } -%typemap(out, noblock=1) char * { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); } -%typemap(javadirectorin) char * "$jniinput" -%typemap(javadirectorout) char * "$javacall" - -/* char *& - treat as String */ -%typemap(in, noblock=1) char *& ($*1_ltype temp = 0) { - $1 = 0; - if ($input) { - temp = ($*1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!temp) return $null; - } - $1 = &temp; -} -%typemap(freearg, noblock=1) char *& { if ($1 && *$1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)*$1); } -%typemap(out, noblock=1) char *& { if (*$1) $result = JCALL1(NewStringUTF, jenv, (const char *)*$1); } - -%typemap(out) void "" -%typemap(javadirectorin) void "$jniinput" -%typemap(javadirectorout) void "$javacall" -%typemap(directorin, descriptor="V") void "" - -/* primitive types by reference */ -%typemap(in) const bool & ($*1_ltype temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & -%{ static $*1_ltype temp; - temp = $input ? true : false; - $result = &temp; %} - -%typemap(javadirectorin) const bool & "$jniinput" -%typemap(javadirectorout) const bool & "$javacall" - -%typemap(in) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) -%{ temp = ($*1_ltype)$input; - $1 = &temp; %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &, - const signed char &, - const unsigned char &, - const short &, - const unsigned short &, - const int &, - const unsigned int &, - const long &, - const unsigned long &, - const long long &, - const float &, - const double & -%{ static $*1_ltype temp; - temp = ($*1_ltype)$input; - $result = &temp; %} - -%typemap(directorin, descriptor="Z") const bool & "$input = (jboolean)$1;" -%typemap(directorin, descriptor="C") const char & "$input = (jchar)$1;" -%typemap(directorin, descriptor="B") const signed char & "$input = (jbyte)$1;" -%typemap(directorin, descriptor="S") const unsigned char & "$input = (jshort)$1;" -%typemap(directorin, descriptor="S") const short & "$input = (jshort)$1;" -%typemap(directorin, descriptor="I") const unsigned short & "$input = (jint)$1;" -%typemap(directorin, descriptor="I") const int & "$input = (jint)$1;" -%typemap(directorin, descriptor="J") const unsigned int & "$input = (jlong)$1;" -%typemap(directorin, descriptor="I") const long & "$input = (jint)$1;" -%typemap(directorin, descriptor="J") const unsigned long & "$input = (jlong)$1;" -%typemap(directorin, descriptor="J") const long long & "$input = (jlong)$1;" -%typemap(directorin, descriptor="F") const float & "$input = (jfloat)$1;" -%typemap(directorin, descriptor="D") const double & "$input = (jdouble)$1;" - -%typemap(javadirectorin) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$jniinput" - -%typemap(javadirectorout) const char & ($*1_ltype temp), - const signed char & ($*1_ltype temp), - const unsigned char & ($*1_ltype temp), - const short & ($*1_ltype temp), - const unsigned short & ($*1_ltype temp), - const int & ($*1_ltype temp), - const unsigned int & ($*1_ltype temp), - const long & ($*1_ltype temp), - const unsigned long & ($*1_ltype temp), - const long long & ($*1_ltype temp), - const float & ($*1_ltype temp), - const double & ($*1_ltype temp) - "$javacall" - - -%typemap(out) const bool & %{ $result = (jboolean)*$1; %} -%typemap(out) const char & %{ $result = (jchar)*$1; %} -%typemap(out) const signed char & %{ $result = (jbyte)*$1; %} -%typemap(out) const unsigned char & %{ $result = (jshort)*$1; %} -%typemap(out) const short & %{ $result = (jshort)*$1; %} -%typemap(out) const unsigned short & %{ $result = (jint)*$1; %} -%typemap(out) const int & %{ $result = (jint)*$1; %} -%typemap(out) const unsigned int & %{ $result = (jlong)*$1; %} -%typemap(out) const long & %{ $result = (jint)*$1; %} -%typemap(out) const unsigned long & %{ $result = (jlong)*$1; %} -%typemap(out) const long long & %{ $result = (jlong)*$1; %} -%typemap(out) const float & %{ $result = (jfloat)*$1; %} -%typemap(out) const double & %{ $result = (jdouble)*$1; %} - -/* const unsigned long long & */ -/* Similar to unsigned long long */ -%typemap(in) const unsigned long long & ($*1_ltype temp) { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, $input); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - $1 = &temp; - temp = 0; - if (sz > 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; i 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; i", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(*$1>>8*(8-i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - $result = bigint; -} - -%typemap(javadirectorin) const unsigned long long & "$jniinput" -%typemap(javadirectorout) const unsigned long long & "$javacall" - -/* Default handling. Object passed by value. Convert to a pointer */ -%typemap(in) SWIGTYPE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - $1 = *argp; %} - -%typemap(directorout) SWIGTYPE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *argp; %} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{ *($&1_ltype*)&$result = new $1_ltype($1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - *($&1_ltype*)&$result = $1ptr; -} -#endif - -%typemap(directorin,descriptor="L$packagepath/$&javaclassname;") SWIGTYPE -%{ $input = 0; - *(($&1_ltype*)&$input) = new $1_ltype(SWIG_STD_MOVE($1)); %} -%typemap(javadirectorin) SWIGTYPE "new $&javaclassname($jniinput, true)" -%typemap(javadirectorout) SWIGTYPE "$&javaclassname.getCPtr($javacall)" - -/* Generic pointers and references */ -%typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)&$input; %} -%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) { - const char *temp = 0; - if ($input) { - temp = JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!temp) return $null; - } - SWIG_UnpackData(temp, (void *)&$1, sizeof($1)); -} -%typemap(in) SWIGTYPE & %{ $1 = *($&1_ltype)&$input; - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type is null"); - return $null; - } %} -%typemap(in, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ $1 = *($&1_ltype)&$input; - if (!$1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type is null"); - return $null; - } - rvrdeleter.reset($1); %} -%typemap(out) SWIGTYPE * -%{ *($&1_ltype)&$result = $1; %} -%typemap(out, fragment="SWIG_PackData", noblock=1) SWIGTYPE (CLASS::*) { - char buf[128]; - char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); - *data = '\0'; - $result = JCALL1(NewStringUTF, jenv, buf); -} -%typemap(out) SWIGTYPE & -%{ *($&1_ltype)&$result = $1; %} -%typemap(out) SWIGTYPE && -%{ *($&1_ltype)&$result = $1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * -%{ $result = *($&1_ltype)&$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) -%{ $result = *($&1_ltype)&$input; %} - -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE * -%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE (CLASS::*) -%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} - -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & -%{ if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *($&1_ltype)&$input; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE && -%{ if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); - return $null; - } - $result = *($&1_ltype)&$input; %} -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE & -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} -%typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE && -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} - -%typemap(javadirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($jniinput == 0) ? null : new $javaclassname($jniinput, false)" -%typemap(javadirectorin) SWIGTYPE & "new $javaclassname($jniinput, false)" -%typemap(javadirectorin) SWIGTYPE && "new $javaclassname($jniinput, false)" -%typemap(javadirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE &, SWIGTYPE && "$javaclassname.getCPtr($javacall)" - -/* Default array handling */ -%typemap(in) SWIGTYPE [] %{ $1 = *($&1_ltype)&$input; %} -%typemap(out) SWIGTYPE [] %{ *($&1_ltype)&$result = $1; %} -%typemap(freearg) SWIGTYPE [ANY], SWIGTYPE [] "" - -/* char arrays - treat as String */ -%typemap(in, noblock=1) char[ANY], char[] { - $1 = 0; - if ($input) { - $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$1) return $null; - } -} - -%typemap(directorout, noblock=1) char[ANY], char[] { - $1 = 0; - if ($input) { - $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); - if (!$result) return $null; - } -} - -%typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char[ANY], char[] { - $input = 0; - if ($1) { - $input = JCALL1(NewStringUTF, jenv, (const char *)$1); - if (!$input) return $null; - } - Swig::LocalRefGuard $1_refguard(jenv, $input); -} - -%typemap(argout) char[ANY], char[] "" -%typemap(freearg, noblock=1) char[ANY], char[] { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); } -%typemap(out, noblock=1) char[ANY], char[] { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); } -%typemap(javadirectorin) char[ANY], char[] "$jniinput" -%typemap(javadirectorout) char[ANY], char[] "$javacall" - -/* JNI types */ -%typemap(in) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray -%{ $1 = $input; %} - -%typemap(directorout) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray -%{ $result = $input; %} - -%typemap(out) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray -%{ $result = $1; %} - -%typemap(directorin,descriptor="Z") jboolean "$input = $1;" -%typemap(directorin,descriptor="C") jchar "$input = $1;" -%typemap(directorin,descriptor="B") jbyte "$input = $1;" -%typemap(directorin,descriptor="S") jshort "$input = $1;" -%typemap(directorin,descriptor="I") jint "$input = $1;" -%typemap(directorin,descriptor="J") jlong "$input = $1;" -%typemap(directorin,descriptor="F") jfloat "$input = $1;" -%typemap(directorin,descriptor="D") jdouble "$input = $1;" -%typemap(directorin,descriptor="Ljava/lang/String;") jstring "$input = $1;" -%typemap(directorin,descriptor="Ljava/lang/Object;",nouse="1") jobject "$input = $1;" -%typemap(directorin,descriptor="[Z") jbooleanArray "$input = $1;" -%typemap(directorin,descriptor="[C") jcharArray "$input = $1;" -%typemap(directorin,descriptor="[B") jbyteArray "$input = $1;" -%typemap(directorin,descriptor="[S") jshortArray "$input = $1;" -%typemap(directorin,descriptor="[I") jintArray "$input = $1;" -%typemap(directorin,descriptor="[J") jlongArray "$input = $1;" -%typemap(directorin,descriptor="[F") jfloatArray "$input = $1;" -%typemap(directorin,descriptor="[D") jdoubleArray "$input = $1;" -%typemap(directorin,descriptor="[Ljava/lang/Object;",nouse="1") jobjectArray "$input = $1;" - -%typemap(javadirectorin) jboolean, - 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 - "$javacall" - -/* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions - * that cannot be overloaded in Java as more than one C++ type maps to a single Java type */ - -%typecheck(SWIG_TYPECHECK_BOOL) /* Java boolean */ - jboolean, - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) /* Java char */ - jchar, - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) /* Java byte */ - jbyte, - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Java short */ - jshort, - unsigned char, - short, - const unsigned char &, - const short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Java int */ - jint, - unsigned short, - int, - long, - const unsigned short &, - const int &, - const long & - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Java long */ - jlong, - unsigned int, - unsigned long, - long long, - const unsigned int &, - const unsigned long &, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_INT128) /* Java BigInteger */ - unsigned long long, - const unsigned long long & - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) /* Java float */ - jfloat, - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) /* Java double */ - jdouble, - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) /* Java String */ - jstring, - char *, - char *&, - char[ANY], - char [] - "" - -%typecheck(SWIG_TYPECHECK_BOOL_ARRAY) /* Java boolean[] */ - jbooleanArray - "" - -%typecheck(SWIG_TYPECHECK_CHAR_ARRAY) /* Java char[] */ - jcharArray - "" - -%typecheck(SWIG_TYPECHECK_INT8_ARRAY) /* Java byte[] */ - jbyteArray - "" - -%typecheck(SWIG_TYPECHECK_INT16_ARRAY) /* Java short[] */ - jshortArray - "" - -%typecheck(SWIG_TYPECHECK_INT32_ARRAY) /* Java int[] */ - jintArray - "" - -%typecheck(SWIG_TYPECHECK_INT64_ARRAY) /* Java long[] */ - jlongArray - "" - -%typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) /* Java float[] */ - jfloatArray - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) /* Java double[] */ - jdoubleArray - "" - -%typecheck(SWIG_TYPECHECK_OBJECT_ARRAY) /* Java jobject[] */ - jobjectArray - "" - -%typecheck(SWIG_TYPECHECK_POINTER) /* Default */ - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE *const&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - - -/* Exception handling */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short -%{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, error_msg); - return $null; %} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] -%{ (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); - return $null; %} - -%typemap(throws) char * -%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1); - return $null; %} - -/* For methods to raise/throw the original Java exception thrown in a director method */ -%typemap(throws) Swig::DirectorException -%{ $1.throwException(jenv); - return $null; %} - -/* Java to C++ DirectorException should already be handled. Suppress warning and do nothing in the - event a user specifies a global: %catches(Swig::DirectorException); */ -%typemap(directorthrows) Swig::DirectorException "" - -/* Typemaps for code generation in proxy classes and Java type wrapper classes */ - -/* The javain typemap is used for converting function parameter types from the type - * used in the proxy, module or type wrapper class to the type used in the JNI class. */ -%typemap(javain) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double & - "$javainput" -%typemap(javain) char *, char *&, char[ANY], char[] "$javainput" -%typemap(javain) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray - "$javainput" -%typemap(javain) SWIGTYPE "$&javaclassname.getCPtr($javainput)" -%typemap(javain) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$javaclassname.getCPtr($javainput)" -%typemap(javain) SWIGTYPE && "$javaclassname.swigRelease($javainput)" -%typemap(javain) SWIGTYPE (CLASS::*) "$javaclassname.getCMemberPtr($javainput)" - -/* The javaout typemap is used for converting function return types from the return type - * used in the JNI class to the type returned by the proxy, module or type wrapper class. */ -%typemap(javaout) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double & { - return $jnicall; - } -%typemap(javaout) char *, char *&, char[ANY], char[] { - return $jnicall; - } -%typemap(javaout) jboolean, - jchar, - jbyte, - jshort, - jint, - jlong, - jfloat, - jdouble, - jstring, - jobject, - jbooleanArray, - jcharArray, - jbyteArray, - jshortArray, - jintArray, - jlongArray, - jfloatArray, - jdoubleArray, - jobjectArray { - return $jnicall; - } -%typemap(javaout) void { - $jnicall; - } -%typemap(javaout) SWIGTYPE { - return new $&javaclassname($jnicall, true); - } -%typemap(javaout) SWIGTYPE & { - return new $javaclassname($jnicall, $owner); - } -%typemap(javaout) SWIGTYPE && { - return new $javaclassname($jnicall, $owner); - } -%typemap(javaout) SWIGTYPE *, SWIGTYPE [] { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner); - } -%typemap(javaout) SWIGTYPE (CLASS::*) { - String cMemberPtr = $jnicall; - return (cMemberPtr == null) ? null : new $javaclassname(cMemberPtr, $owner); - } - -/* Pointer reference typemaps */ -%typemap(jni) SWIGTYPE *const& "jlong" -%typemap(jtype) SWIGTYPE *const& "long" -%typemap(jstype) SWIGTYPE *const& "$*javaclassname" -%typemap(javain) SWIGTYPE *const& "$*javaclassname.getCPtr($javainput)" -%typemap(javaout) SWIGTYPE *const& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $*javaclassname(cPtr, $owner); - } -%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) -%{ temp = *($1_ltype)&$input; - $1 = ($1_ltype)&temp; %} -%typemap(out) SWIGTYPE *const& -%{ *($1_ltype)&$result = *$1; %} -%typemap(directorin,descriptor="L$packagepath/$*javaclassname;") SWIGTYPE *const& -%{ *(($1_ltype)&$input) = ($*1_ltype) $1; %} -%typemap(directorout, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) SWIGTYPE *const& -%{ static $*1_ltype swig_temp; - swig_temp = *($1_ltype)&$input; - $result = &swig_temp; %} -%typemap(javadirectorin) SWIGTYPE *const& "($jniinput == 0) ? null : new $*javaclassname($jniinput, false)" -%typemap(javadirectorout) SWIGTYPE *const& "$*javaclassname.getCPtr($javacall)" - -/* Typemaps used for the generation of proxy and type wrapper class code */ -%typemap(javabase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javaclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class" -%typemap(javacode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javaimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javainterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(javainterfacemodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public interface" - -/* javabody typemaps */ - -%define SWIG_JAVABODY_METHODS(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE) %enddef // legacy name - -%define SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Base proxy classes -%typemap(javabody) TYPE %{ - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY static long swigRelease($javaclassname obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } -%} - -// Derived proxy classes -%typemap(javabody_derived) TYPE %{ - private transient long swigCPtr; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { - super($imclassname.$javaclazznameSWIGUpcast(cPtr), cMemoryOwn); - swigCPtr = cPtr; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY static long swigRelease($javaclassname obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } -%} -%enddef - -%define SWIG_JAVABODY_TYPEWRAPPER(PTRCTOR_VISIBILITY, DEFAULTCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) -// Typewrapper classes -%typemap(javabody) TYPE *, TYPE &, TYPE &&, TYPE [] %{ - private transient long swigCPtr; - - PTRCTOR_VISIBILITY $javaclassname(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - DEFAULTCTOR_VISIBILITY $javaclassname() { - swigCPtr = 0; - } - - CPTR_VISIBILITY static long getCPtr($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - CPTR_VISIBILITY static long swigRelease($javaclassname obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -%} - -%typemap(javabody) TYPE (CLASS::*) %{ - private transient String swigCMemberPtr; - - PTRCTOR_VISIBILITY $javaclassname(String cMemberPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCMemberPtr = cMemberPtr; - } - - DEFAULTCTOR_VISIBILITY $javaclassname() { - swigCMemberPtr = null; - } - - CPTR_VISIBILITY static String getCMemberPtr($javaclassname obj) { - return obj.swigCMemberPtr; - } -%} -%enddef - -/* Set the default javabody typemaps to use protected visibility. - Use the macros to change to public if using multiple modules. */ -SWIG_JAVABODY_PROXY(protected, protected, SWIGTYPE) -SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE) - -%typemap(javafinalize) SWIGTYPE %{ - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } -%} - -/* - * Java constructor typemaps: - * - * The javaconstruct typemap is inserted when a proxy class's constructor is generated. - * This typemap allows control over what code is executed in the constructor as - * well as specifying who owns the underlying C/C++ object. Normally, Java has - * ownership and the underlying C/C++ object is deallocated when the Java object - * is finalized (swigCMemOwn is true.) If swigCMemOwn is false, C/C++ is - * ultimately responsible for deallocating the underlying object's memory. - * - * The SWIG_PROXY_CONSTRUCTOR macro defines the javaconstruct typemap for a proxy - * class for a particular TYPENAME. OWNERSHIP is passed as the value of - * swigCMemOwn to the pointer constructor method. WEAKREF determines which kind - * of Java object reference will be used by the C++ director class (WeakGlobalRef - * vs. GlobalRef.) - * - * The SWIG_DIRECTOR_OWNED macro sets the ownership of director-based proxy - * classes and the weak reference flag to false, meaning that the underlying C++ - * object will be reclaimed by C++. - */ - -%define SWIG_PROXY_CONSTRUCTOR(OWNERSHIP, WEAKREF, TYPENAME...) -%typemap(javaconstruct,directorconnect="\n $imclassname.$javaclazznamedirector_connect(this, swigCPtr, OWNERSHIP, WEAKREF);") TYPENAME { - this($imcall, OWNERSHIP);$directorconnect - } -%enddef - -%define SWIG_DIRECTOR_OWNED(TYPENAME...) -SWIG_PROXY_CONSTRUCTOR(true, false, TYPENAME) -%enddef - -// Set the default for SWIGTYPE: Java owns the C/C++ object. -SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) - -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - $jnicall; - } - swigCPtr = 0; - } - } - -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - $jnicall; - } - swigCPtr = 0; - } - super.delete(); - } - -%typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{ - protected void $methodname() { - swigCMemOwn = false; - $jnicall; - } -%} - -%typemap(directorowner_release, methodname="swigReleaseOwnership") SWIGTYPE %{ - public void $methodname() { - swigCMemOwn = false; - $jnicall; - } -%} - -%typemap(directorowner_take, methodname="swigTakeOwnership") SWIGTYPE %{ - public void $methodname() { - swigCMemOwn = true; - $jnicall; - } -%} - -/* Java specific directives */ -#define %javaconst(flag) %feature("java:const","flag") -#define %javaconstvalue(value) %feature("java:constvalue",value) -#define %javaenum(wrapapproach) %feature("java:enum","wrapapproach") -#define %javamethodmodifiers %feature("java:methodmodifiers") -#define %javaexception(exceptionclasses) %feature("except",throws=exceptionclasses) -#define %nojavaexception %feature("except","0",throws="") -#define %clearjavaexception %feature("except","",throws="") -#define %proxycode %insert("proxycode") - -%pragma(java) jniclassclassmodifiers="public class" -%pragma(java) moduleclassmodifiers="public class" - -/* Some ANSI C typemaps */ - -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* String & length */ -%typemap(jni) (const char *STRING, size_t LENGTH) "jbyteArray" -%typemap(jtype) (const char *STRING, size_t LENGTH) "byte[]" -%typemap(jstype) (const char *STRING, size_t LENGTH) "byte[]" -%typemap(javain) (const char *STRING, size_t LENGTH) "$javainput" -%typemap(freearg) (const char *STRING, size_t LENGTH) "" -%typemap(in) (const char *STRING, size_t LENGTH) { - if ($input) { - $1 = ($1_ltype) JCALL2(GetByteArrayElements, jenv, $input, 0); - $2 = ($2_type) JCALL1(GetArrayLength, jenv, $input); - } else { - $1 = 0; - $2 = 0; - } -} -%typemap(argout) (const char *STRING, size_t LENGTH) { - if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, JNI_ABORT); -} -%typemap(directorin, descriptor="[B", noblock=1) (const char *STRING, size_t LENGTH) { - $input = 0; - if ($1) { - $input = JCALL1(NewByteArray, jenv, (jsize)$2); - if (!$input) return $null; - JCALL4(SetByteArrayRegion, jenv, $input, 0, (jsize)$2, (jbyte *)$1); - } - Swig::LocalRefGuard $1_refguard(jenv, $input); -} -%typemap(javadirectorin, descriptor="[B") (const char *STRING, size_t LENGTH) "$jniinput" -%apply (const char *STRING, size_t LENGTH) { (char *STRING, size_t LENGTH) } -/* Enable write-back for non-const version */ -%typemap(argout) (char *STRING, size_t LENGTH) { - if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0); -} -%typemap(directorargout, noblock=1) (char *STRING, size_t LENGTH) -{ if ($input && $1) JCALL4(GetByteArrayRegion, jenv, $input, 0, (jsize)$2, (jbyte *)$1); } -%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) } - -/* java keywords */ -%include - -// Default enum handling -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/java/javahead.swg b/win64/bin/swig/share/swig/4.1.0/java/javahead.swg deleted file mode 100755 index c482a970..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/javahead.swg +++ /dev/null @@ -1,91 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javahead.swg - * - * Java support code - * ----------------------------------------------------------------------------- */ - - -/* JNI function calls require different calling conventions for C and C++. These JCALL macros are used so - * that the same typemaps can be used for generating code for both C and C++. The SWIG preprocessor can expand - * the macros thereby generating the correct calling convention. It is thus essential that all typemaps that - * use the macros are not within %{ %} brackets as they won't be run through the SWIG preprocessor. */ -#ifdef __cplusplus -# define JCALL0(func, jenv) jenv->func() -# define JCALL1(func, jenv, ar1) jenv->func(ar1) -# define JCALL2(func, jenv, ar1, ar2) jenv->func(ar1, ar2) -# define JCALL3(func, jenv, ar1, ar2, ar3) jenv->func(ar1, ar2, ar3) -# define JCALL4(func, jenv, ar1, ar2, ar3, ar4) jenv->func(ar1, ar2, ar3, ar4) -# define JCALL5(func, jenv, ar1, ar2, ar3, ar4, ar5) jenv->func(ar1, ar2, ar3, ar4, ar5) -# define JCALL6(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6) jenv->func(ar1, ar2, ar3, ar4, ar5, ar6) -# define JCALL7(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) jenv->func(ar1, ar2, ar3, ar4, ar5, ar6, ar7) -#else -# define JCALL0(func, jenv) (*jenv)->func(jenv) -# define JCALL1(func, jenv, ar1) (*jenv)->func(jenv, ar1) -# define JCALL2(func, jenv, ar1, ar2) (*jenv)->func(jenv, ar1, ar2) -# define JCALL3(func, jenv, ar1, ar2, ar3) (*jenv)->func(jenv, ar1, ar2, ar3) -# define JCALL4(func, jenv, ar1, ar2, ar3, ar4) (*jenv)->func(jenv, ar1, ar2, ar3, ar4) -# define JCALL5(func, jenv, ar1, ar2, ar3, ar4, ar5) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5) -# define JCALL6(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5, ar6) -# define JCALL7(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) -#endif - -%insert(runtime) %{ -#include -#include -#include -%} - -%insert(runtime) %{ -/* Support for throwing Java exceptions */ -typedef enum { - SWIG_JavaOutOfMemoryError = 1, - SWIG_JavaIOException, - SWIG_JavaRuntimeException, - SWIG_JavaIndexOutOfBoundsException, - SWIG_JavaArithmeticException, - SWIG_JavaIllegalArgumentException, - SWIG_JavaNullPointerException, - SWIG_JavaDirectorPureVirtual, - SWIG_JavaUnknownError, - SWIG_JavaIllegalStateException, -} SWIG_JavaExceptionCodes; - -typedef struct { - SWIG_JavaExceptionCodes code; - const char *java_exception; -} SWIG_JavaExceptions_t; -%} - -%insert(runtime) { -static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { - jclass excep; - static const SWIG_JavaExceptions_t java_exceptions[] = { - { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, - { SWIG_JavaIOException, "java/io/IOException" }, - { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, - { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, - { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, - { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, - { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, - { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, - { SWIG_JavaUnknownError, "java/lang/UnknownError" }, - { SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" }, - { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } - }; - const SWIG_JavaExceptions_t *except_ptr = java_exceptions; - - while (except_ptr->code != code && except_ptr->code) - except_ptr++; - - JCALL0(ExceptionClear, jenv); - excep = JCALL1(FindClass, jenv, except_ptr->java_exception); - if (excep) - JCALL2(ThrowNew, jenv, excep, msg); -} -} - -%insert(runtime) %{ -/* Contract support */ - -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } } while (0) -%} diff --git a/win64/bin/swig/share/swig/4.1.0/java/javakw.swg b/win64/bin/swig/share/swig/4.1.0/java/javakw.swg deleted file mode 100755 index 02557bf4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/javakw.swg +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef JAVA_JAVAKW_SWG_ -#define JAVA_JAVAKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVAKW(x) %keywordwarn("'" `x` "' is a java keyword",rename="_%s") `x` - -/* - from - http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html -*/ - -JAVAKW(abstract); -JAVAKW(double); -JAVAKW(int); -JAVAKW(strictfp); -JAVAKW(boolean); -JAVAKW(else); -JAVAKW(interface); -JAVAKW(super); -JAVAKW(break); -JAVAKW(extends); -JAVAKW(long); -JAVAKW(switch); -JAVAKW(byte); -JAVAKW(final); -JAVAKW(native); -JAVAKW(synchronized); -JAVAKW(case); -JAVAKW(finally); -JAVAKW(new); -JAVAKW(this); -JAVAKW(catch); -JAVAKW(float); -JAVAKW(package); -JAVAKW(throw); -JAVAKW(char); -JAVAKW(for); -JAVAKW(private); -JAVAKW(throws); -JAVAKW(class); -JAVAKW(goto); -JAVAKW(protected); -JAVAKW(transient); -JAVAKW(const); -JAVAKW(if); -JAVAKW(public); -JAVAKW(try); -JAVAKW(continue); -JAVAKW(implements); -JAVAKW(return); -JAVAKW(void); -JAVAKW(default); -JAVAKW(import); -JAVAKW(short); -JAVAKW(volatile); -JAVAKW(do); -JAVAKW(instanceof); -JAVAKW(static); -JAVAKW(while); - - -/* others bad names */ - -/* Note here that only *::clone() is bad, and *::clone(int) is ok */ -%namewarn("321:clone() is a java bad method name") *::clone(); - - -#undef JAVAKW - -#endif //JAVA_JAVAKW_SWG_ diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_array.i b/win64/bin/swig/share/swig/4.1.0/java/std_array.i deleted file mode 100755 index 10113a26..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_array.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_array.i - * ----------------------------------------------------------------------------- */ - -%include - -namespace std { - - template class array { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - array(); - array(const array& other); - - size_type size() const; - %rename(isEmpty) empty; - bool empty() const; - void fill(const T& u); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i "jlong" -%typemap (jtype) std::auto_ptr< TYPE > "long" -%typemap (jstype) std::auto_ptr< TYPE > "$typemap(jstype, TYPE)" - -%typemap(in) std::auto_ptr< TYPE > (TYPE *auto_temp) -%{ auto_temp = *(TYPE **)&$input; - $1.reset(auto_temp); %} - -%typemap(javain) std::auto_ptr< TYPE > "$typemap(jstype, TYPE).swigRelease($javainput)" - -%typemap (out) std::auto_ptr< TYPE > %{ - jlong lpp = 0; - *(TYPE **) &lpp = $1.release(); - $result = lpp; -%} - -%typemap(javaout) std::auto_ptr< TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_common.i b/win64/bin/swig/share/swig/4.1.0/java/std_common.i deleted file mode 100755 index c80263ae..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_deque.i b/win64/bin/swig/share/swig/4.1.0/java/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_except.i b/win64/bin/swig/share/swig/4.1.0/java/std_except.i deleted file mode 100755 index d25e13d6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_except.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_except.i - * - * Typemaps used by the STL wrappers that throw exceptions. - * These typemaps are used when methods are declared with an STL exception specification, such as - * size_t at() const throw (std::out_of_range); - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws) std::bad_cast "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::bad_exception "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::domain_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::exception "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::invalid_argument "SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, $1.what());\n return $null;" -%typemap(throws) std::length_error "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" -%typemap(throws) std::logic_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::out_of_range "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" -%typemap(throws) std::overflow_error "SWIG_JavaThrowException(jenv, SWIG_JavaArithmeticException, $1.what());\n return $null;" -%typemap(throws) std::range_error "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" -%typemap(throws) std::runtime_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" -%typemap(throws) std::underflow_error "SWIG_JavaThrowException(jenv, SWIG_JavaArithmeticException, $1.what());\n return $null;" - diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_list.i b/win64/bin/swig/share/swig/4.1.0/java/std_list.i deleted file mode 100755 index 865b55d2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_list.i +++ /dev/null @@ -1,225 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list. - * The Java proxy class extends java.util.AbstractSequentialList. The std::list - * container looks and feels much like a java.util.LinkedList from Java. - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -%fragment("SWIG_ListSize", "header", fragment="SWIG_JavaIntFromSize_t") { -SWIGINTERN jint SWIG_ListSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) - throw std::out_of_range("list size is too large to fit into a Java int"); - return sz; -} -} - -%javamethodmodifiers std::list::begin "private"; -%javamethodmodifiers std::list::insert "private"; -%javamethodmodifiers std::list::doSize "private"; -%javamethodmodifiers std::list::doPreviousIndex "private"; -%javamethodmodifiers std::list::doNextIndex "private"; -%javamethodmodifiers std::list::doHasNext "private"; - -// Match Java style better: -%rename(Iterator) std::list::iterator; - -%nodefaultctor std::list::iterator; - -namespace std { - template class list { - -%typemap(javabase) std::list "java.util.AbstractSequentialList<$typemap(jboxtype, T)>" -%proxycode %{ - public $javaclassname(java.util.Collection c) { - this(); - java.util.ListIterator<$typemap(jboxtype, T)> it = listIterator(0); - // Special case the "copy constructor" here to avoid lots of cross-language calls - for (java.lang.Object o : c) { - it.add(($typemap(jboxtype, T))o); - } - } - - public int size() { - return doSize(); - } - - public boolean add($typemap(jboxtype, T) value) { - addLast(value); - return true; - } - - public java.util.ListIterator<$typemap(jboxtype, T)> listIterator(int index) { - return new java.util.ListIterator<$typemap(jboxtype, T)>() { - private Iterator pos; - private Iterator last; - - private java.util.ListIterator<$typemap(jboxtype, T)> init(int index) { - if (index < 0 || index > $javaclassname.this.size()) - throw new IndexOutOfBoundsException("Index: " + index); - pos = $javaclassname.this.begin(); - pos = pos.advance_unchecked(index); - return this; - } - - public void add($typemap(jboxtype, T) v) { - // Technically we can invalidate last here, but this makes more sense - last = $javaclassname.this.insert(pos, v); - } - - public void set($typemap(jboxtype, T) v) { - if (null == last) { - throw new IllegalStateException(); - } - last.set_unchecked(v); - } - - public void remove() { - if (null == last) { - throw new IllegalStateException(); - } - $javaclassname.this.remove(last); - last = null; - } - - public int previousIndex() { - return $javaclassname.this.doPreviousIndex(pos); - } - - public int nextIndex() { - return $javaclassname.this.doNextIndex(pos); - } - - public $typemap(jboxtype, T) previous() { - if (previousIndex() < 0) { - throw new java.util.NoSuchElementException(); - } - last = pos; - pos = pos.previous_unchecked(); - return last.deref_unchecked(); - } - - public $typemap(jboxtype, T) next() { - if (!hasNext()) { - throw new java.util.NoSuchElementException(); - } - last = pos; - pos = pos.next_unchecked(); - return last.deref_unchecked(); - } - - public boolean hasPrevious() { - // This call to previousIndex() will be much slower than the hasNext() implementation, but it's simpler like this with C++ forward iterators - return previousIndex() != -1; - } - - public boolean hasNext() { - return $javaclassname.this.doHasNext(pos); - } - }.init(index); - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - /* - * We'd actually be better off having the nested class *not* be static in the wrapper - * output, but this doesn't actually remove the $static from the nested class still. - * (This would allow us to somewhat simplify the implementation of the ListIterator - * interface and give "natural" semantics to Java users of the C++ iterator) - */ - //%typemap(javaclassmodifiers) iterator "public class" - //%typemap(javainterfaces) iterator "java.util.ListIterator<$typemap(jboxtype, T)>" - - struct iterator { - %extend { - void set_unchecked(const T &v) { - **$self = v; - } - - iterator next_unchecked() const { - std::list::iterator ret = *$self; - ++ret; - return ret; - } - - iterator previous_unchecked() const { - std::list::iterator ret = *$self; - --ret; - return ret; - } - - T deref_unchecked() const { - return **$self; - } - - iterator advance_unchecked(size_type index) const { - std::list::iterator ret = *$self; - std::advance(ret, index); - return ret; - } - } - }; - - list(); - list(const list& other); - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(remove) erase; - iterator erase(iterator pos); - %rename(removeLast) pop_back; - void pop_back(); - %rename(removeFirst) pop_front; - void pop_front(); - %rename(addLast) push_back; - void push_back(const T &value); - %rename(addFirst) push_front; - void push_front(const T &value); - iterator begin(); - iterator end(); - iterator insert(iterator pos, const T &value); - - %extend { - %fragment("SWIG_ListSize"); - - list(jint count, const T &value) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("list count must be positive"); - return new std::list(static_cast::size_type>(count), value); - } - - jint doSize() const throw (std::out_of_range) { - return SWIG_ListSize(self->size()); - } - - jint doPreviousIndex(const iterator &pos) const throw (std::out_of_range) { - return pos == self->begin() ? -1 : SWIG_ListSize(std::distance(self->begin(), static_cast::const_iterator>(pos))); - } - - jint doNextIndex(const iterator &pos) const throw (std::out_of_range) { - return pos == self->end() ? SWIG_ListSize(self->size()) : SWIG_ListSize(std::distance(self->begin(), static_cast::const_iterator>(pos))); - } - - bool doHasNext(const iterator &pos) const { - return pos != $self->end(); - } - } - }; -} diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_map.i b/win64/bin/swig/share/swig/4.1.0/java/std_map.i deleted file mode 100755 index b9617eaf..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_map.i +++ /dev/null @@ -1,224 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * The Java proxy class extends java.util.AbstractMap. The std::map - * container looks and feels much like a java.util.HashMap from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_MapSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_MapSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("map size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::map::sizeImpl "private"; -%javamethodmodifiers std::map::containsImpl "private"; -%javamethodmodifiers std::map::putUnchecked "private"; -%javamethodmodifiers std::map::removeUnchecked "private"; -%javamethodmodifiers std::map::find "private"; -%javamethodmodifiers std::map::begin "private"; -%javamethodmodifiers std::map::end "private"; - -%rename(Iterator) std::map::iterator; -%nodefaultctor std::map::iterator; -%javamethodmodifiers std::map::iterator::getNextUnchecked "private"; -%javamethodmodifiers std::map::iterator::isNot "private"; -%javamethodmodifiers std::map::iterator::getKey "private"; -%javamethodmodifiers std::map::iterator::getValue "private"; -%javamethodmodifiers std::map::iterator::setValue "private"; - -namespace std { - -template > class map { - -%typemap(javabase) std::map< K, T, C > - "java.util.AbstractMap<$typemap(jboxtype, K), $typemap(jboxtype, T)>" - -%proxycode %{ - - public int size() { - return sizeImpl(); - } - - public boolean containsKey(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return false; - } - - return containsImpl(($typemap(jboxtype, K))key); - } - - public $typemap(jboxtype, T) get(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - return itr.getValue(); - } - - return null; - } - - public $typemap(jboxtype, T) put($typemap(jboxtype, K) key, $typemap(jboxtype, T) value) { - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - itr.setValue(value); - return oldValue; - } else { - putUnchecked(key, value); - return null; - } - } - - public $typemap(jboxtype, T) remove(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - removeUnchecked(itr); - return oldValue; - } else { - return null; - } - } - - public java.util.Set> entrySet() { - java.util.Set> setToReturn = - new java.util.HashSet>(); - - Iterator itr = begin(); - final Iterator end = end(); - while (itr.isNot(end)) { - setToReturn.add(new Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)>() { - private Iterator iterator; - - private Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)> init(Iterator iterator) { - this.iterator = iterator; - return this; - } - - public $typemap(jboxtype, K) getKey() { - return iterator.getKey(); - } - - public $typemap(jboxtype, T) getValue() { - return iterator.getValue(); - } - - public $typemap(jboxtype, T) setValue($typemap(jboxtype, T) newValue) { - $typemap(jboxtype, T) oldValue = iterator.getValue(); - iterator.setValue(newValue); - return oldValue; - } - }.init(itr)); - itr = itr.getNextUnchecked(); - } - - return setToReturn; - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - std::map< K, T, C >::iterator getNextUnchecked() { - std::map< K, T, C >::iterator copy = (*$self); - return ++copy; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - - K getKey() const { - return (*$self)->first; - } - - T getValue() const { - return (*$self)->second; - } - - void setValue(const T& newValue) { - (*$self)->second = newValue; - } - } - }; - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator find(const K& key); - iterator begin(); - iterator end(); - %extend { - %fragment("SWIG_MapSize"); - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_MapSize(self->size()); - } - - bool containsImpl(const K& key) { - return (self->count(key) > 0); - } - - void putUnchecked(const K& key, const T& value) { - (*self)[key] = value; - } - - void removeUnchecked(const std::map< K, T, C >::iterator itr) { - self->erase(itr); - } - } -}; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_pair.i b/win64/bin/swig/share/swig/4.1.0/java/std_pair.i deleted file mode 100755 index eb5e17ac..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_pair.i +++ /dev/null @@ -1,37 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_set.i b/win64/bin/swig/share/swig/4.1.0/java/std_set.i deleted file mode 100755 index 6326cd00..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_set.i +++ /dev/null @@ -1,207 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_set.i - * - * SWIG typemaps for std::set - * The Java proxy class extends java.util.AbstractSet. The std::set - * container looks and feels much like a java.util.HashSet from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::set -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_SetSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_SetSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("set size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::set::sizeImpl "private"; -%javamethodmodifiers std::set::containsImpl "private"; -%javamethodmodifiers std::set::removeImpl "private"; -%javamethodmodifiers std::set::hasNextImpl "private"; -%javamethodmodifiers std::set::begin "private"; -%javamethodmodifiers std::set::end "private"; - -%rename(Iterator) std::set::iterator; -%nodefaultctor std::set::iterator; -%javamethodmodifiers std::set::iterator::incrementUnchecked "private"; -%javamethodmodifiers std::set::iterator::derefUnchecked "private"; -%javamethodmodifiers std::set::iterator::isNot "private"; - -namespace std { - -template -class set { - -%typemap(javabase) std::set "java.util.AbstractSet<$typemap(jboxtype, T)>" -%proxycode %{ - public $javaclassname(java.util.Collection collection) { - this(); - addAll(collection); - } - - public int size() { - return sizeImpl(); - } - - public boolean add($typemap(jboxtype, T) key) { - return addImpl(key); - } - - public boolean addAll(java.util.Collection collection) { - boolean didAddElement = false; - for (java.lang.Object object : collection) { - didAddElement |= add(($typemap(jboxtype, T))object); - } - - return didAddElement; - } - - public java.util.Iterator<$typemap(jboxtype, T)> iterator() { - return new java.util.Iterator<$typemap(jboxtype, T)>() { - private Iterator curr; - private Iterator end; - - private java.util.Iterator<$typemap(jboxtype, T)> init() { - curr = $javaclassname.this.begin(); - end = $javaclassname.this.end(); - return this; - } - - public $typemap(jboxtype, T) next() { - if (!hasNext()) { - throw new java.util.NoSuchElementException(); - } - - // Save the current position, increment it, - // then return the value at the position before the increment. - final $typemap(jboxtype, T) currValue = curr.derefUnchecked(); - curr.incrementUnchecked(); - return currValue; - } - - public boolean hasNext() { - return curr.isNot(end); - } - - public void remove() { - throw new java.lang.UnsupportedOperationException(); - } - }.init(); - } - - public boolean containsAll(java.util.Collection collection) { - for (java.lang.Object object : collection) { - if (!contains(object)) { - return false; - } - } - - return true; - } - - public boolean contains(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, T))) { - return false; - } - - return containsImpl(($typemap(jboxtype, T))object); - } - - public boolean removeAll(java.util.Collection collection) { - boolean didRemoveElement = false; - for (java.lang.Object object : collection) { - didRemoveElement |= remove(object); - } - - return didRemoveElement; - } - - public boolean remove(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, T))) { - return false; - } - - return removeImpl(($typemap(jboxtype, T))object); - } -%} - - public: - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - void incrementUnchecked() { - ++(*$self); - } - - T derefUnchecked() const { - return **$self; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - } - }; - - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T key_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - set(); - set(const set& other); - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator begin(); - iterator end(); - - %extend { - %fragment("SWIG_SetSize"); - - // Returns whether item was inserted. - bool addImpl(const T& key) { - return self->insert(key).second; - } - - // Returns whether set contains key. - bool containsImpl(const T& key) { - return (self->count(key) > 0); - } - - // Returns whether the item was erased. - bool removeImpl(const T& key) { - return (self->erase(key) > 0); - } - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_SetSize(self->size()); - } - - bool hasNextImpl(const iterator& itr) const { - return (itr != $self->end()); - } - } -}; - -} diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/java/std_shared_ptr.i deleted file mode 100755 index 01a0e9dd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_string.i b/win64/bin/swig/share/swig/4.1.0/java/std_string.i deleted file mode 100755 index 5e50f3d6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_string.i +++ /dev/null @@ -1,121 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string& - * These are mapped to a Java String and are passed around by value. - * - * To use non-const std::string references use the following %apply. Note - * that they are passed by value. - * %apply const std::string & {std::string &}; - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - -%naturalvar string; - -class string; - -// string -%typemap(jni) string "jstring" -%typemap(jtype) string "String" -%typemap(jstype) string "String" -%typemap(javadirectorin) string "$jniinput" -%typemap(javadirectorout) string "$javacall" - -%typemap(in) string -%{ if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - $1.assign($1_pstr); - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorout) string -%{ if(!$input) { - if (!jenv->ExceptionCheck()) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - } - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - $result.assign($1_pstr); - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorin,descriptor="Ljava/lang/String;") string -%{ $input = jenv->NewStringUTF($1.c_str()); - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(out) string -%{ $result = jenv->NewStringUTF($1.c_str()); %} - -%typemap(javain) string "$javainput" - -%typemap(javaout) string { - return $jnicall; - } - -%typemap(typecheck) string = char *; - -%typemap(throws) string -%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); - return $null; %} - -// const string & -%typemap(jni) const string & "jstring" -%typemap(jtype) const string & "String" -%typemap(jstype) const string & "String" -%typemap(javadirectorin) const string & "$jniinput" -%typemap(javadirectorout) const string & "$javacall" - -%typemap(in) const string & -%{ if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - $*1_ltype $1_str($1_pstr); - $1 = &$1_str; - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & -%{ if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return $null; - } - const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); - if (!$1_pstr) return $null; - /* possible thread/reentrant code problem */ - static $*1_ltype $1_str; - $1_str = $1_pstr; - $result = &$1_str; - jenv->ReleaseStringUTFChars($input, $1_pstr); %} - -%typemap(directorin,descriptor="Ljava/lang/String;") const string & -%{ $input = jenv->NewStringUTF($1.c_str()); - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(out) const string & -%{ $result = jenv->NewStringUTF($1->c_str()); %} - -%typemap(javain) const string & "$javainput" - -%typemap(javaout) const string & { - return $jnicall; - } - -%typemap(typecheck) const string & = char *; - -%typemap(throws) const string & -%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); - return $null; %} - -} - diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/java/std_unique_ptr.i deleted file mode 100755 index debfc179..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_unique_ptr.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) - -%typemap (jni) std::unique_ptr< TYPE > "jlong" -%typemap (jtype) std::unique_ptr< TYPE > "long" -%typemap (jstype) std::unique_ptr< TYPE > "$typemap(jstype, TYPE)" - -%typemap(in) std::unique_ptr< TYPE > (TYPE *unique_temp) -%{ unique_temp = *(TYPE **)&$input; - $1.reset(unique_temp); %} - -%typemap(javain) std::unique_ptr< TYPE > "$typemap(jstype, TYPE).swigRelease($javainput)" - -%typemap (out) std::unique_ptr< TYPE > %{ - jlong lpp = 0; - *(TYPE **) &lpp = $1.release(); - $result = lpp; -%} - -%typemap(javaout) std::unique_ptr< TYPE > { - long cPtr = $jnicall; - return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); - } - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_unordered_map.i b/win64/bin/swig/share/swig/4.1.0/java/std_unordered_map.i deleted file mode 100755 index c5e2b784..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_unordered_map.i +++ /dev/null @@ -1,211 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unordered_map.i - * - * SWIG typemaps for std::unordered_map - * The Java proxy class extends java.util.AbstractMap. The std::unordered_map - * container looks and feels much like a java.util.HashMap from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::unordered_map -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_MapSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_MapSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("map size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::unordered_map::sizeImpl "private"; -%javamethodmodifiers std::unordered_map::containsImpl "private"; -%javamethodmodifiers std::unordered_map::putUnchecked "private"; -%javamethodmodifiers std::unordered_map::removeUnchecked "private"; -%javamethodmodifiers std::unordered_map::find "private"; -%javamethodmodifiers std::unordered_map::begin "private"; -%javamethodmodifiers std::unordered_map::end "private"; - -%rename(Iterator) std::unordered_map::iterator; -%nodefaultctor std::unordered_map::iterator; -%javamethodmodifiers std::unordered_map::iterator::getNextUnchecked "private"; -%javamethodmodifiers std::unordered_map::iterator::isNot "private"; -%javamethodmodifiers std::unordered_map::iterator::getKey "private"; -%javamethodmodifiers std::unordered_map::iterator::getValue "private"; -%javamethodmodifiers std::unordered_map::iterator::setValue "private"; - -namespace std { - -template class unordered_map { - -%typemap(javabase) std::unordered_map - "java.util.AbstractMap<$typemap(jboxtype, K), $typemap(jboxtype, T)>" - -%proxycode %{ - - public int size() { - return sizeImpl(); - } - - public boolean containsKey(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return false; - } - - return containsImpl(($typemap(jboxtype, K))key); - } - - public $typemap(jboxtype, T) get(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - return itr.getValue(); - } - - return null; - } - - public $typemap(jboxtype, T) put($typemap(jboxtype, K) key, $typemap(jboxtype, T) value) { - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - itr.setValue(value); - return oldValue; - } else { - putUnchecked(key, value); - return null; - } - } - - public $typemap(jboxtype, T) remove(java.lang.Object key) { - if (!(key instanceof $typemap(jboxtype, K))) { - return null; - } - - Iterator itr = find(($typemap(jboxtype, K)) key); - if (itr.isNot(end())) { - $typemap(jboxtype, T) oldValue = itr.getValue(); - removeUnchecked(itr); - return oldValue; - } else { - return null; - } - } - - public java.util.Set> entrySet() { - java.util.Set> setToReturn = - new java.util.HashSet>(); - - Iterator itr = begin(); - final Iterator end = end(); - while (itr.isNot(end)) { - setToReturn.add(new Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)>() { - private Iterator iterator; - - private Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)> init(Iterator iterator) { - this.iterator = iterator; - return this; - } - - public $typemap(jboxtype, K) getKey() { - return iterator.getKey(); - } - - public $typemap(jboxtype, T) getValue() { - return iterator.getValue(); - } - - public $typemap(jboxtype, T) setValue($typemap(jboxtype, T) newValue) { - $typemap(jboxtype, T) oldValue = iterator.getValue(); - iterator.setValue(newValue); - return oldValue; - } - }.init(itr)); - itr = itr.getNextUnchecked(); - } - - return setToReturn; - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - unordered_map(); - unordered_map(const unordered_map& other); - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - std::unordered_map< K, T >::iterator getNextUnchecked() { - std::unordered_map< K, T >::iterator copy = (*$self); - return ++copy; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - - K getKey() const { - return (*$self)->first; - } - - T getValue() const { - return (*$self)->second; - } - - void setValue(const T& newValue) { - (*$self)->second = newValue; - } - } - }; - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator find(const K& key); - iterator begin(); - iterator end(); - %extend { - %fragment("SWIG_MapSize"); - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_MapSize(self->size()); - } - - bool containsImpl(const K& key) { - return (self->count(key) > 0); - } - - void putUnchecked(const K& key, const T& value) { - (*self)[key] = value; - } - - void removeUnchecked(const std::unordered_map< K, T >::iterator itr) { - self->erase(itr); - } - } -}; - -} diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_unordered_set.i b/win64/bin/swig/share/swig/4.1.0/java/std_unordered_set.i deleted file mode 100755 index 97250ada..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_unordered_set.i +++ /dev/null @@ -1,203 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unordered_set.i - * - * SWIG typemaps for std::unordered_set - * The Java proxy class extends java.util.AbstractSet. The std::unordered_set - * container looks and feels much like a java.util.HashSet from Java. - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::unordered_set -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%fragment("SWIG_UnorderedSetSize", "header", fragment="SWIG_JavaIntFromSize_t") { - SWIGINTERN jint SWIG_UnorderedSetSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) { - throw std::out_of_range("unordered_set size is too large to fit into a Java int"); - } - - return sz; - } -} - -%javamethodmodifiers std::unordered_set::sizeImpl "private"; -%javamethodmodifiers std::unordered_set::containsImpl "private"; -%javamethodmodifiers std::unordered_set::removeImpl "private"; -%javamethodmodifiers std::unordered_set::hasNextImpl "private"; -%javamethodmodifiers std::unordered_set::begin "private"; -%javamethodmodifiers std::unordered_set::end "private"; - -%rename(Iterator) std::unordered_set::iterator; -%nodefaultctor std::unordered_set::iterator; -%javamethodmodifiers std::unordered_set::iterator::incrementUnchecked "private"; -%javamethodmodifiers std::unordered_set::iterator::derefUnchecked "private"; -%javamethodmodifiers std::unordered_set::iterator::isNot "private"; - -namespace std { - -template -class unordered_set { - -%typemap(javabase) std::unordered_set "java.util.AbstractSet<$typemap(jboxtype, Key)>" -%proxycode %{ - public $javaclassname(java.util.Collection collection) { - this(); - addAll(collection); - } - - public int size() { - return sizeImpl(); - } - - public boolean addAll(java.util.Collection collection) { - boolean didAddElement = false; - for (java.lang.Object object : collection) { - didAddElement |= add(($typemap(jboxtype, Key))object); - } - - return didAddElement; - } - - public java.util.Iterator<$typemap(jboxtype, Key)> iterator() { - return new java.util.Iterator<$typemap(jboxtype, Key)>() { - private Iterator curr; - private Iterator end; - - private java.util.Iterator<$typemap(jboxtype, Key)> init() { - curr = $javaclassname.this.begin(); - end = $javaclassname.this.end(); - return this; - } - - public $typemap(jboxtype, Key) next() { - if (!hasNext()) { - throw new java.util.NoSuchElementException(); - } - - // Save the current position, increment it, - // then return the value at the position before the increment. - final $typemap(jboxtype, Key) currValue = curr.derefUnchecked(); - curr.incrementUnchecked(); - return currValue; - } - - public boolean hasNext() { - return curr.isNot(end); - } - - public void remove() { - throw new java.lang.UnsupportedOperationException(); - } - }.init(); - } - - public boolean containsAll(java.util.Collection collection) { - for (java.lang.Object object : collection) { - if (!contains(object)) { - return false; - } - } - - return true; - } - - public boolean contains(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, Key))) { - return false; - } - - return containsImpl(($typemap(jboxtype, Key))object); - } - - public boolean removeAll(java.util.Collection collection) { - boolean didRemoveElement = false; - for (java.lang.Object object : collection) { - didRemoveElement |= remove(object); - } - - return didRemoveElement; - } - - public boolean remove(java.lang.Object object) { - if (!(object instanceof $typemap(jboxtype, Key))) { - return false; - } - - return removeImpl(($typemap(jboxtype, Key))object); - } -%} - - public: - - struct iterator { - %typemap(javaclassmodifiers) iterator "protected class" - %extend { - void incrementUnchecked() { - ++(*$self); - } - - Key derefUnchecked() const { - return **$self; - } - - bool isNot(iterator other) const { - return (*$self != other); - } - } - }; - - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef Key value_type; - typedef Key key_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - unordered_set(); - unordered_set(const unordered_set& other); - - %rename(isEmpty) empty; - bool empty() const; - void clear(); - iterator begin(); - iterator end(); - - %extend { - %fragment("SWIG_UnorderedSetSize"); - - // Returns whether item was inserted. - bool add(const Key& key) { - return self->insert(key).second; - } - - // Returns whether set contains key. - bool containsImpl(const Key& key) { - return (self->count(key) > 0); - } - - // Returns whether the item was erased. - bool removeImpl(const Key& key) { - return (self->erase(key) > 0); - } - - jint sizeImpl() const throw (std::out_of_range) { - return SWIG_UnorderedSetSize(self->size()); - } - - bool hasNextImpl(const iterator& itr) const { - return (itr != $self->end()); - } - } -}; - -} diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_vector.i b/win64/bin/swig/share/swig/4.1.0/java/std_vector.i deleted file mode 100755 index 40775012..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_vector.i +++ /dev/null @@ -1,185 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector. - * The Java proxy class extends java.util.AbstractList and implements - * java.util.RandomAccess. The std::vector container looks and feels much like a - * java.util.ArrayList from Java. - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -%fragment("SWIG_VectorSize", "header", fragment="SWIG_JavaIntFromSize_t") { -SWIGINTERN jint SWIG_VectorSize(size_t size) { - jint sz = SWIG_JavaIntFromSize_t(size); - if (sz == -1) - throw std::out_of_range("vector size is too large to fit into a Java int"); - return sz; -} -} - -%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CTYPE, CONST_REFERENCE) -%typemap(javabase) std::vector< CTYPE > "java.util.AbstractList<$typemap(jboxtype, CTYPE)>" -%typemap(javainterfaces) std::vector< CTYPE > "java.util.RandomAccess" -%proxycode %{ - public $javaclassname($typemap(jstype, CTYPE)[] initialElements) { - this(); - reserve(initialElements.length); - - for ($typemap(jstype, CTYPE) element : initialElements) { - add(element); - } - } - - public $javaclassname(Iterable<$typemap(jboxtype, CTYPE)> initialElements) { - this(); - for ($typemap(jstype, CTYPE) element : initialElements) { - add(element); - } - } - - public $typemap(jboxtype, CTYPE) get(int index) { - return doGet(index); - } - - public $typemap(jboxtype, CTYPE) set(int index, $typemap(jboxtype, CTYPE) e) { - return doSet(index, e); - } - - public boolean add($typemap(jboxtype, CTYPE) e) { - modCount++; - doAdd(e); - return true; - } - - public void add(int index, $typemap(jboxtype, CTYPE) e) { - modCount++; - doAdd(index, e); - } - - public $typemap(jboxtype, CTYPE) remove(int index) { - modCount++; - return doRemove(index); - } - - protected void removeRange(int fromIndex, int toIndex) { - modCount++; - doRemoveRange(fromIndex, toIndex); - } - - public int size() { - return doSize(); - } -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef CTYPE *pointer; - typedef CTYPE const *const_pointer; - typedef CTYPE &reference; - typedef CONST_REFERENCE const_reference; - - vector(); - vector(const vector &other); - - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %extend { - %fragment("SWIG_VectorSize"); - - vector(jint count, const CTYPE &value) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("vector count must be positive"); - return new std::vector< CTYPE >(static_cast::size_type>(count), value); - } - - jint doSize() const throw (std::out_of_range) { - return SWIG_VectorSize(self->size()); - } - - void doAdd(const value_type& x) { - self->push_back(x); - } - - void doAdd(jint index, const value_type& x) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (0 <= index && index <= size) { - self->insert(self->begin() + index, x); - } else { - throw std::out_of_range("vector index out of range"); - } - } - - value_type doRemove(jint index) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (0 <= index && index < size) { - CTYPE const old_value = (*self)[index]; - self->erase(self->begin() + index); - return old_value; - } else { - throw std::out_of_range("vector index out of range"); - } - } - - CONST_REFERENCE doGet(jint index) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (index >= 0 && index < size) - return (*self)[index]; - else - throw std::out_of_range("vector index out of range"); - } - - value_type doSet(jint index, const value_type& val) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (index >= 0 && index < size) { - CTYPE const old_value = (*self)[index]; - (*self)[index] = val; - return old_value; - } - else - throw std::out_of_range("vector index out of range"); - } - - void doRemoveRange(jint fromIndex, jint toIndex) throw (std::out_of_range) { - jint size = static_cast(self->size()); - if (0 <= fromIndex && fromIndex <= toIndex && toIndex <= size) { - self->erase(self->begin() + fromIndex, self->begin() + toIndex); - } else { - throw std::out_of_range("vector index out of range"); - } - } - } -%enddef - -%javamethodmodifiers std::vector::doSize "private"; -%javamethodmodifiers std::vector::doAdd "private"; -%javamethodmodifiers std::vector::doGet "private"; -%javamethodmodifiers std::vector::doSet "private"; -%javamethodmodifiers std::vector::doRemove "private"; -%javamethodmodifiers std::vector::doRemoveRange "private"; - -namespace std { - - template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(T, const value_type&) - }; - - // bool specialization - template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(bool, bool) - }; -} - -%define specialize_std_vector(T) -#warning "specialize_std_vector - specialization for type T no longer needed" -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/java/std_wstring.i b/win64/bin/swig/share/swig/4.1.0/java/std_wstring.i deleted file mode 100755 index c24baaa3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/std_wstring.i +++ /dev/null @@ -1,180 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_wstring.i - * - * Typemaps for std::wstring and const std::wstring& - * - * These are mapped to a Java String and are passed around by value. - * Warning: Unicode / multibyte characters are handled differently on different - * OSs so the std::wstring typemaps may not always work as intended. - * - * To use non-const std::wstring references use the following %apply. Note - * that they are passed by value. - * %apply const std::wstring & {std::wstring &}; - * ----------------------------------------------------------------------------- */ - -namespace std { - -%naturalvar wstring; - -class wstring; - -// wstring -%typemap(jni) wstring "jstring" -%typemap(jtype) wstring "String" -%typemap(jstype) wstring "String" -%typemap(javadirectorin) wstring "$jniinput" -%typemap(javadirectorout) wstring "$javacall" - -%typemap(in) wstring -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - if ($1_len) { - $1.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $1.push_back((wchar_t)$1_pstr[i]); - } - } - jenv->ReleaseStringChars($input, $1_pstr); - %} - -%typemap(directorout) wstring -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - if ($1_len) { - $result.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $result.push_back((wchar_t)$1_pstr[i]); - } - } - jenv->ReleaseStringChars($input, $1_pstr); - %} - -%typemap(directorin,descriptor="Ljava/lang/String;") wstring %{ - jsize $1_len = (jsize)$1.length(); - jchar *$1_conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - $1_conv_buf[i] = (jchar)$1[i]; - } - $input = jenv->NewString($1_conv_buf, $1_len); - Swig::LocalRefGuard $1_refguard(jenv, $input); - delete [] $1_conv_buf; -%} - -%typemap(out) wstring -%{jsize $1_len = (jsize)$1.length(); - jchar *conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - conv_buf[i] = (jchar)$1[i]; - } - $result = jenv->NewString(conv_buf, $1_len); - delete [] conv_buf; %} - -%typemap(javain) wstring "$javainput" - -%typemap(javaout) wstring { - return $jnicall; - } - -//%typemap(typecheck) wstring = wchar_t *; - -%typemap(throws) wstring -%{std::string message($1.size(), '\0'); - for (size_t i = 0; i < $1.size(); ++i) { - message[i] = (char)$1[i]; - } - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str()); - return $null; %} - -// const wstring & -%typemap(jni) const wstring & "jstring" -%typemap(jtype) const wstring & "String" -%typemap(jstype) const wstring & "String" -%typemap(javadirectorin) const wstring & "$jniinput" -%typemap(javadirectorout) const wstring & "$javacall" - -%typemap(in) const wstring & -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - std::wstring $1_str; - if ($1_len) { - $1_str.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $1_str.push_back((wchar_t)$1_pstr[i]); - } - } - $1 = &$1_str; - jenv->ReleaseStringChars($input, $1_pstr); - %} - -%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring & -%{if(!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); - return $null; - } - const jchar *$1_pstr = jenv->GetStringChars($input, 0); - if (!$1_pstr) return $null; - jsize $1_len = jenv->GetStringLength($input); - /* possible thread/reentrant code problem */ - static std::wstring $1_str; - if ($1_len) { - $1_str.reserve($1_len); - for (jsize i = 0; i < $1_len; ++i) { - $1_str.push_back((wchar_t)$1_pstr[i]); - } - } - $result = &$1_str; - jenv->ReleaseStringChars($input, $1_pstr); %} - -%typemap(directorin,descriptor="Ljava/lang/String;") const wstring & %{ - jsize $1_len = (jsize)$1.length(); - jchar *$1_conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - $1_conv_buf[i] = (jchar)($1)[i]; - } - $input = jenv->NewString($1_conv_buf, $1_len); - Swig::LocalRefGuard $1_refguard(jenv, $input); - delete [] $1_conv_buf; -%} - -%typemap(out) const wstring & -%{jsize $1_len = (jsize)$1->length(); - jchar *conv_buf = new jchar[$1_len]; - for (jsize i = 0; i < $1_len; ++i) { - conv_buf[i] = (jchar)(*$1)[i]; - } - $result = jenv->NewString(conv_buf, $1_len); - delete [] conv_buf; %} - -%typemap(javain) const wstring & "$javainput" - -%typemap(javaout) const wstring & { - return $jnicall; - } - -//%typemap(typecheck) const wstring & = wchar_t *; - -%typemap(throws) const wstring & -%{std::string message($1.size(), '\0'); - for (size_t i = 0; i < $1.size(); ++i) { - message[i] = (char)$1[i]; - } - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str()); - return $null; %} - -} - diff --git a/win64/bin/swig/share/swig/4.1.0/java/stl.i b/win64/bin/swig/share/swig/4.1.0/java/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/java/swiginterface.i b/win64/bin/swig/share/swig/4.1.0/java/swiginterface.i deleted file mode 100755 index 81dd6d62..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/swiginterface.i +++ /dev/null @@ -1,74 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swiginterface.i - * - * SWIG interface feature and typemaps implementation providing: - * %interface - * %interface_impl - * %interface_custom - * ----------------------------------------------------------------------------- */ - -%define INTERFACE_TYPEMAPS(CTYPE...) -%typemap(jtype) CTYPE, CTYPE *, CTYPE *const&, CTYPE [], CTYPE & "long" -%typemap(jstype) CTYPE "$&javainterfacename" -%typemap(jstype) CTYPE *, CTYPE [], CTYPE & "$javainterfacename" -%typemap(jstype) CTYPE *const& "$*javainterfacename" -%typemap(javain) CTYPE "$javainput.$&interfacename_GetInterfaceCPtr()" -%typemap(javain) CTYPE & "$javainput.$interfacename_GetInterfaceCPtr()" -%typemap(javain) CTYPE *, CTYPE [] "($javainput == null) ? 0 : $javainput.$interfacename_GetInterfaceCPtr()" -%typemap(javain) CTYPE *const& "($javainput == null) ? 0 : $javainput.$*interfacename_GetInterfaceCPtr()" -%typemap(javaout) CTYPE { - return ($&javainterfacename)new $&javaclassname($jnicall, true); - } -%typemap(javaout) CTYPE & { - return ($javainterfacename)new $javaclassname($jnicall, $owner); - } -%typemap(javaout) CTYPE *, CTYPE [] { - long cPtr = $jnicall; - return (cPtr == 0) ? null : ($javainterfacename)new $javaclassname(cPtr, $owner); - } -%typemap(javaout) CTYPE *const& { - long cPtr = $jnicall; - return (cPtr == 0) ? null : ($*javainterfacename)new $*javaclassname(cPtr, $owner); - } - -%typemap(javadirectorin) CTYPE "($&javainterfacename)new $&javaclassname($jniinput, true)" -%typemap(javadirectorin) CTYPE & "($javainterfacename)new $javaclassname($jniinput, false)" -%typemap(javadirectorin) CTYPE *, CTYPE [] "($jniinput == 0) ? null : ($javainterfacename)new $javaclassname($jniinput, false)" -%typemap(javadirectorin) CTYPE *const& "($jniinput == 0) ? null : ($*javainterfacename)new $*javaclassname($jniinput, false)" -%typemap(javadirectorout) CTYPE "$javacall.$&interfacename_GetInterfaceCPtr()" -%typemap(javadirectorout) CTYPE *, CTYPE [], CTYPE & "$javacall.$interfacename_GetInterfaceCPtr()" -%typemap(javadirectorout) CTYPE *const& "$javacall.$*interfacename_GetInterfaceCPtr()" -%typemap(directorin,descriptor="L$packagepath/$&javainterfacename;") CTYPE -%{ $input = 0; - *(($&1_ltype*)&$input) = new $1_ltype(SWIG_STD_MOVE($1)); %} -%typemap(directorin,descriptor="L$packagepath/$javainterfacename;") CTYPE *, CTYPE [] -%{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} -%typemap(directorin,descriptor="L$packagepath/$javainterfacename;") CTYPE & -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} -%typemap(directorin,descriptor="L$packagepath/$*javainterfacename;") CTYPE *const& -%{ *($&1_ltype)&$input = ($1_ltype) &$1; %} - -%typemap(javainterfacecode, declaration=" long $interfacename_GetInterfaceCPtr();\n", cptrmethod="$interfacename_GetInterfaceCPtr") CTYPE %{ - public long $interfacename_GetInterfaceCPtr() { - return $imclassname.$javaclazzname$interfacename_GetInterfaceCPtr(swigCPtr); - } -%} -%enddef - -%define %interface(CTYPE...) -%feature("interface", name="%sSwigInterface") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_impl(CTYPE...) -%rename("%sSwigImpl") CTYPE; -%feature("interface", name="%(rstrip:[SwigImpl])s") CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - -%define %interface_custom(PROXY, INTERFACE, CTYPE...) -%rename(PROXY) CTYPE; -%feature("interface", name=INTERFACE) CTYPE; -INTERFACE_TYPEMAPS(CTYPE) -%enddef - diff --git a/win64/bin/swig/share/swig/4.1.0/java/swigmove.i b/win64/bin/swig/share/swig/4.1.0/java/swigmove.i deleted file mode 100755 index 28897eee..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/swigmove.i +++ /dev/null @@ -1,16 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in) SWIGTYPE MOVE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - return $null; - } - SwigValueWrapper< $1_ltype >::reset($1, argp); %} - -%typemap(javain) SWIGTYPE MOVE "$&javaclassname.swigRelease($javainput)" diff --git a/win64/bin/swig/share/swig/4.1.0/java/typemaps.i b/win64/bin/swig/share/swig/4.1.0/java/typemaps.i deleted file mode 100755 index 0f46e197..00000000 --- a/win64/bin/swig/share/swig/4.1.0/java/typemaps.i +++ /dev/null @@ -1,529 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* -INPUT typemaps --------------- - -These typemaps remap a C pointer or C++ reference to be an "INPUT" value which is -passed by value instead of reference. - -The following typemaps can be applied to turn a pointer or reference into a simple -input value. That is, instead of passing a pointer or reference to an object, -you would use a real value instead. - - bool *INPUT, bool &INPUT - signed char *INPUT, signed char &INPUT - unsigned char *INPUT, unsigned char &INPUT - short *INPUT, short &INPUT - unsigned short *INPUT, unsigned short &INPUT - int *INPUT, int &INPUT - unsigned int *INPUT, unsigned int &INPUT - long *INPUT, long &INPUT - unsigned long *INPUT, unsigned long &INPUT - long long *INPUT, long long &INPUT - unsigned long long *INPUT, unsigned long long &INPUT - float *INPUT, float &INPUT - double *INPUT, double &INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -In Java you could then use it like this: - double answer = modulename.fadd(10.0, 20.0); - -There are no char *INPUT typemaps, however you can apply the signed char * typemaps instead: - %include - %apply signed char *INPUT {char *input}; - void f(char *input); -*/ - -%define INPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JNIDESC) -%typemap(jni) TYPE *INPUT, TYPE &INPUT "JNITYPE" -%typemap(jtype) TYPE *INPUT, TYPE &INPUT "JTYPE" -%typemap(jstype) TYPE *INPUT, TYPE &INPUT "JTYPE" -%typemap(javain) TYPE *INPUT, TYPE &INPUT "$javainput" - -%typemap(in) TYPE *INPUT, TYPE &INPUT -%{ $1 = ($1_ltype)&$input; %} - -%typemap(freearg) TYPE *INPUT, TYPE &INPUT "" - -%typemap(typecheck) TYPE *INPUT = TYPE; -%typemap(typecheck) TYPE &INPUT = TYPE; -%enddef - -INPUT_TYPEMAP(bool, jboolean, boolean, "Z"); -INPUT_TYPEMAP(signed char, jbyte, byte, "B"); -INPUT_TYPEMAP(unsigned char, jshort, short, "S"); -INPUT_TYPEMAP(short, jshort, short, "S"); -INPUT_TYPEMAP(unsigned short, jint, int, "I"); -INPUT_TYPEMAP(int, jint, int, "I"); -INPUT_TYPEMAP(unsigned int, jlong, long, "J"); -INPUT_TYPEMAP(long, jint, int, "I"); -INPUT_TYPEMAP(unsigned long, jlong, long, "J"); -INPUT_TYPEMAP(long long, jlong, long, "J"); -INPUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, "Ljava/math/BigInteger;"); -INPUT_TYPEMAP(float, jfloat, float, "F"); -INPUT_TYPEMAP(double, jdouble, double, "D"); - -#undef INPUT_TYPEMAP - -/* Convert from BigInteger using the toByteArray member function */ -/* Overrides the typemap in the INPUT_TYPEMAP macro */ -%typemap(in) unsigned long long *INPUT($*1_ltype temp), unsigned long long &INPUT($*1_ltype temp) { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, $input); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - temp = 0; - if (sz > 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Java output of the function would be the function return value and the -value in the single element array. In Java you would use it like this: - - double[] ptr = {0.0}; - double fraction = modulename.modf(5.0,ptr); - -There are no char *OUTPUT typemaps, however you can apply the signed char * typemaps instead: - %include - %apply signed char *OUTPUT {char *output}; - void f(char *output); -*/ - -/* Java BigInteger[] */ -%typecheck(SWIG_TYPECHECK_INT128_ARRAY) SWIGBIGINTEGERARRAY "" - -%define OUTPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE) -%typemap(jni) TYPE *OUTPUT, TYPE &OUTPUT %{JNITYPE##Array%} -%typemap(jtype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" -%typemap(jstype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" -%typemap(javain) TYPE *OUTPUT, TYPE &OUTPUT "$javainput" -%typemap(javadirectorin) TYPE *OUTPUT, TYPE &OUTPUT "$jniinput" -%typemap(javadirectorout) TYPE *OUTPUT, TYPE &OUTPUT "$javacall" - -%typemap(in) TYPE *OUTPUT($*1_ltype temp), TYPE &OUTPUT($*1_ltype temp) -{ - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - temp = ($*1_ltype)0; - $1 = &temp; -} - -%typemap(freearg) TYPE *OUTPUT, TYPE &OUTPUT "" - -%typemap(argout) TYPE *OUTPUT, TYPE &OUTPUT -{ - JNITYPE jvalue = (JNITYPE)temp$argnum; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &jvalue); -} - -%typemap(directorin,descriptor=JNIDESC) TYPE &OUTPUT %{ - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorin,descriptor=JNIDESC) TYPE *OUTPUT %{ - if ($1) { - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - } - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorargout, noblock=1) TYPE &OUTPUT -{ - JNITYPE $1_jvalue; - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = ($*1_ltype)$1_jvalue; -} - -%typemap(directorargout, noblock=1) TYPE *OUTPUT -{ - if ($result) { - JNITYPE $1_jvalue; - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = ($*1_ltype)$1_jvalue; - } -} - -%typemap(typecheck) TYPE *OUTPUT = TYPECHECKTYPE; -%typemap(typecheck) TYPE &OUTPUT = TYPECHECKTYPE; -%enddef - -OUTPUT_TYPEMAP(bool, jboolean, boolean, Boolean, "[Z", jbooleanArray); -OUTPUT_TYPEMAP(signed char, jbyte, byte, Byte, "[B", jbyteArray); -OUTPUT_TYPEMAP(unsigned char, jshort, short, Short, "[S", jshortArray); -OUTPUT_TYPEMAP(short, jshort, short, Short, "[S", jshortArray); -OUTPUT_TYPEMAP(unsigned short, jint, int, Int, "[I", jintArray); -OUTPUT_TYPEMAP(int, jint, int, Int, "[I", jintArray); -OUTPUT_TYPEMAP(unsigned int, jlong, long, Long, "[J", jlongArray); -OUTPUT_TYPEMAP(long, jint, int, Int, "[I", jintArray); -OUTPUT_TYPEMAP(unsigned long, jlong, long, Long, "[J", jlongArray); -OUTPUT_TYPEMAP(long long, jlong, long, Long, "[J", jlongArray); -OUTPUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, Object, "[Ljava/math/BigInteger;", jobjectArray); -OUTPUT_TYPEMAP(float, jfloat, float, Float, "[F", jfloatArray); -OUTPUT_TYPEMAP(double, jdouble, double, Double, "[D", jdoubleArray); - -#undef OUTPUT_TYPEMAP - -%typemap(in) bool *OUTPUT($*1_ltype temp), bool &OUTPUT($*1_ltype temp) -{ - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - temp = false; - $1 = &temp; -} - -%typemap(directorargout, noblock=1) bool &OUTPUT -{ - jboolean $1_jvalue; - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = $1_jvalue ? true : false; -} - -%typemap(directorargout, noblock=1) bool *OUTPUT -{ - if ($result) { - jboolean $1_jvalue; - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = $1_jvalue ? true : false; - } -} - - -/* Convert to BigInteger - byte array holds number in 2's complement big endian format */ -/* Use first element in BigInteger array for output */ -/* Overrides the typemap in the OUTPUT_TYPEMAP macro */ -%typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT { - jbyteArray ba = JCALL1(NewByteArray, jenv, 9); - jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger"); - jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(temp$argnum>>8*(8-i)); - } - - JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); - bigint = JCALL3(NewObject, jenv, clazz, mid, ba); - JCALL1(DeleteLocalRef, jenv, ba); - JCALL3(SetObjectArrayElement, jenv, $input, 0, bigint); -} - -/* -INOUT typemaps --------------- - -Mappings for a parameter that is both an input and an output parameter - -The following typemaps can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" typemaps described earlier. Output values are -returned as an element in a Java array. - - bool *INOUT, bool &INOUT - signed char *INOUT, signed char &INOUT - unsigned char *INOUT, unsigned char &INOUT - short *INOUT, short &INOUT - unsigned short *INOUT, unsigned short &INOUT - int *INOUT, int &INOUT - unsigned int *INOUT, unsigned int &INOUT - long *INOUT, long &INOUT - unsigned long *INOUT, unsigned long &INOUT - long long *INOUT, long long &INOUT - unsigned long long *INOUT, unsigned long long &INOUT - float *INOUT, float &INOUT - double *INOUT, double &INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -This works similarly to C in that the mapping directly modifies the -input value - the input must be an array with a minimum of one element. -The element in the array is the input and the output is the element in -the array. - - double x[] = {5.0}; - neg(x); - -The implementation of the OUTPUT and INOUT typemaps is different to other -languages in that other languages will return the output value as part -of the function return value. This difference is due to Java being a typed language. - -There are no char *INOUT typemaps, however you can apply the signed char * typemaps instead: - %include - %apply signed char *INOUT {char *inout}; - void f(char *inout); -*/ - -%define INOUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE) -%typemap(jni) TYPE *INOUT, TYPE &INOUT %{JNITYPE##Array%} -%typemap(jtype) TYPE *INOUT, TYPE &INOUT "JTYPE[]" -%typemap(jstype) TYPE *INOUT, TYPE &INOUT "JTYPE[]" -%typemap(javain) TYPE *INOUT, TYPE &INOUT "$javainput" -%typemap(javadirectorin) TYPE *INOUT, TYPE &INOUT "$jniinput" -%typemap(javadirectorout) TYPE *INOUT, TYPE &INOUT "$javacall" - -%typemap(in) TYPE *INOUT, TYPE &INOUT { - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - $1 = ($1_ltype) JCALL2(Get##JAVATYPE##ArrayElements, jenv, $input, 0); -} - -%typemap(freearg) TYPE *INOUT, TYPE &INOUT "" - -%typemap(argout) TYPE *INOUT, TYPE &INOUT -{ JCALL3(Release##JAVATYPE##ArrayElements, jenv, $input, (JNITYPE *)$1, 0); } - -%typemap(directorin,descriptor=JNIDESC) TYPE &INOUT %{ - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - JNITYPE $1_jvalue = (JNITYPE)$1; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorin,descriptor=JNIDESC) TYPE *INOUT %{ - if ($1) { - $input = JCALL1(New##JAVATYPE##Array, jenv, 1); - if (!$input) return $null; - JNITYPE $1_jvalue = (JNITYPE)*$1; - JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - } - Swig::LocalRefGuard $1_refguard(jenv, $input); %} - -%typemap(directorargout, noblock=1) TYPE &INOUT -{ - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = ($*1_ltype)$1_jvalue; -} - -%typemap(directorargout, noblock=1) TYPE *INOUT -{ - if ($result) { - JNITYPE $1_jvalue; - JCALL4(Get##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = ($*1_ltype)$1_jvalue; - } -} - -%typemap(typecheck) TYPE *INOUT = TYPECHECKTYPE; -%typemap(typecheck) TYPE &INOUT = TYPECHECKTYPE; -%enddef - -INOUT_TYPEMAP(bool, jboolean, boolean, Boolean, "[Z", jbooleanArray); -INOUT_TYPEMAP(signed char, jbyte, byte, Byte, "[B", jbyteArray); -INOUT_TYPEMAP(unsigned char, jshort, short, Short, "[S", jshortArray); -INOUT_TYPEMAP(short, jshort, short, Short, "[S", jshortArray); -INOUT_TYPEMAP(unsigned short, jint, int, Int, "[I", jintArray); -INOUT_TYPEMAP(int, jint, int, Int, "[I", jintArray); -INOUT_TYPEMAP(unsigned int, jlong, long, Long, "[J", jlongArray); -INOUT_TYPEMAP(long, jint, int, Int, "[I", jintArray); -INOUT_TYPEMAP(unsigned long, jlong, long, Long, "[J", jlongArray); -INOUT_TYPEMAP(long long, jlong, long, Long, "[J", jlongArray); -INOUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, Object, "[java/math/BigInteger;", jobjectArray); -INOUT_TYPEMAP(float, jfloat, float, Float, "[F", jfloatArray); -INOUT_TYPEMAP(double, jdouble, double, Double, "[D", jdoubleArray); - -#undef INOUT_TYPEMAP - -/* Override typemaps in the INOUT_TYPEMAP macro for booleans to fix casts - as a jboolean isn't always the same size as a bool */ -%typemap(in) bool *INOUT (bool btemp, jboolean *jbtemp), bool &INOUT (bool btemp, jboolean *jbtemp) { - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - jbtemp = JCALL2(GetBooleanArrayElements, jenv, $input, 0); - btemp = (*jbtemp) ? true : false; - $1 = &btemp; -} - -%typemap(argout) bool *INOUT, bool &INOUT { - *jbtemp$argnum = btemp$argnum ? (jboolean)1 : (jboolean)0; - JCALL3(ReleaseBooleanArrayElements, jenv, $input , (jboolean *)jbtemp$argnum, 0); -} - -%typemap(directorargout, noblock=1) bool &INOUT -{ - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - $result = $1_jvalue ? true : false; -} - -%typemap(directorargout, noblock=1) bool *INOUT -{ - if ($result) { - jboolean $1_jvalue; - JCALL4(GetBooleanArrayRegion, jenv, $input, 0, 1, &$1_jvalue); - *$result = $1_jvalue ? true : false; - } -} - - -/* Override the typemap in the INOUT_TYPEMAP macro for unsigned long long */ -%typemap(in) unsigned long long *INOUT ($*1_ltype temp), unsigned long long &INOUT ($*1_ltype temp) { - jobject bigint; - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!$input) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return $null; - } - if (JCALL1(GetArrayLength, jenv, $input) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return $null; - } - bigint = JCALL2(GetObjectArrayElement, jenv, $input, 0); - if (!bigint) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array element null"); - return $null; - } - clazz = JCALL1(GetObjectClass, jenv, bigint); - mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); - ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, bigint, mid); - bae = JCALL2(GetByteArrayElements, jenv, ba, 0); - sz = JCALL1(GetArrayLength, jenv, ba); - temp = 0; - if (sz > 0) { - temp = ($*1_ltype)(signed char)bae[0]; - for(i=1; igetPrivateObject()->tryAllowDestroyInGC(); %} \ No newline at end of file diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_common.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_common.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_complex.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_complex.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_deque.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_deque.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_except.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_except.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_map.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_map.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_pair.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_pair.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_string.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_string.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_vector.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/std_vector.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/stl.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/stl.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/cocos/typemaps.i b/win64/bin/swig/share/swig/4.1.0/javascript/cocos/typemaps.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/arrays_javascript.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/arrays_javascript.i deleted file mode 100755 index 471d3933..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/arrays_javascript.i +++ /dev/null @@ -1,94 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_javascript.i - * - * These typemaps give more natural support for arrays. The typemaps are not efficient - * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from JavaScript and vice versa. The JavaScript array is expected to be the same size as the C array. - * An exception is thrown if they are not. - * - * Example usage: - * Wrapping: - * - * %include - * %inline %{ - * extern int FiddleSticks[3]; - * %} - * - * Use from JavaScript like this: - * - * var fs = [10, 11, 12]; - * example.FiddleSticks = fs; - * fs = example.FiddleSticks; - * ----------------------------------------------------------------------------- */ - - -%fragment("SWIG_JSCGetIntProperty", "header", fragment=SWIG_AsVal_frag(int)) {} -%fragment("SWIG_JSCGetNumberProperty", "header", fragment=SWIG_AsVal_frag(double)) {} -%fragment("SWIG_JSCOutInt", "header", fragment=SWIG_From_frag(int)) {} -%fragment("SWIG_JSCOutNumber", "header", fragment=SWIG_From_frag(double)) {} - -%define JAVASCRIPT_ARRAYS_IN_DECL(NAME, CTYPE, ANY, ANYLENGTH) - -%typemap(in, fragment=NAME) CTYPE[ANY] { - if (JSValueIsObject(context, $input)) - { - int i; - // Convert into Array - JSObjectRef array = JSValueToObject(context, $input, NULL); - - int length = ANYLENGTH; - - $1 = ($*1_ltype *)malloc(sizeof($*1_ltype) * length); - - // Get each element from array - for (i = 0; i < length; i++) - { - JSValueRef jsvalue = JSObjectGetPropertyAtIndex(context, array, i, NULL); - $*1_ltype temp; - - // Get primitive value from JSObject - int res = SWIG_AsVal(CTYPE)(jsvalue, &temp); - if (!SWIG_IsOK(res)) - { - SWIG_exception_fail(SWIG_ERROR, "Failed to convert $input to double"); - } - arg$argnum[i] = temp; - } - } - else - { - SWIG_exception_fail(SWIG_ERROR, "$input is not JSObjectRef"); - } -} - -%typemap(freearg) CTYPE[ANY] { - free($1); -} - -%enddef - -%define JAVASCRIPT_ARRAYS_OUT_DECL(NAME, CTYPE) - -%typemap(out, fragment=NAME) CTYPE[ANY] { - int length = $1_dim0; - JSValueRef values[length]; - int i; - - for (i = 0; i < length; i++) - { - values[i] = SWIG_From(CTYPE)($1[i]); - } - - $result = JSObjectMakeArray(context, length, values, NULL); -} - -%enddef - -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, , SWIGJSC_ArrayLength(context, array)) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, ANY, $1_dim0) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, , SWIGJSC_ArrayLength(context, array)) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, ANY, $1_dim0) - -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutInt", int) -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutNumber", double) - diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/ccomplex.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/ccomplex.i deleted file mode 100755 index 7eaae0e7..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/ccomplex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ccomplex.i - * - * C complex typemaps - * ISO C99: 7.3 Complex arithmetic - * ----------------------------------------------------------------------------- */ - - -%include - -%{ -#include -%} - -#define complex _Complex - -/* C complex constructor */ -#define CCplxConst(r, i) ((r) + I*(i)) - -%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); - -/* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/cdata.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/cdata.i deleted file mode 100755 index 1c6de446..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/complex.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/complex.i deleted file mode 100755 index ee3e1d3c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/complex.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __cplusplus -%include -#else -%include -#endif - diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/exception.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/exception.i deleted file mode 100755 index 1aa231df..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/exception.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascript.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascript.swg deleted file mode 100755 index 652410e2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascript.swg +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascript.swg - * - * Javascript typemaps - * ----------------------------------------------------------------------------- */ - -%include - -%include - -%include - -%include - -%include - -%include - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcode.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcode.swg deleted file mode 100755 index f9f8e47d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcode.swg +++ /dev/null @@ -1,429 +0,0 @@ -/* ----------------------------------------------------------------------------- - * js_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - goto fail; - fail: - return NULL; -} -%} - -/* ----------------------------------------------------------------------------- - * js_veto_ctor: a vetoing ctor for abstract classes - * - $jswrapper: name of wrapper - * - $jsname: class name - * ----------------------------------------------------------------------------- */ -%fragment ("js_veto_ctor", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, - size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - SWIG_exception(SWIG_ERROR, "Class $jsname can not be instantiated"); -fail: - return 0; -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatcher: dispatcher for overloaded constructors - * - $jswrapper: name of wrapper - * - $jsname: class name - * - $jsdispatchcases: part containing code for dispatching - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatcher", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, - size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSObjectRef thisObject = NULL; - - // switch all cases by means of series of if-returns. - $jsdispatchcases - - // default: - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of $jsname"); - - fail: - return thisObject; -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ -%fragment ("js_overloaded_ctor", "templates") -%{ -static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - $jscode - return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - - goto fail; - fail: - return NULL; -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatch_case: template for a dispatch case for calling an overloaded ctor. - * - $jsargcount: number of arguments of called ctor - * - $jswrapper: wrapper of called ctor - * - * Note: a try-catch-like mechanism is used to switch cases - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatch_case", "templates") -%{ - if(argc == $jsargcount) { - thisObject = $jswrapper(context, NULL, argc, argv, exception); - if(thisObject != NULL) { *exception=0; return thisObject; } /* reset exception and return */ - } -%} - - -/* ----------------------------------------------------------------------------- - * js_dtor: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtor", "templates") -%{ -static void $jswrapper(JSObjectRef thisObject) -{ - SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); - if(t) { - if (t->swigCMemOwn) { - free (($jstype)t->swigCObject); - } - JSObjectSetPrivate(thisObject, NULL); - free(t); - } -} -%} - -/* ----------------------------------------------------------------------------- - * js_dtor: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * - ${destructor_action}: The custom destructor action to invoke. - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtoroverride", "templates") -%{ -static void $jswrapper(JSObjectRef thisObject) -{ - SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); - if(t) { - if (t->swigCMemOwn) { - $jstype arg1 = ($jstype)t->swigCObject; - ${destructor_action} - } - /* remove the private data to make sure that it isn't accessed elsewhere */ - JSObjectSetPrivate(thisObject, NULL); - free(t); - } -} -%} - -/* ----------------------------------------------------------------------------- - * js_getter: template for getter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_getter", "templates") -%{ -static JSValueRef $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) -{ - $jslocals - JSValueRef jsresult; - - $jscode - return jsresult; - - goto fail; - fail: - return JSValueMakeUndefined(context); -} -%} - -/* ----------------------------------------------------------------------------- - * js_setter: template for setter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_setter", "templates") -%{ -static bool $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) -{ - $jslocals - $jscode - - return true; - - goto fail; - fail: - return false; -} -%} - -/* ----------------------------------------------------------------------------- - * js_function: template for function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function", "templates") -%{ -static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - JSValueRef jsresult; - - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - return jsresult; - - goto fail; - fail: - return JSValueMakeUndefined(context); -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatcher: template for a function dispatcher for overloaded functions - * - $jswrapper: wrapper function name - * - $jsname: name of the wrapped function - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function_dispatcher", "templates") -%{ -static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - $jslocals - JSValueRef jsresult; - int res; - $jscode - - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function $jsname."); - return jsresult; - - goto fail; - fail: - return JSValueMakeUndefined(context); -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_function: template for a overloaded function - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_overloaded_function", "templates") -%{ -static int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception, JSValueRef* p_result) -{ - $jslocals - JSValueRef jsresult; - - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - *p_result = jsresult; - return SWIG_OK; - - goto fail; - fail: - return SWIG_TypeError; -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatch_case: template for a case used in the function dispatcher - * - $jswrapper: wrapper function name - * - $jsargcount: number of arguments of overloaded function - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function_dispatch_case", "templates") -%{ - if(argc == $jsargcount) { - res = $jswrapper(context, function, thisObject, argc, argv, exception, &jsresult); - if(res == SWIG_OK) { *exception = 0; return jsresult; } - } -%} - -/* ----------------------------------------------------------------------------- - * jsc_variable_declaration: template for a variable table entry - * - $jsname: name of the variable - * - $jsgetter: wrapper of getter function - * - $jssetter: wrapper of setter function - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_variable_declaration", "templates") -%{ - {"$jsname", $jsgetter, $jssetter, kJSPropertyAttributeNone}, -%} - - -/* ----------------------------------------------------------------------------- - * jsc_function_declaration: template for a function table entry - * - $jsname: name of the variable - * - $jswrapper: wrapper function - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_function_declaration", "templates") -%{ - {"$jsname", $jswrapper, kJSPropertyAttributeNone}, -%} - -/* ----------------------------------------------------------------------------- - * jsc_classtemplate_declaration: template for a namespace declaration - * - $jsmangledname: mangled class name - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_declaration", "templates") -%{ -static JSClassDefinition $jsmangledname_classDefinition; - -static JSClassDefinition $jsmangledname_objectDefinition; - -static JSClassRef $jsmangledname_classRef; -%} - -/* ----------------------------------------------------------------------------- - * jsc_class_tables: template for a namespace declaration - * - $jsmangledname: mangled class name - * - $jsstaticclassvariables: list of static variable entries - * - $jsstaticclassfunctions: list of static function entries - * - $jsclassvariables: list of member variable entries - * - $jsclassfunctions: list of member function entries - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_tables", "templates") -%{ -static JSStaticValue $jsmangledname_staticValues[] = { - $jsstaticclassvariables - { 0, 0, 0, 0 } -}; - -static JSStaticFunction $jsmangledname_staticFunctions[] = { - $jsstaticclassfunctions - { 0, 0, 0 } -}; - -static JSStaticValue $jsmangledname_values[] = { - $jsclassvariables - { 0, 0, 0, 0 } -}; - -static JSStaticFunction $jsmangledname_functions[] = { - $jsclassfunctions - { 0, 0, 0 } -}; -%} - -/* ----------------------------------------------------------------------------- - * jsc_define_class_template: template for defining a class template - * - $jsmangledname: mangled class name - * - $jsmangledtype: mangled class type - * - $jsctor: wrapper of ctor - * - $jsbaseclass: mangled name of base class - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_definition", "templates") -%{ - $jsmangledname_classDefinition.staticFunctions = $jsmangledname_staticFunctions; - $jsmangledname_classDefinition.staticValues = $jsmangledname_staticValues; - $jsmangledname_classDefinition.callAsConstructor = $jsctor; - $jsmangledname_objectDefinition.finalize = $jsdtor; - $jsmangledname_objectDefinition.staticValues = $jsmangledname_values; - $jsmangledname_objectDefinition.staticFunctions = $jsmangledname_functions; - $jsclass_inheritance - $jsmangledname_classRef = JSClassCreate(&$jsmangledname_objectDefinition); - SWIGTYPE_$jsmangledtype->clientdata = $jsmangledname_classRef; -%} - -%fragment ("jsc_class_inherit", templates) -%{ - if (SWIGTYPE_p$jsbaseclassmangled != NULL) { - $jsmangledname_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p$jsbaseclassmangled->clientdata; - } -%} - -%fragment ("jsc_class_noinherit", templates) -%{ - $jsmangledname_objectDefinition.parentClass = _SwigObject_classRef; -%} - - -/* ----------------------------------------------------------------------------- - * jsc_register_class: template for registration of a class - * - $jsname: class name - * - $jsmangledname: mangled class name - * - $jsnspace: mangled name of namespace - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_class_registration", "templates") -%{ - JS_registerClass(context, $jsnspace_object, "$jsname", &$jsmangledname_classDefinition); -%} - - -/* ----------------------------------------------------------------------------- - * jsc_nspace_declaration: template for a namespace declaration - * - $jsnspace: mangled name of the namespace - * - $jsglobalvariables: list of variable entries - * - $jsglobalfunctions: list of function entries - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_nspace_declaration", "templates") -%{ -static JSStaticValue $jsnspace_values[] = { - $jsglobalvariables - { 0, 0, 0, 0 } -}; - -static JSStaticFunction $jsnspace_functions[] = { - $jsglobalfunctions - { 0, 0, 0 } -}; - -static JSClassDefinition $jsnspace_classDefinition; -static JSObjectRef $jsmangledname_object; -%} - -/* ----------------------------------------------------------------------------- - * jsc_nspace_definition: template for definition of a namespace object - * - $jsmangledname: mangled name of namespace - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_nspace_definition", "templates") -%{ - $jsmangledname_classDefinition.staticFunctions = $jsmangledname_functions; - $jsmangledname_classDefinition.staticValues = $jsmangledname_values; - $jsmangledname_object = JSObjectMake(context, JSClassCreate(&$jsmangledname_classDefinition), NULL); -%} - -/* ----------------------------------------------------------------------------- - * jsc_nspace_registration: template for registration of a namespace object - * - $jsname: name of namespace - * - $jsmangledname: mangled name of namespace - * - $jsparent: mangled name of parent namespace - * ----------------------------------------------------------------------------- */ -%fragment ("jsc_nspace_registration", "templates") -%{ - JS_registerNamespace(context, $jsmangledname_object, $jsparent_object, "$jsname"); -%} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcomplex.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcomplex.swg deleted file mode 100755 index 47dcfc13..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptcomplex.swg +++ /dev/null @@ -1,146 +0,0 @@ -/* - Defines the As/From converters for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header", - fragment=SWIG_From_frag(double)) -{ -SWIGINTERNINLINE JSObjectRef -SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) -{ - JSValueRef vals[2]; - vals[0] = SWIG_From(double)(Real(c)); - vals[1] = SWIG_From(double)(Imag(c)); - return JSObjectMakeArray(context, 2, vals, NULL); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ -SWIGINTERN int -SWIG_AsVal_dec(Type) (JSValueRef o, Type* val) -{ - if (JSValueIsObject(context, o)) { - JSObjectRef array; - JSValueRef exception, js_re, js_im; - double re, im; - int res; - - exception = 0; - res = 0; - - array = JSValueToObject(context, o, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_re = JSObjectGetPropertyAtIndex(context, array, 0, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_im = JSObjectGetPropertyAtIndex(context, array, 1, &exception); - if(exception != 0) - return SWIG_TypeError; - - res = SWIG_AsVal(double)(js_re, &re); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(js_im, &im); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if (val) *val = Constructor(re, im); - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { -SWIGINTERN int -SWIG_AsVal_dec(Type)(JSValueRef o, Type *val) -{ - if (JSValueIsObject(context, o)) { - JSObjectRef array; - JSValueRef exception, js_re, js_im; - double re, im; - int res; - - exception = 0; - res = 0; - - array = JSValueToObject(context, o, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_re = JSObjectGetPropertyAtIndex(context, array, 0, &exception); - if(exception != 0) - return SWIG_TypeError; - - js_im = JSObjectGetPropertyAtIndex(context, array, 1, &exception); - if(exception != 0) - return SWIG_TypeError; - - res = SWIG_AsVal(double)(js_re, &re); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(js_im, &im); - if(!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0f); - return res; - } - } - return SWIG_TypeError; -} -} - -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptfragments.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptfragments.swg deleted file mode 100755 index 1680e765..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'javascriptfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the default ones defined by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascripthelpers.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascripthelpers.swg deleted file mode 100755 index bffec9a6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascripthelpers.swg +++ /dev/null @@ -1,69 +0,0 @@ -%insert(wrapper) %{ - -SWIGINTERN bool JS_registerClass(JSGlobalContextRef context, JSObjectRef parentObject, - const char* className, - JSClassDefinition* definition) { - - JSStringRef js_className = JSStringCreateWithUTF8CString(className); - JSObjectRef classObject = JSObjectMake(context, JSClassCreate(definition), NULL); - JSObjectSetProperty(context, parentObject, - js_className, classObject, - kJSPropertyAttributeNone, NULL); - JSStringRelease(js_className); - - return true; -} - -SWIGINTERN bool JS_registerNamespace(JSGlobalContextRef context, - JSObjectRef namespaceObj, JSObjectRef parentNamespace, - const char* name) -{ - JSStringRef js_name = JSStringCreateWithUTF8CString(name); - JSObjectSetProperty(context, parentNamespace, - js_name, namespaceObj, - kJSPropertyAttributeNone, NULL); - JSStringRelease(js_name); - - return true; -} - - -SWIGINTERN bool JS_registerFunction(JSGlobalContextRef context, JSObjectRef object, - const char* functionName, JSObjectCallAsFunctionCallback callback) -{ - JSStringRef js_functionName = JSStringCreateWithUTF8CString(functionName); - JSObjectSetProperty(context, object, js_functionName, - JSObjectMakeFunctionWithCallback(context, js_functionName, callback), - kJSPropertyAttributeNone, NULL); - JSStringRelease(js_functionName); - return true; -} - -SWIGINTERN bool JS_veto_set_variable(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) -{ - char buffer[256]; - char msg[512]; - int res; - - JSStringGetUTF8CString(propertyName, buffer, 256); - res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); - - if(res<0) { - SWIG_exception(SWIG_ERROR, "Tried to write read-only variable."); - } else { - SWIG_exception(SWIG_ERROR, msg); - } -fail: - return false; -} - -SWIGINTERN JSValueRef JS_CharPtrToJSValue(JSContextRef context, char* cstr) { - JSValueRef val; - - JSStringRef jsstring = JSStringCreateWithUTF8CString((char*) cstr); - val = JSValueMakeString(context, jsstring); - JSStringRelease(jsstring); - - return val; -} -%} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptinit.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptinit.swg deleted file mode 100755 index e90f9438..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptinit.swg +++ /dev/null @@ -1,112 +0,0 @@ -%insert(init) %{ -SWIGRUNTIME void -SWIG_JSC_SetModule(JSGlobalContextRef context, swig_module_info *swig_module) { - JSObjectRef globalObject; - JSStringRef moduleName; - JSClassDefinition classDef; - JSClassRef classRef; - JSObjectRef object; - - if(context == 0){ - return; - } - - globalObject = JSContextGetGlobalObject(context); - moduleName = JSStringCreateWithUTF8CString("swig_module_info_data"); - - classDef = kJSClassDefinitionEmpty; - classRef = JSClassCreate(&classDef); - - object = JSObjectMake(context, classRef, NULL); - JSObjectSetPrivate(object, (void*)swig_module); - - JSObjectSetProperty(context, globalObject, moduleName, object, kJSPropertyAttributeNone, NULL); - - JSClassRelease(classRef); - JSStringRelease(moduleName); -} -SWIGRUNTIME swig_module_info * -SWIG_JSC_GetModule(JSGlobalContextRef context) { - JSObjectRef globalObject; - JSStringRef moduleName; - JSValueRef value; - JSObjectRef object; - - if(context == 0){ - return 0; - } - - globalObject = JSContextGetGlobalObject(context); - moduleName = JSStringCreateWithUTF8CString("swig_module_info_data"); - - if(JSObjectHasProperty(context, globalObject, moduleName) == false) { - JSStringRelease(moduleName); - return 0; - } - - value = JSObjectGetProperty(context, globalObject, moduleName, NULL); - object = JSValueToObject(context, value, NULL); - JSStringRelease(moduleName); - - return (swig_module_info*)JSObjectGetPrivate(object); -} - -#define SWIG_GetModule(clientdata) SWIG_JSC_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_JSC_SetModule(clientdata, pointer) -#define SWIG_INIT_CLIENT_DATA_TYPE JSGlobalContextRef -%} - -%insert(init) "swiginit.swg" - -%fragment ("js_initializer_define", "templates") %{ -#define SWIGJSC_INIT $jsname_initialize -%} - -// Open the initializer function -%insert(init) -%{ - -#ifdef __cplusplus -extern "C" { -#endif - -bool SWIGJSC_INIT (JSGlobalContextRef context, JSObjectRef *exports) { - SWIG_InitializeModule(context); -%} - -/* ----------------------------------------------------------------------------- - * js_initializer: template for the module initializer function - * - $jsname: module name - * - $jscreatenamespaces: part with code for creating namespace objects - * - $jscreateclasses: part with code for creating classes - * - $jsregisternamespaces: part with code for registration of namespaces - * ----------------------------------------------------------------------------- */ -%fragment ("js_initializer", "templates") %{ - /* Initialize the base swig type object */ - _SwigObject_objectDefinition.staticFunctions = _SwigObject_functions; - _SwigObject_objectDefinition.staticValues = _SwigObject_values; - _SwigObject_classRef = JSClassCreate(&_SwigObject_objectDefinition); - - /* Initialize the PackedData class */ - _SwigPackedData_objectDefinition.staticFunctions = _SwigPackedData_functions; - _SwigPackedData_objectDefinition.staticValues = _SwigPackedData_values; - _SwigPackedData_objectDefinition.finalize = _wrap_SwigPackedData_delete; - _SwigPackedData_classRef = JSClassCreate(&_SwigPackedData_objectDefinition); - - /* Create objects for namespaces */ - $jscreatenamespaces - - /* Register classes */ - $jsregisterclasses - - /* Register namespaces */ - $jsregisternamespaces - - *exports = exports_object; - - return true; -} -#ifdef __cplusplus -} -#endif -%} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptkw.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptkw.swg deleted file mode 100755 index 57a1aeb8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptkw.swg +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef JAVASCRIPT_JAVASCRIPTKW_SWG_ -#define JAVASCRIPT_JAVASCRIPTKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVASCRIPTKW(x) %keywordwarn("'" `x` "' is a javascript keyword, renaming to '_"`x`"'",rename="_%s") `x` - -/* Taken from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words */ - -JAVASCRIPTKW(break); -JAVASCRIPTKW(case); -JAVASCRIPTKW(catch); -JAVASCRIPTKW(continue); -JAVASCRIPTKW(default); -JAVASCRIPTKW(delete); -JAVASCRIPTKW(do); -JAVASCRIPTKW(else); -JAVASCRIPTKW(finally); -JAVASCRIPTKW(for); -JAVASCRIPTKW(function); -JAVASCRIPTKW(if); -JAVASCRIPTKW(in); -JAVASCRIPTKW(instanceof); -JAVASCRIPTKW(new); -JAVASCRIPTKW(return); -JAVASCRIPTKW(switch); -JAVASCRIPTKW(this); -JAVASCRIPTKW(throw); -JAVASCRIPTKW(try); -JAVASCRIPTKW(typeof); -JAVASCRIPTKW(var); -JAVASCRIPTKW(void); -JAVASCRIPTKW(while); -JAVASCRIPTKW(with); - -/* others bad names if any*/ -// for example %namewarn("321:clone() is a javascript bad method name") *::clone(); - -#undef JAVASCRIPTKW - -#endif //JAVASCRIPT_JAVASCRIPTKW_SWG_ diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptprimtypes.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptprimtypes.swg deleted file mode 100755 index 874137a4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptprimtypes.swg +++ /dev/null @@ -1,192 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE -JSValueRef SWIG_From_dec(bool)(bool value) -{ - return JSValueMakeBoolean(context, value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN -int SWIG_AsVal_dec(bool)(JSValueRef obj, bool *val) -{ - if(!JSValueIsBoolean(context, obj)) { - return SWIG_ERROR; - } - if (val) *val = JSValueToBoolean(context, obj); - return SWIG_OK; -} -} - -/* int */ - -%fragment(SWIG_From_frag(int),"header") { -SWIGINTERNINLINE JSValueRef - SWIG_From_dec(int)(int value) -{ - return JSValueMakeNumber(context, value); -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE JSValueRef -SWIG_From_dec(long)(long value) -{ - return JSValueMakeNumber(context, value); -} -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(long)(JSValueRef obj, long* val) -{ - if (!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - if(val) *val = (long) JSValueToNumber(context, obj, NULL); - - return SWIG_OK; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE JSValueRef -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return (value > LONG_MAX) ? - JSValueMakeNumber(context, value) : JSValueMakeNumber(context, %numeric_cast(value,long)); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(JSValueRef obj, unsigned long *val) -{ - long longVal; - if(!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - - longVal = (long) JSValueToNumber(context, obj, NULL); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -} - -/* long long */ -// Note: these are copied from 'long' and probably need fixing - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE JSValueRef -SWIG_From_dec(long long)(long long value) -{ - return JSValueMakeNumber(context, value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment=SWIG_AsVal_frag(long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(JSValueRef obj, long long* val) -{ - if (!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - if(val) *val = (long long) JSValueToNumber(context, obj, NULL); - - return SWIG_OK; -} -%#endif -} - -/* unsigned long long */ -// Note: these are copied from 'unsigned long' and probably need fixing - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment=SWIG_From_frag(long long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN JSValueRef -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return (value > LONG_MAX) ? - JSValueMakeNumber(context, value) : JSValueMakeNumber(context, %numeric_cast(value,long)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(JSValueRef obj, unsigned long long *val) -{ - long long longVal; - if(!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - - longVal = (unsigned long long) JSValueToNumber(context, obj, NULL); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERN JSValueRef -SWIG_From_dec(double) (double val) -{ - return JSValueMakeNumber(context, val); -} -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(JSValueRef obj, double *val) -{ - if(!JSValueIsNumber(context, obj)) { - return SWIG_TypeError; - } - if(val) *val = JSValueToNumber(context, obj, NULL); - - return SWIG_OK; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptrun.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptrun.swg deleted file mode 100755 index 2a212890..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptrun.swg +++ /dev/null @@ -1,369 +0,0 @@ -/* ---------------------------------------------------------------------------- - * Errors and exceptions - * - * ---------------------------------------------------------------------------*/ - -#define SWIG_Error(code, msg) SWIG_JSC_exception(context, exception, code, msg) -#define SWIG_exception(code, msg) do { SWIG_JSC_exception(context, exception, code, msg); SWIG_fail; } while (0) -#define SWIG_fail goto fail - -SWIGRUNTIME void SWIG_Javascript_Raise_ValueRef(JSContextRef context, JSValueRef *exception, JSValueRef valRef) { - JSValueRef error_arguments[1]; - JSObjectRef exception_object; - /* Converting the result to an object will let JavascriptCore add - "sourceURL" (file) and "line" (number) and "message" to the exception, - instead of just returning a raw string. This is extremely important for debugging your errors. - Using JSObjectMakeError is better than JSValueToObject because the latter only populates - "sourceURL" and "line", but not "message" or any others I don't know about. - */ - error_arguments[0] = valRef; - exception_object = JSObjectMakeError(context, 1, error_arguments, NULL); - - /* Return the exception_object */ - *exception = exception_object; -} - -SWIGRUNTIME void SWIG_Javascript_Raise(JSContextRef context, JSValueRef *exception, const char* msg) { - JSStringRef message = JSStringCreateWithUTF8CString(msg); - JSValueRef exception_value = JSValueMakeString(context, message); - - SWIG_Javascript_Raise_ValueRef(context, exception, exception_value); - - JSStringRelease(message); -} - -SWIGRUNTIME void SWIG_JSC_exception(JSContextRef context, JSValueRef *exception, int code, const char* msg) { - SWIG_Javascript_Raise(context, exception, msg); -} - -/* ---------------------------------------------------------------------------- - * The parent class of all Proxies - * - * ---------------------------------------------------------------------------*/ - -typedef struct { - bool swigCMemOwn; - void *swigCObject; - swig_type_info *info; -} SwigPrivData; - -SWIGRUNTIME JSValueRef _wrap_SwigObject_disown(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSValueRef jsresult; - - JSObjectRef obj = JSValueToObject(context, thisObject, NULL); - SwigPrivData *cdata = (SwigPrivData *) JSObjectGetPrivate(obj); - - cdata->swigCMemOwn = false; - - jsresult = JSValueMakeUndefined(context); - return jsresult; -} - -SWIGRUNTIME JSValueRef _wrap_SwigObject_getCPtr(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSValueRef jsresult; - long result; - - JSObjectRef obj = JSValueToObject(context, thisObject, NULL); - SwigPrivData *cdata = (SwigPrivData*) JSObjectGetPrivate(obj); - - result = (long) cdata->swigCObject; - jsresult = JSValueMakeNumber(context, result); - - return jsresult; -} - -SWIGRUNTIME JSValueRef _wrap_SwigObject_equals(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) -{ - JSValueRef jsresult; - bool result; - - JSObjectRef obj = JSValueToObject(context, thisObject, NULL); - SwigPrivData *cdata = (SwigPrivData*) JSObjectGetPrivate(obj); - - JSObjectRef obj2 = JSValueToObject(context, argv[0], NULL); - SwigPrivData *cdata2 = (SwigPrivData*) JSObjectGetPrivate(obj2); - - result = (cdata->swigCObject == cdata2->swigCObject); - jsresult = JSValueMakeBoolean(context, result); - - return jsresult; -} - -SWIGRUNTIME JSStaticValue _SwigObject_values[] = { - { - 0, 0, 0, 0 - } -}; - -SWIGRUNTIME JSStaticFunction _SwigObject_functions[] = { - { - "disown",_wrap_SwigObject_disown, kJSPropertyAttributeNone - }, - { - "equals",_wrap_SwigObject_equals, kJSPropertyAttributeNone - }, - { - "getCPtr",_wrap_SwigObject_getCPtr, kJSPropertyAttributeNone - }, - { - 0, 0, 0 - } -}; - -SWIGRUNTIME JSClassDefinition _SwigObject_objectDefinition; - -SWIGRUNTIME JSClassRef _SwigObject_classRef; - - -SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** ptr, swig_type_info *info, int flags) { - SwigPrivData *cdata; - - cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); - if (cdata == NULL) { - return SWIG_ERROR; - } - assert(ptr); - *ptr = NULL; - if (!info || cdata->info == info) { - *ptr = cdata->swigCObject; - } else { - swig_cast_info *tc = SWIG_TypeCheckStruct(cdata->info, info); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, cdata->swigCObject, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !cdata->swigCMemOwn) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (flags & SWIG_POINTER_DISOWN) { - cdata->swigCMemOwn = false; - } - if (flags & SWIG_POINTER_CLEAR) { - cdata->swigCObject = 0; - } - } - - return SWIG_OK; -} - -SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { - JSObjectRef objRef; - - /* special case: JavaScript null => C NULL pointer */ - if(JSValueIsNull(context, valRef)) { - *ptr=0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - if(!JSValueIsObject(context, valRef)) { - return SWIG_TypeError; - } - - objRef = JSValueToObject(context, valRef, NULL); - if(objRef == NULL) { - return SWIG_ERROR; - } - - return SWIG_JSC_ConvertInstancePtr(context, objRef, ptr, info, flags); -} - -SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, swig_type_info *info, int flags) { - JSClassRef classRef; - JSObjectRef result; - SwigPrivData *cdata; - - if (ptr == NULL) { - // HACK: it is not possible to use JSValueToObject (causing seg-fault) - // This static cast turned out to be a workaround - // In future, we should change the interface of this method - // to return JSValueRef instead of JSObjectRef. - return (JSObjectRef) JSValueMakeNull(context); - } - - if(info->clientdata == NULL) { - classRef = _SwigObject_classRef; - } else { - classRef = (JSClassRef) info->clientdata; - } - - result = JSObjectMake(context, classRef, NULL); - - cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); - cdata->swigCObject = ptr; - cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; - cdata->info = info; - - JSObjectSetPrivate(result, cdata); - - return result; -} - -#define SWIG_ConvertPtr(obj, ptr, info, flags) SWIG_JSC_ConvertPtr(context, obj, ptr, info, flags) -#define SWIG_NewPointerObj(ptr, info, flags) SWIG_JSC_NewPointerObj(context, ptr, info, flags) - -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_JSC_ConvertInstancePtr(context, obj, pptr, type, flags) -#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_JSC_NewPointerObj(context, thisvalue, type, flags) - -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_JSC_ConvertPtr(context, obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_JSC_NewPointerObj(context, ptr, type, 0) - -/* ---------------------------------------------------------------------------- - * A class for packed data - * - * ---------------------------------------------------------------------------*/ - -typedef struct { - void *data; - size_t size; - swig_type_info *type; -} SwigPackedData; - -SWIGRUNTIME JSStaticValue _SwigPackedData_values[] = { - { - 0, 0, 0, 0 - } -}; -SWIGRUNTIME JSStaticFunction _SwigPackedData_functions[] = { - { - 0, 0, 0 - } -}; -SWIGRUNTIME JSClassDefinition _SwigPackedData_objectDefinition; -SWIGRUNTIME JSClassRef _SwigPackedData_classRef; - -SWIGRUNTIMEINLINE -int SwigJSCPacked_Check(JSContextRef context, JSValueRef valRef) { - return JSValueIsObjectOfClass(context, valRef, _SwigPackedData_classRef); -} - -SWIGRUNTIME -swig_type_info* SwigJSCPacked_UnpackData(JSContextRef context, JSValueRef valRef, void *ptr, size_t size) { - if (SwigJSCPacked_Check(context, valRef)) { - JSObjectRef objRef = JSValueToObject(context, valRef, NULL); - SwigPackedData *sobj = (SwigPackedData *) JSObjectGetPrivate(objRef); - if (sobj->size != size) return 0; - memcpy(ptr, sobj->data, size); - return sobj->type; - } else { - return 0; - } -} - -SWIGRUNTIME -int SWIG_JSC_ConvertPacked(JSContextRef context, JSValueRef valRef, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigJSCPacked_UnpackData(context, valRef, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -SWIGRUNTIME -JSValueRef SWIG_JSC_NewPackedObj(JSContextRef context, void *data, size_t size, swig_type_info *type) { - - JSClassRef classRef = _SwigObject_classRef; - JSObjectRef result = JSObjectMake(context, classRef, NULL); - - SwigPackedData* cdata = (SwigPackedData*) malloc(sizeof(SwigPackedData)); - cdata->data = data; - cdata->size = size; - cdata->type = type; - - JSObjectSetPrivate(result, cdata); - - return result; -} - -/* SwigPackedData wrappers */ -SWIGRUNTIME -void _wrap_SwigPackedData_delete(JSObjectRef obj) -{ - SwigPackedData* cdata = (SwigPackedData*) JSObjectGetPrivate(obj); - if (cdata) { - free(cdata->data); - } -} - -/* for C++ member pointers, ie, member methods */ - -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_JSC_ConvertPacked(context, obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_JSC_NewPackedObj(context, ptr, sz, type) - - -/* --------------------------------------------------------------------------- - * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) - * - * ---------------------------------------------------------------------------*/ -SWIGRUNTIME -unsigned int SWIGJSC_ArrayLength(JSContextRef context, JSObjectRef arr) { - static JSStringRef LENGTH = 0; - JSValueRef exception = NULL; - JSValueRef js_length; - double length; - - if (LENGTH == 0) { - LENGTH = JSStringCreateWithUTF8CString("length"); - } - - js_length = JSObjectGetProperty(context, arr, LENGTH, &exception); - if (exception == 0 && JSValueIsNumber(context, js_length)) { - length = JSValueToNumber(context, js_length, 0); - return (unsigned int) length; - } else { - return 0; - } -} - -SWIGRUNTIME -bool SWIGJSC_ValueIsArray(JSContextRef context, JSValueRef value) { - if (JSValueIsObject(context, value)) { - static JSStringRef ArrayString = NULL; - static JSStringRef isArrayString = NULL; - JSObjectRef array = NULL; - JSObjectRef isArray = NULL; - JSValueRef retval = NULL; - - if (!ArrayString) - ArrayString = JSStringCreateWithUTF8CString("Array"); - if (!isArrayString) - isArrayString = JSStringCreateWithUTF8CString("isArray"); - - array = (JSObjectRef)JSObjectGetProperty(context, JSContextGetGlobalObject(context), ArrayString, NULL); - isArray = (JSObjectRef)JSObjectGetProperty(context, array, isArrayString, NULL); - retval = JSObjectCallAsFunction(context, isArray, NULL, 1, &value, NULL); - - if (JSValueIsBoolean(context, retval)) - return JSValueToBoolean(context, retval); - } - return false; -} - -SWIGRUNTIME -JSValueRef SWIGJSC_AppendOutput(JSContextRef context, JSValueRef value, JSValueRef obj) { - JSObjectRef arr; - unsigned int length; - - if (JSValueIsUndefined(context, value)) { - arr = JSObjectMakeArray(context, 0, 0, 0); - } else if (!SWIGJSC_ValueIsArray(context, value)) { - arr = JSObjectMakeArray(context, 1, &value, 0); - } else { - arr = JSValueToObject(context, value, 0); - } - - length = SWIGJSC_ArrayLength(context, arr); - JSObjectSetPropertyAtIndex(context, arr, length, obj, 0); - return arr; -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptruntime.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptruntime.swg deleted file mode 100755 index 41f8e2f6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptruntime.swg +++ /dev/null @@ -1,20 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascriptruntime.swg - * - * Javascript support code - * ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ -#include -#include -#include -#include -#include -#include -#include -%} - -%insert(runtime) "swigrun.swg"; /* SWIG API */ -%insert(runtime) "swigerrors.swg"; /* SWIG errors */ - -%insert(runtime) "javascriptrun.swg"; /* SWIG errors */ diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptstrings.swg b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptstrings.swg deleted file mode 100755 index 87a6e7ce..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/javascriptstrings.swg +++ /dev/null @@ -1,187 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_JSC_AsCharPtrAndSize(JSContextRef context, JSValueRef valRef, char** cptr, size_t* psize, int *alloc) -{ - if(JSValueIsString(context, valRef)) { - JSStringRef js_str = JSValueToStringCopy(context, valRef, NULL); - size_t len = JSStringGetMaximumUTF8CStringSize(js_str); - char* cstr = (char*) %new_array(len, char); - /* JSStringGetUTF8CString returns the length including 0-terminator */ - len = JSStringGetUTF8CString(js_str, cstr, len); - - if(alloc) *alloc = SWIG_NEWOBJ; - if(psize) *psize = len; - if(cptr) *cptr = cstr; - - return SWIG_OK; - } else { - if(JSValueIsObject(context, valRef)) { - JSObjectRef obj = JSValueToObject(context, valRef, NULL); - // try if the object is a wrapped char[] - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - return SWIG_TypeError; - } else { - return SWIG_TypeError; - } - } -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE JSValueRef -SWIG_JSC_FromCharPtrAndSize(JSContextRef context, const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - // TODO: handle extra long strings - //swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - //return pchar_descriptor ? - // SWIG_InternalNewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : SWIG_Py_Void(); - return JSValueMakeUndefined(context); - } else { - JSStringRef jsstring; - JSValueRef result; - if(size < 2) { - char c[2]; - int i; - for(i=0;i - -/* Look for user fragments file. */ -%include - -/* Javascript fragments for fundamental types */ -%include - -/* Javascript fragments for char* strings */ -%include - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -#define SWIG_Object JSValueRef -#define VOID_Object JSValueMakeUndefined(context) - -/* append output */ -#define SWIG_AppendOutput(result, obj) SWIGJSC_AppendOutput(context, result, obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) - -/* raise */ -#define SWIG_Raise(obj, type, desc) SWIG_Javascript_Raise_ValueRef(context, exception, obj) - -%insert("runtime") %{ -#define SWIG_JSC_FROM_DECL_ARGS(arg1) (JSContextRef context, arg1) -#define SWIG_JSC_FROM_CALL_ARGS(arg1) (context, arg1) -#define SWIG_JSC_AS_DECL_ARGS(arg1, arg2) (JSContextRef context, arg1, arg2) -#define SWIG_JSC_AS_CALL_ARGS(arg1, arg2) (context, arg1, arg2) -%} - -/* Include the unified typemap library */ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_auto_ptr.i deleted file mode 100755 index 304f1fc9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_common.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_common.i deleted file mode 100755 index c80263ae..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_complex.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_complex.i deleted file mode 100755 index 464e6f31..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_complex.i +++ /dev/null @@ -1,26 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_deque.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_except.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_except.i deleted file mode 100755 index 3e056e7d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_map.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_map.i deleted file mode 100755 index 626942eb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_map.i +++ /dev/null @@ -1,81 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_pair.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_pair.i deleted file mode 100755 index 539130ff..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_string.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_string.i deleted file mode 100755 index 0afc2468..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_unique_ptr.i deleted file mode 100755 index 79320de6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_vector.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_vector.i deleted file mode 100755 index dca90ff3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/std_vector.i +++ /dev/null @@ -1,99 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/swigmove.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/swigmove.i deleted file mode 100755 index 03e87fa2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/typemaps.i b/win64/bin/swig/share/swig/4.1.0/javascript/jsc/typemaps.i deleted file mode 100755 index 0ad6ce85..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/jsc/typemaps.i +++ /dev/null @@ -1,148 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Python tuple. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Python output of the function would be a tuple containing both -output values. - -*/ - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Python tuple. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Python). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Python variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/arrays_javascript.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/arrays_javascript.i deleted file mode 100755 index d70c983f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/arrays_javascript.i +++ /dev/null @@ -1,86 +0,0 @@ -/* ----------------------------------------------------------------------------- - * arrays_javascript.i - * - * These typemaps give more natural support for arrays. The typemaps are not efficient - * as there is a lot of copying of the array values whenever the array is passed to C/C++ - * from JavaScript and vice versa. The JavaScript array is expected to be the same size as the C array. - * An exception is thrown if they are not. - * - * Example usage: - * Wrapping: - * - * %include - * %inline %{ - * extern int FiddleSticks[3]; - * %} - * - * Use from JavaScript like this: - * - * var fs = [10, 11, 12]; - * example.FiddleSticks = fs; - * fs = example.FiddleSticks; - * ----------------------------------------------------------------------------- */ - - -%fragment("SWIG_JSCGetIntProperty", "header", fragment=SWIG_AsVal_frag(int)) {} -%fragment("SWIG_JSCGetNumberProperty", "header", fragment=SWIG_AsVal_frag(double)) {} -%fragment("SWIG_JSCOutInt", "header", fragment=SWIG_From_frag(int)) {} -%fragment("SWIG_JSCOutNumber", "header", fragment=SWIG_From_frag(double)) {} - -%define JAVASCRIPT_ARRAYS_IN_DECL(NAME, CTYPE, ANY, ANYLENGTH) - -%typemap(in, fragment=NAME) CTYPE[ANY] { - if ($input->IsArray()) { - // Convert into Array - v8::Local array = v8::Local::Cast($input); - - int length = ANYLENGTH; - - $1 = ($*1_ltype *)malloc(sizeof($*1_ltype) * length); - - // Get each element from array - for (int i = 0; i < length; i++) { - v8::Local jsvalue = SWIGV8_ARRAY_GET(array, i); - $*1_ltype temp; - - // Get primitive value from JSObject - int res = SWIG_AsVal(CTYPE)(jsvalue, &temp); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ERROR, "Failed to convert $input to double"); - } - arg$argnum[i] = temp; - } - } else { - SWIG_exception_fail(SWIG_ERROR, "$input is not an array"); - } -} - -%typemap(freearg) CTYPE[ANY] { - free($1); -} - -%enddef - -%define JAVASCRIPT_ARRAYS_OUT_DECL(NAME, CTYPE) - -%typemap(out, fragment=NAME) CTYPE[ANY] { - int length = $1_dim0; - v8::Local array = SWIGV8_ARRAY_NEW(length); - - for (int i = 0; i < length; i++) { - SWIGV8_ARRAY_SET(array, i, SWIG_From(CTYPE)($1[i])); - } - - $result = array; -} - -%enddef - -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, , array->Length()) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetIntProperty", int, ANY, $1_dim0) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, , array->Length()) -JAVASCRIPT_ARRAYS_IN_DECL("SWIG_JSCGetNumberProperty", double, ANY, $1_dim0) - -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutInt", int) -JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_JSCOutNumber", double) - diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/ccomplex.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/ccomplex.i deleted file mode 100755 index 7eaae0e7..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/ccomplex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ccomplex.i - * - * C complex typemaps - * ISO C99: 7.3 Complex arithmetic - * ----------------------------------------------------------------------------- */ - - -%include - -%{ -#include -%} - -#define complex _Complex - -/* C complex constructor */ -#define CCplxConst(r, i) ((r) + I*(i)) - -%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); - -/* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/cdata.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/cdata.i deleted file mode 100755 index 1c6de446..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/complex.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/complex.i deleted file mode 100755 index ee3e1d3c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/complex.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __cplusplus -%include -#else -%include -#endif - diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/exception.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/exception.i deleted file mode 100755 index 1aa231df..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/exception.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascript.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascript.swg deleted file mode 100755 index 652410e2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascript.swg +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascript.swg - * - * Javascript typemaps - * ----------------------------------------------------------------------------- */ - -%include - -%include - -%include - -%include - -%include - -%include - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcode.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcode.swg deleted file mode 100755 index 5daf6dfb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcode.swg +++ /dev/null @@ -1,435 +0,0 @@ -/* ----------------------------------------------------------------------------- - * js_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ - -%fragment("js_ctor", "templates") %{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_OBJECT self = args.Holder(); - $jslocals - if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper."); - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - $jscode - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_veto_ctor: a vetoing ctor for abstract classes - * - $jswrapper: name of wrapper - * - $jsname: class name - * ----------------------------------------------------------------------------- */ -%fragment ("js_veto_ctor", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIG_exception(SWIG_ERROR, "Class $jsname can not be instantiated"); -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatcher: dispatcher for overloaded constructors - * - $jswrapper: name of wrapper - * - $jsname: class name - * - $jsdispatchcases: part containing code for dispatching - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatcher", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - OverloadErrorHandler errorHandler; - SWIGV8_VALUE self; - - // switch all cases by means of series of if-returns. - $jsdispatchcases - - // default: - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of $jsmangledname"); - -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_ctor: template for wrapping a ctor. - * - $jswrapper: wrapper of called ctor - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * - $jsargcount: number of arguments - * - $jsmangledtype: mangled type of class - * ----------------------------------------------------------------------------- */ -%fragment("js_overloaded_ctor", "templates") %{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_OBJECT self = args.Holder(); - $jslocals - if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper."); - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - $jscode - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_ctor_dispatch_case: template for a dispatch case for calling an overloaded ctor. - * - $jsargcount: number of arguments of called ctor - * - $jswrapper: wrapper of called ctor - * - * Note: a try-catch-like mechanism is used to switch cases - * ----------------------------------------------------------------------------- */ -%fragment ("js_ctor_dispatch_case", "templates") -%{ - if(args.Length() == $jsargcount) { - errorHandler.err.Clear(); - $jswrapper(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } - } -%} - -/* ----------------------------------------------------------------------------- - * js_dtor: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtor", "templates") -%{ - -static void $jswrapper(const v8::WeakCallbackInfo &data) { - SWIGV8_Proxy *proxy = data.GetParameter(); - - if(proxy->swigCMemOwn && proxy->swigCObject) { -#ifdef SWIGRUNTIME_DEBUG - printf("Deleting wrapped instance: %s\n", proxy->info->name); -#endif - $jsfree proxy->swigCObject; - } - delete proxy; -} -%} - -/* ----------------------------------------------------------------------------- - * js_dtoroverride: template for a destructor wrapper - * - $jsmangledname: mangled class name - * - $jstype: class type - * - ${destructor_action}: The custom destructor action to invoke. - * ----------------------------------------------------------------------------- */ -%fragment ("js_dtoroverride", "templates") -%{ -static void $jswrapper(const v8::WeakCallbackInfo &data) { - SWIGV8_Proxy *proxy = data.GetParameter(); - - if(proxy->swigCMemOwn && proxy->swigCObject) { - $jstype arg1 = ($jstype)proxy->swigCObject; - ${destructor_action} - } - delete proxy; -} -%} - -/* ----------------------------------------------------------------------------- - * js_getter: template for getter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_getter", "templates") -%{ -static SwigV8ReturnValue $jswrapper(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - $jslocals - $jscode - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} -%} - -/* ----------------------------------------------------------------------------- - * js_setter: template for setter function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_setter", "templates") -%{ -static void $jswrapper(v8::Local property, v8::Local value, const SwigV8PropertyCallbackInfoVoid &info) { - SWIGV8_HANDLESCOPE(); - - $jslocals - $jscode - goto fail; -fail: - return; -} -%} - -/* ----------------------------------------------------------------------------- - * js_function: template for function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_function", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - $jslocals - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); - - $jscode - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatcher: template for a function dispatcher for overloaded functions - * - $jswrapper: wrapper function name - * - $jsname: name of the wrapped function - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment("js_function_dispatcher", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - OverloadErrorHandler errorHandler; - $jscode - - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function $jsname."); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_overloaded_function: template for a overloaded function - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_overloaded_function", "templates") -%{ -static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) -{ - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - $jslocals - $jscode - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} -%} - -/* ----------------------------------------------------------------------------- - * js_function_dispatch_case: template for a case used in the function dispatcher - * - $jswrapper: wrapper function name - * - $jsargcount: number of arguments of overloaded function - * - $jscode: code part of wrapper - * ----------------------------------------------------------------------------- */ -%fragment ("js_function_dispatch_case", "templates") -%{ - - if(args.Length() == $jsargcount) { - errorHandler.err.Clear(); - $jswrapper(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } - } -%} - -/* ----------------------------------------------------------------------------- - * jsv8_declare_class_template: template for a class template declaration. - * - $jsmangledname: mangled class name - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_declare_class_template", "templates") -%{ - SWIGV8_ClientData $jsmangledname_clientData; -%} - -/* ----------------------------------------------------------------------------- - * jsv8_define_class_template: template for a class template definition. - * - $jsmangledname: mangled class name - * - $jsmangledtype: mangled class type - * - $jsdtor: the dtor wrapper - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_define_class_template", "templates") -%{ - /* Name: $jsmangledname, Type: $jsmangledtype, Dtor: $jsdtor */ - SWIGV8_FUNCTION_TEMPLATE $jsmangledname_class = SWIGV8_CreateClassTemplate("$jsmangledname"); - SWIGV8_SET_CLASS_TEMPL($jsmangledname_clientData.class_templ, $jsmangledname_class); - $jsmangledname_clientData.dtor = $jsdtor; - if (SWIGTYPE_$jsmangledtype->clientdata == 0) { - SWIGTYPE_$jsmangledtype->clientdata = &$jsmangledname_clientData; - } -%} - - -/* ----------------------------------------------------------------------------- - * jsv8_inherit: template for an class inherit statement. - * - $jsmangledname: mangled class name - * - $jsbaseclass: mangled name of the base class - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_inherit", "templates") -%{ - if (SWIGTYPE_p$jsbaseclass->clientdata && !(static_cast(SWIGTYPE_p$jsbaseclass->clientdata)->class_templ.IsEmpty())) - { - $jsmangledname_class->Inherit( - v8::Local::New( - v8::Isolate::GetCurrent(), - static_cast(SWIGTYPE_p$jsbaseclass->clientdata)->class_templ) - ); - -#ifdef SWIGRUNTIME_DEBUG - printf("Inheritance successful $jsmangledname $jsbaseclass\n"); -#endif - } else { -#ifdef SWIGRUNTIME_DEBUG - printf("Unable to inherit baseclass, it didn't exist $jsmangledname $jsbaseclass\n"); -#endif - } -%} - -/* ----------------------------------------------------------------------------- - * jsv8_create_class_instance: template for creating an class object. - * - $jsname: class name - * - $jsmangledname: mangled class name - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_create_class_instance", "templates") -%{ - /* Class: $jsname ($jsmangledname) */ - SWIGV8_FUNCTION_TEMPLATE $jsmangledname_class_0 = SWIGV8_CreateClassTemplate("$jsname"); - $jsmangledname_class_0->SetCallHandler($jsctor); - $jsmangledname_class_0->Inherit($jsmangledname_class); -#if (SWIG_V8_VERSION < 0x0704) - $jsmangledname_class_0->SetHiddenPrototype(true); - v8::Local $jsmangledname_obj = $jsmangledname_class_0->GetFunction(); -#else - v8::Local $jsmangledname_obj = $jsmangledname_class_0->GetFunction(context).ToLocalChecked(); -#endif -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_class: template for a statement that registers a class in a parent namespace. - * - $jsname: class name - * - $jsmangledname: mangled class name - * - $jsparent: mangled name of parent namespace - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_class", "templates") -%{ - SWIGV8_MAYBE_CHECK($jsparent_obj->Set(context, SWIGV8_SYMBOL_NEW("$jsname"), $jsmangledname_obj)); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_create_namespace: template for a statement that creates a namespace object. - * - $jsmangledname: mangled namespace name - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_create_namespace", "templates") -%{ - SWIGV8_OBJECT $jsmangledname_obj = SWIGV8_OBJECT_NEW(); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_namespace: template for a statement that registers a namespace in a parent namespace. - * - $jsname: name of namespace - * - $jsmangledname: mangled name of namespace - * - $jsparent: mangled name of parent namespace - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_namespace", "templates") -%{ - SWIGV8_MAYBE_CHECK($jsparent_obj->Set(context, SWIGV8_SYMBOL_NEW("$jsname"), $jsmangledname_obj)); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_member_function: template for a statement that registers a member function. - * - $jsmangledname: mangled class name - * - $jsname: name of the function - * - $jswrapper: wrapper of the member function - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_member_function", "templates") -%{ - SWIGV8_AddMemberFunction($jsmangledname_class, "$jsname", $jswrapper); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_member_variable: template for a statement that registers a member variable. - * - $jsmangledname: mangled class name - * - $jsname: name of the function - * - $jsgetter: wrapper of the getter function - * - $jssetter: wrapper of the setter function - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_member_variable", "templates") -%{ - SWIGV8_AddMemberVariable($jsmangledname_class, "$jsname", $jsgetter, $jssetter); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_static_function: template for a statement that registers a static class function. - * - $jsname: function name - * - $jswrapper: wrapper of the function - * - $jsparent: mangled name of parent namespace - * - * Note: this template is also used for global functions. - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_static_function", "templates") -%{ - SWIGV8_AddStaticFunction($jsparent_obj, "$jsname", $jswrapper, context); -%} - -/* ----------------------------------------------------------------------------- - * jsv8_register_static_variable: template for a statement that registers a static variable. - * - $jsname: variable name - * - $jsparent: mangled name of parent namespace - * - $jsgetter: wrapper of the getter function - * - $jssetter: wrapper of the setter function - * - * Note: this template is also used for global variables. - * ----------------------------------------------------------------------------- */ -%fragment("jsv8_register_static_variable", "templates") -%{ - SWIGV8_AddStaticVariable($jsparent_obj, "$jsname", $jsgetter, $jssetter, context); -%} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcomplex.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcomplex.swg deleted file mode 100755 index 25bc1606..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptcomplex.swg +++ /dev/null @@ -1,124 +0,0 @@ -/* - Defines the As/From converters for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header", - fragment=SWIG_From_frag(double)) -{ -SWIGINTERNINLINE SWIGV8_VALUE -SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) -{ - SWIGV8_HANDLESCOPE_ESC(); - - v8::Local vals = SWIGV8_ARRAY_NEW(0); - - SWIGV8_ARRAY_SET(vals, 0, SWIG_From(double)(Real(c))); - SWIGV8_ARRAY_SET(vals, 1, SWIG_From(double)(Imag(c))); - SWIGV8_ESCAPE(vals); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ -SWIGINTERN int -SWIG_AsVal_dec(Type) (SWIGV8_VALUE o, Type* val) -{ - SWIGV8_HANDLESCOPE(); - - if (o->IsArray()) { - SWIGV8_ARRAY array = SWIGV8_ARRAY::Cast(o); - - if (array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); - double re, im; - int res; - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 0), &re); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 1), &im); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if (val) *val = Constructor(re, im); - return SWIG_OK; - } else if (o->IsNumber()) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { -SWIGINTERN int -SWIG_AsVal_dec(Type) (SWIGV8_VALUE o, Type* val) -{ - SWIGV8_HANDLESCOPE(); - - if (o->IsArray()) { - SWIGV8_ARRAY array = SWIGV8_ARRAY::Cast(o); - - if (array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); - double re, im; - int res; - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 0), &re); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - res = SWIG_AsVal(double)(SWIGV8_ARRAY_GET(array, 1), &im); - if (!SWIG_IsOK(res)) { - return SWIG_TypeError; - } - - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else if (o->IsNumber()) { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptfragments.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptfragments.swg deleted file mode 100755 index 1680e765..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'javascriptfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the default ones defined by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascripthelpers.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascripthelpers.swg deleted file mode 100755 index 36c8c681..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascripthelpers.swg +++ /dev/null @@ -1,87 +0,0 @@ -%insert(runtime) %{ - -typedef v8::FunctionCallback SwigV8FunctionCallback; -typedef v8::AccessorNameGetterCallback SwigV8AccessorGetterCallback; -typedef v8::AccessorNameSetterCallback SwigV8AccessorSetterCallback; -typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfoVoid; - -/** - * Creates a class template for a class with specified initialization function. - */ -SWIGRUNTIME SWIGV8_FUNCTION_TEMPLATE SWIGV8_CreateClassTemplate(const char* symbol) { - SWIGV8_HANDLESCOPE_ESC(); - - v8::Local class_templ = SWIGV8_FUNCTEMPLATE_NEW_VOID(); - class_templ->SetClassName(SWIGV8_SYMBOL_NEW(symbol)); - - SWIGV8_OBJECT_TEMPLATE inst_templ = class_templ->InstanceTemplate(); - inst_templ->SetInternalFieldCount(1); - - SWIGV8_OBJECT_TEMPLATE equals_templ = class_templ->PrototypeTemplate(); - equals_templ->Set(SWIGV8_SYMBOL_NEW("equals"), SWIGV8_FUNCTEMPLATE_NEW(_SWIGV8_wrap_equals)); - - SWIGV8_OBJECT_TEMPLATE cptr_templ = class_templ->PrototypeTemplate(); - cptr_templ->Set(SWIGV8_SYMBOL_NEW("getCPtr"), SWIGV8_FUNCTEMPLATE_NEW(_wrap_getCPtr)); - - SWIGV8_ESCAPE(class_templ); -} - -/** - * Registers a class method with given name for a given class template. - */ -SWIGRUNTIME void SWIGV8_AddMemberFunction(SWIGV8_FUNCTION_TEMPLATE class_templ, const char* symbol, - SwigV8FunctionCallback _func) { - SWIGV8_OBJECT_TEMPLATE proto_templ = class_templ->PrototypeTemplate(); - proto_templ->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)); -} - -/** - * Registers a class property with given name for a given class template. - */ -SWIGRUNTIME void SWIGV8_AddMemberVariable(SWIGV8_FUNCTION_TEMPLATE class_templ, const char* symbol, - SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) { - SWIGV8_OBJECT_TEMPLATE proto_templ = class_templ->InstanceTemplate(); - proto_templ->SetAccessor(SWIGV8_SYMBOL_NEW(symbol), getter, setter); -} - -/** - * Registers a class method with given name for a given object. - */ -SWIGRUNTIME void SWIGV8_AddStaticFunction(SWIGV8_OBJECT obj, const char* symbol, - const SwigV8FunctionCallback& _func, v8::Local context) { - SWIGV8_MAYBE_CHECK(obj->Set(context, SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)->GetFunction(context).ToLocalChecked())); -} - -/** - * Registers a class method with given name for a given object. - */ -SWIGRUNTIME void SWIGV8_AddStaticVariable(SWIGV8_OBJECT obj, const char* symbol, - SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter, - v8::Local context) { - SWIGV8_MAYBE_CHECK(obj->SetAccessor(context, SWIGV8_SYMBOL_NEW(symbol), getter, setter)); -} - -SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local value, const SwigV8PropertyCallbackInfoVoid& info) -{ - char buffer[256]; - char msg[512]; - int res; - - v8::Local sproperty; - if (property->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocal(&sproperty)) { - SWIGV8_WRITE_UTF8(sproperty, buffer, 256); - res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); - } - else { - res = -1; - } - - if(res<0) { - SWIG_exception(SWIG_ERROR, "Tried to write read-only variable."); - } else { - SWIG_exception(SWIG_ERROR, msg); - } -fail: ; -} - -%} // v8_helper_functions diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptinit.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptinit.swg deleted file mode 100755 index 631d1444..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptinit.swg +++ /dev/null @@ -1,126 +0,0 @@ -%insert(header) %{ -#include -%} - -%insert(init) %{ - -SWIGRUNTIME void -SWIG_V8_SetModule(v8::Local context, swig_module_info *swig_module) { - v8::Local global_obj = context->Global(); - v8::Local mod = SWIGV8_EXTERNAL_NEW(swig_module); - assert(!mod.IsEmpty()); - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("swig_module_info_data")); - global_obj->SetPrivate(context, privateKey, mod); -} - -SWIGRUNTIME swig_module_info * -SWIG_V8_GetModule(v8::Local context) { - v8::Local global_obj = context->Global(); - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("swig_module_info_data")); - v8::Local moduleinfo; - if (!global_obj->GetPrivate(context, privateKey).ToLocal(&moduleinfo)) - return 0; - - if (moduleinfo.IsEmpty() || moduleinfo->IsNull() || moduleinfo->IsUndefined()) - { - // It's not yet loaded - return 0; - } - - v8::Local moduleinfo_extern = v8::Local::Cast(moduleinfo); - - if (moduleinfo_extern.IsEmpty() || moduleinfo_extern->IsNull() || moduleinfo_extern->IsUndefined()) - { - // Something's not right - return 0; - } - - void *ptr = moduleinfo_extern->Value(); - assert(ptr); - swig_module_info *retptr = static_cast(ptr); - assert(retptr); - return retptr; -} - -#define SWIG_GetModule(clientdata) SWIG_V8_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_V8_SetModule(clientdata, pointer) -#define SWIG_INIT_CLIENT_DATA_TYPE v8::Local - -%} - -%insert(init) "swiginit.swg" - -// Open the initializer function definition here - -%fragment ("js_initializer_define", "templates") %{ -#define SWIGV8_INIT $jsname_initialize -%} - -%insert(init) %{ -#if !defined(NODE_MODULE_VERSION) || (NODE_MODULE_VERSION < 12) -// Note: 'extern "C"'' disables name mangling which makes it easier to load the symbol manually -extern "C" void SWIGV8_INIT (SWIGV8_OBJECT exports_obj) -#elif (NODE_MODULE_VERSION < 64) -void SWIGV8_INIT (SWIGV8_OBJECT exports_obj, SWIGV8_VALUE /*module*/, void*) -#else -void SWIGV8_INIT (SWIGV8_OBJECT exports_obj, SWIGV8_VALUE /*module*/, v8::Local context, void*) -#endif -{ -#if !defined(NODE_MODULE_VERSION) || NODE_MODULE_VERSION < 64 - v8::Local context = SWIGV8_CURRENT_CONTEXT(); -#endif - - SWIG_InitializeModule(context); -%} - - -/* ----------------------------------------------------------------------------- - * js_initializer: template for the module initializer function - * - $jsname: module name - * - $jsv8nspaces: part with code creating namespace objects - * - $jsv8classtemplates: part with code creating class templates - * - $jsv8wrappers: part with code that registers wrapper functions - * - $jsv8inheritance: part with inherit statements - * - $jsv8classinstances: part with code creating class objects - * - $jsv8staticwrappers: part with code adding static functions to class objects - * - $jsv8registerclasses: part with code that registers class objects in namespaces - * - $jsv8registernspaces: part with code that registers namespaces in parent namespaces - * ----------------------------------------------------------------------------- */ -%fragment("js_initializer", "templates") -%{ - // a class template for creating proxies of undefined types - SWIGV8_SET_CLASS_TEMPL(SWIGV8_SWIGTYPE_Proxy_class_templ, SWIGV8_CreateClassTemplate("SwigProxy")); - - /* create objects for namespaces */ - $jsv8nspaces - - /* create class templates */ - $jsv8classtemplates - - /* register wrapper functions */ - $jsv8wrappers - - /* setup inheritances */ - $jsv8inheritance - - /* class instances */ - $jsv8classinstances - - /* add static class functions and variables */ - $jsv8staticwrappers - - /* register classes */ - $jsv8registerclasses - - /* create and register namespace objects */ - $jsv8registernspaces -} - -#if defined(BUILDING_NODE_EXTENSION) -#if (NODE_MODULE_VERSION < 64) -NODE_MODULE($jsname, $jsname_initialize) -#else -NODE_MODULE_CONTEXT_AWARE($jsname, $jsname_initialize) -#endif -#endif -%} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptkw.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptkw.swg deleted file mode 100755 index 57a1aeb8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptkw.swg +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef JAVASCRIPT_JAVASCRIPTKW_SWG_ -#define JAVASCRIPT_JAVASCRIPTKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVASCRIPTKW(x) %keywordwarn("'" `x` "' is a javascript keyword, renaming to '_"`x`"'",rename="_%s") `x` - -/* Taken from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words */ - -JAVASCRIPTKW(break); -JAVASCRIPTKW(case); -JAVASCRIPTKW(catch); -JAVASCRIPTKW(continue); -JAVASCRIPTKW(default); -JAVASCRIPTKW(delete); -JAVASCRIPTKW(do); -JAVASCRIPTKW(else); -JAVASCRIPTKW(finally); -JAVASCRIPTKW(for); -JAVASCRIPTKW(function); -JAVASCRIPTKW(if); -JAVASCRIPTKW(in); -JAVASCRIPTKW(instanceof); -JAVASCRIPTKW(new); -JAVASCRIPTKW(return); -JAVASCRIPTKW(switch); -JAVASCRIPTKW(this); -JAVASCRIPTKW(throw); -JAVASCRIPTKW(try); -JAVASCRIPTKW(typeof); -JAVASCRIPTKW(var); -JAVASCRIPTKW(void); -JAVASCRIPTKW(while); -JAVASCRIPTKW(with); - -/* others bad names if any*/ -// for example %namewarn("321:clone() is a javascript bad method name") *::clone(); - -#undef JAVASCRIPTKW - -#endif //JAVASCRIPT_JAVASCRIPTKW_SWG_ diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptprimtypes.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptprimtypes.swg deleted file mode 100755 index fd8e46e8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptprimtypes.swg +++ /dev/null @@ -1,203 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE -SWIGV8_VALUE -SWIG_From_dec(bool)(bool value) -{ - return SWIGV8_BOOLEAN_NEW(value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN -int SWIG_AsVal_dec(bool)(SWIGV8_VALUE obj, bool *val) -{ - if(!obj->IsBoolean()) { - return SWIG_ERROR; - } - - if (val) *val = SWIGV8_BOOLEAN_VALUE(obj); - return SWIG_OK; -} -} - -/* int */ - -%fragment(SWIG_From_frag(int),"header") { -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(int)(int value) -{ - return SWIGV8_INT32_NEW(value); -} -} - -%fragment(SWIG_AsVal_frag(int),"header") { -SWIGINTERN -int SWIG_AsVal_dec(int)(SWIGV8_VALUE valRef, int* val) -{ - if (!valRef->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = SWIGV8_INTEGER_VALUE(valRef); - - return SWIG_OK; -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(long)(long value) -{ - return SWIGV8_NUMBER_NEW(value); -} -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN -int SWIG_AsVal_dec(long)(SWIGV8_VALUE obj, long* val) -{ - if (!obj->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = (long) SWIGV8_INTEGER_VALUE(obj); - - return SWIG_OK; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(unsigned long)(unsigned long value) -{ - return value <= UINT32_MAX ? (SWIGV8_VALUE)SWIGV8_INTEGER_NEW_UNS(value) : (SWIGV8_VALUE)SWIGV8_NUMBER_NEW(static_cast(value)); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN -int SWIG_AsVal_dec(unsigned long)(SWIGV8_VALUE obj, unsigned long *val) -{ - if(!obj->IsNumber()) { - return SWIG_TypeError; - } - - long longVal = (long) SWIGV8_NUMBER_VALUE(obj); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -} - -/* long long */ -// Note: these are copied from 'long' and probably need fixing - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(long long)(long long value) -{ - return SWIGV8_NUMBER_NEW(value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment=SWIG_AsVal_frag(long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN -int SWIG_AsVal_dec(long long)(SWIGV8_VALUE obj, long long* val) -{ - if (!obj->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = (long long) SWIGV8_INTEGER_VALUE(obj); - - return SWIG_OK; -} -%#endif -} - -/* unsigned long long */ -// Note: these are copied from 'unsigned long' and probably need fixing - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment=SWIG_From_frag(long long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE -SWIGV8_VALUE SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return value <= UINT32_MAX ? (SWIGV8_VALUE)SWIGV8_INTEGER_NEW_UNS(value) : (SWIGV8_VALUE)SWIGV8_NUMBER_NEW(static_cast(value)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN -int SWIG_AsVal_dec(unsigned long long)(SWIGV8_VALUE obj, unsigned long long *val) -{ - if(!obj->IsNumber()) { - return SWIG_TypeError; - } - - long long longVal = (long long) SWIGV8_NUMBER_VALUE(obj); - - if(longVal < 0) { - return SWIG_OverflowError; - } - - if(val) *val = longVal; - - return SWIG_OK; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERN -SWIGV8_VALUE SWIG_From_dec(double) (double val) -{ - return SWIGV8_NUMBER_NEW(val); -} -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN -int SWIG_AsVal_dec(double)(SWIGV8_VALUE obj, double *val) -{ - if(!obj->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = SWIGV8_NUMBER_VALUE(obj); - - return SWIG_OK; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptrun.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptrun.swg deleted file mode 100755 index 4c3d9983..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptrun.swg +++ /dev/null @@ -1,487 +0,0 @@ -/* --------------------------------------------------------------------------- - * These typedefs and defines are used to deal with v8 API changes - * - * Useful table of versions: https://nodejs.org/en/download/releases/ - * ---------------------------------------------------------------------------*/ - -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_STRING_NEW2(cstr, len) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::String::kNormalString, len) -#else -#define SWIGV8_STRING_NEW2(cstr, len) (v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::NewStringType::kNormal, len)).ToLocalChecked() -#endif - -typedef void SwigV8ReturnValue; -typedef v8::FunctionCallbackInfo SwigV8Arguments; -typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; -#define SWIGV8_RETURN(val) args.GetReturnValue().Set(val); return -#define SWIGV8_RETURN_INFO(val, info) info.GetReturnValue().Set(val); return - -#define SWIGV8_HANDLESCOPE() v8::HandleScope scope(v8::Isolate::GetCurrent()); -#define SWIGV8_HANDLESCOPE_ESC() v8::EscapableHandleScope scope(v8::Isolate::GetCurrent()); -#define SWIGV8_ESCAPE(val) return scope.Escape(val) - -#define SWIGV8_ADJUST_MEMORY(size) v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size) -#define SWIGV8_CURRENT_CONTEXT() v8::Isolate::GetCurrent()->GetCurrentContext() -#define SWIGV8_THROW_EXCEPTION(err) v8::Isolate::GetCurrent()->ThrowException(err) - -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_STRING_NEW(str) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str, v8::String::kNormalString) -#define SWIGV8_SYMBOL_NEW(sym) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym, v8::String::kNormalString) -#else -#define SWIGV8_STRING_NEW(str) (v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str, v8::NewStringType::kNormal)).ToLocalChecked() -#define SWIGV8_SYMBOL_NEW(sym) (v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym, v8::NewStringType::kNormal)).ToLocalChecked() -#endif - -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_MAYBE_CHECK(maybe) maybe.FromJust() -#else -#define SWIGV8_MAYBE_CHECK(maybe) maybe.Check() -#endif - -#define SWIGV8_ARRAY_NEW(size) v8::Array::New(v8::Isolate::GetCurrent(), size) -#define SWIGV8_BOOLEAN_NEW(bool) v8::Boolean::New(v8::Isolate::GetCurrent(), bool) -#define SWIGV8_EXTERNAL_NEW(val) v8::External::New(v8::Isolate::GetCurrent(), val) -#define SWIGV8_FUNCTEMPLATE_NEW(func) v8::FunctionTemplate::New(v8::Isolate::GetCurrent(), func) -#define SWIGV8_FUNCTEMPLATE_NEW_VOID() v8::FunctionTemplate::New(v8::Isolate::GetCurrent()) -#define SWIGV8_INT32_NEW(num) v8::Int32::New(v8::Isolate::GetCurrent(), num) -#define SWIGV8_INTEGER_NEW(num) v8::Integer::New(v8::Isolate::GetCurrent(), num) -#define SWIGV8_INTEGER_NEW_UNS(num) v8::Integer::NewFromUnsigned(v8::Isolate::GetCurrent(), num) -#define SWIGV8_NUMBER_NEW(num) v8::Number::New(v8::Isolate::GetCurrent(), num) -#define SWIGV8_OBJECT_NEW() v8::Object::New(v8::Isolate::GetCurrent()) -#define SWIGV8_UNDEFINED() v8::Undefined(v8::Isolate::GetCurrent()) -#define SWIGV8_ARRAY v8::Local -#define SWIGV8_FUNCTION_TEMPLATE v8::Local -#define SWIGV8_OBJECT v8::Local -#define SWIGV8_OBJECT_TEMPLATE v8::Local -#define SWIGV8_VALUE v8::Local -#define SWIGV8_NULL() v8::Null(v8::Isolate::GetCurrent()) -#define SWIGV8_ARRAY_GET(array, index) (array)->Get(SWIGV8_CURRENT_CONTEXT(), index).ToLocalChecked() -#define SWIGV8_ARRAY_SET(array, index, value) SWIGV8_MAYBE_CHECK((array)->Set(SWIGV8_CURRENT_CONTEXT(), index, value)) - -#define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ.Reset(v8::Isolate::GetCurrent(), class); - -#if SWIG_V8_VERSION < 0x0608 -#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject() -#define SWIGV8_TO_STRING(handle) (handle)->ToString() -#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue() -#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue() -#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue() -#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(buffer, len) -#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length() -#else -#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() -#define SWIGV8_TO_STRING(handle) (handle)->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() -#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() -#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() -#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(v8::Isolate::GetCurrent(), buffer, len) -#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length(v8::Isolate::GetCurrent()) -#if (SWIG_V8_VERSION < 0x0704) -#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() -#else -#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(v8::Isolate::GetCurrent()) -#endif -#endif - -/* --------------------------------------------------------------------------- - * Error handling - * - * ---------------------------------------------------------------------------*/ - -#define SWIG_Error(code, msg) SWIGV8_ErrorHandler.error(code, msg) -#define SWIG_exception(code, msg) do { SWIGV8_ErrorHandler.error(code, msg); SWIG_fail; } while (0) -#define SWIG_fail goto fail -#define SWIGV8_OVERLOAD false - -SWIGINTERN void SWIG_V8_Raise(const char *msg) { - SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_STRING_NEW(msg))); -} - -SWIGINTERN void SWIG_V8_Raise(SWIGV8_VALUE obj, const char *msg) { - SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_TO_STRING(obj))); -} - - -/* - Note: There are two contexts for handling errors. - A static V8ErrorHandler is used in not overloaded methods. - For overloaded methods the throwing type checking mechanism is used - during dispatching. As V8 exceptions can not be reset properly - the trick is to use a dynamic ErrorHandler with same local name as the global - one. - - - See definition of SWIG_Error above. - - See code templates 'JS_function_dispatcher', 'JS_functionwrapper_overload', - and 'JS_function_dispatch_case' in javascriptcode.swg - -*/ -class V8ErrorHandler { -public: - virtual ~V8ErrorHandler() {} - virtual void error(int code, const char *msg) { - SWIG_V8_Raise(msg); - } -}; -// this is used in usually -SWIGRUNTIME V8ErrorHandler SWIGV8_ErrorHandler; - -// instances of this are used in overloaded functions -class OverloadErrorHandler: public V8ErrorHandler { -public: - virtual void error(int code, const char *msg) { - err = v8::Exception::Error(SWIGV8_STRING_NEW(msg)); - if(code != SWIG_TypeError) { - SWIGV8_THROW_EXCEPTION(err); - } - } - SWIGV8_VALUE err; -}; - -/* --------------------------------------------------------------------------- - * Basic Proxy object - * - * ---------------------------------------------------------------------------*/ - -// Note: to trigger the v8 gc more often one can tell v8 about the memory consumption -// TODO: we could add a v8 specific parameter to control this value -#define SWIGV8_AVG_OBJ_SIZE 1000 - -class SWIGV8_Proxy { -public: - SWIGV8_Proxy(): swigCMemOwn(false), swigCObject(0), info(0) { - SWIGV8_ADJUST_MEMORY(SWIGV8_AVG_OBJ_SIZE); - }; - - ~SWIGV8_Proxy() { - handle.ClearWeak(); - handle.Reset(); - - SWIGV8_ADJUST_MEMORY(-SWIGV8_AVG_OBJ_SIZE); - } - - bool swigCMemOwn; - void *swigCObject; - swig_type_info *info; - v8::Persistent handle; -}; - -class SWIGV8_ClientData { -public: - v8::Persistent class_templ; - - void (*dtor) (const v8::WeakCallbackInfo &data); -}; - -SWIGRUNTIME v8::Persistent SWIGV8_SWIGTYPE_Proxy_class_templ; - -SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(SWIGV8_OBJECT objRef, void **ptr, swig_type_info *info, int flags) { - SWIGV8_HANDLESCOPE(); - - if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; - - SWIGV8_Proxy *cdata = static_cast(objRef->GetAlignedPointerFromInternalField(0)); - - if(cdata == NULL) { - return SWIG_ERROR; - } - if(info && cdata->info != info) { - swig_cast_info *tc = SWIG_TypeCheckStruct(cdata->info, info); - if (!tc && cdata->info->name) { - tc = SWIG_TypeCheck(cdata->info->name, info); - } - bool type_valid = tc != 0; - if(!type_valid) { - return SWIG_TypeError; - } - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, cdata->swigCObject, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - *ptr = cdata->swigCObject; - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !cdata->swigCMemOwn) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (flags & SWIG_POINTER_DISOWN) { - cdata->swigCMemOwn = false; - } - if (flags & SWIG_POINTER_CLEAR) { - cdata->swigCObject = 0; - } - } - return SWIG_OK; -} - - -SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackInfo &data) { - SWIGV8_Proxy *proxy = data.GetParameter(); - delete proxy; -} - -SWIGRUNTIME int SWIG_V8_GetInstancePtr(SWIGV8_VALUE valRef, void **ptr) { - if(!valRef->IsObject()) { - return SWIG_TypeError; - } - SWIGV8_OBJECT objRef = SWIGV8_OBJECT::Cast(valRef); - - if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; - - SWIGV8_Proxy *cdata = static_cast(objRef->GetAlignedPointerFromInternalField(0)); - - if(cdata == NULL) { - return SWIG_ERROR; - } - - *ptr = cdata->swigCObject; - - return SWIG_OK; -} - -SWIGRUNTIME void SWIGV8_SetPrivateData(SWIGV8_OBJECT obj, void *ptr, swig_type_info *info, int flags) { - SWIGV8_Proxy *cdata = new SWIGV8_Proxy(); - cdata->swigCObject = ptr; - cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; - cdata->info = info; - - obj->SetAlignedPointerInInternalField(0, cdata); - - cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); - - if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { - cdata->handle.SetWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor, v8::WeakCallbackType::kParameter); - } else { - cdata->handle.SetWeak(cdata, SWIGV8_Proxy_DefaultDtor, v8::WeakCallbackType::kParameter); - } - -#if (SWIG_V8_VERSION < 0x0704) - cdata->handle.MarkIndependent(); -// Looks like future versions do not require that anymore: -// https://monorail-prod.appspot.com/p/chromium/issues/detail?id=923361#c11 -#endif -} - -SWIGRUNTIME int SWIG_V8_ConvertPtr(SWIGV8_VALUE valRef, void **ptr, swig_type_info *info, int flags) { - SWIGV8_HANDLESCOPE(); - - /* special case: JavaScript null => C NULL pointer */ - if(valRef->IsNull()) { - *ptr=0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - if(!valRef->IsObject()) { - return SWIG_TypeError; - } - SWIGV8_OBJECT objRef = SWIGV8_OBJECT::Cast(valRef); - return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); -} - -SWIGRUNTIME SWIGV8_VALUE SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { - SWIGV8_HANDLESCOPE_ESC(); - - SWIGV8_FUNCTION_TEMPLATE class_templ; - - if (ptr == NULL) { - v8::Local result = SWIGV8_NULL(); - SWIGV8_ESCAPE(result); - } - - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - - if(info->clientdata != 0) { - class_templ = v8::Local::New(isolate, ((SWIGV8_ClientData*) info->clientdata)->class_templ); - } else { - class_templ = v8::Local::New(isolate, SWIGV8_SWIGTYPE_Proxy_class_templ); - } - - v8::Local result = class_templ->InstanceTemplate()->NewInstance(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked(); - - SWIGV8_SetPrivateData(result, ptr, info, flags); - - SWIGV8_ESCAPE(result); -} - -#define SWIG_ConvertPtr(obj, ptr, info, flags) SWIG_V8_ConvertPtr(obj, ptr, info, flags) -#define SWIG_NewPointerObj(ptr, info, flags) SWIG_V8_NewPointerObj(ptr, info, flags) - -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_V8_ConvertInstancePtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_V8_NewPointerObj(thisvalue, type, flags) - -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_V8_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_V8_NewPointerObj(ptr, type, 0) - -#define SWIG_GetInstancePtr(obj, ptr) SWIG_V8_GetInstancePtr(obj, ptr) - -SWIGRUNTIME SwigV8ReturnValue _SWIGV8_wrap_equals(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - void *arg1 = (void *) 0 ; - void *arg2 = (void *) 0 ; - bool result; - int res1; - int res2; - - if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for equals."); - - res1 = SWIG_GetInstancePtr(args.Holder(), &arg1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ERROR, "Could not get pointer from 'this' object for equals."); - } - res2 = SWIG_GetInstancePtr(args[0], &arg2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "equals" "', argument " "1"" of type '" "void *""'"); - } - - result = (bool)(arg1 == arg2); - jsresult = SWIGV8_BOOLEAN_NEW(result); - - SWIGV8_RETURN(jsresult); - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - -SWIGRUNTIME SwigV8ReturnValue _wrap_getCPtr(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_VALUE jsresult; - void *arg1 = (void *) 0 ; - long result; - int res1; - - res1 = SWIG_GetInstancePtr(args.Holder(), &arg1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getCPtr" "', argument " "1"" of type '" "void *""'"); - } - - result = (long)arg1; - jsresult = SWIGV8_NUMBER_NEW(result); - - SWIGV8_RETURN(jsresult); - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - -/* --------------------------------------------------------------------------- - * PackedData object - * - * ---------------------------------------------------------------------------*/ - -class SwigV8PackedData { -public: - SwigV8PackedData(void *data, size_t size, swig_type_info *type): data(data), size(size), type(type) {}; - - ~SwigV8PackedData() { - }; - - void *data; - size_t size; - swig_type_info *type; - - v8::Persistent handle; -}; - -SWIGRUNTIMEINLINE -int SwigV8Packed_Check(SWIGV8_VALUE valRef) { - SWIGV8_HANDLESCOPE(); - - SWIGV8_OBJECT objRef = SWIGV8_TO_OBJECT(valRef); - if(objRef->InternalFieldCount() < 1) return false; - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("__swig__packed_data__")); - v8::Local flag; - if (!objRef->GetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey).ToLocal(&flag)) - return false; - return (flag->IsBoolean() && SWIGV8_BOOLEAN_VALUE(flag)); -} - -SWIGRUNTIME -swig_type_info *SwigV8Packed_UnpackData(SWIGV8_VALUE valRef, void *ptr, size_t size) { - if (SwigV8Packed_Check(valRef)) { - SWIGV8_HANDLESCOPE(); - - SwigV8PackedData *sobj; - - SWIGV8_OBJECT objRef = SWIGV8_TO_OBJECT(valRef); - - sobj = static_cast(objRef->GetAlignedPointerFromInternalField(0)); - if (sobj == NULL || sobj->size != size) return 0; - memcpy(ptr, sobj->data, size); - return sobj->type; - } else { - return 0; - } -} - -SWIGRUNTIME -int SWIGV8_ConvertPacked(SWIGV8_VALUE valRef, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigV8Packed_UnpackData(valRef, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackInfo &data) { - SwigV8PackedData *cdata = data.GetParameter(); - delete cdata; -} - -SWIGRUNTIME -SWIGV8_VALUE SWIGV8_NewPackedObj(void *data, size_t size, swig_type_info *type) { - SWIGV8_HANDLESCOPE_ESC(); - - SwigV8PackedData *cdata = new SwigV8PackedData(data, size, type); -// v8::Handle obj = SWIGV8_OBJECT_NEW(); - v8::Local obj = SWIGV8_OBJECT_NEW(); - - v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("__swig__packed_data__")); - obj->SetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey, SWIGV8_BOOLEAN_NEW(true)); - - obj->SetAlignedPointerInInternalField(0, cdata); - - cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); - - cdata->handle.SetWeak(cdata, _wrap_SwigV8PackedData_delete, v8::WeakCallbackType::kParameter); - -#if (SWIG_V8_VERSION < 0x0704) - cdata->handle.MarkIndependent(); -// Looks like future versions do not require that anymore: -// https://monorail-prod.appspot.com/p/chromium/issues/detail?id=923361#c11 -#endif - - SWIGV8_ESCAPE(obj); - -} - -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIGV8_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIGV8_NewPackedObj(ptr, sz, type) - - -/* --------------------------------------------------------------------------- - * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) - * - * ---------------------------------------------------------------------------*/ - -SWIGRUNTIME - -SWIGV8_VALUE SWIGV8_AppendOutput(SWIGV8_VALUE result, SWIGV8_VALUE obj) { - SWIGV8_HANDLESCOPE_ESC(); - - if (result->IsUndefined()) { - result = SWIGV8_ARRAY_NEW(0); - } else if (!result->IsArray()) { - SWIGV8_ARRAY tmparr = SWIGV8_ARRAY_NEW(0); - SWIGV8_ARRAY_SET(tmparr, 0, result); - result = tmparr; - } - - SWIGV8_ARRAY arr = SWIGV8_ARRAY::Cast(result); - SWIGV8_ARRAY_SET(arr, arr->Length(), obj); - SWIGV8_ESCAPE(arr); -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptruntime.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptruntime.swg deleted file mode 100755 index c986eef0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptruntime.swg +++ /dev/null @@ -1,47 +0,0 @@ -/* ----------------------------------------------------------------------------- - * javascriptruntime.swg - * - * ----------------------------------------------------------------------------- */ - -// V8 Version Macro -// ---------------- -// -// v8 added version macros V8_MAJOR_VERSION, V8_MINOR_VERSION, V8_BUILD_NUMBER -// and V8_PATCH_LEVEL in version 4.3.0. SWIG doesn't support anything that -// old so SWIG generated code can rely on these. - -// Node support -// ------------ - -#ifdef BUILDING_NODE_EXTENSION -%insert("runtime") %{ -#include -//Older version of node.h does not include this -#include -%} -#endif - - -// V8 runtime -// ---------- - -%insert(runtime) %{ -#include - -#undef SWIG_V8_VERSION -#define SWIG_V8_VERSION ((V8_MAJOR_VERSION / 10) * 4096 + \ - (V8_MAJOR_VERSION % 10) * 256 + \ - (V8_MINOR_VERSION / 10) * 16 + \ - (V8_MINOR_VERSION % 10)) - -#include -#include -#include -#include -%} - -%insert(runtime) "swigrun.swg"; /* SWIG API */ -%insert(runtime) "swigerrors.swg"; /* SWIG errors */ - -%insert(runtime) "javascriptrun.swg" - diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptstrings.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptstrings.swg deleted file mode 100755 index 08613772..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascriptstrings.swg +++ /dev/null @@ -1,59 +0,0 @@ - -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ -%fragment("SWIG_AsCharPtrAndSize", "header", fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(SWIGV8_VALUE valRef, char** cptr, size_t* psize, int *alloc) -{ - if(valRef->IsString()) { - v8::Local js_str = v8::Local::Cast(valRef); - - size_t len = SWIGV8_UTF8_LENGTH(js_str) + 1; - char* cstr = (char*) %new_array(len, char); - SWIGV8_WRITE_UTF8(js_str, cstr, len); - - if(alloc) *alloc = SWIG_NEWOBJ; - if(psize) *psize = len; - if(cptr) *cptr = cstr; - - return SWIG_OK; - } else { - if(valRef->IsObject()) { - SWIGV8_OBJECT obj = SWIGV8_OBJECT::Cast(valRef); - // try if the object is a wrapped char[] - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - return SWIG_TypeError; - } else { - return SWIG_TypeError; - } - } -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE SWIGV8_VALUE -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - // TODO: handle extra long strings - return SWIGV8_UNDEFINED(); - } else { - v8::Local js_str = SWIGV8_STRING_NEW2(carray, size); - return js_str; - } - } else { - return SWIGV8_UNDEFINED(); - } -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascripttypemaps.swg b/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascripttypemaps.swg deleted file mode 100755 index 34764730..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/javascripttypemaps.swg +++ /dev/null @@ -1,43 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Javascript - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ - -/* Include fundamental fragemt definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Javascript fragments for fundamental types */ -%include - -/* Javascript fragments for char* strings */ -%include - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* Javascript types */ - -#define SWIG_Object SWIGV8_VALUE -#define VOID_Object SWIGV8_UNDEFINED() - -/* Overload of the output/constant/exception/dirout handling */ - -/* append output */ -#define SWIG_AppendOutput(result, obj) SWIGV8_AppendOutput(result, obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) - -/* raise */ -#define SWIG_Raise(obj, type, desc) SWIG_V8_Raise(obj, type) - -/* Include the unified typemap library */ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_auto_ptr.i deleted file mode 100755 index 304f1fc9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_common.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_common.i deleted file mode 100755 index c80263ae..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_complex.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_complex.i deleted file mode 100755 index 464e6f31..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_complex.i +++ /dev/null @@ -1,26 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_deque.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_except.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_except.i deleted file mode 100755 index 3e056e7d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_map.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_map.i deleted file mode 100755 index 7803006c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_map.i +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_pair.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_pair.i deleted file mode 100755 index 7b04d637..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_pair.i +++ /dev/null @@ -1,35 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_string.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_string.i deleted file mode 100755 index 0afc2468..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_unique_ptr.i deleted file mode 100755 index 79320de6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_vector.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_vector.i deleted file mode 100755 index dca90ff3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/std_vector.i +++ /dev/null @@ -1,99 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - %rename(isEmpty) empty; - bool empty() const; - void clear(); - %rename(add) push_back; - void push_back(const value_type& x); - %extend { - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/swigmove.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/swigmove.i deleted file mode 100755 index 03e87fa2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/javascript/v8/typemaps.i b/win64/bin/swig/share/swig/4.1.0/javascript/v8/typemaps.i deleted file mode 100755 index 223a535a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/javascript/v8/typemaps.i +++ /dev/null @@ -1,148 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Python tuple. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Python output of the function would be a tuple containing both -output values. - -*/ - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Python tuple. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Python). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Python variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/linkruntime.c b/win64/bin/swig/share/swig/4.1.0/linkruntime.c old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/lua/_std_common.i b/win64/bin/swig/share/swig/4.1.0/lua/_std_common.i deleted file mode 100755 index eea67e45..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/_std_common.i +++ /dev/null @@ -1,93 +0,0 @@ -/* ----------------------------------------------------------------------------- - * _std_common.i - * - * std::helpers for LUA - * ----------------------------------------------------------------------------- */ - -%include // the general exceptions - -/* -The basic idea here, is instead of trying to feed SWIG all the -horribly templated STL code, to give it a neatened version. - -These %defines cover some of the more common methods -so the class declarations become just a set of %defines - -*/ - -/* #define for basic container features -note: I allow front(), back() & pop_back() to throw exceptions -upon empty containers, rather than coredump -(as we haven't defined the methods, we can use %extend to add with -new features) - -*/ -%define %STD_CONTAINER_METHODS(CLASS,T) -public: - CLASS(); - CLASS(const CLASS&); - unsigned int size() const; - unsigned int max_size() const; - bool empty() const; - void clear(); - %extend { // the extra stuff which must be checked - T front()const throw (std::out_of_range){ // only read front & back - if (self->empty()) - throw std::out_of_range("in "#CLASS"::front()"); - return self->front(); - } - T back()const throw (std::out_of_range){ // not write to them - if (self->empty()) - throw std::out_of_range("in "#CLASS"::back()"); - return self->back(); - } - } -%enddef - -/* push/pop for front/back -also note: front & back are read only methods, not used for writing -*/ -%define %STD_FRONT_ACCESS_METHODS(CLASS,T) -public: - void push_front(const T& val); - %extend { // must check this - void pop_front() throw (std::out_of_range){ - if (self->empty()) - throw std::out_of_range("in "#CLASS"::pop_front()"); - self->pop_back(); - } - } -%enddef - -%define %STD_BACK_ACCESS_METHODS(CLASS,T) -public: - void push_back(const T& val); - %extend { // must check this - void pop_back() throw (std::out_of_range){ - if (self->empty()) - throw std::out_of_range("in "#CLASS"::pop_back()"); - self->pop_back(); - } - } -%enddef - -/* -Random access methods -*/ -%define %STD_RANDOM_ACCESS_METHODS(CLASS,T) - %extend // this is a extra bit of SWIG code - { - // [] is replaced by __getitem__ & __setitem__ - // simply throws a string, which causes a lua error - T __getitem__(unsigned int idx) throw (std::out_of_range){ - if (idx>=self->size()) - throw std::out_of_range("in "#CLASS"::__getitem__()"); - return (*self)[idx]; - } - void __setitem__(unsigned int idx,const T& val) throw (std::out_of_range){ - if (idx>=self->size()) - throw std::out_of_range("in "#CLASS"::__setitem__()"); - (*self)[idx]=val; - } - }; -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/lua/argcargv.i b/win64/bin/swig/share/swig/4.1.0/lua/argcargv.i deleted file mode 100755 index dc96d215..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/argcargv.i +++ /dev/null @@ -1,57 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - - Use it as follows: - - %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) } - extern int mainApp(size_t argc, const char **argv); - - then from lua: - - args = { "arg0", "arg1" } - mainApp(args) - - * ------------------------------------------------------------ */ - -%{ -SWIGINTERN int SWIG_argv_size(lua_State* L, int index) { - int n=0; - while(1){ - lua_rawgeti(L,index,n+1); - if (lua_isnil(L,-1)) - break; - ++n; - lua_pop(L,1); - } - lua_pop(L,1); - return n; -} -%} - -%typemap(in) (int ARGC, char **ARGV) { - if (lua_istable(L,$input)) { - int i, size = SWIG_argv_size(L,$input); - $1 = ($1_ltype) size; - $2 = (char **) malloc((size+1)*sizeof(char *)); - for (i = 0; i < size; i++) { - lua_rawgeti(L,$input,i+1); - if (lua_isnil(L,-1)) - break; - $2[i] = (char *)lua_tostring(L, -1); - lua_pop(L,1); - } - $2[i]=NULL; - } else { - $1 = 0; $2 = 0; - lua_pushstring(L,"Expecting argv array"); - lua_error(L); - } -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = lua_istable(L,$input); -} - -%typemap(freearg) (int ARGC, char **ARGV) { - free((char *) $2); -} diff --git a/win64/bin/swig/share/swig/4.1.0/lua/carrays.i b/win64/bin/swig/share/swig/4.1.0/lua/carrays.i deleted file mode 100755 index 5b4fc21e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/carrays.i +++ /dev/null @@ -1,8 +0,0 @@ -/* Small change to the standard carrays.i -renaming the field to __getitem & __setitem -for operator[] access -*/ -%rename(__getitem) *::getitem; // the v=X[i] (get operator) -%rename(__setitem) *::setitem; // the X[i]=v (set operator) - -%include <../carrays.i> diff --git a/win64/bin/swig/share/swig/4.1.0/lua/factory.i b/win64/bin/swig/share/swig/4.1.0/lua/factory.i deleted file mode 100755 index 53e56623..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/factory.i +++ /dev/null @@ -1,23 +0,0 @@ -/* - A modification of factory.swg from the generic UTL library. -*/ - -%include - -%define %_factory_dispatch(Type) -if (!dcast) { - Type *dobj = dynamic_cast($1); - if (dobj) { - dcast = 1; - SWIG_NewPointerObj(L, dobj, $descriptor(Type *), $owner); SWIG_arg++; - } -}%enddef - -%define %factory(Method,Types...) -%typemap(out) Method { - int dcast = 0; - %formacro(%_factory_dispatch, Types) - if (!dcast) { - SWIG_NewPointerObj(L, $1, $descriptor, $owner); SWIG_arg++; - } -}%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/lua/lua.swg b/win64/bin/swig/share/swig/4.1.0/lua/lua.swg deleted file mode 100755 index 2cd5a224..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/lua.swg +++ /dev/null @@ -1,236 +0,0 @@ -/* ----------------------------------------------------------------------------- - * lua.swg - * - * SWIG Configuration File for Lua. - * This file is parsed by SWIG before reading any other interface file. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * includes - * ----------------------------------------------------------------------------- */ - -%include /* The typemaps */ -%include /* The runtime stuff */ -%include /* Warnings for Lua keywords */ - -//%include -/* ----------------------------------------------------------------------------- - * constants typemaps - * ----------------------------------------------------------------------------- */ -// this basically adds to a table of constants -%typemap(consttab) int, unsigned int, short, unsigned short, long, unsigned long, unsigned char, signed char, bool, enum SWIGTYPE - {SWIG_LUA_CONSTTAB_INT("$symname", $value)} - -%typemap(consttab) float, double - {SWIG_LUA_CONSTTAB_FLOAT("$symname", $value)} - -%typemap(consttab) long long, unsigned long long, signed long long - {SWIG_LUA_CONSTTAB_FLOAT("$symname", $value)} - -%typemap(consttab) const long long&, const unsigned long long&, const signed long long& - {SWIG_LUA_CONSTTAB_FLOAT("$symname", *$value)} - -%typemap(consttab) char *, const char *, char [], const char [] - {SWIG_LUA_CONSTTAB_STRING("$symname", $value)} - -// note: char is treated as a separate special type -// signed char & unsigned char are numbers -%typemap(consttab) char - {SWIG_LUA_CONSTTAB_CHAR("$symname", $value)} - -%typemap(consttab) long long, unsigned long long - {SWIG_LUA_CONSTTAB_STRING("$symname", "$value")} - -%typemap(consttab) SWIGTYPE *, SWIGTYPE *const, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] - { SWIG_LUA_CONSTTAB_POINTER("$symname",$value, $1_descriptor) } - -%typemap(consttab) SWIGTYPE - { SWIG_LUA_CONSTTAB_POINTER("$symname",&$value, $&1_descriptor) } - -// member function pointers -%typemap(consttab) SWIGTYPE (CLASS::*) - { SWIG_LUA_CONSTTAB_BINARY("$symname", sizeof($type),&$value, $1_descriptor) } - - -/* ----------------------------------------------------------------------------- - * Overloaded operator support - * ----------------------------------------------------------------------------- */ -// lua calls the + operator '__add' -// python likes to call it '__add__' -// Assuming most SWIGers will probably use the __add__ if they extend their classes -// we have two sets of renames -// one to rename the operator+() to __add() -// (this lets SWIG rename the operator overloads) -// another is to rename __add__() to __add() -// (this means that people who wrote SWIG code to do that add will also work) - -#ifdef __cplusplus -// this is extra renaming for lua -// not all operators are supported, so only those that are, are listed -%rename(__add) *::operator+; -%rename(__sub) *::operator-; -%rename(__mul) *::operator*; -%rename(__div) *::operator/; -%rename(__unm) *::operator-(); -%rename(__unm) *::operator-() const; - -%rename(__eq) *::operator==; -%ignore *::operator!=; // note: Lua does not have a notequal operator - // it just uses 'not (a==b)' -%rename(__lt) *::operator<; -%ignore *::operator>; // ditto less than vs greater than -%rename(__le) *::operator<=; -%ignore *::operator>=; // ditto less than vs greater than -%ignore *::operator!; // does not support not - -%rename(__call) *::operator(); // the fn call operator - -// lua does not support overloading of: -// logical/bitwise operators -// assign operator -// +=,-=,*=, etc -// therefore ignoring them for now -// it also doesn't support non class operators -// eg friends or XX operator+(XX,XX) -// also ignoring -// note: some of these might be better to rename, but not doing that for now -%ignore *::operator&&; %ignore operator&&; -%ignore *::operator||; %ignore operator||; -%ignore *::operator+=; -%ignore *::operator-=; -%ignore *::operator*=; -%ignore *::operator/=; -%ignore *::operator%=; -%ignore *::operator++; %ignore *::operator--; - -%ignore *::operator=; // note: this might be better to rename to assign() or similar - -%ignore operator+; -%ignore operator-; -%ignore operator*; -%ignore operator/; -%ignore operator%; -%ignore operator[]; -%ignore operator>; %ignore operator>=; -%ignore operator<; %ignore operator<=; -%ignore operator==; %ignore operator!=; - - -// renaming the python operators to be compatible with lua -// this means that if a developer has written a fn __add__() -// it will be used for the lua + -%rename(__add) *::__add__; -%rename(__sub) *::__sub__; -%rename(__mul) *::__mul__; -%rename(__div) *::__div__; -%rename(__unm) *::__neg__; // lua calls unary minus,'unm' not 'neg' -%rename(__tostring) *::__str__; // both map to __tostring -%rename(__tostring) *::__repr__; // both map to __tostring - - -%rename(__pow) *::__pow__; // lua power '^' operator -%rename(__concat) *::__concat__; // lua concat '..' operator -%rename(__eq) *::__eq__; -%rename(__lt) *::__lt__; -%rename(__le) *::__le__; -%rename(__call) *::__call__; // the fn call operator() - -// the [] operator has two parts, the get & the set -%rename(__getitem) *::__getitem__; // the v=X[i] (get operator) -%rename(__setitem) *::__setitem__; // the X[i]=v (set operator) - - -#endif - - -/* ------------------------------------------------------------ - * Exceptions - * ------------------------------------------------------------ */ -/* Confession: I don't really like C++ exceptions -The python/lua ones are great, but C++ ones I don't like -(mainly because I cannot get the stack trace out of it) -Therefore I have not bothered to try doing much in this - -Therefore currently it's just enough to get a few test cases running ok - -note: if you wish to throw anything related to std::exception -use %include instead -*/ - -// number as number+error -%typemap(throws) int,unsigned int,signed int, - long,unsigned long,signed long, - short,unsigned short,signed short, - float,double, - long long,unsigned long long, - unsigned char, signed char, - int&,unsigned int&,signed int&, - long&,unsigned long&,signed long&, - short&,unsigned short&,signed short&, - float&,double&, - long long&,unsigned long long&, - unsigned char&, signed char& -%{lua_pushnumber(L,(lua_Number)$1);SWIG_fail; %} - -%typemap(throws) bool,bool& -%{lua_pushboolean(L,(int)($1==true));SWIG_fail; %} - -// enum as number+error -%typemap(throws) enum SWIGTYPE -%{lua_pushnumber(L,(lua_Number)(int)$1);SWIG_fail; %} - -// strings are just sent as errors -%typemap(throws) char *, const char * -%{lua_pushstring(L,$1);SWIG_fail;%} - -// char is changed to a string -%typemap(throws) char -%{lua_pushlstring(L,&$1,1);SWIG_fail;%} - -/* -Throwing object is a serious problem: -Assuming some code throws a 'FooBar' -There are a few options: -- return a pointer to it: but it's unclear how long this will last for. -- return a copy of it: but not all objects are copyable - (see exception_partial_info in the test suite for a case where you cannot do this) -- convert to a string & throw that - it's not so useful, but it works (this is more lua like). -The third option (though not nice) is used -For a more useful solution: see std_except for more details -*/ - -// basic typemap for structs, classes, pointers & references -// convert to string and error -%typemap(throws) SWIGTYPE -%{(void)$1; /* ignore it */ -lua_pushfstring(L,"object exception:%s",SWIG_TypePrettyName($1_descriptor)); -SWIG_fail;%} - -// code to make a copy of the object and return this -// if you have a function which throws a FooBar & you want SWIG to return a copy of the object as its error -// then use one of the below -// %apply SWIGTYPE EXCEPTION_BY_VAL {FooBar}; -// %apply SWIGTYPE& EXCEPTION_BY_VAL {FooBar&}; // note: need & twice -%typemap(throws) SWIGTYPE EXCEPTION_BY_VAL -%{SWIG_NewPointerObj(L,(void *)new $1_ltype($1),$&1_descriptor,1); -SWIG_fail;%} - -// similar for object reference -// note: swig typemaps seem a little confused around here, therefore we use $basetype -%typemap(throws) SWIGTYPE& EXCEPTION_BY_VAL -%{SWIG_NewPointerObj(L,(void *)new $basetype($1),$1_descriptor,1); -SWIG_fail;%} - - -// note: no support for object pointers -// it's not clear how long the pointer is valid for, therefore not supporting it - -/* ----------------------------------------------------------------------------- - * extras - * ----------------------------------------------------------------------------- */ -// this %define is to allow insertion of lua source code into the wrapper file -#define %luacode %insert("luacode") - - -/* ------------------------------ end lua.swg ------------------------------ */ diff --git a/win64/bin/swig/share/swig/4.1.0/lua/lua_fnptr.i b/win64/bin/swig/share/swig/4.1.0/lua/lua_fnptr.i deleted file mode 100755 index 52f15b84..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/lua_fnptr.i +++ /dev/null @@ -1,124 +0,0 @@ -/* ----------------------------------------------------------------------------- - * lua_fnptr.i - * - * SWIG Library file containing the main typemap code to support Lua modules. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Basic function pointer support - * ----------------------------------------------------------------------------- */ -/* -The structure: SWIGLUA_FN provides a simple (local only) wrapping for a function. - -For example if you wanted to have a C/C++ function take a lua function as a parameter. -You could declare it as: - int my_func(int a, int b, SWIGLUA_FN fn); -note: it should be passed by value, not byref or as a pointer. - -The SWIGLUA_FN holds a pointer to the lua_State, and the stack index where the function is held. -The macro SWIGLUA_FN_GET() will put a copy of the lua function at the top of the stack. -After that it's fairly simple to write the rest of the code (assuming know how to use lua), -just push the parameters, call the function and return the result. - - int my_func(int a, int b, SWIGLUA_FN fn) - { - SWIGLUA_FN_GET(fn); - lua_pushnumber(fn.L,a); - lua_pushnumber(fn.L,b); - lua_call(fn.L,2,1); // 2 in, 1 out - return luaL_checknumber(fn.L,-1); - } - -SWIG will automatically performs the wrapping of the arguments in and out. - -However: if you wish to store the function between calls, look to the SWIGLUA_REF below. - -*/ -// this is for the C code only, we don't want SWIG to wrapper it for us. -%{ -typedef struct{ - lua_State* L; /* the state */ - int idx; /* the index on the stack */ -}SWIGLUA_FN; - -#define SWIGLUA_FN_GET(fn) {lua_pushvalue(fn.L,fn.idx);} -%} - -// the actual typemap -%typemap(in,checkfn="lua_isfunction") SWIGLUA_FN -%{ $1.L=L; $1.idx=$input; %} - -/* ----------------------------------------------------------------------------- - * Storing lua object support - * ----------------------------------------------------------------------------- */ -/* -The structure: SWIGLUA_REF provides a mechanism to store object (usually functions) -between calls to the interpreter. - -For example if you wanted to have a C/C++ function take a lua function as a parameter. -Then call it later, You could declare it as: - SWIGLUA_REF myref; - void set_func(SWIGLUA_REF ref); - SWIGLUA_REF get_func(); - void call_func(int val); -note: it should be passed by value, not byref or as a pointer. - -The SWIGLUA_REF holds a pointer to the lua_State, and an integer reference to the object. -Because it holds a permanent ref to an object, the SWIGLUA_REF must be handled with a bit more care. -It should be initialised to {0,0}. The function swiglua_ref_set() should be used to set it. -swiglua_ref_clear() should be used to clear it when not in use, and swiglua_ref_get() to get the -data back. - -Note: the typemap does not check that the object is in fact a function, -if you need that you must add it yourself. - - - int my_func(int a, int b, SWIGLUA_FN fn) - { - SWIGLUA_FN_GET(fn); - lua_pushnumber(fn.L,a); - lua_pushnumber(fn.L,b); - lua_call(fn.L,2,1); // 2 in, 1 out - return luaL_checknumber(fn.L,-1); - } - -SWIG will automatically performs the wrapping of the arguments in and out. - -However: if you wish to store the function between calls, look to the SWIGLUA_REF below. - -*/ - -%{ -typedef struct{ - lua_State* L; /* the state */ - int ref; /* a ref in the lua global index */ -}SWIGLUA_REF; - - -void swiglua_ref_clear(SWIGLUA_REF* pref){ - if (pref->L!=0 && pref->ref!=LUA_NOREF && pref->ref!=LUA_REFNIL){ - luaL_unref(pref->L,LUA_REGISTRYINDEX,pref->ref); - } - pref->L=0; pref->ref=0; -} - -void swiglua_ref_set(SWIGLUA_REF* pref,lua_State* L,int idx){ - pref->L=L; - lua_pushvalue(L,idx); /* copy obj to top */ - pref->ref=luaL_ref(L,LUA_REGISTRYINDEX); /* remove obj from top & put into registry */ -} - -void swiglua_ref_get(SWIGLUA_REF* pref){ - if (pref->L!=0) - lua_rawgeti(pref->L,LUA_REGISTRYINDEX,pref->ref); -} - -%} - -%typemap(in) SWIGLUA_REF -%{ swiglua_ref_set(&$1,L,$input); %} - -%typemap(out) SWIGLUA_REF -%{ if ($1.L!=0) {swiglua_ref_get(&$1);} else {lua_pushnil(L);} - SWIG_arg++; %} - diff --git a/win64/bin/swig/share/swig/4.1.0/lua/luakw.swg b/win64/bin/swig/share/swig/4.1.0/lua/luakw.swg deleted file mode 100755 index 36ee44d9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/luakw.swg +++ /dev/null @@ -1,67 +0,0 @@ -/* - Warnings for Lua keywords, built-in names and bad names. -*/ - -#define LUAKW(x) %keywordwarn("'" `x` "' is a Lua keyword", rename="c_%s") `x` -#define LUABN(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "'" `x` "' conflicts with a basic function in Lua"), %$not %$ismember) `x` - -/* - Warnings for Lua keywords - http://www.lua.org/manual/5.2/manual.html#3.1 -*/ - -LUAKW(and); -LUAKW(break); -LUAKW(do); -LUAKW(else); -LUAKW(elseif); -LUAKW(end); -LUAKW(false); -LUAKW(for); -LUAKW(function); -LUAKW(goto); -LUAKW(if); -LUAKW(in); -LUAKW(local); -LUAKW(nil); -LUAKW(not); -LUAKW(or); -LUAKW(repeat); -LUAKW(return); -LUAKW(then); -LUAKW(true); -LUAKW(until); -LUAKW(while); - -/* - Basic functions - http://www.lua.org/manual/5.2/manual.html#6.1 -*/ - -LUABN(assert); -LUABN(collectgarbage); -LUABN(dofile); -LUABN(error); -LUABN(_G); // Not actually a function -LUABN(getmetatable); -LUABN(ipairs); -LUABN(load); -LUABN(loadfile); -LUABN(next); -LUABN(pairs); -LUABN(pcall); -LUABN(print); -LUABN(rawequal); -LUABN(rawget); -LUABN(rawlen); -LUABN(rawset); -LUABN(select); -LUABN(setmetatable); -LUABN(tonumber); -LUABN(tostring); -LUABN(type); -LUABN(_VERSION); // Not actually a function -LUABN(xpcall); - -#undef LUABN -#undef LUAKW diff --git a/win64/bin/swig/share/swig/4.1.0/lua/luarun.swg b/win64/bin/swig/share/swig/4.1.0/lua/luarun.swg deleted file mode 100755 index dd64a13d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/luarun.swg +++ /dev/null @@ -1,1950 +0,0 @@ -/* ----------------------------------------------------------------------------- - * luarun.swg - * - * This file contains the runtime support for Lua modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "lua.h" -#include "lauxlib.h" -#include /* for malloc */ -#include /* for a few sanity tests */ - -/* ----------------------------------------------------------------------------- - * Lua flavors - * ----------------------------------------------------------------------------- */ - -#define SWIG_LUA_FLAVOR_LUA 1 -#define SWIG_LUA_FLAVOR_ELUA 2 -#define SWIG_LUA_FLAVOR_ELUAC 3 - -#if !defined(SWIG_LUA_TARGET) -# error SWIG_LUA_TARGET not defined -#endif - -#if defined(SWIG_LUA_ELUA_EMULATE) - -struct swig_elua_entry; - -typedef struct swig_elua_key { - int type; - union { - const char* strkey; - lua_Number numkey; - } key; -} swig_elua_key; - -typedef struct swig_elua_val { - int type; - union { - lua_Number number; - const struct swig_elua_entry *table; - const char *string; - lua_CFunction function; - struct { - char member; - long lvalue; - void *pvalue; - swig_type_info **ptype; - } userdata; - } value; -} swig_elua_val; - -typedef struct swig_elua_entry { - swig_elua_key key; - swig_elua_val value; -} swig_elua_entry; - -#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} } -#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} } -#define LNILKEY {LUA_TNIL, {.strkey = 0} } - -#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} } -#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} } -#define LROVAL(x) {LUA_TTABLE, {.table = x} } -#define LNILVAL {LUA_TNIL, {.string = 0} } -#define LSTRVAL(x) {LUA_TSTRING, {.string = x} } - -#define LUA_REG_TYPE swig_elua_entry - -#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable" - -#define lua_pushrotable(L,p)\ - lua_newtable(L);\ - assert(p);\ - SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p)); - -#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ - LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } } - -#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\ - LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } } -#endif - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) -# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) -# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) -# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) - /* Those two types of constants are not supported in elua */ - -#ifndef SWIG_LUA_CONSTTAB_POINTER -#warning eLua does not support pointers as constants. By default, nil will be used as value -#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL -#endif - -#ifndef SWIG_LUA_CONSTTAB_BINARY -#warning eLua does not support pointers to member as constants. By default, nil will be used as value -#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL -#endif -#else /* SWIG_LUA_FLAVOR_LUA */ -# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 -# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 -# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 -# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 -# define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ - SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D -# define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\ - SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D -#endif - -#ifndef SWIG_LUA_ELUA_EMULATE -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} -# define LSTRVAL LRO_STRVAL -#endif -#endif /* SWIG_LUA_ELUA_EMULATE*/ - -#ifndef SWIG_LUA_ELUA_EMULATE -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) - -#ifndef MIN_OPT_LEVEL -#define MIN_OPT_LEVEL 2 -#endif - -#include "lrodefs.h" -#include "lrotable.h" -#endif -#endif /* SWIG_LUA_ELUA_EMULATE*/ -/* ----------------------------------------------------------------------------- - * compatibility defines - * ----------------------------------------------------------------------------- */ - -/* History of Lua C API length functions: In Lua 5.0 (and before?) - there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen", - but a compatibility define of "lua_strlen" was added. In Lua 5.2, - this function was again renamed, to "lua_rawlen" (to emphasize that - it doesn't call the "__len" metamethod), and the compatibility - define of lua_strlen was removed. All SWIG uses have been updated - to "lua_rawlen", and we add our own defines of that here for older - versions of Lua. */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 -# define lua_rawlen lua_strlen -#elif LUA_VERSION_NUM == 501 -# define lua_rawlen lua_objlen -#endif - - -/* lua_pushglobaltable is the recommended "future-proof" way to get - the global table for Lua 5.2 and later. Here we define - lua_pushglobaltable ourselves for Lua versions before 5.2. */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) -#endif - -/* lua_absindex was introduced in Lua 5.2 */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) -#endif - -/* lua_rawsetp was introduced in Lua 5.2 */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -#define lua_rawsetp(L,index,ptr)\ - lua_pushlightuserdata(L,(void*)(ptr));\ - lua_insert(L,-2);\ - lua_rawset(L,index); - -#define lua_rawgetp(L,index,ptr)\ - lua_pushlightuserdata(L,(void*)(ptr));\ - lua_rawget(L,index); - -#endif - -/* -------------------------------------------------------------------------- - * Helper functions for error handling - * -------------------------------------------------------------------------- */ - -/* Push the string STR on the Lua stack, like lua_pushstring, but - prefixed with the location of the innermost Lua call-point - (as formatted by luaL_where). */ -SWIGRUNTIME void -SWIG_Lua_pusherrstring (lua_State *L, const char *str) -{ - luaL_where (L, 1); - lua_pushstring (L, str); - lua_concat (L, 2); -} - -/* Push a formatted string generated from FMT and following args on - the Lua stack, like lua_pushfstring, but prefixed with the - location of the innermost Lua call-point (as formatted by luaL_where). */ -SWIGRUNTIME void -SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...) -{ - va_list argp; - va_start(argp, fmt); - luaL_where(L, 1); - lua_pushvfstring(L, fmt, argp); - va_end(argp); - lua_concat(L, 2); -} - - -/* ----------------------------------------------------------------------------- - * global swig types - * ----------------------------------------------------------------------------- */ -/* Constant table */ -#define SWIG_LUA_INT 1 -#define SWIG_LUA_FLOAT 2 -#define SWIG_LUA_STRING 3 -#define SWIG_LUA_POINTER 4 -#define SWIG_LUA_BINARY 5 -#define SWIG_LUA_CHAR 6 - -/* Structure for variable linking table */ -typedef struct { - const char *name; - lua_CFunction get; - lua_CFunction set; -} swig_lua_var_info; - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -typedef const LUA_REG_TYPE swig_lua_method; -typedef const LUA_REG_TYPE swig_lua_const_info; -#else /* Normal lua */ -typedef luaL_Reg swig_lua_method; - -/* Constant information structure */ -typedef struct { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_lua_const_info; - -#endif - -typedef struct { - const char *name; - lua_CFunction getmethod; - lua_CFunction setmethod; -} swig_lua_attribute; - - -struct swig_lua_class; -/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */ -typedef struct swig_lua_namespace { - const char *name; - swig_lua_method *ns_methods; - swig_lua_attribute *ns_attributes; - swig_lua_const_info *ns_constants; - struct swig_lua_class **ns_classes; - struct swig_lua_namespace **ns_namespaces; -} swig_lua_namespace; - -typedef struct swig_lua_class { - const char *name; /* Name that this class has in Lua */ - const char *fqname; /* Fully qualified name - Scope + class name */ - swig_type_info **type; - lua_CFunction constructor; - void (*destructor)(void *); - swig_lua_method *methods; - swig_lua_attribute *attributes; - swig_lua_namespace *cls_static; - swig_lua_method *metatable; /* 0 for -eluac */ - struct swig_lua_class **bases; - const char **base_names; -} swig_lua_class; - -/* this is the struct for wrapping all pointers in SwigLua -*/ -typedef struct { - swig_type_info *type; - int own; /* 1 if owned & must be destroyed */ - void *ptr; -} swig_lua_userdata; - -/* this is the struct for wrapping arbitrary packed binary data -(currently it is only used for member function pointers) -the data ordering is similar to swig_lua_userdata, but it is currently not possible -to tell the two structures apart within SWIG, other than by looking at the type -*/ -typedef struct { - swig_type_info *type; - int own; /* 1 if owned & must be destroyed */ - char data[1]; /* arbitrary amount of data */ -} swig_lua_rawdata; - -/* Common SWIG API */ -#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) -#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) -#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) -#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) - -/* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) -#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer) -#define SWIG_MODULE_CLIENTDATA_TYPE lua_State* - -/* Contract support */ -#define SWIG_contract_assert(expr, msg) \ - do { if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } } while (0) - - -/* helper #defines */ -#define SWIG_fail {goto fail;} -#define SWIG_fail_arg(func_name,argnum,type) \ - {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ - func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ - goto fail;} -#define SWIG_fail_ptr(func_name,argnum,type) \ - SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") -#define SWIG_check_num_args(func_name,a,b) \ - if (lua_gettop(L)b) \ - {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ - goto fail;} - - -#define SWIG_Lua_get_table(L,n) \ - (lua_pushstring(L, n), lua_rawget(L,-2)) - -#define SWIG_Lua_add_function(L,n,f) \ - (lua_pushstring(L, n), \ - lua_pushcfunction(L, f), \ - lua_rawset(L,-3)) - -#define SWIG_Lua_add_boolean(L,n,b) \ - (lua_pushstring(L, n), \ - lua_pushboolean(L, b), \ - lua_rawset(L,-3)) - -/* special helper for allowing 'nil' for usertypes */ -#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) - -#ifdef __cplusplus -/* Special helper for member function pointers -it gets the address, casts it, then dereferences it */ -/*#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) */ -#endif - -/* storing/access of swig_module_info */ -SWIGRUNTIME swig_module_info * -SWIG_Lua_GetModule(lua_State *L) { - swig_module_info *ret = 0; - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_rawget(L,LUA_REGISTRYINDEX); - if (lua_islightuserdata(L,-1)) - ret=(swig_module_info*)lua_touserdata(L,-1); - lua_pop(L,1); /* tidy */ - return ret; -} - -SWIGRUNTIME void -SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) { - /* add this all into the Lua registry: */ - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_pushlightuserdata(L,(void*)module); - lua_rawset(L,LUA_REGISTRYINDEX); -} - -/* ----------------------------------------------------------------------------- - * global variable support code: modules - * ----------------------------------------------------------------------------- */ - -/* this function is called when trying to set an immutable. -default action is to print an error. -This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ -SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L) -{ -/* there should be 1 param passed in: the new value */ -#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE - lua_pop(L,1); /* remove it */ - luaL_error(L,"This variable is immutable"); -#endif - return 0; /* should not return anything */ -} - -#ifdef SWIG_LUA_ELUA_EMULATE - -SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own); -SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type); -static int swig_lua_elua_emulate_unique_key; - -/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */ -SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table) -{ - int i, table_parsed, parsed_tables_array, target_table; - assert(lua_istable(L,-1)); - target_table = lua_gettop(L); - /* Get the registry where we put all parsed tables to avoid loops */ - lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); - if(lua_isnil(L,-1)) { - lua_pop(L,1); - lua_newtable(L); - lua_pushvalue(L,-1); - lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key)); - } - parsed_tables_array = lua_gettop(L); - lua_pushvalue(L,target_table); - lua_rawsetp(L, parsed_tables_array, table); - table_parsed = 0; - const int SWIGUNUSED pairs_start = lua_gettop(L); - for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++) - { - const swig_elua_entry *entry = table + i; - int is_metatable = 0; - switch(entry->key.type) { - case LUA_TSTRING: - lua_pushstring(L,entry->key.key.strkey); - if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0) - is_metatable = 1; - break; - case LUA_TNUMBER: - lua_pushnumber(L,entry->key.key.numkey); - break; - case LUA_TNIL: - lua_pushnil(L); - break; - default: - assert(0); - } - switch(entry->value.type) { - case LUA_TSTRING: - lua_pushstring(L,entry->value.value.string); - break; - case LUA_TNUMBER: - lua_pushnumber(L,entry->value.value.number); - break; - case LUA_TFUNCTION: - lua_pushcfunction(L,entry->value.value.function); - break; - case LUA_TTABLE: - lua_rawgetp(L,parsed_tables_array, entry->value.value.table); - table_parsed = !lua_isnil(L,-1); - if(!table_parsed) { - lua_pop(L,1); /*remove nil */ - lua_newtable(L); - SWIG_Lua_elua_emulate_register(L,entry->value.value.table); - } - if(is_metatable) { - assert(lua_istable(L,-1)); - lua_pushvalue(L,-1); - lua_setmetatable(L,target_table); - } - - break; - case LUA_TUSERDATA: - if(entry->value.value.userdata.member) - SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue, - entry->value.value.userdata.lvalue, - *(entry->value.value.userdata.ptype)); - else - SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue, - *(entry->value.value.userdata.ptype),0); - break; - case LUA_TNIL: - lua_pushnil(L); - break; - default: - assert(0); - } - assert(lua_gettop(L) == pairs_start + 2); - lua_rawset(L,target_table); - } - lua_pop(L,1); /* Removing parsed tables storage */ - assert(lua_gettop(L) == target_table); -} - -SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L) -{ - lua_pushnil(L); - lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); -} - -SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L); - -SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L) -{ - SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1); - SWIG_Lua_get_class_registry(L); - lua_getfield(L,-1,"lua_getmetatable"); - lua_remove(L,-2); /* remove the registry*/ - assert(!lua_isnil(L,-1)); - lua_pushvalue(L,1); - assert(lua_gettop(L) == 3); /* object | function | object again */ - lua_call(L,1,1); - if(!lua_isnil(L,-1)) /*There is an ordinary metatable */ - return 1; - /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/ - assert(lua_gettop(L) == 2); - if(lua_istable(L,-2)) { - lua_pop(L,1); /*remove the nil*/ - lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY); - } - assert(lua_gettop(L) == 2); - return 1; - -fail: - lua_error(L); - return 0; -} - -SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L) -{ - SWIG_Lua_get_class_registry(L); - lua_pushglobaltable(L); - lua_pushstring(L,"lua_getmetatable"); - lua_getfield(L,-2,"getmetatable"); - assert(!lua_isnil(L,-1)); - lua_rawset(L,-4); - lua_pushstring(L, "getmetatable"); - lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable); - lua_rawset(L,-3); - lua_pop(L,2); - -} -/* END OF REMOVE */ - -#endif -/* ----------------------------------------------------------------------------- - * global variable support code: namespaces and modules (which are the same thing) - * ----------------------------------------------------------------------------- */ - -SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) -{ -/* there should be 2 params passed in - (1) table (not the meta table) - (2) string name of the attribute -*/ - assert(lua_istable(L,-2)); /* just in case */ - lua_getmetatable(L,-2); - assert(lua_istable(L,-1)); - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); - /* look for the key in the .get table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,-2); /* stack tidy, remove .get table */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - /* ok, so try the .fn table */ - SWIG_Lua_get_table(L,".fn"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); /* look for the fn */ - lua_remove(L,-2); /* stack tidy, remove .fn table */ - if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */ - { /* found it so return the fn & let lua call it */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - return 0; -} - -SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L) -{ -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value -*/ - - assert(lua_istable(L,1)); - lua_getmetatable(L,1); /* get the meta table */ - assert(lua_istable(L,-1)); - - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,3); /* value */ - lua_call(L,1,0); - return 0; - } - lua_pop(L,1); /* remove the value */ - } - lua_pop(L,1); /* remove the value .set table */ - lua_pop(L,1); /* remote metatable */ - lua_rawset(L,-3); - return 0; -} - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ -SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */ -SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */ -SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss); - -/* helper function - register namespace methods and attributes into namespace */ -SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns) -{ - int i; - /* There must be namespace table (not metatable) at the top of the stack */ - assert(lua_istable(L,-1)); - SWIG_Lua_InstallConstants(L, ns->ns_constants); - - /* add methods to the namespace/module table */ - for(i=0;ns->ns_methods[i].name;i++){ - SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func); - } - lua_getmetatable(L,-1); - - /* add fns */ - for(i=0;ns->ns_attributes[i].name;i++){ - SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); - } - - /* clear stack - remove metatble */ - lua_pop(L,1); - return 0; -} - -/* Register all classes in the namespace */ -SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns) -{ - swig_lua_class **classes; - - /* There must be a module/namespace table at the top of the stack */ - assert(lua_istable(L,-1)); - - classes = ns->ns_classes; - - if( classes != 0 ) { - while(*classes != 0) { - SWIG_Lua_class_register(L, *classes); - classes++; - } - } -} - -/* Helper function. Creates namespace table and adds it to module table - if 'reg' is true, then will register namespace table to parent one (must be on top of the stack - when function is called). - Function always returns newly registered table on top of the stack. -*/ -SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg) -{ - swig_lua_namespace **sub_namespace; - /* 1 argument - table on the top of the stack */ - const int SWIGUNUSED begin = lua_gettop(L); - assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */ - lua_checkstack(L,5); - lua_newtable(L); /* namespace itself */ - lua_newtable(L); /* metatable for namespace */ - - /* add a table called ".get" */ - lua_pushstring(L,".get"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".set" */ - lua_pushstring(L,".set"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".fn" */ - lua_pushstring(L,".fn"); - lua_newtable(L); - lua_rawset(L,-3); - - /* add accessor fns for using the .get,.set&.fn */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); - - lua_setmetatable(L,-2); /* set metatable */ - - /* Register all functions, variables etc */ - SWIG_Lua_add_namespace_details(L,ns); - /* Register classes */ - SWIG_Lua_add_namespace_classes(L,ns); - - sub_namespace = ns->ns_namespaces; - if( sub_namespace != 0) { - while(*sub_namespace != 0) { - SWIG_Lua_namespace_register(L, *sub_namespace, 1); - lua_pop(L,1); /* removing sub-namespace table */ - sub_namespace++; - } - } - - if (reg) { - lua_pushstring(L,ns->name); - lua_pushvalue(L,-2); - lua_rawset(L,-4); /* add namespace to module table */ - } - assert(lua_gettop(L) == begin+1); -} -#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ - -/* ----------------------------------------------------------------------------- - * global variable support code: classes - * ----------------------------------------------------------------------------- */ - -SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname); - -typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret); - -SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type, - int first_arg, swig_lua_base_iterator_func func, int *const ret) -{ - /* first_arg - position of the object in stack. Everything that is above are arguments - * and is passed to every evocation of the func */ - int last_arg = lua_gettop(L);/* position of last argument */ - int original_metatable = last_arg + 1; - size_t bases_count; - int result = SWIG_ERROR; - int bases_table; - (void)swig_type; - lua_getmetatable(L,first_arg); - - /* initialise base search */ -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - SWIG_Lua_get_table(L,".bases"); - assert(lua_istable(L,-1)); - bases_count = lua_rawlen(L,-1); - bases_table = lua_gettop(L); -#else - /* In elua .bases table doesn't exist. Use table from swig_lua_class */ - (void)bases_table; - assert(swig_type!=0); - swig_module_info *module=SWIG_GetModule(L); - swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases; - const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names; - bases_count = 0; - for(;base_names[bases_count]; - bases_count++);/* get length of bases */ -#endif - - if(ret) - *ret = 0; - if(bases_count>0) - { - int to_remove; - size_t i; - int j; - int subcall_last_arg; - int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */ - int valid = 1; - swig_type_info *base_swig_type = 0; - for(j=first_arg;j<=last_arg;j++) - lua_pushvalue(L,j); - subcall_last_arg = lua_gettop(L); - - /* Trick: temporarily replacing original metatable with metatable for base class and call getter */ - for(i=0;ifqname); - base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]); - assert(base_swig_type != 0); - } -#endif - - if(!valid) - continue; - assert(lua_isuserdata(L, subcall_first_arg)); - assert(lua_istable(L,-1)); - lua_setmetatable(L,subcall_first_arg); /* Set new metatable */ - assert(lua_gettop(L) == subcall_last_arg); - result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */ - if(result != SWIG_ERROR) { - break; - } - } - /* Restore original metatable */ - lua_pushvalue(L,original_metatable); - lua_setmetatable(L,first_arg); - /* Clear - remove everything between last_arg and subcall_last_arg including */ - to_remove = subcall_last_arg - last_arg; - for(j=0;jtype; - result = SWIG_Lua_class_do_get(L,type,1,&ret); - if(result == SWIG_OK) - return ret; - - result = SWIG_Lua_class_do_get_item(L,type,1,&ret); - if(result == SWIG_OK) - return ret; - - return 0; -} - -/* helper for the class.set method, performs the lookup of class attributes - * It returns error code. Number of function return values is passed inside 'ret' - */ -SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret) -{ -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value - */ - - int bases_search_result; - int substack_start = lua_gettop(L) - 3; - lua_checkstack(L,5); - assert(lua_isuserdata(L,substack_start+1)); /* just in case */ - lua_getmetatable(L,substack_start+1); /* get the meta table */ - assert(lua_istable(L,-1)); /* just in case */ - if(ret) - *ret = 0; /* it is setter - number of return values is always 0 */ - - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,substack_start+2); /* key */ - lua_rawget(L,-2); - lua_remove(L,-2); /* tidy stack, remove .set table */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,substack_start+1); /* userdata */ - lua_pushvalue(L,substack_start+3); /* value */ - lua_call(L,2,0); - lua_remove(L,substack_start+4); /*remove metatable*/ - return SWIG_OK; - } - lua_pop(L,1); /* remove the value */ - } else { - lua_pop(L,1); /* remove the answer for .set table request*/ - } - /* NEW: looks for the __setitem() fn - this is a user provided set fn */ - SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ - if (lua_iscfunction(L,-1)) /* if it's there */ - { /* found it so call the fn & return its value */ - lua_pushvalue(L,substack_start+1); /* the userdata */ - lua_pushvalue(L,substack_start+2); /* the parameter */ - lua_pushvalue(L,substack_start+3); /* the value */ - lua_call(L,3,0); /* 3 values in ,0 out */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return SWIG_OK; - } - lua_pop(L,1); /* remove value */ - - lua_pop(L,1); /* remove metatable */ - /* Search among bases */ - bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret); - if(ret) - assert(*ret == 0); - assert(lua_gettop(L) == substack_start + 3); - return bases_search_result; -} - -/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly - * handles return values. - */ -SWIGINTERN int SWIG_Lua_class_set(lua_State *L) -{ -/* There should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value - */ - int ret = 0; - int result; - swig_lua_userdata *usr; - swig_type_info *type; - assert(lua_isuserdata(L,1)); - usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - type = usr->type; - result = SWIG_Lua_class_do_set(L,type,1,&ret); - if(result != SWIG_OK) { - SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method."); - lua_error(L); - } else { - assert(ret==0); - } - return 0; -} - -/* the class.destruct method called by the interpreter */ -SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) -{ -/* there should be 1 params passed in - (1) userdata (not the meta table) */ - swig_lua_userdata *usr; - swig_lua_class *clss; - assert(lua_isuserdata(L,-1)); /* just in case */ - usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ - /* if must be destroyed & has a destructor */ - if (usr->own) /* if must be destroyed */ - { - clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ - if (clss && clss->destructor) /* there is a destroy fn */ - { - clss->destructor(usr->ptr); /* bye bye */ - } - } - return 0; -} - -/* the class.__tostring method called by the interpreter and print */ -SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) -{ -/* there should be 1 param passed in - (1) userdata (not the metatable) */ - swig_lua_userdata* userData; - assert(lua_isuserdata(L,1)); /* just in case */ - userData = (swig_lua_userdata*)lua_touserdata(L,1); /* get the userdata address */ - - lua_pushfstring(L, "", userData->type->str, userData->ptr); - return 1; -} - -/* to manually disown some userdata */ -SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) -{ -/* there should be 1 params passed in - (1) userdata (not the meta table) */ - swig_lua_userdata *usr; - assert(lua_isuserdata(L,-1)); /* just in case */ - usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ - - usr->own = 0; /* clear our ownership */ - return 0; -} - -/* lua callable function to compare userdata's value -the issue is that two userdata may point to the same thing -but to lua, they are different objects */ -SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) -{ - int result; - swig_lua_userdata *usr1,*usr2; - if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ - return 0; /* nil reply */ - usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ - /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ - result=(usr1->ptr==usr2->ptr); - lua_pushboolean(L,result); - return 1; -} - -/* populate table at the top of the stack with metamethods that ought to be inherited */ -SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) -{ - SWIG_Lua_add_boolean(L, "__add", 1); - SWIG_Lua_add_boolean(L, "__sub", 1); - SWIG_Lua_add_boolean(L, "__mul", 1); - SWIG_Lua_add_boolean(L, "__div", 1); - SWIG_Lua_add_boolean(L, "__mod", 1); - SWIG_Lua_add_boolean(L, "__pow", 1); - SWIG_Lua_add_boolean(L, "__unm", 1); - SWIG_Lua_add_boolean(L, "__len", 1 ); - SWIG_Lua_add_boolean(L, "__concat", 1 ); - SWIG_Lua_add_boolean(L, "__eq", 1); - SWIG_Lua_add_boolean(L, "__lt", 1); - SWIG_Lua_add_boolean(L, "__le", 1); - SWIG_Lua_add_boolean(L, "__call", 1); - SWIG_Lua_add_boolean(L, "__tostring", 1); - SWIG_Lua_add_boolean(L, "__gc", 0); -} - -/* creates the swig registry */ -SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L) -{ - /* create main SWIG registry table */ - lua_pushstring(L,"SWIG"); - lua_newtable(L); - /* populate it with some predefined data */ - - /* .library table. Placeholder */ - lua_pushstring(L,".library"); - lua_newtable(L); - { - /* list of metamethods that class inherits from its bases */ - lua_pushstring(L,"inheritable_metamethods"); - lua_newtable(L); - /* populate with list of metamethods */ - SWIG_Lua_populate_inheritable_metamethods(L); - lua_rawset(L,-3); - } - lua_rawset(L,-3); - - lua_rawset(L,LUA_REGISTRYINDEX); -} - -/* gets the swig registry (or creates it) */ -SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L) -{ - /* add this all into the swig registry: */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ - if (!lua_istable(L,-1)) /* not there */ - { /* must be first time, so add it */ - lua_pop(L,1); /* remove the result */ - SWIG_Lua_create_class_registry(L); - /* then get it */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); - } -} - -SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L) -{ - SWIG_Lua_get_class_registry(L); - lua_pushstring(L, ".library"); - lua_rawget(L,-2); - assert( !lua_isnil(L,-1) ); - lua_pushstring(L, "inheritable_metamethods"); - lua_rawget(L,-2); - - /* Remove class registry and library table */ - lua_remove(L,-2); - lua_remove(L,-2); -} - -/* Helper function to get the classes metatable from the register */ -SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname) -{ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,cname); /* get the name */ - lua_rawget(L,-2); /* get it */ - lua_remove(L,-2); /* tidy up (remove registry) */ -} - -/* Set up the base classes pointers. -Each class structure has a list of pointers to the base class structures. -This function fills them. -It cannot be done at compile time, as this will not work with hireachies -spread over more than one swig file. -Therefore it must be done at runtime, querying the SWIG type system. -*/ -SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss) -{ - int i=0; - swig_module_info *module=SWIG_GetModule(L); - for(i=0;clss->base_names[i];i++) - { - if (clss->bases[i]==0) /* not found yet */ - { - /* lookup and cache the base class */ - swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); - if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; - } - } -} - -#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) -/* Merges two tables */ -SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source) -{ - /* iterating */ - lua_pushnil(L); - while (lua_next(L,source) != 0) { - /* -1 - value, -2 - index */ - /* have to copy to assign */ - lua_pushvalue(L,-2); /* copy of index */ - lua_pushvalue(L,-2); /* copy of value */ - lua_rawset(L, target); - lua_pop(L,1); - /* only key is left */ - } -} - -/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */ -SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base) -{ - /* push original[name], then base[name] */ - lua_pushstring(L,name); - lua_rawget(L,original); - int original_table = lua_gettop(L); - lua_pushstring(L,name); - lua_rawget(L,base); - int base_table = lua_gettop(L); - SWIG_Lua_merge_tables_by_index(L, original_table, base_table); - /* clearing stack */ - lua_pop(L,2); -} - -/* Function takes all symbols from base and adds it to derived class. It's just a helper. */ -SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls) -{ - /* There is one parameter - original, i.e. 'derived' class metatable */ - assert(lua_istable(L,-1)); - int original = lua_gettop(L); - SWIG_Lua_get_class_metatable(L,base_cls->fqname); - int base = lua_gettop(L); - SWIG_Lua_merge_tables(L, ".fn", original, base ); - SWIG_Lua_merge_tables(L, ".set", original, base ); - SWIG_Lua_merge_tables(L, ".get", original, base ); - lua_pop(L,1); -} - -/* Function squashes all symbols from 'clss' bases into itself */ -SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss) -{ - int i; - SWIG_Lua_get_class_metatable(L,clss->fqname); - for(i=0;clss->base_names[i];i++) - { - if (clss->bases[i]==0) /* Somehow it's not found. Skip it */ - continue; - /* Thing is: all bases are already registered. Thus they have already executed - * this function. So we just need to squash them into us, because their bases - * are already squashed into them. No need for recursion here! - */ - SWIG_Lua_class_squash_base(L, clss->bases[i]); - } - lua_pop(L,1); /*tidy stack*/ -} -#endif - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ -/* helper add a variable to a registered class */ -SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn) -{ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,getFn); - lua_pop(L,1); /* tidy stack (remove table) */ - if (setFn) - { - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,setFn); - lua_pop(L,1); /* tidy stack (remove table) */ - } -} - -/* helper to recursively add class static details (static attributes, operations and constants) */ -SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss) -{ - int i = 0; - /* The class namespace table must be on the top of the stack */ - assert(lua_istable(L,-1)); - /* call all the base classes first: we can then override these later: */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_add_class_static_details(L,clss->bases[i]); - } - - SWIG_Lua_add_namespace_details(L, clss->cls_static); -} - -SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */ - -/* helper to recursively add class details (attributes & operations) */ -SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss) -{ - int i; - size_t bases_count = 0; - /* Add bases to .bases table */ - SWIG_Lua_get_table(L,".bases"); - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); - /* Base class must be already registered */ - assert(lua_istable(L,-1)); - lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */ - bases_count++; - } - assert(lua_rawlen(L,-1) == bases_count); - lua_pop(L,1); /* remove .bases table */ - /* add attributes */ - for(i=0;clss->attributes[i].name;i++){ - SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); - } - /* add methods to the metatable */ - SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;clss->methods[i].name;i++){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func); - } - lua_pop(L,1); /* tidy stack (remove table) */ - /* add operator overloads - This adds methods from metatable array to metatable. Can mess up garbage - collectind if someone defines __gc method - */ - if(clss->metatable) { - for(i=0;clss->metatable[i].name;i++) { - SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func); - } - } - -#if !defined(SWIG_LUA_SQUASH_BASES) - /* Adding metamethods that are defined in base classes. If bases were squashed - * then it is obviously unnecessary - */ - SWIG_Lua_add_class_user_metamethods(L, clss); -#endif -} - -/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed - for the following issue: Lua runtime checks for metamethod existence with rawget function - ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method - search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly - in metatable and not in object). - Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants - are automatically given a special proxy __x that calls the real __x method. - Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime, - those changes must be reflected in all descendants. -*/ - -SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/ - -/* The real function that resolves a metamethod. - * Function searches given class and all its bases (recursively) for first instance of something that is - * not equal to SWIG_Lua_resolve_metamethod. (Almost always this 'something' is actual metamethod implementation - * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the - * answer. - * Returns 1 if found, 0 otherwise. - * clss is class which metatable we will search for method - * metamethod_name_idx is index in L where metamethod name (as string) lies - * skip_check allows skipping searching metamethod in the given class and immediately going to searching in bases. skip_check - * is not carried to subsequent recursive calls - false is always passed. It is set to true only at first call from - * SWIG_Lua_resolve_metamethod - * */ -SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx, - int skip_check) -{ - /* This function is called recursively */ - int result = 0; - int i = 0; - - if (!skip_check) { - SWIG_Lua_get_class_metatable(L, clss->fqname); - lua_pushvalue(L, metamethod_name_idx); - lua_rawget(L,-2); - /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then - * this isn't the function we are looking for :) - * lua_tocfunction will return NULL if not cfunction - */ - if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) { - lua_remove(L,-2); /* removing class metatable */ - return 1; - } - lua_pop(L,2); /* remove class metatable and query result */ - } - - /* Forwarding calls to bases */ - for(i=0;clss->bases[i];i++) - { - result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0); - if (result) - break; - } - - return result; -} - -/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method - * and calls it */ -SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) -{ - int numargs; - int metamethod_name_idx; - const swig_lua_class* clss; - int result; - - lua_checkstack(L,5); - numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */ - - /* Get upvalues from closure */ - lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/ - metamethod_name_idx = lua_gettop(L); - - lua_pushvalue(L, lua_upvalueindex(2)); - clss = (const swig_lua_class*)(lua_touserdata(L,-1)); - lua_pop(L,1); /* remove lightuserdata with clss from stack */ - - /* Actual work */ - result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1); - if (!result) { - SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation."); - lua_error(L); - return 0; - } - - lua_remove(L,-2); /* remove metamethod key */ - lua_insert(L,1); /* move function to correct position */ - lua_call(L, numargs, LUA_MULTRET); - return lua_gettop(L); /* return all results */ -} - - -/* If given metamethod must be present in given class, then creates appropriate proxy - * Returns 1 if successfully added, 0 if not added because no base class has it, -1 - * if method is defined in the class metatable itself - */ -SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index) -{ - int key_index; - int success = 0; - int i = 0; - - /* metamethod name - on the top of the stack */ - assert(lua_isstring(L,-1)); - - key_index = lua_gettop(L); - - /* Check whether method is already defined in metatable */ - lua_pushvalue(L,key_index); /* copy of the key */ - lua_gettable(L,metatable_index); - if( !lua_isnil(L,-1) ) { - lua_pop(L,1); - return -1; - } - lua_pop(L,1); - - /* Iterating over immediate bases */ - for(i=0;clss->bases[i];i++) - { - const swig_lua_class *base = clss->bases[i]; - SWIG_Lua_get_class_metatable(L, base->fqname); - lua_pushvalue(L, key_index); - lua_rawget(L, -2); - if( !lua_isnil(L,-1) ) { - lua_pushvalue(L, key_index); - - /* Add proxy function */ - lua_pushvalue(L, key_index); /* first closure value is function name */ - lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */ - lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2); - - lua_rawset(L, metatable_index); - success = 1; - } - lua_pop(L,1); /* remove function or nil */ - lua_pop(L,1); /* remove base class metatable */ - - if( success ) - break; - } - - return success; -} - -SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss) -{ - int metatable_index; - int metamethods_info_index; - int tostring_undefined; - int eq_undefined = 0; - - SWIG_Lua_get_class_metatable(L, clss->fqname); - metatable_index = lua_gettop(L); - SWIG_Lua_get_inheritable_metamethods(L); - assert(lua_istable(L,-1)); - metamethods_info_index = lua_gettop(L); - lua_pushnil(L); /* first key */ - while(lua_next(L, metamethods_info_index) != 0 ) { - /* key at index -2, value at index -1 */ - const int is_inheritable = lua_toboolean(L,-2); - lua_pop(L,1); /* remove value - we don't need it anymore */ - - if(is_inheritable) { /* if metamethod is inheritable */ - SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index); - } - } - - lua_pop(L,1); /* remove inheritable metamethods table */ - - /* Special handling for __tostring method */ - lua_pushstring(L, "__tostring"); - lua_pushvalue(L,-1); - lua_rawget(L,metatable_index); - tostring_undefined = lua_isnil(L,-1); - lua_pop(L,1); - if( tostring_undefined ) { - lua_pushcfunction(L, SWIG_Lua_class_tostring); - lua_rawset(L, metatable_index); - } else { - lua_pop(L,1); /* remove copy of the key */ - } - - /* Special handling for __eq method */ - lua_pushstring(L, "__eq"); - lua_pushvalue(L,-1); - lua_rawget(L,metatable_index); - eq_undefined = lua_isnil(L,-1); - lua_pop(L,1); - if( eq_undefined ) { - lua_pushcfunction(L, SWIG_Lua_class_equal); - lua_rawset(L, metatable_index); - } else { - lua_pop(L,1); /* remove copy of the key */ - } - /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[] - * a __getitem/__setitem method should be defined - */ - lua_pop(L,1); /* pop class metatable */ -} - -/* Register class static methods,attributes etc as well as constructor proxy */ -SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss) -{ - const int SWIGUNUSED begin = lua_gettop(L); - lua_checkstack(L,5); /* just in case */ - assert(lua_istable(L,-1)); /* just in case */ - assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */ - - SWIG_Lua_namespace_register(L,clss->cls_static, 1); - - assert(lua_istable(L,-1)); /* just in case */ - - /* add its constructor to module with the name of the class - so you can do MyClass(...) as well as new_MyClass(...) - BUT only if a constructor is defined - (this overcomes the problem of pure virtual classes without constructors)*/ - if (clss->constructor) - { - lua_getmetatable(L,-1); - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,"__call", clss->constructor); - lua_pop(L,1); - } - - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_class_static_details(L, clss); - - /* clear stack */ - lua_pop(L,1); - assert( lua_gettop(L) == begin ); -} - -/* Performs the instance (non-static) class registration process. Metatable for class is created - * and added to the class registry. - */ -SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss) -{ - const int SWIGUNUSED begin = lua_gettop(L); - int i; - /* if name already there (class is already registered) then do nothing */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - lua_rawget(L,-2); - if(!lua_isnil(L,-1)) { - lua_pop(L,2); - assert(lua_gettop(L)==begin); - return; - } - lua_pop(L,2); /* tidy stack */ - /* Recursively initialize all bases */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_class_register_instance(L,clss->bases[i]); - } - /* Again, get registry and push name */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - lua_newtable(L); /* create the metatable */ -#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - /* If squashing is requested, then merges all bases metatable into this one. - * It would get us all special methods: __getitem, __add etc. - * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away - */ - { - int new_metatable_index = lua_absindex(L,-1); - for(i=0;clss->bases[i];i++) - { - int base_metatable; - SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); - base_metatable = lua_absindex(L,-1); - SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); - lua_pop(L,1); - } - } - /* And now we will overwrite all incorrectly set data */ -#endif - /* add string of class name called ".type" */ - lua_pushstring(L,".type"); - lua_pushstring(L,clss->fqname); - lua_rawset(L,-3); - /* add a table called bases */ - lua_pushstring(L,".bases"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".get" */ - lua_pushstring(L,".get"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".set" */ - lua_pushstring(L,".set"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".fn" */ - lua_pushstring(L,".fn"); - lua_newtable(L); - /* add manual disown method */ - SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown); - lua_rawset(L,-3); - /* add accessor fns for using the .get,.set&.fn */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); - SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); - /* add it */ - lua_rawset(L,-3); /* metatable into registry */ - lua_pop(L,1); /* tidy stack (remove registry) */ - assert(lua_gettop(L) == begin); - -#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */ - SWIG_Lua_class_squash_bases(L,clss); -#endif - SWIG_Lua_get_class_metatable(L,clss->fqname); - SWIG_Lua_add_class_instance_details(L,clss); /* recursive adding of details (atts & ops) */ - lua_pop(L,1); /* tidy stack (remove class metatable) */ - assert( lua_gettop(L) == begin ); -} - -SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) -{ - int SWIGUNUSED begin; - assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */ - SWIG_Lua_class_register_instance(L,clss); - SWIG_Lua_class_register_static(L,clss); - - /* Add links from static part to instance part and vice versa */ - /* [SWIG registry] [Module] - * "MyClass" ----> [MyClass metatable] <===== "MyClass" -+> [static part] - * ".get" ----> ... | | getmetatable()----| - * ".set" ----> ... | | | - * ".static" --------------)----------------/ [static part metatable] - * | ".get" --> ... - * | ".set" --> .... - * |=============================== ".instance" - */ - begin = lua_gettop(L); - lua_pushstring(L,clss->cls_static->name); - lua_rawget(L,-2); /* get class static table */ - assert(lua_istable(L,-1)); - lua_getmetatable(L,-1); - assert(lua_istable(L,-1)); /* get class static metatable */ - lua_pushstring(L,".instance"); /* prepare key */ - - SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */ - assert(lua_istable(L,-1)); - lua_pushstring(L,".static"); /* prepare key */ - lua_pushvalue(L, -4); /* push static class TABLE */ - assert(lua_istable(L,-1)); - lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */ - lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */ - lua_pop(L,2); - assert(lua_gettop(L) == begin); -} -#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) -SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss) -{ - const int SWIGUNUSED begin = lua_gettop(L); - int i; - /* if name already there (class is already registered) then do nothing */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - lua_rawget(L,-2); - if(!lua_isnil(L,-1)) { - lua_pop(L,2); - assert(lua_gettop(L)==begin); - return; - } - lua_pop(L,2); /* tidy stack */ - /* Recursively initialize all bases */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_elua_class_register_instance(L,clss->bases[i]); - } - /* Again, get registry and push name */ - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->fqname); /* get the name */ - assert(clss->metatable); - lua_pushrotable(L, (void*)(clss->metatable)); /* create the metatable */ - lua_rawset(L,-3); - lua_pop(L,1); - assert(lua_gettop(L) == begin); -} -#endif /* elua && eluac */ - -/* ----------------------------------------------------------------------------- - * Class/structure conversion fns - * ----------------------------------------------------------------------------- */ - -/* helper to add metatable to new lua object */ -SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type) -{ - if (type->clientdata) /* there is clientdata: so add the metatable */ - { - SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname); - if (lua_istable(L,-1)) - { - lua_setmetatable(L,-2); - } - else - { - lua_pop(L,1); - } - } -} - -/* pushes a new object into the lua stack */ -SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own) -{ - swig_lua_userdata *usr; - if (!ptr){ - lua_pushnil(L); - return; - } - usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ - usr->ptr=ptr; /* set the ptr */ - usr->type=type; - usr->own=own; -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - SWIG_Lua_AddMetatable(L,type); /* add metatable */ -#endif -} - -/* takes a object from the lua stack & converts it into an object of the correct type - (if possible) */ -SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags) -{ - int ret = SWIG_ERROR; - swig_lua_userdata *usr; - swig_cast_info *cast; - /* special case: lua nil => NULL pointer */ - if (lua_isnil(L,index)) - { - *ptr=0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - if (lua_islightuserdata(L,index)) - { - *ptr=lua_touserdata(L,index); - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ - if (usr) - { - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !usr->own) - { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ - { - usr->own = 0; - } - if (!type) /* special cast void*, no casting fn */ - { - *ptr=usr->ptr; - ret = SWIG_OK; - } - else - { - cast=SWIG_TypeCheck(usr->type->name,type); /* performs normal type checking */ - if (cast) - { - int newmemory = 0; - *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - ret = SWIG_OK; - } - } - if ((ret == SWIG_OK) && (flags & SWIG_POINTER_CLEAR)) - { - usr->ptr = 0; - } - } - return ret; -} - -SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags, - int argnum,const char *func_name){ - void *result = 0; - if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ - luaL_error (L,"Error in %s, expected a %s at argument number %d\n", - func_name,(type && type->str)?type->str:"void*",argnum); - } - return result; -} - -/* pushes a packed userdata. user for member fn pointers only */ -SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type) -{ - swig_lua_rawdata *raw; - assert(ptr); /* not acceptable to pass in a NULL value */ - raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ - raw->type=type; - raw->own=0; - memcpy(raw->data,ptr,size); /* copy the data */ - SWIG_Lua_AddMetatable(L,type); /* add metatable */ -} - -/* converts a packed userdata. user for member fn pointers only */ -SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type) -{ - swig_lua_rawdata *raw; - raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ - if (!raw) return SWIG_ERROR; /* error */ - if (type==0 || type==raw->type) /* void* or identical type */ - { - memcpy(ptr,raw->data,size); /* copy it */ - return SWIG_OK; /* ok */ - } - return SWIG_ERROR; /* error */ -} - -/* a function to get the typestring of a piece of data */ -SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) -{ - swig_lua_userdata *usr; - if (lua_isuserdata(L,tp)) - { - usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ - if (usr && usr->type && usr->type->str) - return usr->type->str; - return "userdata (unknown type)"; - } - return lua_typename(L,lua_type(L,tp)); -} - -/* lua callable function to get the userdata's type */ -SWIGRUNTIME int SWIG_Lua_type(lua_State *L) -{ - lua_pushstring(L,SWIG_Lua_typename(L,1)); - return 1; -} - -/* ----------------------------------------------------------------------------- - * global variable support code: class/struct typemap functions - * ----------------------------------------------------------------------------- */ - -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) -/* Install Constants */ -SWIGINTERN void -SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) { - int i; - for (i = 0; constants[i].type; i++) { - switch(constants[i].type) { - case SWIG_LUA_INT: - lua_pushstring(L,constants[i].name); - lua_pushinteger(L,(lua_Integer)constants[i].lvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_FLOAT: - lua_pushstring(L,constants[i].name); - lua_pushnumber(L,(lua_Number)constants[i].dvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_CHAR: - lua_pushstring(L,constants[i].name); - { - char c = (char)constants[i].lvalue; - lua_pushlstring(L,&c,1); - } - lua_rawset(L,-3); - break; - case SWIG_LUA_STRING: - lua_pushstring(L,constants[i].name); - lua_pushstring(L,(char *) constants[i].pvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_POINTER: - lua_pushstring(L,constants[i].name); - SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0); - lua_rawset(L,-3); - break; - case SWIG_LUA_BINARY: - lua_pushstring(L,constants[i].name); - SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); - lua_rawset(L,-3); - break; - default: - break; - } - } -} -#endif - -/* ----------------------------------------------------------------------------- - * executing lua code from within the wrapper - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ -#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) -#endif -/* Executes a C string in Lua which is a really simple way of calling lua from C -Unfortunately lua keeps changing its APIs, so we need a conditional compile -In lua 5.0.X it's lua_dostring() -In lua 5.1.X it's luaL_dostring() -*/ -SWIGINTERN int -SWIG_Lua_dostring(lua_State *L, const char *str) { - int ok,top; - if (str==0 || str[0]==0) return 0; /* nothing to do */ - top=lua_gettop(L); /* save stack */ -#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) - ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ -#else - ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ -#endif - if (ok!=0) { - SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); - } - lua_settop(L,top); /* restore the stack */ - return ok; -} - -#ifdef __cplusplus -} -#endif - -/* ------------------------------ end luarun.swg ------------------------------ */ diff --git a/win64/bin/swig/share/swig/4.1.0/lua/luaruntime.swg b/win64/bin/swig/share/swig/4.1.0/lua/luaruntime.swg deleted file mode 100755 index 18b4fdcf..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/luaruntime.swg +++ /dev/null @@ -1,104 +0,0 @@ -/* ----------------------------------------------------------------------------- - * luaruntime.swg - * - * all the runtime code for . - * ----------------------------------------------------------------------------- */ - -%runtime "swigrun.swg" /* Common C API type-checking code */ -%runtime "swigerrors.swg" /* SWIG errors */ -%runtime "luarun.swg" /* Lua runtime stuff */ - -%insert(initbeforefunc) "swiginit.swg" - -%insert(initbeforefunc) %{ - -/* Forward declaration of where the user's %init{} gets inserted */ -void SWIG_init_user(lua_State* L ); - -#ifdef __cplusplus -extern "C" { -#endif -/* this is the initialization function - added at the very end of the code - the function is always called SWIG_init, but an earlier #define will rename it -*/ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) -LUALIB_API int SWIG_init(lua_State* L) -#else -SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ -#endif -{ -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ - int i; - int globalRegister = 0; - /* start with global table */ - lua_pushglobaltable (L); - /* SWIG's internal initialisation */ - SWIG_InitializeModule((void*)L); - SWIG_PropagateClientData(); -#endif - -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE) - /* add a global fn */ - SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); - SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal); -#endif - -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - /* set up base class pointers (the hierarchy) */ - for (i = 0; swig_types[i]; i++){ - if (swig_types[i]->clientdata){ - SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); - } - } -#ifdef SWIG_LUA_MODULE_GLOBAL - globalRegister = 1; -#endif - - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) - SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister); -#endif - -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) - for (i = 0; swig_types[i]; i++){ - if (swig_types[i]->clientdata){ - SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata)); - } - } -#endif - -#if defined(SWIG_LUA_ELUA_EMULATE) - lua_newtable(L); - SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods); - SWIG_Lua_elua_emulate_register_clear(L); - if(globalRegister) { - lua_pushstring(L,swig_SwigModule.name); - lua_pushvalue(L,-2); - lua_rawset(L,-4); - } -#endif - -#endif - -#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - /* invoke user-specific initialization */ - SWIG_init_user(L); - /* end module */ - /* Note: We do not clean up the stack here (Lua will do this for us). At this - point, we have the globals table and out module table on the stack. Returning - one value makes the module table the result of the require command. */ - return 1; -#else - return 0; -#endif -} - -#ifdef __cplusplus -} -#endif - -%} - -/* Note: the initialization function is closed after all code is generated */ - diff --git a/win64/bin/swig/share/swig/4.1.0/lua/luatypemaps.swg b/win64/bin/swig/share/swig/4.1.0/lua/luatypemaps.swg deleted file mode 100755 index ce963a20..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/luatypemaps.swg +++ /dev/null @@ -1,418 +0,0 @@ -/* ----------------------------------------------------------------------------- - * luatypemaps.swg - * - * basic typemaps for Lua. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * standard typemaps - * ----------------------------------------------------------------------------- */ -/* NEW LANGUAGE NOTE: - the 'checkfn' param is something that I added for typemap(in) - it is an optional fn call to check the type of the lua object - the fn call must be of the form - int checkfn(lua_State *L, int index); - and return 1/0 depending upon if this is the correct type - For the typemap(out), an additional SWIG_arg parameter must be incremented - to reflect the number of values returned (normally SWIG_arg++; will do) -*/ -// numbers -%typemap(in,checkfn="lua_isnumber") int, short, long, - signed char, float, double -%{$1 = ($type)lua_tonumber(L, $input);%} - -// additional check for unsigned numbers, to not permit negative input -%typemap(in,checkfn="lua_isnumber") unsigned int, - unsigned short, unsigned long, unsigned char -%{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative"); -$1 = ($type)lua_tonumber(L, $input);%} - -%typemap(out) int,short,long, - unsigned int,unsigned short,unsigned long, - signed char,unsigned char, - float,double -%{ lua_pushnumber(L, (lua_Number) $1); SWIG_arg++;%} - -// we must also provide typemaps for primitives by const reference: -// given a function: -// int intbyref(const int& i); -// SWIG assumes that this code will need a pointer to int to be passed in -// (this might be ok for objects by const ref, but not for numeric primitives) -// therefore we add a set of typemaps to fix this (for both in & out) -%typemap(in,checkfn="lua_isnumber") const int&($*1_ltype temp) -%{ temp=($*1_ltype)lua_tonumber(L,$input); $1=&temp;%} - -%typemap(in,checkfn="lua_isnumber") const unsigned int&($*1_ltype temp) -%{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative"); -temp=($*1_ltype)lua_tonumber(L,$input); $1=&temp;%} - -%typemap(out) const int&, const unsigned int& -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} - -// for the other numbers we can just use an apply statement to cover them -%apply const int & {const short&,const long&,const signed char&, - const float&,const double&}; - -%apply const unsigned int & {const unsigned short&,const unsigned long&, - const unsigned char&}; - -/* enums have to be handled slightly differently - VC++ .net will not allow a cast from lua_Number(double) to enum directly. -*/ -%typemap(in,checkfn="lua_isnumber") enum SWIGTYPE -%{$1 = ($type)(int)lua_tonumber(L, $input);%} - -%typemap(out) enum SWIGTYPE -%{ lua_pushnumber(L, (lua_Number)(int)($1)); SWIG_arg++;%} - -// and const refs -%typemap(in,checkfn="lua_isnumber") const enum SWIGTYPE &($basetype temp) -%{ temp=($basetype)(int)lua_tonumber(L,$input); $1=&temp;%} -%typemap(in,checkfn="lua_isnumber") const enum SWIGTYPE &&($basetype temp) -%{ temp=($basetype)(int)lua_tonumber(L,$input); $1=&temp;%} -%typemap(out) const enum SWIGTYPE & -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} -%typemap(out) const enum SWIGTYPE && -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} - - -// boolean (which is a special type in lua) -// note: lua_toboolean() returns 1 or 0 -// note: 1 & 0 are not booleans in lua, only true & false -%typemap(in,checkfn="lua_isboolean") bool -%{$1 = (lua_toboolean(L, $input)!=0);%} - -%typemap(out) bool -%{ lua_pushboolean(L,(int)($1!=0)); SWIG_arg++;%} - -// for const bool&, SWIG treats this as a const bool* so we must dereference it -%typemap(in,checkfn="lua_isboolean") const bool& (bool temp) -%{temp=(lua_toboolean(L, $input)!=0); - $1=&temp;%} - -%typemap(out) const bool& -%{ lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%} - -// strings (char * and char[]) -%fragment("SWIG_lua_isnilstring", "header") { -SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) { - int ret = lua_isstring(L, idx); - if (!ret) - ret = lua_isnil(L, idx); - return ret; -} -} - -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char *, char * -%{$1 = ($ltype)lua_tostring(L, $input);%} - -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char[ANY], char[ANY] -%{$1 = ($ltype)lua_tostring(L, $input);%} - -%typemap(out) const char *, char * -%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} - -%typemap(out) const char[ANY], char[ANY] -%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} - -// char's -// currently treating chars as small strings, not as numbers -// (however signed & unsigned char's are numbers...) -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") char -%{$1 = (lua_tostring(L, $input))[0];%} - -%typemap(out) char -%{ lua_pushlstring(L, &$1, 1); SWIG_arg++;%} - -// by const ref -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char& (char temp) -%{temp = (lua_tostring(L, $input))[0]; $1=&temp;%} - -%typemap(out) const char& -%{ lua_pushlstring(L, $1, 1); SWIG_arg++;%} - -// pointers and references -// under SWIG rules, it is ok, to have a pass in a lua nil, -// it should be converted to a SWIG NULL. -// This will only be allowed for pointers & arrays, not refs or by value -// the checkfn lua_isuserdata will only work for userdata -// the checkfn SWIG_isptrtype will work for both userdata and nil -%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE*,SWIGTYPE[] -%{ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ - SWIG_fail_ptr("$symname",$argnum,$descriptor); - } -%} - -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE& -%{ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ - SWIG_fail_ptr("$symname",$argnum,$descriptor); - } -%} - -%typemap(in,checkfn="lua_isuserdata",fragment="") SWIGTYPE&& (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) %{ - res = SWIG_ConvertPtr(L, $input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type '$1_type' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $descriptor); - } - } - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -%} - -// out is simple -%typemap(out) SWIGTYPE*,SWIGTYPE& -%{SWIG_NewPointerObj(L,$1,$descriptor,$owner); SWIG_arg++; %} -%typemap(out) SWIGTYPE*,SWIGTYPE&& -%{SWIG_NewPointerObj(L,$1,$descriptor,$owner); SWIG_arg++; %} - -// dynamic casts -// this uses the SWIG_TypeDynamicCast() which relies on RTTI to find out what the pointer really is -// the we return it as the correct type -%typemap(out) SWIGTYPE *DYNAMIC, - SWIGTYPE &DYNAMIC -{ - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_NewPointerObj(L,(void*)$1,ty,$owner); SWIG_arg++; -} - - -// passing objects by value -// SWIG_ConvertPtr wants an object pointer (the $<ype argp) -// then dereferences it to get the object -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE ($<ype argp) -%{ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&argp,$&descriptor,0))){ - SWIG_fail_ptr("$symname",$argnum,$&descriptor); - } - $1 = *argp; -%} - -// Also needed for object ptrs by const ref -// eg A* const& ref_pointer(A* const& a); -// found in mixed_types.i -%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE *const&($*ltype temp) -%{temp=($*ltype)SWIG_MustGetPtr(L,$input,$*descriptor,0,$argnum,"$symname"); -$1=($1_ltype)&temp;%} - -%typemap(out) SWIGTYPE *const& -%{SWIG_NewPointerObj(L,*$1,$*descriptor,$owner); SWIG_arg++; %} - - -// DISOWN-ing typemaps -// if you have an object pointer which must be disowned, use this typemap -// eg. for void destroy_foo(Foo* toDie); -// use %apply SWIGTYPE* DISOWN {Foo* toDie}; -// you could just use %delobject, but this is more flexible -%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE* DISOWN,SWIGTYPE DISOWN[] -%{ if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("$symname",$argnum,$descriptor); - } -%} - - -// Primitive types--return by value -// must make a new object, copy the data & return the new object -// Note: the brackets are {...} and not %{..%}, because we want them to be included in the wrapper -// this is because typemap(out) does not support local variables, like in typemap(in) does -// and we need the $&1_ltype resultptr; to be declared -#ifdef __cplusplus -%typemap(out) SWIGTYPE -{ - $&1_ltype resultptr = new $1_ltype($1); - SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; -} -#else -%typemap(out) SWIGTYPE -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; -} -#endif - -// member function pointer -// a member fn ptr is not 4 bytes like a normal pointer, but 8 bytes (at least on mingw) -// so the standard wrapping cannot be done -// nor can you cast a member function pointer to a void* (obviously) -// therefore a special wrapping functions SWIG_ConvertMember() & SWIG_NewMemberObj() were written -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE (CLASS::*) -%{ - if (!SWIG_IsOK(SWIG_ConvertMember(L,$input,(void*)(&$1),sizeof($1),$descriptor))) - SWIG_fail_ptr("$symname",$argnum,$descriptor); -%} - -%typemap(out) SWIGTYPE (CLASS::*) -%{ - SWIG_NewMemberObj(L,(void*)(&$1),sizeof($1),$descriptor); SWIG_arg++; -%} - - -// void (must be empty without the SWIG_arg++) -%typemap(out) void "" - -/* void* is a special case -A function void fn(void*) should take any kind of pointer as a parameter (just like C/C++ does) -but if it's an output, then it should be wrapped like any other SWIG object (using default typemap) -*/ -%typemap(in,checkfn="SWIG_isptrtype") void* -%{$1=($1_ltype)SWIG_MustGetPtr(L,$input,0,0,$argnum,"$symname");%} - -/* long long is another special case: -as lua only supports one numeric type (lua_Number), we will just -cast it to that & accept the loss of precision. -An alternative solution would be a long long struct or class -with the relevant operators. -*/ -%apply long {long long, signed long long, unsigned long long}; -%apply const long& {const long long&, const signed long long&, const unsigned long long&}; - -/* It is possible to also pass a lua_State* into a function, so -void fn(int a, float b, lua_State* s) is wrappable as -> fn(1,4.3) -- note: the state is implicitly passed in -*/ -%typemap(in, numinputs=0) lua_State* -%{$1 = L;%} - - - -/* ----------------------------------------------------------------------------- - * typecheck rules - * ----------------------------------------------------------------------------- */ -/* These are needed for the overloaded functions -These define the detection routines which will spot what -parameters match which function -*/ - -// unfortunately lua only considers one type of number -// so all numbers (int,float,double) match -// you could add an advanced fn to get type & check if it's integral -%typecheck(SWIG_TYPECHECK_INTEGER) - int, short, long, - unsigned int, unsigned short, unsigned long, - signed char, unsigned char, - long long, unsigned long long, signed long long, - const int &, const short &, const long &, - const unsigned int &, const unsigned short &, const unsigned long &, - const signed char&, const unsigned char&, - const long long &, const unsigned long long &, - enum SWIGTYPE, const enum SWIGTYPE&, const enum SWIGTYPE &&, - float, double, const float &, const double& -{ - $1 = lua_isnumber(L,$input); -} - -%typecheck(SWIG_TYPECHECK_BOOL) - bool, const bool & -{ - $1 = lua_isboolean(L,$input); -} - -// special check for a char (string of length 1) -%typecheck(SWIG_TYPECHECK_CHAR,fragment="SWIG_lua_isnilstring") char, const char& { - $1 = SWIG_lua_isnilstring(L,$input) && (lua_rawlen(L,$input)==1); -} - -%typecheck(SWIG_TYPECHECK_STRING,fragment="SWIG_lua_isnilstring") char *, char[] { - $1 = SWIG_lua_isnilstring(L,$input); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { - void *ptr; - if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE & { - void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE && { - void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $&1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, 0, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -// Also needed for object pointers by const ref -// eg const A* ref_pointer(A* const& a); -// found in mixed_types.i -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& -{ - void *ptr; - if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $*descriptor, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -/* ----------------------------------------------------------------------------- - * Others - * ----------------------------------------------------------------------------- */ - -// Array reference typemaps -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -// size_t (which is just a unsigned long) -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; - - -/* ----------------------------------------------------------------------------- - * Specials - * ----------------------------------------------------------------------------- */ -// swig::LANGUAGE_OBJ was added to allow containers of native objects -// however it's rather difficult to do this in lua, as you cannot hold pointers -// to native objects (they are held in the interpreter) -// therefore for now: just ignoring this feature -#ifdef __cplusplus -%ignore swig::LANGUAGE_OBJ; - -//%inline %{ -%{ -namespace swig { -typedef struct{} LANGUAGE_OBJ; -} -%} - -#endif // __cplusplus diff --git a/win64/bin/swig/share/swig/4.1.0/lua/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/lua/std_auto_ptr.i deleted file mode 100755 index b7ee2936..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, checkfn="SWIG_isptrtype", noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(L, $input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $descriptor(TYPE *)); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++; -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/lua/std_common.i b/win64/bin/swig/share/swig/4.1.0/lua/std_common.i deleted file mode 100755 index c80263ae..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/std_common.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - diff --git a/win64/bin/swig/share/swig/4.1.0/lua/std_deque.i b/win64/bin/swig/share/swig/4.1.0/lua/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/lua/std_except.i b/win64/bin/swig/share/swig/4.1.0/lua/std_except.i deleted file mode 100755 index 1700f677..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/std_except.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Typemaps used by the STL wrappers that throw exceptions. - * These typemaps are used when methods are declared with an STL exception - * specification, such as: - * size_t at() const throw (std::out_of_range); - * - * std_except.i - * ----------------------------------------------------------------------------- */ - -%{ -#include -#include -%} -%include - -namespace std -{ - %ignore exception; // not sure if I should ignore this... - class exception - { - public: - exception() throw() { } - virtual ~exception() throw(); - virtual const char* what() const throw(); - }; -} - -// normally objects which are thrown are returned to the interpreter as errors -// (which potentially may have problems if they are not copied) -// therefore all classes based upon std::exception are converted to their strings & returned as errors -%typemap(throws) std::bad_cast "SWIG_exception(SWIG_TypeError, $1.what());" -%typemap(throws) std::bad_exception "SWIG_exception(SWIG_RuntimeError, $1.what());" -%typemap(throws) std::domain_error "SWIG_exception(SWIG_ValueError, $1.what());" -%typemap(throws) std::exception "SWIG_exception(SWIG_SystemError, $1.what());" -%typemap(throws) std::invalid_argument "SWIG_exception(SWIG_ValueError, $1.what());" -%typemap(throws) std::length_error "SWIG_exception(SWIG_IndexError, $1.what());" -%typemap(throws) std::logic_error "SWIG_exception(SWIG_RuntimeError, $1.what());" -%typemap(throws) std::out_of_range "SWIG_exception(SWIG_IndexError, $1.what());" -%typemap(throws) std::overflow_error "SWIG_exception(SWIG_OverflowError, $1.what());" -%typemap(throws) std::range_error "SWIG_exception(SWIG_IndexError, $1.what());" -%typemap(throws) std::runtime_error "SWIG_exception(SWIG_RuntimeError, $1.what());" -%typemap(throws) std::underflow_error "SWIG_exception(SWIG_RuntimeError, $1.what());" diff --git a/win64/bin/swig/share/swig/4.1.0/lua/std_map.i b/win64/bin/swig/share/swig/4.1.0/lua/std_map.i deleted file mode 100755 index a639a47a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/std_map.i +++ /dev/null @@ -1,66 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; -} diff --git a/win64/bin/swig/share/swig/4.1.0/lua/std_pair.i b/win64/bin/swig/share/swig/4.1.0/lua/std_pair.i deleted file mode 100755 index 8ba27498..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/std_pair.i +++ /dev/null @@ -1,26 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * std::pair typemaps for LUA - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - T first; - U second; - }; - - template - pair make_pair(const T& first, const U& second); -} diff --git a/win64/bin/swig/share/swig/4.1.0/lua/std_string.i b/win64/bin/swig/share/swig/4.1.0/lua/std_string.i deleted file mode 100755 index 01fa12db..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/std_string.i +++ /dev/null @@ -1,125 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * std::string typemaps for LUA - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -/* -Only std::string and const std::string& are typemapped -they are converted to the Lua strings automatically - -std::string& and std::string* are not -they must be explicitly managed (see below) - -eg. - -std::string test_value(std::string x) { - return x; -} - -can be used as - -s="hello world" -s2=test_value(s) -assert(s==s2) -*/ - -namespace std { - -%naturalvar string; - -/* -Bug report #1526022: -Lua strings and std::string can contain embedded zero bytes -Therefore a standard out typemap should not be: - lua_pushstring(L,$1.c_str()); -but - lua_pushlstring(L,$1.data(),$1.size()); - -Similarly for getting the string - $1 = (char*)lua_tostring(L, $input); -becomes - $1.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); - -Not using: lua_tolstring() as this is only found in Lua 5.1 & not 5.0.2 -*/ - -%typemap(in,checkfn="lua_isstring") string -%{$1.assign(lua_tostring(L,$input),lua_rawlen(L,$input));%} - -%typemap(out) string -%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_arg++;%} - -%typemap(in,checkfn="lua_isstring") const string& ($*1_ltype temp) -%{temp.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); $1=&temp;%} - -%typemap(out) const string& -%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} - -// for throwing of any kind of string, string ref's and string pointers -// we convert all to lua strings -%typemap(throws) string, string&, const string& -%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_fail;%} - -%typemap(throws) string*, const string* -%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_fail;%} - -%typecheck(SWIG_TYPECHECK_STRING) string, const string& { - $1 = lua_isstring(L,$input); -} - -/* -std::string& can be wrapped, but you must inform SWIG if it is in or out - -eg: -void fn(std::string& str); -Is this an in/out/inout value? - -Therefore you need the usual -%apply (std::string& INOUT) {std::string& str}; -or -%apply std::string& INOUT {std::string& str}; -typemaps to tell SWIG what to do. -*/ - -%typemap(in) string &INPUT=const string &; -%typemap(in, numinputs=0) string &OUTPUT ($*1_ltype temp) -%{ $1 = &temp; %} -%typemap(argout) string &OUTPUT -%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} -%typemap(in) string &INOUT =const string &; -%typemap(argout) string &INOUT = string &OUTPUT; - -/* -A really cut down version of the string class - -This provides basic mapping of lua strings <-> std::string -and little else -(the std::string has a lot of unneeded functions anyway) - -note: no fn's taking the const string& -as this is overloaded by the const char* version -*/ - - class string { - public: - string(); - string(const char*); - unsigned int size() const; - unsigned int length() const; - bool empty() const; - // no support for operator[] - const char* c_str()const; - const char* data()const; - // assign does not return a copy of this object - // (no point in a scripting language) - void assign(const char*); - // no support for all the other features - // it's probably better to do it in lua - }; -} - diff --git a/win64/bin/swig/share/swig/4.1.0/lua/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/lua/std_unique_ptr.i deleted file mode 100755 index 424a53c2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, checkfn="SWIG_isptrtype", noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(L, $input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $descriptor(TYPE *)); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++; -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/lua/std_vector.i b/win64/bin/swig/share/swig/4.1.0/lua/std_vector.i deleted file mode 100755 index ccb2dbf8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/std_vector.i +++ /dev/null @@ -1,140 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * std::vector typemaps for LUA - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} -%include // the general exceptions -/* -A really cut down version of the vector class. - -Note: this does not match the true std::vector class -but instead is an approximate, so that SWIG knows how to wrapper it. -(Eg, all access is by value, not ref, as SWIG turns refs to pointers) - -And no support for iterators & insert/erase - -It would be useful to have a vector<->Lua table conversion routine - -*/ -namespace std { - - template - class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(unsigned int); - vector(const vector& other); - vector(unsigned int,T); - - unsigned int size() const; - unsigned int max_size() const; - bool empty() const; - void clear(); - void push_back(T val); - void pop_back(); - T front()const; // only read front & back - T back()const; // not write to them - // operator [] given later: - - %extend // this is a extra bit of SWIG code - { - // [] is replaced by __getitem__ & __setitem__ - // simply throws a string, which causes a lua error - T __getitem__(unsigned int idx) throw (std::out_of_range) - { - if (idx>=self->size()) - throw std::out_of_range("in vector::__getitem__()"); - return (*self)[idx]; - } - void __setitem__(unsigned int idx,T val) throw (std::out_of_range) - { - if (idx>=self->size()) - throw std::out_of_range("in vector::__setitem__()"); - (*self)[idx]=val; - } - }; - }; - -} - -/* -Vector<->LuaTable fns -These look a bit like the array<->LuaTable fns -but are templated, not %defined -(you must have template support for STL) - -*/ -/* -%{ -// reads a table into a vector of numbers -// lua numbers will be cast into the type required (rounding may occur) -// return 0 if non numbers found in the table -// returns new'ed ptr if ok -template -std::vector* SWIG_read_number_vector(lua_State* L,int index) -{ - int i=0; - std::vector* vec=new std::vector(); - while(1) - { - lua_rawgeti(L,index,i+1); - if (!lua_isnil(L,-1)) - { - lua_pop(L,1); - break; // finished - } - if (!lua_isnumber(L,-1)) - { - lua_pop(L,1); - delete vec; - return 0; // error - } - vec->push_back((T)lua_tonumber(L,-1)); - lua_pop(L,1); - ++i; - } - return vec; // ok -} -// writes a vector of numbers out as a lua table -template -int SWIG_write_number_vector(lua_State* L,std::vector *vec) -{ - lua_newtable(L); - for(int i=0;isize();++i) - { - lua_pushnumber(L,(double)((*vec)[i])); - lua_rawseti(L,-2,i+1);// -1 is the number, -2 is the table - } -} -%} - -// then the typemaps - -%define SWIG_TYPEMAP_NUM_VECTOR(T) - -// in -%typemap(in) std::vector *INPUT -%{ $1 = SWIG_read_number_vector(L,$input); - if (!$1) SWIG_fail;%} - -%typemap(freearg) std::vector *INPUT -%{ delete $1;%} - -// out -%typemap(argout) std::vector *OUTPUT -%{ SWIG_write_number_vector(L,$1); SWIG_arg++; %} - -%enddef -*/ diff --git a/win64/bin/swig/share/swig/4.1.0/lua/stl.i b/win64/bin/swig/share/swig/4.1.0/lua/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/lua/swigmove.i b/win64/bin/swig/share/swig/4.1.0/lua/swigmove.i deleted file mode 100755 index 25cf4739..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/swigmove.i +++ /dev/null @@ -1,18 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, checkfn="lua_isuserdata", noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(L, $input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - lua_pushfstring(L, "Cannot release ownership as memory is not owned for argument $argnum of type '$1_type' in $symname"); SWIG_fail; - } else { - SWIG_fail_ptr("$symname", $argnum, $&1_descriptor); - } - } - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/win64/bin/swig/share/swig/4.1.0/lua/typemaps.i b/win64/bin/swig/share/swig/4.1.0/lua/typemaps.i deleted file mode 100755 index cdabb05e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/typemaps.i +++ /dev/null @@ -1,554 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.swg - * - * SWIG Library file containing the main typemap code to support Lua modules. - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Basic inout typemaps - * ----------------------------------------------------------------------------- */ -/* -These provide the basic ability for passing in & out of standard numeric data types -(int,long,float,double, etc) - -The basic code looks like this: - -%typemap(in,checkfn="lua_isnumber") int *INPUT(int temp), int &INPUT(int temp) -%{ temp = (int)lua_tonumber(L,$input); - $1 = &temp; %} - -%typemap(in, numinputs=0) int *OUTPUT (int temp) -%{ $1 = &temp; %} - -%typemap(argout) int *OUTPUT -%{ lua_pushnumber(L, (double) *$1); SWIG_arg++;%} - -%typemap(in) int *INOUT = int *INPUT; -%typemap(argout) int *INOUT = int *OUTPUT; - -However the code below is a mixture of #defines & such, so nowhere as easy to read - -To make you code work correctly it's not just a matter of %including this file -You also have to give SWIG the hints on which to use where - -eg -extern int add_pointer(int* a1,int* a2); // a1 & a2 are pointer values to be added -extern void swap(int* s1, int* s2); // does the swap - -You will need to either change the argument names -extern int add_pointer(int* INPUT,int* INPUT); - -or provide a %apply statement - -%apply int* INOUT{ int *s1, int *s2 }; - // if SWIG sees int* s1, int* s2, assume they are inout params -*/ - - -%define SWIG_NUMBER_TYPEMAP(TYPE) -%typemap(in,checkfn="lua_isnumber") TYPE *INPUT($*ltype temp), TYPE &INPUT($*ltype temp) -%{ temp = ($*ltype)lua_tonumber(L,$input); - $1 = &temp; %} -%typemap(in, numinputs=0) TYPE *OUTPUT ($*ltype temp) -%{ $1 = &temp; %} -%typemap(argout) TYPE *OUTPUT -%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} -%typemap(in) TYPE *INOUT = TYPE *INPUT; -%typemap(argout) TYPE *INOUT = TYPE *OUTPUT; -%typemap(in) TYPE &OUTPUT = TYPE *OUTPUT; -%typemap(argout) TYPE &OUTPUT = TYPE *OUTPUT; -%typemap(in) TYPE &INOUT = TYPE *INPUT; -%typemap(argout) TYPE &INOUT = TYPE *OUTPUT; -// const version (the $*ltype is the basic number without ptr or const's) -%typemap(in,checkfn="lua_isnumber") const TYPE *INPUT($*ltype temp) -%{ temp = ($*ltype)lua_tonumber(L,$input); - $1 = &temp; %} -%enddef - -// now the code -SWIG_NUMBER_TYPEMAP(unsigned char); SWIG_NUMBER_TYPEMAP(signed char); - -SWIG_NUMBER_TYPEMAP(short); SWIG_NUMBER_TYPEMAP(unsigned short); SWIG_NUMBER_TYPEMAP(signed short); -SWIG_NUMBER_TYPEMAP(int); SWIG_NUMBER_TYPEMAP(unsigned int); SWIG_NUMBER_TYPEMAP(signed int); -SWIG_NUMBER_TYPEMAP(long); SWIG_NUMBER_TYPEMAP(unsigned long); SWIG_NUMBER_TYPEMAP(signed long); -SWIG_NUMBER_TYPEMAP(float); -SWIG_NUMBER_TYPEMAP(double); -SWIG_NUMBER_TYPEMAP(enum SWIGTYPE); -// also for long longs's -SWIG_NUMBER_TYPEMAP(long long); SWIG_NUMBER_TYPEMAP(unsigned long long); SWIG_NUMBER_TYPEMAP(signed long long); - -// note we don't do char, as a char* is probably a string not a ptr to a single char - -// similar for booleans -%typemap(in,checkfn="lua_isboolean") bool *INPUT(bool temp), bool &INPUT(bool temp) -%{ temp = (lua_toboolean(L,$input)!=0); - $1 = &temp; %} - -%typemap(in, numinputs=0) bool *OUTPUT (bool temp),bool &OUTPUT (bool temp) -%{ $1 = &temp; %} - -%typemap(argout) bool *OUTPUT,bool &OUTPUT -%{ lua_pushboolean(L, (int)((*$1)!=0)); SWIG_arg++;%} - -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; - -/* ----------------------------------------------------------------------------- - * Basic Array typemaps - * ----------------------------------------------------------------------------- */ -/* -I have no idea why this kind of code does not exist in SWIG as standard, -but here is it. -This code will convert to/from 1D numeric arrays. -In order to reduce code bloat, there are a few macros -and quite a few functions defined -(unfortunately this makes it a lot less clear) - -assuming we have functions -void process_array(int arr[3]); // nice fixed size array -void process_var_array(float arr[],int len); // variable sized array -void process_var_array_inout(double* arr,int len); // variable sized array - // data passed in & out -void process_enum_inout_array_var(enum Days *arrinout, int len); // using enums -void return_array_5(int arrout[5]); // out array only - -in order to wrap them correctly requires a typemap - -// inform SWIG of the correct typemap -// For fixed length, you must specify it as INPUT[ANY] -%apply (int INPUT[ANY]) {(int arr[3])}; -// variable length arrays are just the same -%apply (float INPUT[],int) {(float arr[],int len)}; -// it is also ok, to map the TYPE* instead of a TYPE[] -%apply (double *INOUT,int) {(double arr*,int len)}; -// for the enum's you must use enum SWIGTYPE -%apply (enum SWIGTYPE *INOUT,int) {(enum Days *arrinout, int len)}; -// fixed length out if also fine -%apply (int OUTPUT[ANY]) {(int arrout[5])}; - -Generally, you could use %typemap(...)=... -but the %apply is neater & easier - -a few things of note: -* all Lua tables are indexed from 1, all C/C++ arrays are indexed from 0 - therefore t={6,5,3} -- t[1]==6, t[2]==5, t[3]==3 - when passed to process_array(int arr[3]) becomes - arr[0]==6, arr[1]==5, arr[2]==3 -* for OUTPUT arrays, no array need be passed in, the fn will return a Lua table - so for the above mentioned return_array_5() would look like - arr=return_array_5() -- no parameters passed in -* for INOUT arrays, a table must be passed in, and a new table will be returned - (this is consistent with the way that numbers are processed) - if you want just use - arr={...} - arr=process_var_array_inout(arr) -- arr is replaced by the new version - -The following are not yet supported: -* variable length output only array (inout works ok) -* multidimensional arrays -* arrays of objects/structs -* arrays of pointers - -*/ - -/* -The internals of the array management stuff -helper fns/macros -SWIG_ALLOC_ARRAY(TYPE,LEN) // returns a typed array TYPE[LEN] -SWIG_FREE_ARRAY(PTR) // delete the ptr (if not zero) - -// counts the specified table & gets the size -// integer version -int SWIG_itable_size(lua_State* L, int index); -// other version -int SWIG_table_size(lua_State* L, int index); - -SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE) -// this fn declares up 4 functions for helping to read/write tables -// these can then be called by the macros ... -// all assume the table is an integer indexes from 1 -// but the C array is a indexed from 0 - // created a fixed size array, reads the specified table - // and then fills the array with numbers - // returns ptr to the array if ok, or 0 for error - // (also pushes a error message to the stack) -TYPE* SWIG_get_NAME_num_array_fixed(lua_State* L, int index, int size); - // as per SWIG_get_NAME_num_array_fixed() - // but reads the entire table & creates an array of the correct size - // (if the table is empty, it returns an error rather than a zero length array) -TYPE* SWIG_get_NAME_num_array_var(lua_State* L, int index, int* size); - // writes a table to Lua with all the specified numbers -void SWIG_write_NAME_num_array(lua_State* L,TYPE *array,int size); - // read the specified table, and fills the array with numbers - // returns 1 of ok (only fails if it doesn't find numbers) - // helper fn (called by SWIG_get_NAME_num_array_*() fns) -int SWIG_read_NAME_num_array(lua_State* L,int index,TYPE *array,int size); - -*/ - -%{ -#ifdef __cplusplus /* generic alloc/dealloc fns*/ -#define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN] -#define SWIG_FREE_ARRAY(PTR) delete[] PTR -#else -#define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE)) -#define SWIG_FREE_ARRAY(PTR) free(PTR) -#endif -/* counting the size of arrays:*/ -SWIGINTERN int SWIG_itable_size(lua_State* L, int index) -{ - int n=0; - while(1){ - lua_rawgeti(L,index,n+1); - if (lua_isnil(L,-1))break; - ++n; - lua_pop(L,1); - } - lua_pop(L,1); - return n; -} - -SWIGINTERN int SWIG_table_size(lua_State* L, int index) -{ - int n=0; - lua_pushnil(L); /* first key*/ - while (lua_next(L, index) != 0) { - ++n; - lua_pop(L, 1); /* removes `value'; keeps `key' for next iteration*/ - } - return n; -} - -/* super macro to declare array typemap helper fns */ -#define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\ - SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\ - int i;\ - for (i = 0; i < size; i++) {\ - lua_rawgeti(L,index,i+1);\ - if (lua_isnumber(L,-1)){\ - array[i] = (TYPE)lua_tonumber(L,-1);\ - } else {\ - lua_pop(L,1);\ - return 0;\ - }\ - lua_pop(L,1);\ - }\ - return 1;\ - }\ - SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\ - TYPE *array;\ - if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\ - SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);\ - return 0;\ - }\ - array=SWIG_ALLOC_ARRAY(TYPE,size);\ - if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\ - SWIG_Lua_pusherrstring(L,"table must contain numbers");\ - SWIG_FREE_ARRAY(array);\ - return 0;\ - }\ - return array;\ - }\ - SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\ - {\ - TYPE *array;\ - if (!lua_istable(L,index)) {\ - SWIG_Lua_pusherrstring(L,"expected a table");\ - return 0;\ - }\ - *size=SWIG_itable_size(L,index);\ - if (*size<1){\ - SWIG_Lua_pusherrstring(L,"table appears to be empty");\ - return 0;\ - }\ - array=SWIG_ALLOC_ARRAY(TYPE,*size);\ - if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\ - SWIG_Lua_pusherrstring(L,"table must contain numbers");\ - SWIG_FREE_ARRAY(array);\ - return 0;\ - }\ - return array;\ - }\ - SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\ - int i;\ - lua_newtable(L);\ - for (i = 0; i < size; i++){\ - lua_pushnumber(L,(lua_Number)array[i]);\ - lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \ - }\ - } -%} - -/* -This is one giant macro to define the typemaps & the helpers -for array handling -*/ -%define SWIG_TYPEMAP_NUM_ARR(NAME,TYPE) -%{SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)%} - -// fixed size array's -%typemap(in) TYPE INPUT[ANY] -%{ $1 = SWIG_get_##NAME##_num_array_fixed(L,$input,$1_dim0); - if (!$1) SWIG_fail;%} - -%typemap(freearg) TYPE INPUT[ANY] -%{ SWIG_FREE_ARRAY($1);%} - -// variable size array's -%typemap(in) (TYPE *INPUT,int) -%{ $1 = SWIG_get_##NAME##_num_array_var(L,$input,&$2); - if (!$1) SWIG_fail;%} - -%typemap(freearg) (TYPE *INPUT,int) -%{ SWIG_FREE_ARRAY($1);%} - -// out fixed arrays -%typemap(in,numinputs=0) TYPE OUTPUT[ANY] -%{ $1 = SWIG_ALLOC_ARRAY(TYPE,$1_dim0); %} - -%typemap(argout) TYPE OUTPUT[ANY] -%{ SWIG_write_##NAME##_num_array(L,$1,$1_dim0); SWIG_arg++; %} - -%typemap(freearg) TYPE OUTPUT[ANY] -%{ SWIG_FREE_ARRAY($1); %} - -// inout fixed arrays -%typemap(in) TYPE INOUT[ANY]=TYPE INPUT[ANY]; -%typemap(argout) TYPE INOUT[ANY]=TYPE OUTPUT[ANY]; -%typemap(freearg) TYPE INOUT[ANY]=TYPE INPUT[ANY]; -// inout variable arrays -%typemap(in) (TYPE *INOUT,int)=(TYPE *INPUT,int); -%typemap(argout) (TYPE *INOUT,int) -%{ SWIG_write_##NAME##_num_array(L,$1,$2); SWIG_arg++; %} -%typemap(freearg) (TYPE *INOUT,int)=(TYPE *INPUT,int); - -// TODO out variable arrays (is there a standard form for such things?) - -// referencing so that (int *INPUT,int) and (int INPUT[],int) are the same -%typemap(in) (TYPE INPUT[],int)=(TYPE *INPUT,int); -%typemap(freearg) (TYPE INPUT[],int)=(TYPE *INPUT,int); - -%enddef - -// the following line of code -// declares the C helper fns for the array typemaps -// as well as defining typemaps for -// fixed len arrays in & out, & variable length arrays in - -SWIG_TYPEMAP_NUM_ARR(schar,signed char); -SWIG_TYPEMAP_NUM_ARR(uchar,unsigned char); -SWIG_TYPEMAP_NUM_ARR(int,int); -SWIG_TYPEMAP_NUM_ARR(uint,unsigned int); -SWIG_TYPEMAP_NUM_ARR(short,short); -SWIG_TYPEMAP_NUM_ARR(ushort,unsigned short); -SWIG_TYPEMAP_NUM_ARR(long,long); -SWIG_TYPEMAP_NUM_ARR(ulong,unsigned long); -SWIG_TYPEMAP_NUM_ARR(float,float); -SWIG_TYPEMAP_NUM_ARR(double,double); - -// again enums are a problem so they need their own type -// we use the int conversion routine & recast it -%typemap(in) enum SWIGTYPE INPUT[ANY] -%{ $1 = ($ltype)SWIG_get_int_num_array_fixed(L,$input,$1_dim0); - if (!$1) SWIG_fail;%} - -%typemap(freearg) enum SWIGTYPE INPUT[ANY] -%{ SWIG_FREE_ARRAY($1);%} - -// variable size arrays -%typemap(in) (enum SWIGTYPE *INPUT,int) -%{ $1 = ($ltype)SWIG_get_int_num_array_var(L,$input,&$2); - if (!$1) SWIG_fail;%} - -%typemap(freearg) (enum SWIGTYPE *INPUT,int) -%{ SWIG_FREE_ARRAY($1);%} - -// out fixed arrays -%typemap(in,numinputs=0) enum SWIGTYPE OUTPUT[ANY] -%{ $1 = SWIG_ALLOC_ARRAY(enum SWIGTYPE,$1_dim0); %} - -%typemap(argout) enum SWIGTYPE OUTPUT[ANY] -%{ SWIG_write_int_num_array(L,(int*)$1,$1_dim0); SWIG_arg++; %} - -%typemap(freearg) enum SWIGTYPE OUTPUT[ANY] -%{ SWIG_FREE_ARRAY($1); %} - -// inout fixed arrays -%typemap(in) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; -%typemap(argout) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE OUTPUT[ANY]; -%typemap(freearg) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; -// inout variable arrays -%typemap(in) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); -%typemap(argout) (enum SWIGTYPE *INOUT,int) -%{ SWIG_write_int_num_array(L,(int*)$1,$2); SWIG_arg++; %} -%typemap(freearg) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); - - -/* Surprisingly pointer arrays are easier: -this is because all ptr arrays become void** -so only a few fns are needed & a few casts - -The function defined are - // created a fixed size array, reads the specified table - // and then fills the array with pointers (checking the type) - // returns ptr to the array if ok, or 0 for error - // (also pushes a error message to the stack) -void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type); - // as per SWIG_get_ptr_array_fixed() - // but reads the entire table & creates an array of the correct size - // (if the table is empty, it returns an error rather than a zero length array) -void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type); - // writes a table to Lua with all the specified pointers - // all pointers have the ownership value 'own' (normally 0) -void SWIG_write_ptr_array(lua_State* L,void **array,int size,int own); - // read the specified table, and fills the array with ptrs - // returns 1 of ok (only fails if it doesn't find correct type of ptrs) - // helper fn (called by SWIG_get_ptr_array_*() fns) -int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type); - -The key thing to remember is that it is assumed that there is no -modification of pointers ownership in the arrays - -eg A fn: -void pointers_in(TYPE* arr[],int len); -will make copies of the pointer into a temp array and then pass it into the fn -Lua does not remember that this fn held the pointers, so it is not safe to keep -these pointers until later - -eg A fn: -void pointers_out(TYPE* arr[3]); -will return a table containing three pointers -however these pointers are NOT owned by Lua, merely borrowed -so if the C/C++ frees then Lua is not aware - -*/ - -%{ -SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){ - int i; - for (i = 0; i < size; i++) { - lua_rawgeti(L,index,i+1); - if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){ - lua_pop(L,1); - return 0; - } - lua_pop(L,1); - } - return 1; -} -SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){ - void **array; - if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) { - SWIG_Lua_pushferrstring(L,"expected a table of size %d",size); - return 0; - } - array=SWIG_ALLOC_ARRAY(void*,size); - if (!SWIG_read_ptr_array(L,index,array,size,type)){ - SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name); - SWIG_FREE_ARRAY(array); - return 0; - } - return array; -} -SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){ - void **array; - if (!lua_istable(L,index)) { - SWIG_Lua_pusherrstring(L,"expected a table"); - return 0; - } - *size=SWIG_itable_size(L,index); - if (*size<1){ - SWIG_Lua_pusherrstring(L,"table appears to be empty"); - return 0; - } - array=SWIG_ALLOC_ARRAY(void*,*size); - if (!SWIG_read_ptr_array(L,index,array,*size,type)){ - SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name); - SWIG_FREE_ARRAY(array); - return 0; - } - return array; -} -SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){ - int i; - lua_newtable(L); - for (i = 0; i < size; i++){ - SWIG_NewPointerObj(L,array[i],type,own); - lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ - } -} -%} - -// fixed size array's -%typemap(in) SWIGTYPE* INPUT[ANY] -%{ $1 = ($ltype)SWIG_get_ptr_array_fixed(L,$input,$1_dim0,$*1_descriptor); - if (!$1) SWIG_fail;%} - -%typemap(freearg) SWIGTYPE* INPUT[ANY] -%{ SWIG_FREE_ARRAY($1);%} - -// variable size array's -%typemap(in) (SWIGTYPE **INPUT,int) -%{ $1 = ($ltype)SWIG_get_ptr_array_var(L,$input,&$2,$*1_descriptor); - if (!$1) SWIG_fail;%} - -%typemap(freearg) (SWIGTYPE **INPUT,int) -%{ SWIG_FREE_ARRAY($1);%} - -// out fixed arrays -%typemap(in,numinputs=0) SWIGTYPE* OUTPUT[ANY] -%{ $1 = SWIG_ALLOC_ARRAY($*1_type,$1_dim0); %} - -%typemap(argout) SWIGTYPE* OUTPUT[ANY] -%{ SWIG_write_ptr_array(L,(void**)$1,$1_dim0,$*1_descriptor,0); SWIG_arg++; %} - -%typemap(freearg) SWIGTYPE* OUTPUT[ANY] -%{ SWIG_FREE_ARRAY($1); %} - -// inout fixed arrays -%typemap(in) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; -%typemap(argout) SWIGTYPE* INOUT[ANY]=SWIGTYPE* OUTPUT[ANY]; -%typemap(freearg) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; -// inout variable arrays -%typemap(in) (SWIGTYPE** INOUT,int)=(SWIGTYPE** INPUT,int); -%typemap(argout) (SWIGTYPE** INOUT,int) -%{ SWIG_write_ptr_array(L,(void**)$1,$2,$*1_descriptor,0); SWIG_arg++; %} -%typemap(freearg) (SWIGTYPE**INOUT,int)=(SWIGTYPE**INPUT,int); - -/* ----------------------------------------------------------------------------- - * Pointer-Pointer typemaps - * ----------------------------------------------------------------------------- */ -/* -This code is to deal with the issue for pointer-pointer's -In particular for factory methods. - -for example take the following code segment: - -struct iMath; // some structure -int Create_Math(iMath** pptr); // its factory (assume it mallocs) - -to use it you might have the following C code: - -iMath* ptr; -int ok; -ok=Create_Math(&ptr); -// do things with ptr -//... -free(ptr); - -With the following SWIG code -%apply SWIGTYPE** OUTPUT{iMath **pptr }; - -You can get natural wrapping in Lua as follows: -ok,ptr=Create_Math() -- ptr is a iMath* which is returned with the int -ptr=nil -- the iMath* will be GC'ed as normal -*/ - -%typemap(in,numinputs=0) SWIGTYPE** OUTPUT ($*ltype temp) -%{ temp = ($*ltype)0; - $1 = &temp; %} -%typemap(argout) SWIGTYPE** OUTPUT -%{SWIG_NewPointerObj(L,*$1,$*descriptor,1); SWIG_arg++; %} - diff --git a/win64/bin/swig/share/swig/4.1.0/lua/wchar.i b/win64/bin/swig/share/swig/4.1.0/lua/wchar.i deleted file mode 100755 index 33b804a5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/lua/wchar.i +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wchar.i - * - * Typemaps for the wchar_t type - * These are mapped to a Lua string and are passed around by value. - * ----------------------------------------------------------------------------- */ - -// note: only support for pointer right now, not fixed length strings -// TODO: determine how long a const wchar_t* is so we can write wstr2str() -// & do the output typemap - -%{ -#include - -wchar_t* str2wstr(const char *str, int len) -{ - wchar_t* p; - if (str==0 || len<1) return 0; - p=(wchar_t *)malloc((len+1)*sizeof(wchar_t)); - if (p==0) return 0; - if (mbstowcs(p, str, len)==(size_t)-1) - { - free(p); - return 0; - } - p[len]=0; - return p; -} -%} - -%typemap(in, checkfn="SWIG_lua_isnilstring", fragment="SWIG_lua_isnilstring") wchar_t * -%{ -$1 = str2wstr(lua_tostring( L, $input ),lua_rawlen( L, $input )); -if ($1==0) {SWIG_Lua_pushferrstring(L,"Error in converting to wchar (arg %d)",$input);goto fail;} -%} - -%typemap(freearg) wchar_t * -%{ -free($1); -%} - -%typemap(typecheck) wchar_t * = char *; diff --git a/win64/bin/swig/share/swig/4.1.0/math.i b/win64/bin/swig/share/swig/4.1.0/math.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/Makefile b/win64/bin/swig/share/swig/4.1.0/mzscheme/Makefile deleted file mode 100755 index c18c4dc2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/Makefile +++ /dev/null @@ -1,3 +0,0 @@ - -co: - co RCS/*.i* RCS/*.swg* diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/mzrun.swg b/win64/bin/swig/share/swig/4.1.0/mzscheme/mzrun.swg deleted file mode 100755 index d8fc6cb5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/mzrun.swg +++ /dev/null @@ -1,521 +0,0 @@ -/* ----------------------------------------------------------------------------- - * mzrun.swg - * ----------------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Common SWIG API */ - -#define SWIG_ConvertPtr(s, result, type, flags) \ - SWIG_MzScheme_ConvertPtr(s, result, type, flags) -#define SWIG_NewPointerObj(ptr, type, owner) \ - SWIG_MzScheme_NewPointerObj((void *)ptr, type, owner) -#define SWIG_MustGetPtr(s, type, argnum, flags) \ - SWIG_MzScheme_MustGetPtr(s, type, argnum, flags, FUNC_NAME, argc, argv) - -#define SWIG_contract_assert(expr,msg) \ - do { \ - if (!(expr)) { \ - char *m=(char *) scheme_malloc(strlen(msg)+1000); \ - sprintf(m,"SWIG contract, assertion failed: function=%s, message=%s", \ - (char *) FUNC_NAME,(char *) msg); \ - scheme_signal_error(m); \ - } \ - } while (0) - -/* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_MzScheme_GetModule((Scheme_Env *)(clientdata)) -#define SWIG_SetModule(clientdata, pointer) SWIG_MzScheme_SetModule((Scheme_Env *) (clientdata), pointer) -#define SWIG_MODULE_CLIENTDATA_TYPE Scheme_Env * - -/* MzScheme-specific SWIG API */ - -#define SWIG_malloc(size) SWIG_MzScheme_Malloc(size, FUNC_NAME) -#define SWIG_free(mem) free(mem) -#define SWIG_NewStructFromPtr(ptr,type) \ - _swig_convert_struct_##type##(ptr) - -#define MAXVALUES 6 -#define swig_make_boolean(b) (b ? scheme_true : scheme_false) - -static long -SWIG_convert_integer(Scheme_Object *o, - long lower_bound, long upper_bound, - const char *func_name, int argnum, int argc, - Scheme_Object **argv) -{ - long value; - int status = scheme_get_int_val(o, &value); - if (!status) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - if (value < lower_bound || value > upper_bound) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - return value; -} - -static int -SWIG_is_integer(Scheme_Object *o) -{ - long value; - return scheme_get_int_val(o, &value); -} - -static unsigned long -SWIG_convert_unsigned_integer(Scheme_Object *o, - unsigned long lower_bound, unsigned long upper_bound, - const char *func_name, int argnum, int argc, - Scheme_Object **argv) -{ - unsigned long value; - int status = scheme_get_unsigned_int_val(o, &value); - if (!status) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - if (value < lower_bound || value > upper_bound) - scheme_wrong_type(func_name, "integer", argnum, argc, argv); - return value; -} - -static int -SWIG_is_unsigned_integer(Scheme_Object *o) -{ - unsigned long value; - return scheme_get_unsigned_int_val(o, &value); -} - -/* ----------------------------------------------------------------------- - * mzscheme 30X support code - * ----------------------------------------------------------------------- */ - -#ifndef SCHEME_STR_VAL -#define MZSCHEME30X 1 -#endif - -#ifdef MZSCHEME30X -/* - * This is MZSCHEME 299.100 or higher (30x). From version 299.100 of - * mzscheme upwards, strings are in unicode. These functions convert - * to and from utf8 encodings of these strings. NB! strlen(s) will be - * the size in bytes of the string, not the actual length. - */ -#define SCHEME_STR_VAL(obj) SCHEME_BYTE_STR_VAL(scheme_char_string_to_byte_string(obj)) -#define SCHEME_STRLEN_VAL(obj) SCHEME_BYTE_STRLEN_VAL(scheme_char_string_to_byte_string(obj)) -#define SCHEME_STRINGP(obj) SCHEME_CHAR_STRINGP(obj) -#define scheme_make_string(s) scheme_make_utf8_string(s) -#define scheme_make_sized_string(s,l) scheme_make_sized_utf8_string(s,l) -#define scheme_make_sized_offset_string(s,d,l) \ - scheme_make_sized_offset_utf8_string(s,d,l) -#define SCHEME_MAKE_STRING(s) scheme_make_utf8_string(s) -#else -#define SCHEME_MAKE_STRING(s) scheme_make_string_without_copying(s) -#endif -/* ----------------------------------------------------------------------- - * End of mzscheme 30X support code - * ----------------------------------------------------------------------- */ - -struct swig_mz_proxy { - Scheme_Type mztype; - swig_type_info *type; - void *object; - int own; -}; - -static Scheme_Type swig_type; - -static void -mz_free_swig(void *p, void *data) { - struct swig_mz_proxy *proxy = (struct swig_mz_proxy *) p; - if (SCHEME_NULLP((Scheme_Object*)p) || SCHEME_TYPE((Scheme_Object*)p) != swig_type) - return; - if (proxy->type) { - if (proxy->type->clientdata && proxy->own) { - ((Scheme_Prim *)proxy->type->clientdata)(1, (Scheme_Object **)&proxy); - } - } -} - -static Scheme_Object * -SWIG_MzScheme_NewPointerObj(void *ptr, swig_type_info *type, int owner) { - if (ptr) { - struct swig_mz_proxy *new_proxy; - new_proxy = (struct swig_mz_proxy *) scheme_malloc(sizeof(struct swig_mz_proxy)); - new_proxy->mztype = swig_type; - new_proxy->type = type; - new_proxy->object = ptr; - new_proxy->own = owner & SWIG_POINTER_OWN; - if (new_proxy->own) { - scheme_add_finalizer(new_proxy, mz_free_swig, NULL); - } - return (Scheme_Object *) new_proxy; - } else { - return scheme_make_null(); - } -} - -static int -SWIG_MzScheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, int flags) { - swig_cast_info *cast; - int ret = SWIG_ERROR; - - if (SCHEME_NULLP(s)) { - *result = NULL; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } else if (SCHEME_TYPE(s) == swig_type) { - struct swig_mz_proxy *proxy = (struct swig_mz_proxy *) s; - - if ((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE && !proxy->own) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - - if (type) { - cast = SWIG_TypeCheckStruct(proxy->type, type); - if (cast) { - int newmemory = 0; - *result = SWIG_TypeCast(cast, proxy->object, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - ret = SWIG_OK; - } else { - return SWIG_ERROR; - } - } else { - *result = proxy->object; - ret = SWIG_OK; - } - - if (flags & SWIG_POINTER_DISOWN) { - scheme_subtract_finalizer(proxy, mz_free_swig, NULL); - proxy->own = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - proxy->object = 0; - } - } - return ret; -} - -static SWIGINLINE void * -SWIG_MzScheme_MustGetPtr(Scheme_Object *s, swig_type_info *type, - int argnum, int flags, const char *func_name, - int argc, Scheme_Object **argv) { - void *result; - if (SWIG_MzScheme_ConvertPtr(s, &result, type, flags)) { - scheme_wrong_type(func_name, type->str ? type->str : "void *", argnum - 1, argc, argv); - } - return result; -} - -static SWIGINLINE void * -SWIG_MzScheme_Malloc(size_t size, const char *func_name) { - void *p = malloc(size); - if (p == NULL) { - scheme_signal_error("swig-memory-error"); - } else return p; -} - -static Scheme_Object * -SWIG_MzScheme_PackageValues(int num, Scheme_Object **values) { - /* ignore first value if void */ - if (num > 0 && SCHEME_VOIDP(values[0])) - num--, values++; - if (num == 0) return scheme_void; - else if (num == 1) return values[0]; - else return scheme_values(num, values); -} - -#ifndef scheme_make_inspector -#define scheme_make_inspector(x,y) \ - _scheme_apply(scheme_builtin_value("make-inspector"), x, y) -#endif - -/* Function to create a new struct. */ -static Scheme_Object * -SWIG_MzScheme_new_scheme_struct (Scheme_Env* env, const char* basename, - int num_fields, char** field_names) -{ - Scheme_Object *new_type; - int count_out, i; - Scheme_Object **struct_names; - Scheme_Object **vals; - Scheme_Object **a = (Scheme_Object**) \ - scheme_malloc(num_fields*sizeof(Scheme_Object*)); - - for (i=0; i -#else -#include -#endif - - static char **mz_dlopen_libraries=NULL; - static void **mz_libraries=NULL; - static char **mz_dynload_libpaths=NULL; - - static void mz_set_dlopen_libraries(const char *_libs) - { - int i,k,n; - int mz_dynload_debug=(1==0); - char *extra_paths[1000]; - char *EP; - - { - char *dbg=getenv("MZ_DYNLOAD_DEBUG"); - if (dbg!=NULL) { - mz_dynload_debug=atoi(dbg); - } - } - - { - char *ep=getenv("MZ_DYNLOAD_LIBPATH"); - int i,k,j; - k=0; - if (ep!=NULL) { - EP=strdup(ep); - for(i=0,j=0;EP[i]!='\0';i++) { - if (EP[i]==':') { - EP[i]='\0'; - extra_paths[k++]=&EP[j]; - j=i+1; - } - } - if (j!=i) { - extra_paths[k++]=&EP[j]; - } - } - else { - EP=strdup(""); - } - extra_paths[k]=NULL; - k+=1; - - if (mz_dynload_debug) { - fprintf(stderr,"SWIG:mzscheme:MZ_DYNLOAD_LIBPATH=%s\n",(ep==NULL) ? "(null)" : ep); - fprintf(stderr,"SWIG:mzscheme:extra_paths[%d]\n",k-1); - for(i=0;i %p\n",libp,mz_libraries[i]); - } - free(libp); - } - } - } - } - { - int i; - void *func=NULL; - - for(i=0;mz_dlopen_libraries[i]!=NULL && func==NULL;i++) { - if (mz_libraries[i]!=NULL) { -#ifdef __OS_WIN32 - func=GetProcAddress(mz_libraries[i],function); -#else - func=dlsym(mz_libraries[i],function); -#endif - } - if (mz_dynload_debug) { - fprintf(stderr, - "SWIG:mzscheme:library:%s;dlopen=%p,function=%s,func=%p\n", - mz_dlopen_libraries[i],mz_libraries[i],function,func - ); - } - } - - return func; - } - } - } - -/* The interpreter will store a pointer to this structure in a global - variable called swig-runtime-data-type-pointer. The instance of this - struct is only used if no other module has yet been loaded */ -struct swig_mzscheme_runtime_data { - swig_module_info *module_head; - Scheme_Type type; -}; -static struct swig_mzscheme_runtime_data swig_mzscheme_runtime_data; - - -static swig_module_info * -SWIG_MzScheme_GetModule(Scheme_Env *env) { - Scheme_Object *pointer, *symbol; - struct swig_mzscheme_runtime_data *data; - - /* first check if pointer already created */ - symbol = scheme_intern_symbol("swig-runtime-data-type-pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - pointer = scheme_lookup_global(symbol, env); - if (pointer && SCHEME_CPTRP(pointer)) { - data = (struct swig_mzscheme_runtime_data *) SCHEME_CPTR_VAL(pointer); - swig_type = data->type; - return data->module_head; - } else { - return NULL; - } -} - -static void -SWIG_MzScheme_SetModule(Scheme_Env *env, swig_module_info *module) { - Scheme_Object *pointer, *symbol; - struct swig_mzscheme_runtime_data *data; - - /* first check if pointer already created */ - symbol = scheme_intern_symbol("swig-runtime-data-type-pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - pointer = scheme_lookup_global(symbol, env); - if (pointer && SCHEME_CPTRP(pointer)) { - data = (struct swig_mzscheme_runtime_data *) SCHEME_CPTR_VAL(pointer); - swig_type = data->type; - data->module_head = module; - } else { - /* create a new type for wrapped pointer values */ - swig_type = scheme_make_type((char *)"swig"); - swig_mzscheme_runtime_data.module_head = module; - swig_mzscheme_runtime_data.type = swig_type; - - /* create a new pointer */ -#ifndef MZSCHEME30X - pointer = scheme_make_cptr((void *) &swig_mzscheme_runtime_data, "swig_mzscheme_runtime_data"); -#else - pointer = scheme_make_cptr((void *) &swig_mzscheme_runtime_data, - scheme_make_byte_string("swig_mzscheme_runtime_data")); -#endif - scheme_add_global_symbol(symbol, pointer, env); - } -} - -#ifdef __cplusplus -} -#endif - diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/mzscheme.swg b/win64/bin/swig/share/swig/4.1.0/mzscheme/mzscheme.swg deleted file mode 100755 index 33c685a5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/mzscheme.swg +++ /dev/null @@ -1,56 +0,0 @@ -/* ----------------------------------------------------------------------------- - * mzscheme.swg - * - * SWIG Configuration File for MzScheme. - * This file is parsed by SWIG before reading any other interface file. - * ----------------------------------------------------------------------------- */ - -/* Include headers */ -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors -%runtime "mzrun.swg" - -%define SWIG_APPEND_VALUE(value) - values[lenv++] = value -%enddef - -/* Definitions */ -#define SWIG_malloc(size) swig_malloc(size, FUNC_NAME) -#define SWIG_free(mem) free(mem) - -#define SWIG_convert_short(o) \ - SWIG_convert_integer(o, - (1 << (8 * sizeof(short) - 1)), \ - (1 << (8 * sizeof(short) - 1)) - 1, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_int(o) \ - SWIG_convert_integer(o, INT_MIN, INT_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_long(o) \ - SWIG_convert_integer(o, LONG_MIN, LONG_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_unsigned_short(o) \ - SWIG_convert_unsigned_integer(o, 0, \ - (1 << (8 * sizeof(short))) - 1, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_unsigned_int(o) \ - SWIG_convert_unsigned_integer(o, 0, UINT_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) -#define SWIG_convert_unsigned_long(o) \ - SWIG_convert_unsigned_integer(o, 0, ULONG_MAX, \ - FUNC_NAME, $argnum-1, argc, argv) - -/* Guile compatibility kludges */ -#define SCM_VALIDATE_VECTOR(argnum, value) (void)0 -#define SCM_VALIDATE_LIST(argnum, value) (void)0 - -/* Read in standard typemaps. */ -%include - -%insert(init) "swiginit.swg" - -%init %{ -Scheme_Object *scheme_reload(Scheme_Env *env) { - Scheme_Env *menv = SWIG_MZSCHEME_CREATE_MENV(env); - - SWIG_InitializeModule((void *) env); -%} diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/std_auto_ptr.i deleted file mode 100755 index f702b703..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'"); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_common.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/std_common.i deleted file mode 100755 index 39508921..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_common.i +++ /dev/null @@ -1,23 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; - -%{ -#include - -SWIGINTERNINLINE -std::string swig_scm_to_string(Scheme_Object *x) { - return std::string(SCHEME_STR_VAL(x)); -} - -SWIGINTERNINLINE -Scheme_Object *swig_make_string(const std::string &s) { - return scheme_make_string(s.c_str()); -} -%} diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_deque.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_map.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/std_map.i deleted file mode 100755 index 1907e84a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_map.i +++ /dev/null @@ -1,1388 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// -// The aim of all that follows would be to integrate std::map with -// MzScheme as much as possible, namely, to allow the user to pass and -// be returned Scheme association lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::map), f(const std::map&), f(const std::map*): -// the parameter being read-only, either a Scheme alist or a -// previously wrapped std::map can be passed. -// -- f(std::map&), f(std::map*): -// the parameter must be modified; therefore, only a wrapped std::map -// can be passed. -// -- std::map f(): -// the map is returned by copy; therefore, a Scheme alist -// is returned which is most easily used in other Scheme functions -// -- std::map& f(), std::map* f(), const std::map& f(), -// const std::map* f(): -// the map is returned by reference; therefore, a wrapped std::map -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[*k] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[*k] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - K* key = new K(i->first); - T* val = new T(i->second); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - /* native sequence? */ - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - K* k; - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - /* native sequence? */ - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - K* k; - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, const T& x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - - - // specializations for built-ins - - %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) - - template class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[CONVERT_FROM(key)] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[CONVERT_FROM(key)] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - T* val = new T(i->second); - Scheme_Object* k = CONVERT_TO(i->first); - Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, const T& x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - Scheme_Object* k = CONVERT_TO(i->first); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) - template class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[*k] = CONVERT_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[*k] = CONVERT_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - Scheme_Object* x = CONVERT_TO(i->second); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - K* k; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - K* k; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, T x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, - T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) - template<> class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[CONVERT_K_FROM(key)] = - CONVERT_T_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - Scheme_Object* k = CONVERT_K_TO(i->first); - Scheme_Object* x = CONVERT_T_TO(i->second); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, T x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - Scheme_Object* k = CONVERT_K_TO(i->first); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - - specialize_std_map_on_key(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_key(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_key(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_key(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_map_on_value(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_value(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_value(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_value(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); -} diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_pair.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/std_pair.i deleted file mode 100755 index b9d0b95e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_pair.i +++ /dev/null @@ -1,874 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - - -// ------------------------------------------------------------------------ -// std::pair -// -// See std_vector.i for the rationale of typemap application -// ------------------------------------------------------------------------ - -%{ -#include -%} - -// exported class - -namespace std { - - template struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(*x,*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = std::make_pair(*x,*y); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - T* x = new T($1.first); - U* y = new U($1.second); - Scheme_Object* first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - Scheme_Object* second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scheme_make_pair(first,second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // specializations for built-ins - - %define specialize_std_pair_on_first(T,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - $1 = std::make_pair(CONVERT_FROM(first),*y); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - if (!CHECK(first)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); - temp = std::make_pair(CONVERT_FROM(first),*y); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - U* y = new U($1.second); - Scheme_Object* second = SWIG_NewPointerObj(y,$descriptor(U *), 1); - $result = scheme_make_pair(CONVERT_TO($1.first),second); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - U* y; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK(first) && - SWIG_ConvertPtr(second,(void**) &y, - $descriptor(U *), 0) != -1) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_second(U,CHECK,CONVERT_FROM,CONVERT_TO) - template struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = std::make_pair(*x,CONVERT_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = std::make_pair(*x,CONVERT_FROM(second)); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - T* x = new T($1.first); - Scheme_Object* first = SWIG_NewPointerObj(x,$descriptor(T *), 1); - $result = scheme_make_pair(first,CONVERT_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - T* x; - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (SWIG_ConvertPtr(first,(void**) &x, - $descriptor(T *), 0) != -1 && - CHECK(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - %define specialize_std_pair_on_both(T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO, - U,CHECK_U,CONVERT_U_FROM,CONVERT_U_TO) - template<> struct pair { - %typemap(in) pair (std::pair* m) { - if (SCHEME_PAIRP($input)) { - Scheme_Object *first, *second; - first = scheme_car($input); - second = scheme_cdr($input); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - $1 = make_pair(CONVERT_T_FROM(first), - CONVERT_U_FROM(second)); - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const pair& (std::pair temp, - std::pair* m), - const pair* (std::pair temp, - std::pair* m) { - if (SCHEME_PAIRP($input)) { - Scheme_Object *first, *second; - T *x; - first = scheme_car($input); - second = scheme_cdr($input); - x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); - if (!CHECK_T(first) || !CHECK_U(second)) - SWIG_exception(SWIG_TypeError, - "pair<" #T "," #U "> expected"); - temp = make_pair(CONVERT_T_FROM(first), - CONVERT_U_FROM(second)); - $1 = &temp; - } else { - $1 = ($1_ltype) - SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) pair { - $result = scheme_make_pair(CONVERT_T_TO($1.first), - CONVERT_U_TO($1.second)); - } - %typecheck(SWIG_TYPECHECK_PAIR) pair { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_PAIR) const pair&, - const pair* { - /* native pair? */ - if (SCHEME_PAIRP($input)) { - Scheme_Object* first = scheme_car($input); - Scheme_Object* second = scheme_cdr($input); - if (CHECK_T(first) && CHECK_U(second)) { - $1 = 1; - } else { - $1 = 0; - } - } else { - /* wrapped pair? */ - std::pair* p; - if (SWIG_ConvertPtr($input,(void **) &p, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - %enddef - - - specialize_std_pair_on_first(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_first(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_first(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_first(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_first(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_pair_on_second(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_second(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_second(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_second(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_second(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_pair_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); -} diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_string.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/std_string.i deleted file mode 100755 index 73f995e1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_string.i +++ /dev/null @@ -1,64 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string types - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - /* Overloading check */ - - %typemap(typecheck) string = char *; - %typemap(typecheck) const string & = char *; - - %typemap(in) string { - if (SCHEME_STRINGP($input)) - $1.assign(SCHEME_STR_VAL($input)); - else - SWIG_exception(SWIG_TypeError, "string expected"); - } - - %typemap(in) const string & ($*1_ltype temp) { - if (SCHEME_STRINGP($input)) { - temp.assign(SCHEME_STR_VAL($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } - } - - %typemap(out) string { - $result = scheme_make_string($1.c_str()); - } - - %typemap(out) const string & { - $result = scheme_make_string($1->c_str()); - } - - %typemap(throws) string { - scheme_signal_error("%s: %s", FUNC_NAME, $1.c_str()); - } - - %typemap(throws) const string & { - scheme_signal_error("%s: %s", FUNC_NAME, $1.c_str()); - } -} - - diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/std_unique_ptr.i deleted file mode 100755 index 0d721b23..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type 'TYPE *'"); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_vector.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/std_vector.i deleted file mode 100755 index b99c770d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/std_vector.i +++ /dev/null @@ -1,451 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// MzScheme as much as possible, namely, to allow the user to pass and -// be returned MzScheme vectors or lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a MzScheme sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a MzScheme vector of T:s -// is returned which is most easily used in other MzScheme functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - $1 = std::vector(size); - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i(); - } else if (SCHEME_PAIRP($input)) { - Scheme_Object *head, *tail; - $1 = std::vector(); - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - $1.push_back(*((T*)SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const vector& (std::vector temp), - const vector* (std::vector temp) { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - temp = std::vector(size); - $1 = &temp; - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::vector(); - $1 = &temp; - Scheme_Object *head, *tail; - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - temp.push_back(*((T*) SWIG_MustGetPtr(head, - $descriptor(T *), - $argnum, 0))); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) vector { - $result = scheme_make_vector($1.size(),scheme_undefined); - Scheme_Object** els = SCHEME_VEC_ELS($result); - for (unsigned int i=0; i<$1.size(); i++) { - T* x = new T((($1_type &)$1)[i]); - els[i] = SWIG_NewPointerObj(x,$descriptor(T *), 1); - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - if (SWIG_ConvertPtr(items[0],(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - if (SWIG_ConvertPtr(items[0],(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - if (SWIG_ConvertPtr(head,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - /* wrapped vector? */ - std::vector* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T& ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - $1 = std::vector(size); - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i", - $argnum - 1, argc, argv); - } - } else if (SCHEME_NULLP($input)) { - $1 = std::vector(); - } else if (SCHEME_PAIRP($input)) { - Scheme_Object *head, *tail; - $1 = std::vector(); - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - if (CHECK(head)) - $1.push_back((T)(CONVERT_FROM(head))); - else - scheme_wrong_type(FUNC_NAME, "vector<" #T ">", - $argnum - 1, argc, argv); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const vector& (std::vector temp), - const vector* (std::vector temp) { - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - temp = std::vector(size); - $1 = &temp; - Scheme_Object** items = SCHEME_VEC_ELS($input); - for (unsigned int i=0; i", - $argnum - 1, argc, argv); - } - } else if (SCHEME_NULLP($input)) { - temp = std::vector(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::vector(); - $1 = &temp; - Scheme_Object *head, *tail; - tail = $input; - while (!SCHEME_NULLP(tail)) { - head = scheme_car(tail); - tail = scheme_cdr(tail); - if (CHECK(head)) - temp.push_back((T)(CONVERT_FROM(head))); - else - scheme_wrong_type(FUNC_NAME, "vector<" #T ">", - $argnum - 1, argc, argv); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum - 1, 0); - } - } - %typemap(out) vector { - $result = scheme_make_vector($1.size(),scheme_undefined); - Scheme_Object** els = SCHEME_VEC_ELS($result); - for (unsigned int i=0; i<$1.size(); i++) - els[i] = CONVERT_TO((($1_type &)$1)[i]); - } - %typecheck(SWIG_TYPECHECK_VECTOR) vector { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - $1 = CHECK(items[0]) ? 1 : 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor, 0) != -1) ? 1 : 0; - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - /* native sequence? */ - if (SCHEME_VECTORP($input)) { - unsigned int size = SCHEME_VEC_SIZE($input); - if (size == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* x; - Scheme_Object** items = SCHEME_VEC_ELS($input); - $1 = CHECK(items[0]) ? 1 : 0; - } - } else if (SCHEME_NULLP($input)) { - /* again, an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - T* x; - Scheme_Object *head = scheme_car($input); - $1 = CHECK(head) ? 1 : 0; - } else { - /* wrapped vector? */ - std::vector* v; - $1 = (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor, 0) != -1) ? 1 : 0; - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - %rename(length) size; - unsigned int size() const; - %rename("empty?") empty; - bool empty() const; - %rename("clear!") clear; - void clear(); - %rename("set!") set; - %rename("pop!") pop; - %rename("push!") push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T ref(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/swigmove.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/swigmove.i deleted file mode 100755 index baf5c1c7..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/swigmove.i +++ /dev/null @@ -1,19 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type '$1_type'"); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (argp == NULL) scheme_signal_error(FUNC_NAME ": swig-type-error (null reference)"); - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/win64/bin/swig/share/swig/4.1.0/mzscheme/typemaps.i b/win64/bin/swig/share/swig/4.1.0/mzscheme/typemaps.i deleted file mode 100755 index f1ddca87..00000000 --- a/win64/bin/swig/share/swig/4.1.0/mzscheme/typemaps.i +++ /dev/null @@ -1,399 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * ----------------------------------------------------------------------------- */ - -#define %set_output(obj) $result = obj -#define %set_varoutput(obj) $result = obj -#define %argument_fail(code, type, name, argn) scheme_wrong_type(FUNC_NAME, type, argn, argc, argv) -#define %as_voidptr(ptr) (void*)(ptr) - - -/* The MzScheme module handles all types uniformly via typemaps. Here - are the definitions. */ - -/* Pointers */ - -%typemap(in) SWIGTYPE * { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} - -%typemap(in) void * { - $1 = SWIG_MustGetPtr($input, NULL, $argnum, 0); -} - -%typemap(varin) SWIGTYPE * { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, 1, 0); -} - -%typemap(varin) SWIGTYPE & { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE && { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE [ANY] { - void *temp; - int ii; - $1_basetype *b = 0; - temp = SWIG_MustGetPtr($input, $1_descriptor, 1, 0); - b = ($1_basetype *) $1; - for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii); -} - - -%typemap(varin) void * { - $1 = SWIG_MustGetPtr($input, NULL, 1, 0); -} - -%typemap(out) SWIGTYPE * { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE *DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj ($1, ty, $owner); -} - -%typemap(varout) SWIGTYPE *, SWIGTYPE [] { - $result = SWIG_NewPointerObj ($1, $descriptor, 0); -} - -%typemap(varout) SWIGTYPE & { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -%typemap(varout) SWIGTYPE && { - $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); -} - -/* C++ References */ - -#ifdef __cplusplus - -%typemap(in) SWIGTYPE & { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0); - if ($1 == NULL) scheme_signal_error(FUNC_NAME ": swig-type-error (null reference)"); -} - -%typemap(in, noblock=1, fragment="") SWIGTYPE && (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) { - res = SWIG_ConvertPtr($input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - scheme_signal_error(FUNC_NAME ": cannot release ownership as memory is not owned for argument $argnum of type '$1_type'"); - } else { - %argument_fail(res, "$1_type", $symname, $argnum); - } - } - if (argp == NULL) scheme_signal_error(FUNC_NAME ": swig-type-error (null reference)"); - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -} - -%typemap(out) SWIGTYPE &, SWIGTYPE && { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj ($1, ty, $owner); -} - -#endif - -/* Arrays */ - -%typemap(in) SWIGTYPE[] { - $1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0); -} - -%typemap(out) SWIGTYPE[] { - $result = SWIG_NewPointerObj ($1, $descriptor, $owner); -} - -/* Enums */ -%typemap(in) enum SWIGTYPE { - if (!SWIG_is_integer($input)) - scheme_wrong_type(FUNC_NAME, "integer", $argnum - 1, argc, argv); - $1 = ($1_type) SWIG_convert_int($input); -} - -%typemap(varin) enum SWIGTYPE { - if (!SWIG_is_integer($input)) - scheme_wrong_type(FUNC_NAME, "integer", 0, argc, argv); - $1 = ($1_type) SWIG_convert_int($input); -} - -%typemap(out) enum SWIGTYPE "$result = scheme_make_integer_value($1);" -%typemap(varout) enum SWIGTYPE "$result = scheme_make_integer_value($1);" - - -/* Pass-by-value */ - -%typemap(in) SWIGTYPE($&1_ltype argp) { - argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0); - $1 = *argp; -} - -%typemap(varin) SWIGTYPE { - $&1_ltype argp; - argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, 1, 0); - $1 = *argp; -} - - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype($1); - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 1); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1); -} -#endif - -%typemap(varout) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype($1); - $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 0); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0); -} -#endif - -/* The SIMPLE_MAP macro below defines the whole set of typemaps needed - for simple types. */ - -%define SIMPLE_MAP(C_NAME, MZ_PREDICATE, MZ_TO_C, C_TO_MZ, MZ_NAME) -%typemap(in) C_NAME { - if (!MZ_PREDICATE($input)) - scheme_wrong_type(FUNC_NAME, #MZ_NAME, $argnum - 1, argc, argv); - $1 = MZ_TO_C($input); -} -%typemap(varin) C_NAME { - if (!MZ_PREDICATE($input)) - scheme_wrong_type(FUNC_NAME, #MZ_NAME, 0, argc, argv); - $1 = MZ_TO_C($input); -} -%typemap(out) C_NAME { - $result = C_TO_MZ($1); -} -%typemap(varout) C_NAME { - $result = C_TO_MZ($1); -} -%typemap(in) C_NAME *INPUT (C_NAME temp) { - temp = (C_NAME) MZ_TO_C($input); - $1 = &temp; -} -%typemap(in,numinputs=0) C_NAME *OUTPUT (C_NAME temp) { - $1 = &temp; -} -%typemap(argout) C_NAME *OUTPUT { - Scheme_Object *s; - s = C_TO_MZ(*$1); - SWIG_APPEND_VALUE(s); -} -%typemap(in) C_NAME *BOTH = C_NAME *INPUT; -%typemap(argout) C_NAME *BOTH = C_NAME *OUTPUT; -%typemap(in) C_NAME *INOUT = C_NAME *INPUT; -%typemap(argout) C_NAME *INOUT = C_NAME *OUTPUT; -%enddef - -SIMPLE_MAP(bool, SCHEME_BOOLP, SCHEME_TRUEP, - swig_make_boolean, boolean); -SIMPLE_MAP(char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -SIMPLE_MAP(unsigned char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -SIMPLE_MAP(int, SWIG_is_integer, SWIG_convert_int, - scheme_make_integer_value, integer); -SIMPLE_MAP(short, SWIG_is_integer, SWIG_convert_short, - scheme_make_integer_value, integer); -SIMPLE_MAP(long, SWIG_is_integer, SWIG_convert_long, - scheme_make_integer_value, integer); -SIMPLE_MAP(ptrdiff_t, SWIG_is_integer, SWIG_convert_long, - scheme_make_integer_value, integer); -SIMPLE_MAP(unsigned int, SWIG_is_unsigned_integer, SWIG_convert_unsigned_int, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(unsigned short, SWIG_is_unsigned_integer, SWIG_convert_unsigned_short, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(unsigned long, SWIG_is_unsigned_integer, SWIG_convert_unsigned_long, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(size_t, SWIG_is_unsigned_integer, SWIG_convert_unsigned_long, - scheme_make_integer_value_from_unsigned, integer); -SIMPLE_MAP(float, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); -SIMPLE_MAP(double, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); - -SIMPLE_MAP(char *, SCHEME_STRINGP, SCHEME_STR_VAL, - SCHEME_MAKE_STRING, string); -SIMPLE_MAP(const char *, SCHEME_STRINGP, SCHEME_STR_VAL, - SCHEME_MAKE_STRING, string); - -/* For MzScheme 30x: Use these typemaps if you are not going to use - UTF8 encodings in your C code. - SIMPLE_MAP(char *,SCHEME_BYTE_STRINGP, SCHEME_BYTE_STR_VAL, - scheme_make_byte_string_without_copying,bytestring); - SIMPLE_MAP(const char *,SCHEME_BYTE_STRINGP, SCHEME_BYTE_STR_VAL, - scheme_make_byte_string_without_copying,bytestring); -*/ - -/* Const primitive references. Passed by value */ - -%define REF_MAP(C_NAME, MZ_PREDICATE, MZ_TO_C, C_TO_MZ, MZ_NAME) - %typemap(in) const C_NAME & (C_NAME temp) { - if (!MZ_PREDICATE($input)) - scheme_wrong_type(FUNC_NAME, #MZ_NAME, $argnum - 1, argc, argv); - temp = MZ_TO_C($input); - $1 = &temp; - } - %typemap(out) const C_NAME & { - $result = C_TO_MZ(*$1); - } -%enddef - -REF_MAP(bool, SCHEME_BOOLP, SCHEME_TRUEP, - swig_make_boolean, boolean); -REF_MAP(char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -REF_MAP(unsigned char, SCHEME_CHARP, SCHEME_CHAR_VAL, - scheme_make_character, character); -REF_MAP(int, SWIG_is_integer, SWIG_convert_int, - scheme_make_integer_value, integer); -REF_MAP(short, SWIG_is_integer, SWIG_convert_short, - scheme_make_integer_value, integer); -REF_MAP(long, SWIG_is_integer, SWIG_convert_long, - scheme_make_integer_value, integer); -REF_MAP(unsigned int, SWIG_is_unsigned_integer, SWIG_convert_unsigned_int, - scheme_make_integer_value_from_unsigned, integer); -REF_MAP(unsigned short, SWIG_is_unsigned_integer, SWIG_convert_unsigned_short, - scheme_make_integer_value_from_unsigned, integer); -REF_MAP(unsigned long, SWIG_is_unsigned_integer, SWIG_convert_unsigned_long, - scheme_make_integer_value_from_unsigned, integer); -REF_MAP(float, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); -REF_MAP(double, SCHEME_REALP, scheme_real_to_double, - scheme_make_double, real); - -%typemap(throws) char * { - scheme_signal_error("%s: %s", FUNC_NAME, $1); -} - -/* Void */ - -%typemap(out) void "$result = scheme_void;" - -/* Pass through Scheme_Object * */ - -%typemap (in) Scheme_Object * "$1=$input;" -%typemap (out) Scheme_Object * "$result=$1;" -%typecheck(SWIG_TYPECHECK_POINTER) Scheme_Object * "$1=1;"; - - -/* ------------------------------------------------------------ - * String & length - * ------------------------------------------------------------ */ - -//%typemap(in) (char *STRING, int LENGTH) { -// int temp; -// $1 = ($1_ltype) SWIG_Guile_scm2newstr($input, &temp); -// $2 = ($2_ltype) temp; -//} - -/* ------------------------------------------------------------ - * Typechecking rules - * ------------------------------------------------------------ */ - -%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 -{ - $1 = (SWIG_is_integer($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_BOOL) bool, bool &, const bool & -{ - $1 = (SCHEME_BOOLP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) - float, double, - const float &, const double & -{ - $1 = (SCHEME_REALP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char { - $1 = (SCHEME_STRINGP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - $1 = (SCHEME_STRINGP($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $1_descriptor, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE &, SWIGTYPE && { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $&1_descriptor, SWIG_POINTER_NO_NULL)) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, 0, 0)) { - $1 = 0; - } else { - $1 = 1; - } -} - - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } - - diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/carray.i b/win64/bin/swig/share/swig/4.1.0/ocaml/carray.i deleted file mode 100755 index b0f31f01..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/carray.i +++ /dev/null @@ -1,131 +0,0 @@ -%insert(mli) %{ -type _value = c_obj -%} - -%insert(ml) %{ -type _value = c_obj -%} - -%define %array_tmap_out(type,what,out_f) -%typemap(type) what [ANY] { - int i; - $result = caml_array_new($1_dim0); - for( i = 0; i < $1_dim0; i++ ) { - caml_array_set($result,i,out_f($1[i])); - } -} -%enddef - -%define %array_tmap_in(type,what,in_f) -%typemap(type) what [ANY] { - int i; - $1 = ($*1_type *)malloc( $1_size ); - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = in_f(caml_array_nth($input,i)); - } -} - -%typemap(free) what [ANY] { - free( (void *)$1 ); -} -%enddef - -%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(directorin,type,out_f); - -%array_tmap_in(in,type,in_f); -%array_tmap_in(varin,type,in_f); -%array_tmap_in(directorout,type,in_f); -%enddef - -%make_simple_array_typemap(bool,caml_val_bool,caml_long_val); -%make_simple_array_typemap(short,caml_val_short,caml_long_val); -%make_simple_array_typemap(unsigned short,caml_val_ushort,caml_long_val); -%make_simple_array_typemap(int,caml_val_int,caml_long_val); -%make_simple_array_typemap(unsigned int,caml_val_uint,caml_long_val); -%make_simple_array_typemap(long,caml_val_long,caml_long_val); -%make_simple_array_typemap(unsigned long,caml_val_ulong,caml_long_val); -%make_simple_array_typemap(size_t,caml_val_int,caml_long_val); -%make_simple_array_typemap(float,caml_val_float,caml_double_val); -%make_simple_array_typemap(double,caml_val_double,caml_double_val); - -#ifdef __cplusplus -%typemap(in) SWIGTYPE [] { - int i; - - $1 = new $*1_type [$1_dim0]; - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = *(($*1_ltype *) - caml_ptr_val(caml_array_nth($input,i), - $*1_descriptor)) ; - } -} -#else -%typemap(in) SWIGTYPE [] { - int i; - - $1 = ($*1_type *)malloc( $1_size ); - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = *(($*1_ltype) - caml_ptr_val(caml_array_nth($input), - $*1_descriptor)); - } -} -#endif - -%typemap(out) SWIGTYPE [] { - int i; - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - $result = caml_array_new($1_dim0); - - for( i = 0; i < $1_dim0; i++ ) { - if( fromval ) { - caml_array_set - ($result, - i, - caml_callback(*fromval,caml_val_ptr((void *)&$1[i],$*1_descriptor))); - } else { - caml_array_set - ($result, - i, - caml_val_ptr ((void *)&$1[i],$&1_descriptor)); - } - } -} - -%typemap(in) enum SWIGTYPE [] { - int i; - - $1 = ($*1_type *)malloc( $1_size ); - for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { - $1[i] = ($type) - caml_long_val_full(caml_array_nth($input), - "$type_marker"); - } -} - -%typemap(out) enum SWIGTYPE [] { - int i; - $result = caml_array_new($1_dim0); - - for( i = 0; i < $1_dim0; i++ ) { - caml_array_set - ($result, - i, - caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"), - *caml_named_value("$type_marker"), - Val_int($1[i]))); - } -} - -#ifdef __cplusplus -%typemap(freearg) SWIGTYPE [ANY] { - delete [] $1; -} -#else -%typemap(freearg) SWIGTYPE [ANY] { - free( (void *)$1 ); -} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/class.swg b/win64/bin/swig/share/swig/4.1.0/ocaml/class.swg deleted file mode 100755 index b177747f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/class.swg +++ /dev/null @@ -1,67 +0,0 @@ -(*Stream:class_ctors*) -let create_$classname_from_ptr raw_ptr = - C_obj -begin - let h = Hashtbl.create 20 in - List.iter (fun (nm,fn) -> Hashtbl.replace h nm fn) - [ "nop", (fun args -> C_void) ; - $classbody - "&", (fun args -> raw_ptr) ; - ":parents", - (fun args -> - C_list - (let out = ref [] in - Hashtbl.iter (fun x y -> out := (x,y) :: !out) h ; - (List.map - (fun (x,y) -> - C_string (String.sub x 2 ((String.length x) - 2))) - (List.filter - (fun (x,y) -> - ((String.length x) > 2) - && x.[0] == ':' && x.[1] == ':') !out)))) ; - ":classof", (fun args -> C_string "$realname") ; - ":methods", (fun args -> - C_list (let out = ref [] in - Hashtbl.iter (fun x y -> out := (C_string x) :: !out) h ; !out)) - ] ; - let rec invoke_inner raw_ptr mth arg = - begin - try - let application = Hashtbl.find h mth in - application - (match arg with - C_list l -> (C_list (raw_ptr :: l)) - | C_void -> (C_list [ raw_ptr ]) - | v -> (C_list [ raw_ptr ; v ])) - with Not_found -> - (* Try parent classes *) - begin - let parent_classes = [ - $baselist - ] in - let rec try_parent plist raw_ptr = - match plist with - p :: tl -> - begin - try - (invoke (p raw_ptr)) mth arg - with (BadMethodName (p,m,s)) -> - try_parent tl raw_ptr - end - | [] -> - raise (BadMethodName (raw_ptr,mth,"$realname")) - in try_parent parent_classes raw_ptr - end - end in - (fun mth arg -> invoke_inner raw_ptr mth arg) -end - -let _ = register_class_byname "$realname" create_$classname_from_ptr -let _ = Callback.register - "create_$normalized_from_ptr" - create_$classname_from_ptr - - -(*Stream:mli*) -val create_$classname_from_ptr : c_obj -> c_obj - diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/cstring.i b/win64/bin/swig/share/swig/4.1.0/ocaml/cstring.i deleted file mode 100755 index 1a7343fa..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/cstring.i +++ /dev/null @@ -1,268 +0,0 @@ -/* ----------------------------------------------------------------------------- - * cstring.i - * - * This file provides typemaps and macros for dealing with various forms - * of C character string handling. The primary use of this module - * is in returning character data that has been allocated or changed in - * some way. - * ----------------------------------------------------------------------------- */ - -/* %cstring_input_binary(TYPEMAP, SIZE) - * - * Macro makes a function accept binary string data along with - * a size. - */ - -%define %cstring_input_binary(TYPEMAP, SIZE) -%apply (char *STRING, int LENGTH) { (TYPEMAP, SIZE) }; -%enddef - -/* - * %cstring_bounded_output(TYPEMAP, MAX) - * - * This macro is used to return a NULL-terminated output string of - * some maximum length. For example: - * - * %cstring_bounded_output(char *outx, 512); - * void foo(char *outx) { - * sprintf(outx,"blah blah\n"); - * } - * - */ - -%define %cstring_bounded_output(TYPEMAP,MAX) -%typemap(ignore) TYPEMAP(char temp[MAX+1]) { - $1 = ($1_ltype) temp; -} -%typemap(argout) TYPEMAP { - $1[MAX] = 0; - $result = caml_list_append($result,caml_val_string(str)); -} -%enddef - -/* - * %cstring_chunk_output(TYPEMAP, SIZE) - * - * This macro is used to return a chunk of binary string data. - * Embedded NULLs are okay. For example: - * - * %cstring_chunk_output(char *outx, 512); - * void foo(char *outx) { - * memmove(outx, somedata, 512); - * } - * - */ - -%define %cstring_chunk_output(TYPEMAP,SIZE) -%typemap(ignore) TYPEMAP(char temp[SIZE]) { - $1 = ($1_ltype) temp; -} -%typemap(argout) TYPEMAP { - $result = caml_list_append($result,caml_val_string_len($1,SIZE)); -} -%enddef - -/* - * %cstring_bounded_mutable(TYPEMAP, SIZE) - * - * This macro is used to wrap a string that's going to mutate. - * - * %cstring_bounded_mutable(char *in, 512); - * void foo(in *x) { - * while (*x) { - * *x = toupper(*x); - * x++; - * } - * } - * - */ - - -%define %cstring_bounded_mutable(TYPEMAP,MAX) -%typemap(in) TYPEMAP(char temp[MAX+1]) { - char *t = (char *)caml_ptr_val($input); - strncpy(temp,t,MAX); - $1 = ($1_ltype) temp; -} -%typemap(argout) TYPEMAP { - $result = caml_list_append($result,caml_val_string_len($1,MAX)); -} -%enddef - -/* - * %cstring_mutable(TYPEMAP [, expansion]) - * - * This macro is used to wrap a string that will mutate in place. - * It may change size up to a user-defined expansion. - * - * %cstring_mutable(char *in); - * void foo(in *x) { - * while (*x) { - * *x = toupper(*x); - * x++; - * } - * } - * - */ - -%define %cstring_mutable(TYPEMAP,...) -%typemap(in) TYPEMAP { - char *t = String_val($input); - int n = caml_string_length($input); - $1 = ($1_ltype) t; -#if #__VA_ARGS__ == "" -#ifdef __cplusplus - $1 = ($1_ltype) new char[n+1]; -#else - $1 = ($1_ltype) malloc(n+1); -#endif -#else -#ifdef __cplusplus - $1 = ($1_ltype) new char[n+1+__VA_ARGS__]; -#else - $1 = ($1_ltype) malloc(n+1+__VA_ARGS__); -#endif -#endif - memmove($1,t,n); - $1[n] = 0; -} - -%typemap(argout) TYPEMAP { - $result = caml_list_append($result,caml_val_string($1)); -#ifdef __cplusplus - delete[] $1; -#else - free($1); -#endif -} -%enddef - -/* - * %cstring_output_maxsize(TYPEMAP, SIZE) - * - * This macro returns data in a string of some user-defined size. - * - * %cstring_output_maxsize(char *outx, int max) { - * void foo(char *outx, int max) { - * sprintf(outx,"blah blah\n"); - * } - */ - -%define %cstring_output_maxsize(TYPEMAP, SIZE) -%typemap(in) (TYPEMAP, SIZE) { - $2 = caml_val_long($input); -#ifdef __cplusplus - $1 = ($1_ltype) new char[$2+1]; -#else - $1 = ($1_ltype) malloc($2+1); -#endif -} -%typemap(argout) (TYPEMAP,SIZE) { - $result = caml_list_append($result,caml_val_string($1)); -#ifdef __cplusplus - delete [] $1; -#else - free($1); -#endif -} -%enddef - -/* - * %cstring_output_withsize(TYPEMAP, SIZE) - * - * This macro is used to return character data along with a size - * parameter. - * - * %cstring_output_maxsize(char *outx, int *max) { - * void foo(char *outx, int *max) { - * sprintf(outx,"blah blah\n"); - * *max = strlen(outx); - * } - */ - -%define %cstring_output_withsize(TYPEMAP, SIZE) -%typemap(in) (TYPEMAP, SIZE) { - int n = caml_val_long($input); -#ifdef __cplusplus - $1 = ($1_ltype) new char[n+1]; - $2 = ($2_ltype) new $*1_ltype; -#else - $1 = ($1_ltype) malloc(n+1); - $2 = ($2_ltype) malloc(sizeof($*1_ltype)); -#endif - *$2 = n; -} -%typemap(argout) (TYPEMAP,SIZE) { - $result = caml_list_append($result,caml_val_string_len($1,$2)); -#ifdef __cplusplus - delete [] $1; - delete $2; -#else - free($1); - free($2); -#endif -} -%enddef - -/* - * %cstring_output_allocate(TYPEMAP, RELEASE) - * - * This macro is used to return character data that was - * allocated with new or malloc. - * - * %cstring_output_allocated(char **outx, free($1)); - * void foo(char **outx) { - * *outx = (char *) malloc(512); - * sprintf(outx,"blah blah\n"); - * } - */ - -%define %cstring_output_allocate(TYPEMAP, RELEASE) -%typemap(ignore) TYPEMAP($*1_ltype temp = 0) { - $1 = &temp; -} - -%typemap(argout) TYPEMAP { - if (*$1) { - $result = caml_list_append($result,caml_val_string($1)); - RELEASE; - } else { - $result = caml_list_append($result,caml_val_ptr($1)); - } -} -%enddef - -/* - * %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) - * - * This macro is used to return character data that was - * allocated with new or malloc. - * - * %cstring_output_allocated(char **outx, int *sz, free($1)); - * void foo(char **outx, int *sz) { - * *outx = (char *) malloc(512); - * sprintf(outx,"blah blah\n"); - * *sz = strlen(outx); - * } - */ - -%define %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) -%typemap(ignore) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) { - $1 = &temp; - $2 = &tempn; -} - -%typemap(argout)(TYPEMAP,SIZE) { - if (*$1) { - $result = caml_list_append($result,caml_val_string_len($1,$2)); - RELEASE; - } else - $result = caml_list_append($result,caml_val_ptr($1)); -} -%enddef - - - - - - diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/director.swg b/win64/bin/swig/share/swig/4.1.0/ocaml/director.swg deleted file mode 100755 index 5b83221e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/director.swg +++ /dev/null @@ -1,101 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Ocaml proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#include -#include - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -namespace Swig { - /* base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - - public: - DirectorException(const char *msg="") : swig_msg(msg) { - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - /* type mismatch in the return value from a Ocaml method call */ - class DirectorTypeMismatchException : public DirectorException { - public: - DirectorTypeMismatchException(const char *msg="") : DirectorException(msg) { - } - }; - - /* any Ocaml exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException {}; - - /* attempt to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg="") : DirectorException(msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - /* simple thread abstraction for pthreads on win32 */ -#ifdef __THREAD__ -#define __PTHREAD__ -#if defined(_WIN32) || defined(__WIN32__) -#define pthread_mutex_lock EnterCriticalSection -#define pthread_mutex_unlock LeaveCriticalSection -#define pthread_mutex_t CRITICAL_SECTION -#define MUTEX_INIT(var) CRITICAL_SECTION var -#else -#include -#define MUTEX_INIT(var) pthread_mutex_t var = PTHREAD_MUTEX_INITIALIZER -#endif -#endif - - /* director base class */ - class Director { - private: - /* pointer to the wrapped ocaml object */ - CAML_VALUE swig_self; - /* flag indicating whether the object is owned by ocaml or c++ */ - mutable bool swig_disown_flag; - - public: - /* wrap a ocaml object. */ - Director(CAML_VALUE self) : swig_self(self), swig_disown_flag(false) { - caml_register_global_root(&swig_self); - } - - /* discard our reference at destruction */ - virtual ~Director() { - caml_remove_global_root(&swig_self); - swig_disown(); - // Disown is safe here because we're just divorcing a reference that points to us. - } - - /* return a pointer to the wrapped ocaml object */ - CAML_VALUE swig_get_self() const { - return swig_self; - } - - /* acquire ownership of the wrapped ocaml object (the sense of "disown" is from ocaml) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag=true; - caml_callback(*caml_named_value("caml_obj_disown"),swig_self); - } - } - }; -} - diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/extra-install.list b/win64/bin/swig/share/swig/4.1.0/ocaml/extra-install.list deleted file mode 100755 index e2702db3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/extra-install.list +++ /dev/null @@ -1,4 +0,0 @@ -# see top-level Makefile.in -swigp4.ml -swig.mli -swig.ml diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/ocaml.i b/win64/bin/swig/share/swig/4.1.0/ocaml/ocaml.i deleted file mode 100755 index bcf9ea2a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/ocaml.i +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocaml.i - * - * SWIG Configuration File for Ocaml - * ----------------------------------------------------------------------------- */ - -/* Insert common stuff */ -%insert(runtime) "swigrun.swg" - -/* Include headers */ -%insert(runtime) "ocamlrundec.swg" - -/* Type registration */ -%insert(init) "swiginit.swg" -%insert(init) "typeregister.swg" - -%insert(mlitail) %{ - val swig_val : c_enum_type -> c_obj -> Swig.c_obj -%} - -%insert(mltail) %{ - let rec swig_val t v = - match v with - C_enum e -> enum_to_int t v - | C_list l -> Swig.C_list (List.map (swig_val t) l) - | C_array a -> Swig.C_array (Array.map (swig_val t) a) - | _ -> Obj.magic v -%} - -/*#ifndef SWIG_NOINCLUDE*/ -%insert(runtime) "ocamlrun.swg" -/*#endif*/ - -%insert(classtemplate) "class.swg" - -/* Read in standard typemaps. */ -%include -%include -%include -%include -%include - -/* ocaml keywords */ -/* There's no need to use this, because of my rewriting machinery. C++ - * words never collide with ocaml keywords */ - -/* still we include the file, but the warning says that the offending - name will be properly renamed. Just to let the user to know about - it. */ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/ocaml.swg b/win64/bin/swig/share/swig/4.1.0/ocaml/ocaml.swg deleted file mode 100755 index bb8c89ae..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/ocaml.swg +++ /dev/null @@ -1,320 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocaml.swg - * - * The Ocaml module handles all types uniformly via typemaps. Here - * are the definitions. - * ----------------------------------------------------------------------------- */ - -/* Pointers */ - -%typemap(in) void "" - -%typemap(out) void "$result = Val_int(0);" - -%typemap(in) void * { - $1 = caml_ptr_val($input,$descriptor); -} - -%typemap(varin) void * { - $1 = ($ltype)caml_ptr_val($input,$descriptor); -} - -%typemap(out) void * { - $result = caml_val_ptr($1,$descriptor); -} - -%typemap(varout) void * { - $result = caml_val_ptr($1,$descriptor); -} - -%typemap(in) char *& (char *temp) { - temp = (char*)caml_val_ptr($1,$descriptor); - $1 = &temp; -} - -%typemap(argout) char *& { - swig_result = caml_list_append(swig_result,caml_val_string_len(*$1, strlen(*$1))); -} - -%typemap(in) SWIGTYPE & { - $1 = ($ltype) caml_ptr_val($input,$1_descriptor); -} - -%typemap(in, fragment="") SWIGTYPE && (std::unique_ptr<$*1_ltype> rvrdeleter) %{ - $1 = ($ltype) caml_ptr_val($input,$1_descriptor); - rvrdeleter.reset($1); -%} - -%typemap(varin) SWIGTYPE & { - $1 = *(($ltype) caml_ptr_val($input,$1_descriptor)); -} - -%typemap(varin) SWIGTYPE && { - $1 = *(($ltype) caml_ptr_val($input,$1_descriptor)); -} - -%typemap(varout) SWIGTYPE &, SWIGTYPE && { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)&$1, $1_descriptor); -} - -%typemap(out) SWIGTYPE &, SWIGTYPE && { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); -} - -#if 0 -%typemap(argout) SWIGTYPE & { - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - swig_result = - caml_list_append(swig_result, - caml_callback(*fromval,caml_val_ptr((void *) $1, - $1_descriptor))); - } else { - swig_result = - caml_list_append(swig_result, - caml_val_ptr ((void *) $1,$1_descriptor)); - } -} -%typemap(argout) SWIGTYPE && { - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - swig_result = - caml_list_append(swig_result, - caml_callback(*fromval,caml_val_ptr((void *) $1, - $1_descriptor))); - } else { - swig_result = - caml_list_append(swig_result, - caml_val_ptr ((void *) $1,$1_descriptor)); - } -} -#endif - -%typemap(in) SWIGTYPE { - $1 = *(($&1_ltype) caml_ptr_val($input,$&1_descriptor)) ; -} - -%typemap(varout) SWIGTYPE { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)&$1, $&1_descriptor); -} - -#ifdef __cplusplus - -%typemap(out) SWIGTYPE { - $&1_ltype temp = new $1_ltype($1); - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)temp, $&1_descriptor); -} - -#else - -%typemap(out) SWIGTYPE { - void *temp = calloc(1,sizeof($ltype)); - memmove(temp, &$1, sizeof($1_type)); - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", temp, $&1_descriptor); -} - -#endif - -%typemap(varout) SWIGTYPE * { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); -} - -%typemap(directorin) SWIGTYPE { - $<ype temp = new $1_ltype(SWIG_STD_MOVE($1)); - swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)temp, $&1_descriptor); - args = caml_list_append(args, swig_result); -} - -%typemap(directorin) SWIGTYPE *, SWIGTYPE [], SWIGTYPE &, SWIGTYPE && { - swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)&$1, $&1_descriptor); - args = caml_list_append(args, swig_result); -} - -/* The SIMPLE_MAP macro below defines the whole set of typemaps needed - for simple types. */ - -%define SIMPLE_MAP(C_NAME, C_TO_OCAML, OCAML_TO_C) -/* In */ -%typemap(in) C_NAME { - $1 = OCAML_TO_C($input); -} -%typemap(varin) C_NAME { - $1 = OCAML_TO_C($input); -} -%typemap(in) const C_NAME & ($*1_ltype temp) { - temp = ($*1_ltype) OCAML_TO_C($input); - $1 = &temp; -} -%typemap(varin) const C_NAME & { - $1 = OCAML_TO_C($input); -} -%typemap(directorout) C_NAME { - $1 = OCAML_TO_C($input); -} -/* Out */ -%typemap(out) C_NAME { - $result = C_TO_OCAML($1); -} -%typemap(varout) C_NAME { - $result = C_TO_OCAML($1); -} -%typemap(varout) const C_NAME & { - $result = C_TO_OCAML($1); -} -%typemap(out) const C_NAME & { - $result = C_TO_OCAML(*$1); -} -%typemap(directorin) C_NAME { - args = caml_list_append(args, C_TO_OCAML($1)); -} -%enddef - -SIMPLE_MAP(bool, caml_val_bool, caml_long_val); -SIMPLE_MAP(char, caml_val_char, caml_long_val); -SIMPLE_MAP(signed char, caml_val_char, caml_long_val); -SIMPLE_MAP(unsigned char, caml_val_uchar, caml_long_val); -SIMPLE_MAP(int, caml_val_int, caml_long_val); -SIMPLE_MAP(short, caml_val_short, caml_long_val); -SIMPLE_MAP(wchar_t, caml_val_short, caml_long_val); -SIMPLE_MAP(long, caml_val_long, caml_long_val); -SIMPLE_MAP(ptrdiff_t, caml_val_int, caml_long_val); -SIMPLE_MAP(unsigned int, caml_val_uint, caml_long_val); -SIMPLE_MAP(unsigned short, caml_val_ushort, caml_long_val); -SIMPLE_MAP(unsigned long, caml_val_ulong, caml_long_val); -SIMPLE_MAP(size_t, caml_val_int, caml_long_val); -SIMPLE_MAP(float, caml_val_float, caml_double_val); -SIMPLE_MAP(double, caml_val_double, caml_double_val); -SIMPLE_MAP(long long,caml_val_ulong,caml_long_val); -SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); - -/* Void */ - -%typemap(out) void "$result = Val_unit;" - -/* Pass through value */ - -%typemap (in) CAML_VALUE "$1=$input;" -%typemap (out) CAML_VALUE "$result=$1;" - -#if 0 -%include -#endif - -/* Handle char arrays as strings */ - -%define %char_ptr_in(how) -%typemap(how) char *, signed char *, unsigned char * { - $1 = ($ltype)caml_string_val($input); -} -/* Again work around the empty array bound bug */ -%typemap(how) char [ANY], signed char [ANY], unsigned char [ANY] { - char *temp = caml_string_val($input); - strcpy((char *)$1,temp); -} -%enddef - -%char_ptr_in(in); -%char_ptr_in(varin); -%char_ptr_in(directorout); - -%define %char_ptr_out(how) -%typemap(how) - char *, signed char *, unsigned char *, - const char *, const signed char *, const unsigned char * { - $result = caml_val_string((char *)$1); -} -/* I'd like to use the length here but can't because it might be empty */ -%typemap(how) - char [ANY], signed char [ANY], unsigned char [ANY], - const char [ANY], const signed char [ANY], const unsigned char [ANY] { - $result = caml_val_string((char *)$1); -} -%enddef - -%char_ptr_out(out); -%char_ptr_out(varout); -%char_ptr_out(directorin); - -%define %swigtype_ptr_in(how) -%typemap(how) SWIGTYPE * { - $1 = ($ltype)caml_ptr_val($input,$1_descriptor); -} -%typemap(how) SWIGTYPE (CLASS::*) { - void *v = caml_ptr_val($input,$1_descriptor); - memcpy(& $1, &v, sizeof(v)); -} -%enddef - -%typemap(out) SWIGTYPE * { - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); -} - -%define %swigtype_ptr_out(how) -%typemap(how) SWIGTYPE (CLASS::*) { - void *v; - memcpy(&v,& $1, sizeof(void *)); - $result = caml_val_ptr (v,$1_descriptor); -} -%enddef - -%swigtype_ptr_in(in); -%swigtype_ptr_in(varin); -%swigtype_ptr_in(directorout); -%swigtype_ptr_out(out); -%swigtype_ptr_out(varout); -%swigtype_ptr_out(directorin); - -%define %swigtype_array_fail(how,msg) -%typemap(how) SWIGTYPE [] { - caml_failwith(msg); -} -%enddef - -%swigtype_array_fail(in,"Array arguments for arbitrary types need a typemap"); -%swigtype_array_fail(varin,"Assignment to global arrays for arbitrary types need a typemap"); -%swigtype_array_fail(out,"Array arguments for arbitrary types need a typemap"); -%swigtype_array_fail(varout,"Array variables need a typemap"); -%swigtype_array_fail(directorin,"Array results with arbitrary types need a typemap"); -%swigtype_array_fail(directorout,"Array arguments with arbitrary types need a typemap"); - -/* C++ References */ - -/* Enums */ -%define %swig_enum_in(how) -%typemap(how) enum SWIGTYPE { - $1 = ($type)caml_long_val_full($input,"$type_marker"); -} -%enddef - -%define %swig_enum_out(how) -%typemap(how) enum SWIGTYPE { - $result = caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"),*caml_named_value("$type_marker"),Val_int((int)$1)); -} -%enddef - -%swig_enum_in(in) -%swig_enum_in(varin) -%swig_enum_in(directorout) -%swig_enum_out(out) -%swig_enum_out(varout) -%swig_enum_out(directorin) - -%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) { - $1 = ($1_ltype) caml_string_val($input); - $2 = ($2_ltype) caml_string_len($input); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **)&$1); - $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, ty); -} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/ocamlkw.swg b/win64/bin/swig/share/swig/4.1.0/ocaml/ocamlkw.swg deleted file mode 100755 index 70bea56c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/ocamlkw.swg +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef OCAML_OCAMLKW_SWG_ -#define OCAML_OCAMLKW_SWG_ - -/* Warnings for Ocaml keywords */ -#define OCAMLKW(x) %namewarn("314: '" #x "' is an ocaml keyword and it will be appropriately renamed") #x - -/* - from - https://caml.inria.fr/pub/docs/manual-ocaml/lex.html -*/ - - -OCAMLKW(and); -OCAMLKW(as); -OCAMLKW(asr); -OCAMLKW(assert); -OCAMLKW(begin); -OCAMLKW(class); -OCAMLKW(constraint); -OCAMLKW(do); -OCAMLKW(done); -OCAMLKW(downto); -OCAMLKW(else); -OCAMLKW(end); -OCAMLKW(exception); -OCAMLKW(external); -OCAMLKW(false); -OCAMLKW(for); -OCAMLKW(fun); -OCAMLKW(function); -OCAMLKW(functor); -OCAMLKW(if); -OCAMLKW(in); -OCAMLKW(include); -OCAMLKW(inherit); -OCAMLKW(initializer); -OCAMLKW(land); -OCAMLKW(lazy); -OCAMLKW(let); -OCAMLKW(lor); -OCAMLKW(lsl); -OCAMLKW(lsr); -OCAMLKW(lxor); -OCAMLKW(match); -OCAMLKW(method); -OCAMLKW(mod); -OCAMLKW(module); -OCAMLKW(mutable); -OCAMLKW(new); -OCAMLKW(nonrec); -OCAMLKW(object); -OCAMLKW(of); -OCAMLKW(open); -OCAMLKW(or); -OCAMLKW(private); -OCAMLKW(rec); -OCAMLKW(sig); -OCAMLKW(struct); -OCAMLKW(then); -OCAMLKW(to); -OCAMLKW(true); -OCAMLKW(try); -OCAMLKW(type); -OCAMLKW(val); -OCAMLKW(virtual); -OCAMLKW(when); -OCAMLKW(while); -OCAMLKW(with); - -#undef OCAMLKW - -#endif //OCAML_OCAMLKW_SWG_ diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/ocamlrun.swg b/win64/bin/swig/share/swig/4.1.0/ocaml/ocamlrun.swg deleted file mode 100755 index 82506eba..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/ocamlrun.swg +++ /dev/null @@ -1,607 +0,0 @@ -/* -*-c-*- */ - -/* SWIG pointer structure */ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define C_bool 0 -#define C_char 1 -#define C_uchar 2 -#define C_short 3 -#define C_ushort 4 -#define C_int 5 -#define C_uint 6 -#define C_int32 7 -#define C_int64 8 -#define C_float 9 -#define C_double 10 -#define C_ptr 11 -#define C_array 12 -#define C_list 13 -#define C_obj 14 -#define C_string 15 -#define C_enum 16 -#define C_director_core 17 - - -/* Cast a pointer if possible; returns 1 if successful */ - - SWIGINTERN int - SWIG_Cast (void *source, swig_type_info *source_type, - void **ptr, swig_type_info *dest_type) - { - if( !source ) { /* Special case for NULL. This is a popular question - for other modules on the list, so I want an easy way out... */ - *ptr = 0; - return 0; - } - -#ifdef TYPE_CAST_VERBOSE - fprintf( stderr, "Trying to cast %s to %s\n", - source_type ? source_type->str : "", - dest_type ? dest_type->str : "" ); -#endif - if (dest_type != source_type) { - /* We have a type mismatch. Will have to look through our type - mapping table to figure out whether or not we can accept this - datatype. - -- - Ignore typechecks for void *. Allow any conversion. */ - if( !dest_type || !source_type || - !strcmp(dest_type->name,"_p_void") || - !strcmp(source_type->name,"_p_void") ) { - *ptr = source; - return 0; - } else { - swig_cast_info *tc = - SWIG_TypeCheckStruct(source_type, dest_type ); -#ifdef TYPE_CAST_VERBOSE - fprintf( stderr, "Typecheck -> %s\n", - tc ? tc->type->str : "" ); -#endif - if( tc ) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, source, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - return 0; - } else - return -1; - } - } else { - *ptr = source; - return 0; - } - } - -/* Return 0 if successful. */ - SWIGINTERN int - SWIG_GetPtr(void *inptr, void **outptr, - swig_type_info *intype, swig_type_info *outtype) { - if (intype) { - return SWIG_Cast(inptr, intype, - outptr, outtype) == -1; - } else { - *outptr = inptr; - return 0; - } - } - - SWIGINTERN void caml_print_list( CAML_VALUE v ); - - SWIGINTERN void caml_print_val( CAML_VALUE v ) { - switch( SWIG_Tag_val(v) ) { - case C_bool: - if( Bool_val(SWIG_Field(v,0)) ) fprintf( stderr, "true " ); - else fprintf( stderr, "false " ); - break; - case C_char: - case C_uchar: - fprintf( stderr, "'%c' (\\%03d) ", - (Int_val(SWIG_Field(v,0)) >= ' ' && - Int_val(SWIG_Field(v,0)) < 127) ? Int_val(SWIG_Field(v,0)) : '.', - Int_val(SWIG_Field(v,0)) ); - break; - case C_short: - case C_ushort: - case C_int: - fprintf( stderr, "%d ", (int)caml_long_val(v) ); - break; - - case C_uint: - case C_int32: - fprintf( stderr, "%ud ", (unsigned int)caml_long_val(v) ); - break; - case C_int64: - fprintf( stderr, "%ld ", caml_long_val(v) ); - break; - case C_float: - case C_double: - fprintf( stderr, "%f ", caml_double_val(v) ); - break; - - case C_ptr: - { - void *vout = 0; - swig_type_info *ty = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); - caml_ptr_val_internal(v,&vout,0); - fprintf( stderr, "PTR(%p,%s) ", - vout, - ty ? ty->name : "(null)" ); - } - break; - case C_array: - { - unsigned int i; - for( i = 0; i < Wosize_val( SWIG_Field(v,0) ); i++ ) - caml_print_val( SWIG_Field(SWIG_Field(v,0),i) ); - } - break; - case C_list: - caml_print_list( SWIG_Field(v,0) ); - break; - case C_obj: - fprintf( stderr, "OBJ(%p) ", (void *)SWIG_Field(v,0) ); - break; - case C_string: - { - void *cout; - caml_ptr_val_internal(v,&cout,0); - fprintf( stderr, "'%s' ", (char *)cout ); - } - break; - } - } - - SWIGINTERN void caml_print_list( CAML_VALUE v ) { - CAMLparam1(v); - while( v && Is_block(v) ) { - fprintf( stderr, "[ " ); - caml_print_val( SWIG_Field(v,0) ); - fprintf( stderr, "]\n" ); - v = SWIG_Field(v,1); - } - CAMLreturn0; - } - - SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) { - CAMLparam1(lst); - int i = 0; - while( i < n && lst && Is_block(lst) ) { - i++; lst = SWIG_Field(lst,1); - } - if( lst == Val_unit ) CAMLreturn(Val_unit); - else CAMLreturn(SWIG_Field(lst,0)); - } - - SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) { - CAMLparam2(lst,elt); - SWIG_CAMLlocal3(v,vt,lh); - lh = Val_unit; - v = Val_unit; - - /* Appending C_void should have no effect */ - if( !Is_block(elt) ) return lst; - - while( lst && Is_block(lst) ) { - if( v && v != Val_unit ) { - vt = caml_alloc_tuple(2); - SWIG_Store_field(v,1,vt); - v = vt; - } else { - v = lh = caml_alloc_tuple(2); - } - SWIG_Store_field(v,0,SWIG_Field(lst,0)); - lst = SWIG_Field(lst,1); - } - - if( v && Is_block(v) ) { - vt = caml_alloc_tuple(2); - SWIG_Store_field(v,1,vt); - v = vt; - } else { - v = lh = caml_alloc_tuple(2); - } - SWIG_Store_field(v,0,elt); - SWIG_Store_field(v,1,Val_unit); - - CAMLreturn(lh); - } - - SWIGINTERN int caml_list_length( CAML_VALUE lst ) { - CAMLparam1(lst); - int i = 0; - while( lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); } - CAMLreturn(i); - } - - SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) { - CAMLparam2(arr,item); - SWIG_Store_field(SWIG_Field(arr,0),n,item); - CAMLreturn0; - } - - SWIGINTERN value caml_array_nth( CAML_VALUE arr, int n ) { - CAMLparam1(arr); - if( SWIG_Tag_val(arr) == C_array ) - CAMLreturn(SWIG_Field(SWIG_Field(arr,0),n)); - else if( SWIG_Tag_val(arr) == C_list ) - CAMLreturn(caml_list_nth(arr,0)); - else - caml_failwith("Need array or list"); - } - - SWIGINTERN int caml_array_len( CAML_VALUE arr ) { - CAMLparam1(arr); - if( SWIG_Tag_val(arr) == C_array ) - CAMLreturn(Wosize_val(SWIG_Field(arr,0))); - else if( SWIG_Tag_val(arr) == C_list ) - CAMLreturn(caml_list_length(arr)); - else - caml_failwith("Need array or list"); - } - - SWIGINTERN CAML_VALUE caml_swig_alloc(int x,int y) { - return caml_alloc(x,y); - } - - SWIGINTERN value caml_array_new( int n ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - vv = caml_swig_alloc(1,C_array); - SWIG_Store_field(vv,0,caml_alloc_tuple(n)); - CAMLreturn(vv); - } - - SWIGINTERN CAML_VALUE caml_val_bool( int b ) { - CAMLparam0(); - SWIG_CAMLlocal1(bv); - bv = caml_swig_alloc(1,C_bool); - SWIG_Store_field(bv,0,Val_bool(b)); - CAMLreturn(bv); - } - - SWIGINTERN CAML_VALUE caml_val_char( char c ) { - CAMLparam0(); - SWIG_CAMLlocal1(cv); - cv = caml_swig_alloc(1,C_char); - SWIG_Store_field(cv,0,Val_int(c)); - CAMLreturn(cv); - } - - SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char uc ) { - CAMLparam0(); - SWIG_CAMLlocal1(ucv); - ucv = caml_swig_alloc(1,C_uchar); - SWIG_Store_field(ucv,0,Val_int(uc)); - CAMLreturn(ucv); - } - - SWIGINTERN CAML_VALUE caml_val_short( short s ) { - CAMLparam0(); - SWIG_CAMLlocal1(sv); - sv = caml_swig_alloc(1,C_short); - SWIG_Store_field(sv,0,Val_int(s)); - CAMLreturn(sv); - } - - SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short us ) { - CAMLparam0(); - SWIG_CAMLlocal1(usv); - usv = caml_swig_alloc(1,C_ushort); - SWIG_Store_field(usv,0,Val_int(us)); - CAMLreturn(usv); - } - - SWIGINTERN CAML_VALUE caml_val_int( int i ) { - CAMLparam0(); - SWIG_CAMLlocal1(iv); - iv = caml_swig_alloc(1,C_int); - SWIG_Store_field(iv,0,Val_int(i)); - CAMLreturn(iv); - } - - SWIGINTERN CAML_VALUE caml_val_uint( unsigned int ui ) { - CAMLparam0(); - SWIG_CAMLlocal1(uiv); - uiv = caml_swig_alloc(1,C_int); - SWIG_Store_field(uiv,0,Val_int(ui)); - CAMLreturn(uiv); - } - - SWIGINTERN CAML_VALUE caml_val_long( long l ) { - CAMLparam0(); - SWIG_CAMLlocal1(lv); - lv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(lv,0,caml_copy_int64(l)); - CAMLreturn(lv); - } - - SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long ul ) { - CAMLparam0(); - SWIG_CAMLlocal1(ulv); - ulv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(ulv,0,caml_copy_int64(ul)); - CAMLreturn(ulv); - } - - SWIGINTERN CAML_VALUE caml_val_float( float f ) { - CAMLparam0(); - SWIG_CAMLlocal1(fv); - fv = caml_swig_alloc(1,C_float); - SWIG_Store_field(fv,0,caml_copy_double((double)f)); - CAMLreturn(fv); - } - - SWIGINTERN CAML_VALUE caml_val_double( double d ) { - CAMLparam0(); - SWIG_CAMLlocal1(fv); - fv = caml_swig_alloc(1,C_double); - SWIG_Store_field(fv,0,caml_copy_double(d)); - CAMLreturn(fv); - } - - SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - vv = caml_swig_alloc(2,C_ptr); - SWIG_Store_field(vv,0,caml_copy_int64((long)p)); - SWIG_Store_field(vv,1,caml_copy_int64((long)info)); - CAMLreturn(vv); - } - - SWIGINTERN CAML_VALUE caml_val_string( const char *p ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - if( !p ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); - vv = caml_swig_alloc(1,C_string); - SWIG_Store_field(vv,0,caml_copy_string(p)); - CAMLreturn(vv); - } - - SWIGINTERN CAML_VALUE caml_val_string_len( const char *p, int len ) { - CAMLparam0(); - SWIG_CAMLlocal1(vv); - if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); - vv = caml_swig_alloc(1,C_string); - SWIG_Store_field(vv,0,caml_alloc_string(len)); - memcpy(Bp_val(SWIG_Field(vv,0)),p,len); - CAMLreturn(vv); - } - - #define caml_val_obj(v, name) caml_val_obj_helper(v, SWIG_TypeQuery((name)), name) - SWIGINTERN CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) { - CAMLparam0(); - CAMLreturn(caml_callback2(*caml_named_value("caml_create_object_fn"), - caml_val_ptr(v,type), - caml_copy_string(name))); - } - - SWIGINTERN long caml_long_val_full( CAML_VALUE v, const char *name ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_bool: - case C_char: - case C_uchar: - case C_short: - case C_ushort: - case C_int: - CAMLreturn(Int_val(SWIG_Field(v,0))); - case C_uint: - case C_int32: - CAMLreturn(Int32_val(SWIG_Field(v,0))); - case C_int64: - CAMLreturn((long)SWIG_Int64_val(SWIG_Field(v,0))); - case C_float: - case C_double: - CAMLreturn((long)Double_val(SWIG_Field(v,0))); - case C_string: - CAMLreturn((long)String_val(SWIG_Field(v,0))); - case C_ptr: - CAMLreturn((long)SWIG_Int64_val(SWIG_Field(SWIG_Field(v,0),0))); - case C_enum: { - SWIG_CAMLlocal1(ret); - const CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int"); - if( !name ) caml_failwith( "Not an enum conversion" ); - ret = caml_callback2(*enum_to_int,*caml_named_value(name),v); - CAMLreturn(caml_long_val(ret)); - } - default: - caml_failwith("No conversion to int"); - } - } - - SWIGINTERN long caml_long_val( CAML_VALUE v ) { - return caml_long_val_full(v,0); - } - - SWIGINTERN double caml_double_val( CAML_VALUE v ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0.0; - switch( SWIG_Tag_val(v) ) { - case C_bool: - case C_char: - case C_uchar: - case C_short: - case C_ushort: - case C_int: - CAMLreturn_type(Int_val(SWIG_Field(v,0))); - case C_uint: - case C_int32: - CAMLreturn_type(Int32_val(SWIG_Field(v,0))); - case C_int64: - CAMLreturn_type(SWIG_Int64_val(SWIG_Field(v,0))); - case C_float: - case C_double: - CAMLreturn_type(Double_val(SWIG_Field(v,0))); - default: - fprintf( stderr, "Unknown block tag %d\n", SWIG_Tag_val(v) ); - caml_failwith("No conversion to double"); - } - } - - SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, - swig_type_info *descriptor ) { - CAMLparam1(v); - void *outptr = NULL; - swig_type_info *outdescr = NULL; - static const CAML_VALUE *func_val = NULL; - - if( v == Val_unit ) { - *out = 0; - CAMLreturn_type(0); - } - if( !Is_block(v) ) return -1; - switch( SWIG_Tag_val(v) ) { - case C_obj: - if (!func_val) { - func_val = caml_named_value("caml_obj_ptr"); - } - CAMLreturn_type(caml_ptr_val_internal(caml_callback(*func_val, v), out, descriptor)); - case C_string: - outptr = (void *)String_val(SWIG_Field(v,0)); - break; - case C_ptr: - outptr = (void *)(long)SWIG_Int64_val(SWIG_Field(v,0)); - outdescr = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); - break; - default: - *out = 0; - CAMLreturn_type(1); - break; - } - - CAMLreturn_type(SWIG_GetPtr(outptr, out, outdescr, descriptor)); - } - - SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) { - CAMLparam0(); -#ifdef TYPE_CAST_VERBOSE - caml_print_val( v ); -#endif - void *out = NULL; - if( !caml_ptr_val_internal( v, &out, descriptor ) ) - CAMLreturn_type(out); - else - caml_failwith( "No appropriate conversion found." ); - } - - SWIGINTERN char *caml_string_val( CAML_VALUE v ) { - return (char *)caml_ptr_val( v, 0 ); - } - - SWIGINTERN int caml_string_len( CAML_VALUE v ) { - switch( SWIG_Tag_val(v) ) { - case C_string: - return caml_string_length(SWIG_Field(v,0)); - default: - return strlen((char *)caml_ptr_val(v,0)); - } - } - - SWIGINTERN int caml_bool_check( CAML_VALUE v ) { - CAMLparam1(v); - - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_bool: - case C_ptr: - case C_string: - CAMLreturn(1); - default: - CAMLreturn(0); - } - } - - SWIGINTERN int caml_int_check( CAML_VALUE v ) { - CAMLparam1(v); - - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_char: - case C_uchar: - case C_short: - case C_ushort: - case C_int: - case C_uint: - case C_int32: - case C_int64: - CAMLreturn(1); - - default: - CAMLreturn(0); - } - } - - SWIGINTERN int caml_float_check( CAML_VALUE v ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_float: - case C_double: - CAMLreturn(1); - - default: - CAMLreturn(0); - } - } - - SWIGINTERN int caml_ptr_check( CAML_VALUE v ) { - CAMLparam1(v); - if( !Is_block(v) ) return 0; - - switch( SWIG_Tag_val(v) ) { - case C_string: - case C_ptr: - case C_int64: - CAMLreturn(1); - - default: - CAMLreturn(0); - } - } - - SWIGINTERN CAML_VALUE SWIG_Ocaml_ptr_to_val(const char *name, void *ptr, swig_type_info *descriptor) { - CAMLparam0(); - SWIG_CAMLlocal1(result); - - const CAML_VALUE *fromval = caml_named_value(name); - if (fromval) { - result = caml_callback(*fromval, caml_val_ptr(ptr, descriptor)); - } else { - result = caml_val_ptr(ptr, descriptor); - } - CAMLreturn(result); - } - - static swig_module_info *SWIG_Ocaml_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - CAML_VALUE pointer; - - pointer = caml_callback(*caml_named_value("swig_find_type_info"), caml_val_int(0)); - if (Is_block(pointer) && SWIG_Tag_val(pointer) == C_ptr) { - return (swig_module_info *)(void *)(long)SWIG_Int64_val(SWIG_Field(pointer,0)); - } - return 0; - } - - static void SWIG_Ocaml_SetModule(swig_module_info *pointer) { - CAML_VALUE mod_pointer; - - mod_pointer = caml_val_ptr(pointer, NULL); - caml_callback(*caml_named_value("swig_set_type_info"), mod_pointer); - } - -#ifdef __cplusplus -} -#endif -#undef value - diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/ocamlrundec.swg b/win64/bin/swig/share/swig/4.1.0/ocaml/ocamlrundec.swg deleted file mode 100755 index 96e5d8fa..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/ocamlrundec.swg +++ /dev/null @@ -1,212 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocamlrundec.swg - * - * Ocaml runtime code -- declarations - * ----------------------------------------------------------------------------- */ - -#include -#include -#include - -#ifdef __cplusplus -#define SWIGEXT extern "C" -SWIGEXT { -#else -#define SWIGEXT -#endif -#define value caml_value_t -#define CAML_VALUE caml_value_t -#define CAML_NAME_SPACE -#include -#include -#include -#include -#include -#include -#include - -#if defined(CAMLassert) -/* Both this macro and version.h were introduced in version 4.02.0 */ -#include -#else -#define OCAML_VERSION 0 /* Unknown, but < 40200 */ -#endif - -#define caml_array_set swig_caml_array_set - -/* Adapted from memory.h and mlvalues.h */ - -#define SWIG_CAMLlocal1(x) \ - caml_value_t x = 0; \ - CAMLxparam1 (x) - -#define SWIG_CAMLlocal2(x, y) \ - caml_value_t x = 0, y = 0; \ - CAMLxparam2 (x, y) - -#define SWIG_CAMLlocal3(x, y, z) \ - caml_value_t x = 0, y = 0, z = 0; \ - CAMLxparam3 (x, y, z) - -#define SWIG_CAMLlocal4(x, y, z, t) \ - caml_value_t x = 0, y = 0, z = 0, t = 0; \ - CAMLxparam4 (x, y, z, t) - -#define SWIG_CAMLlocal5(x, y, z, t, u) \ - caml_value_t x = 0, y = 0, z = 0, t = 0, u = 0; \ - CAMLxparam5 (x, y, z, t, u) - -#define SWIG_CAMLlocalN(x, size) \ - caml_value_t x [(size)] = { 0, /* 0, 0, ... */ }; \ - CAMLxparamN (x, (size)) - -#define SWIG_Field(x, i) (((caml_value_t *)(x)) [i]) /* Also an l-value. */ -#define SWIG_Store_field(block, offset, val) do{ \ - mlsize_t caml__temp_offset = (offset); \ - caml_value_t caml__temp_val = (val); \ - caml_modify (&SWIG_Field ((block), caml__temp_offset), caml__temp_val); \ -}while(0) - -#define SWIG_Data_custom_val(v) ((void *) &SWIG_Field((v), 1)) -#ifdef ARCH_BIG_ENDIAN -#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-1]) - /* Also an l-value. */ -#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [sizeof(caml_value_t)-1]) - /* Also an l-value. */ -#else -#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-sizeof(caml_value_t)]) - /* Also an l-value. */ -#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [0]) - /* Also an l-value. */ -#endif - -#ifdef CAMLreturn0 -#undef CAMLreturn0 -#endif -#define CAMLreturn0 do{ \ - caml_local_roots = caml__frame; \ - return; \ -}while (0) - -#ifdef CAMLreturn -#undef CAMLreturn -#endif -#define CAMLreturn(result) do{ \ - caml_value_t caml__temp_result = (result); \ - caml_local_roots = caml__frame; \ - return (caml__temp_result); \ -}while(0) - -#define CAMLreturn_type(result) do{ \ - caml_local_roots = caml__frame; \ - return result; \ -}while(0) - -#ifdef CAMLnoreturn -#undef CAMLnoreturn -#endif -#define CAMLnoreturn ((void) caml__frame) - - -#ifndef ARCH_ALIGN_INT64 -#if OCAML_VERSION >= 40300 -#define SWIG_Int64_val(v) (*((int64_t *) SWIG_Data_custom_val(v))) -#else -#define SWIG_Int64_val(v) (*((int64 *) SWIG_Data_custom_val(v))) -#endif -#else -#if OCAML_VERSION >= 40300 -CAMLextern int64_t Int64_val(caml_value_t v); -#else -CAMLextern int64 Int64_val(caml_value_t v); -#endif -#define SWIG_Int64_val(v) Int64_val(v) -#endif - -#define SWIG_NewPointerObj(p,type,flags) caml_val_ptr(p,type) -#define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer) - -typedef enum { - SWIG_OCamlArithmeticException, - SWIG_OCamlDirectorPureVirtual, - SWIG_OCamlOutOfMemoryError, - SWIG_OCamlOverflowException, - SWIG_OCamlIllegalArgumentException, - SWIG_OCamlIndexOutOfBoundsException, - SWIG_OCamlRuntimeException, - SWIG_OCamlSystemException, - SWIG_OCamlUnknownError -} SWIG_OCamlExceptionCodes; - -SWIGINTERN void SWIG_OCamlThrowException(SWIG_OCamlExceptionCodes code, const char *msg) { - CAMLparam0(); - SWIG_CAMLlocal1(str); - - switch (code) { - case SWIG_OCamlIllegalArgumentException: - caml_invalid_argument(msg); - break; - case SWIG_OCamlSystemException: - str = caml_copy_string(msg); - caml_raise_sys_error(str); - break; - case SWIG_OCamlArithmeticException: - case SWIG_OCamlIndexOutOfBoundsException: - case SWIG_OCamlOutOfMemoryError: - case SWIG_OCamlOverflowException: - case SWIG_OCamlRuntimeException: - case SWIG_OCamlUnknownError: - default: - caml_failwith(msg); - break; - } - CAMLreturn0; -} - -#define SWIG_contract_assert(expr, msg) do { if(!(expr)) {SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, msg);} } while (0) - - SWIGINTERN int - SWIG_GetPtr(void *source, void **result, swig_type_info *type, swig_type_info *result_type); - - SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ); - SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ); - SWIGINTERN int caml_list_length( CAML_VALUE lst ); - SWIGINTERN CAML_VALUE caml_array_new( int n ); - SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ); - SWIGINTERN CAML_VALUE caml_array_nth( CAML_VALUE arr, int n ); - SWIGINTERN int caml_array_len( CAML_VALUE arr ); - - SWIGINTERN CAML_VALUE caml_val_char( char c ); - SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char c ); - - SWIGINTERN CAML_VALUE caml_val_short( short s ); - SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short s ); - - SWIGINTERN CAML_VALUE caml_val_int( int x ); - SWIGINTERN CAML_VALUE caml_val_uint( unsigned int x ); - - SWIGINTERN CAML_VALUE caml_val_long( long x ); - SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long x ); - - SWIGINTERN CAML_VALUE caml_val_float( float f ); - SWIGINTERN CAML_VALUE caml_val_double( double d ); - - SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor ); - - SWIGINTERN CAML_VALUE caml_val_string( const char *str ); - SWIGINTERN CAML_VALUE caml_val_string_len( const char *str, int len ); - - SWIGINTERN long caml_long_val( CAML_VALUE v ); - SWIGINTERN double caml_double_val( CAML_VALUE v ); - - SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, - swig_type_info *descriptor ); - SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ); - - SWIGINTERN char *caml_string_val( CAML_VALUE v ); - SWIGINTERN int caml_string_len( CAML_VALUE v ); - -#ifdef __cplusplus -} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/preamble.swg b/win64/bin/swig/share/swig/4.1.0/ocaml/preamble.swg deleted file mode 100755 index 597c2c6e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/preamble.swg +++ /dev/null @@ -1,17 +0,0 @@ -%insert(mli) %{ -exception BadArgs of string -exception BadMethodName of c_obj * string * string -exception NotObject of c_obj -exception NotEnumType of c_obj -exception LabelNotFromThisEnum of c_obj -exception InvalidDirectorCall of c_obj -%} - -%insert(ml) %{ -exception BadArgs of string -exception BadMethodName of c_obj * string * string -exception NotObject of c_obj -exception NotEnumType of c_obj -exception LabelNotFromThisEnum of c_obj -exception InvalidDirectorCall of c_obj -%} \ No newline at end of file diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/std_common.i b/win64/bin/swig/share/swig/4.1.0/ocaml/std_common.i deleted file mode 100755 index 39c0dbed..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/std_common.i +++ /dev/null @@ -1,23 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; - -%{ -#include -SWIGINTERNINLINE -CAML_VALUE SwigString_FromString(const std::string &s) { - return caml_val_string((char *)s.c_str()); -} - -SWIGINTERNINLINE -std::string SwigString_AsString(CAML_VALUE o) { - return std::string((char *)caml_ptr_val(o,0)); -} -%} diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/std_complex.i b/win64/bin/swig/share/swig/4.1.0/ocaml/std_complex.i deleted file mode 100755 index 1d7e9543..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/std_complex.i +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- -#ifndef SWIG_STD_COMPLEX_I_ -#define SWIG_STD_COMPLEX_I_ - -#ifdef SWIG - -%{ -#include -%} - -namespace std -{ - template class complex; - - %define specialize_std_complex(T) - - %typemap(in) complex { - if (PyComplex_Check($input)) { - $1 = std::complex(PyComplex_RealAsDouble($input), - PyComplex_ImagAsDouble($input)); - } else if (PyFloat_Check($input)) { - $1 = std::complex(PyFloat_AsDouble($input), 0); - } else if (PyInt_Check($input)) { - $1 = std::complex(PyInt_AsLong($input), 0); - } - else { - PyErr_SetString(PyExc_TypeError,"Expected a complex"); - SWIG_fail; - } - } - - %typemap(in) const complex& (std::complex temp) { - if (PyComplex_Check($input)) { - temp = std::complex(PyComplex_RealAsDouble($input), - PyComplex_ImagAsDouble($input)); - $1 = &temp; - } else if (PyFloat_Check($input)) { - temp = std::complex(PyFloat_AsDouble($input), 0); - $1 = &temp; - } else if (PyInt_Check($input)) { - temp = std::complex(PyInt_AsLong($input), 0); - $1 = &temp; - } else { - PyErr_SetString(PyExc_TypeError,"Expected a complex"); - SWIG_fail; - } - } - - %typemap(out) complex { - $result = PyComplex_FromDoubles($1.real(), $1.imag()); - } - - %typemap(out) const complex & { - $result = PyComplex_FromDoubles($1->real(), $1->imag()); - } - - %enddef - - specialize_std_complex(double); - specialize_std_complex(float); -} - -#endif // SWIG - -#endif //SWIG_STD_COMPLEX_I_ diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/std_deque.i b/win64/bin/swig/share/swig/4.1.0/ocaml/std_deque.i deleted file mode 100755 index d83fd576..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/std_deque.i +++ /dev/null @@ -1,28 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_deque.i - * - * Default std_deque wrapper - * ----------------------------------------------------------------------------- */ - -%module std_deque - -%rename(__getitem__) std::deque::getitem; -%rename(__setitem__) std::deque::setitem; -%rename(__delitem__) std::deque::delitem; -%rename(__getslice__) std::deque::getslice; -%rename(__setslice__) std::deque::setslice; -%rename(__delslice__) std::deque::delslice; - -%extend std::deque { - int __len__() { - return (int) self->size(); - } - int __nonzero__() { - return ! self->empty(); - } - void append(const T &x) { - self->push_back(x); - } -}; - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/std_except.i b/win64/bin/swig/share/swig/4.1.0/ocaml/std_except.i deleted file mode 100755 index c382af46..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/std_except.i +++ /dev/null @@ -1,23 +0,0 @@ -%{ -#include -#include -%} - -namespace std -{ - %ignore exception; - struct exception {}; -} - -%typemap(throws) std::bad_cast "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::bad_exception "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::domain_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::exception "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::invalid_argument "SWIG_OCamlThrowException(SWIG_OCamlIllegalArgumentException, $1.what());" -%typemap(throws) std::length_error "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" -%typemap(throws) std::logic_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::out_of_range "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" -%typemap(throws) std::overflow_error "SWIG_OCamlThrowException(SWIG_OCamlArithmeticException, $1.what());" -%typemap(throws) std::range_error "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" -%typemap(throws) std::runtime_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" -%typemap(throws) std::underflow_error "SWIG_OCamlThrowException(SWIG_OCamlArithmeticException, $1.what());" diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/std_list.i b/win64/bin/swig/share/swig/4.1.0/ocaml/std_list.i deleted file mode 100755 index af572611..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/std_list.i +++ /dev/null @@ -1,217 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list types - * ----------------------------------------------------------------------------- */ - -%include - -%module std_list -%{ -#include -#include -%} - - -namespace std { - template class list - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef T &iterator; - typedef const T& const_iterator; - - list(); - list(unsigned int size, const T& value = T()); - list(const list& other); - - void assign(unsigned int n, const T& value); - void swap(list &x); - - const_reference front(); - const_reference back(); - const_iterator begin(); - const_iterator end(); - - void resize(unsigned int n, T c = T()); - bool empty() const; - - void push_front(const T& x); - void push_back(const T& x); - - void pop_front(); - void pop_back(); - void clear(); - unsigned int size() const; - unsigned int max_size() const; - void resize(unsigned int n, const T& value); - - void remove(const T& value); - void unique(); - void reverse(); - void sort(); - - %extend - { - const_reference __getitem__(int i) throw (std::out_of_range) - { - std::list::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && i::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && i::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && ierase(first); - } - else throw std::out_of_range("list index out of range"); - } - std::list __getslice__(int i,int j) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - if (i>=j) i=j; - if (i>=0 && i=0) - { - for (int k=0;k tmp(j-i); - if (j>i) std::copy(first,end,tmp.begin()); - return tmp; - } - else throw std::out_of_range("list index out of range"); - } - void __delslice__(int i,int j) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - - for (int k=0;kerase(first,end); - } - void __setslice__(int i,int j, const std::list& v) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - - for (int k=0;kerase(first,end); - if (i+1 <= int(self->size())) - { - first = self->begin(); - for (int k=0;kinsert(first,v.begin(),v.end()); - } - else self->insert(self->end(),v.begin(),v.end()); - } - - } - unsigned int __len__() - { - return self->size(); - } - bool __nonzero__() - { - return !(self->empty()); - } - void append(const T& x) - { - self->push_back(x); - } - void pop() - { - self->pop_back(); - } - } - }; -} - - - - - - diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/std_map.i b/win64/bin/swig/share/swig/4.1.0/ocaml/std_map.i deleted file mode 100755 index 71a5d2e6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/std_map.i +++ /dev/null @@ -1,79 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/std_pair.i b/win64/bin/swig/share/swig/4.1.0/ocaml/std_pair.i deleted file mode 100755 index 539130ff..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/std_string.i b/win64/bin/swig/share/swig/4.1.0/ocaml/std_string.i deleted file mode 100755 index 56423ccd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/std_string.i +++ /dev/null @@ -1,136 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%{ -#include -#include -%} - -%include -%include - -namespace std { - -%naturalvar string; -%naturalvar wstring; - -class string; -class wstring; - -/* Overloading check */ -%typemap(in) string { - if (caml_ptr_check($input)) - $1.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - else - SWIG_exception(SWIG_TypeError, "string expected"); -} - -%typemap(in) const string & ($*1_ltype temp) { - if (caml_ptr_check($input)) { - temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - -%typemap(in) string & ($*1_ltype temp) { - if (caml_ptr_check($input)) { - temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - -%typemap(in) string * ($*1_ltype *temp) { - if (caml_ptr_check($input)) { - temp = new $*1_ltype((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - -%typemap(free) string * ($*1_ltype *temp) { - delete temp; -} - -%typemap(argout) string & { - swig_result = caml_list_append(swig_result,caml_val_string_len((*$1).c_str(), (*$1).size())); -} - -%typemap(directorin) string { - swig_result = caml_val_string_len($1.c_str(), $1.size()); - args = caml_list_append(args, swig_result); -} - -%typemap(directorout) string { - $result.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); -} - -%typemap(out) string { - $result = caml_val_string_len($1.c_str(),$1.size()); -} - -%typemap(varout) string { - $result = caml_val_string_len($1.c_str(),$1.size()); -} - -%typemap(out) string * { - $result = caml_val_string_len((*$1).c_str(),(*$1).size()); -} - -%typemap(varout) string * { - $result = caml_val_string_len((*$1).c_str(),(*$1).size()); -} - -%typemap(typecheck) string, const string & = char *; - -%typemap(throws) string, const string & "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.c_str());" - -} - -#ifdef ENABLE_CHARPTR_ARRAY -char **c_charptr_array( const std::vector &str_v ); - -%{ - SWIGEXT char **c_charptr_array( const std::vector &str_v ) { - char **out = new char *[str_v.size() + 1]; - out[str_v.size()] = 0; - for( int i = 0; i < str_v.size(); i++ ) { - out[i] = (char *)str_v[i].c_str(); - } - return out; - } -%} -#endif - -#ifdef ENABLE_STRING_VECTOR -%template (StringVector) std::vector; - -%insert(ml) %{ - (* Some STL convenience items *) - - let string_array_to_vector sa = - let nv = _new_StringVector C_void in - ignore (array_to_vector nv (fun x -> C_string x) sa) ; nv - - let c_string_array ar = - _c_charptr_array (string_array_to_vector ar) -%} - -%insert(mli) %{ - val c_string_array: string array -> c_obj -%} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/std_vector.i b/win64/bin/swig/share/swig/4.1.0/ocaml/std_vector.i deleted file mode 100755 index 31283270..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/std_vector.i +++ /dev/null @@ -1,98 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector types - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Python as much as possible, namely, to allow the user to pass and -// be returned Python tuples or lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a Python sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a Python sequence of T:s -// is returned which is most easily used in other Python functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - void push_back(const T& x); - T operator [] ( int f ); - vector &operator = ( vector &other ); - %extend { - void set( int i, const T &x ) { - self->resize(i+1); - (*self)[i] = x; - } - }; - %extend { - T *to_array() { - T *array = new T[self->size() + 1]; - for( int i = 0; i < self->size(); i++ ) - array[i] = (*self)[i]; - return array; - } - }; - }; -}; - -%insert(ml) %{ - - let array_to_vector v argcons array = - for i = 0 to (Array.length array) - 1 do - ignore ((invoke v) "set" (C_list [ C_int i ; (argcons array.(i)) ])) - done ; - v - - let vector_to_array v argcons array = - for i = 0; to (get_int ((invoke v) "size" C_void)) - 1 do - array.(i) <- argcons ((invoke v) "[]" (C_int i)) - done ; - v - -%} - -%insert(mli) %{ - val array_to_vector : c_obj -> ('a -> c_obj) -> 'a array -> c_obj - val vector_to_array : c_obj -> (c_obj -> 'a) -> 'a array -> c_obj -%} diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/stl.i b/win64/bin/swig/share/swig/4.1.0/ocaml/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/swig.ml b/win64/bin/swig/share/swig/4.1.0/ocaml/swig.ml deleted file mode 100755 index fa949369..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/swig.ml +++ /dev/null @@ -1,166 +0,0 @@ -(* -*- tuareg -*- *) -open Int32 -open Int64 - -type enum = [ `Int of int ] - -type 'a c_obj_t = - C_void - | C_bool of bool - | C_char of char - | C_uchar of char - | C_short of int - | C_ushort of int - | C_int of int - | C_uint of int32 - | C_int32 of int32 - | C_int64 of int64 - | C_float of float - | C_double of float - | C_ptr of int64 * int64 - | C_array of 'a c_obj_t array - | C_list of 'a c_obj_t list - | C_obj of (string -> 'a c_obj_t -> 'a c_obj_t) - | C_string of string - | C_enum of 'a - | C_director_core of 'a c_obj_t * 'a c_obj_t option ref - -type c_obj = enum c_obj_t - -exception BadArgs of string -exception BadMethodName of string * string -exception NotObject of c_obj -exception NotEnumType of c_obj -exception LabelNotFromThisEnum of c_obj -exception InvalidDirectorCall of c_obj -exception NoSuchClass of string -let rec invoke obj = - match obj with - C_obj o -> o - | C_director_core (o,r) -> invoke o - | _ -> raise (NotObject (Obj.magic obj)) -let _ = Callback.register "swig_runmethod" invoke - -let fnhelper arg = - match arg with C_list l -> l | C_void -> [] | _ -> [ arg ] - -let director_core_helper fnargs = - try - match List.hd fnargs with - | C_director_core (o,r) -> fnargs - | _ -> C_void :: fnargs - with Failure _ -> C_void :: fnargs - -let rec get_int x = - match x with - C_bool b -> if b then 1 else 0 - | C_char c - | C_uchar c -> (int_of_char c) - | C_short s - | C_ushort s - | C_int s -> s - | C_uint u - | C_int32 u -> (Int32.to_int u) - | C_int64 u -> (Int64.to_int u) - | C_float f -> (int_of_float f) - | C_double d -> (int_of_float d) - | C_ptr (p,q) -> (Int64.to_int p) - | C_obj o -> (try (get_int (o "int" C_void)) - with _ -> (get_int (o "&" C_void))) - | _ -> raise (Failure "Can't convert to int") - -let rec get_float x = - match x with - C_char c - | C_uchar c -> (float_of_int (int_of_char c)) - | C_short s -> (float_of_int s) - | C_ushort s -> (float_of_int s) - | C_int s -> (float_of_int s) - | C_uint u - | C_int32 u -> (float_of_int (Int32.to_int u)) - | C_int64 u -> (float_of_int (Int64.to_int u)) - | C_float f -> f - | C_double d -> d - | C_obj o -> (try (get_float (o "float" C_void)) - with _ -> (get_float (o "double" C_void))) - | _ -> raise (Failure "Can't convert to float") - -let rec get_char x = - (char_of_int (get_int x)) - -let rec get_string x = - match x with - C_string str -> str - | _ -> raise (Failure "Can't convert to string") - -let rec get_bool x = - match x with - C_bool b -> b - | _ -> - (try if get_int x != 0 then true else false - with _ -> raise (Failure "Can't convert to bool")) - -let disown_object obj = - match obj with - C_director_core (o,r) -> r := None - | _ -> raise (Failure "Not a director core object") -let _ = Callback.register "caml_obj_disown" disown_object -let addr_of obj = - match obj with - C_obj _ -> (invoke obj) "&" C_void - | C_director_core (self,r) -> (invoke self) "&" C_void - | C_ptr _ -> obj - | _ -> raise (Failure "Not a pointer.") -let _ = Callback.register "caml_obj_ptr" addr_of - -let make_float f = C_float f -let make_double f = C_double f -let make_string s = C_string s -let make_bool b = C_bool b -let make_char c = C_char c -let make_char_i c = C_char (char_of_int c) -let make_uchar c = C_uchar c -let make_uchar_i c = C_uchar (char_of_int c) -let make_short i = C_short i -let make_ushort i = C_ushort i -let make_int i = C_int i -let make_uint i = C_uint (Int32.of_int i) -let make_int32 i = C_int32 (Int32.of_int i) -let make_int64 i = C_int64 (Int64.of_int i) - -let new_derived_object cfun x_class args = - begin - let get_object ob = - match !ob with - None -> - raise (NotObject C_void) - | Some o -> o in - let ob_ref = ref None in - let class_fun class_f ob_r = - (fun meth args -> class_f (get_object ob_r) meth args) in - let new_class = class_fun x_class ob_ref in - let dircore = C_director_core (C_obj new_class,ob_ref) in - let obj = - cfun (match args with - C_list argl -> (C_list ((dircore :: argl))) - | C_void -> (C_list [ dircore ]) - | a -> (C_list [ dircore ; a ])) in - ob_ref := Some obj ; - obj - end - -let swig_current_type_info = ref C_void -let find_type_info obj = !swig_current_type_info -let _ = Callback.register "swig_find_type_info" find_type_info -let set_type_info obj = - match obj with - C_ptr _ -> swig_current_type_info := obj ; - obj - | _ -> raise (Failure "Internal error: passed non pointer to set_type_info") -let _ = Callback.register "swig_set_type_info" set_type_info - -let class_master_list = Hashtbl.create 20 -let register_class_byname nm co = - Hashtbl.replace class_master_list nm (Obj.magic co) -let create_class nm = - try (Obj.magic (Hashtbl.find class_master_list nm)) with _ -> raise (NoSuchClass nm) diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/swig.mli b/win64/bin/swig/share/swig/4.1.0/ocaml/swig.mli deleted file mode 100755 index 64c8bf71..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/swig.mli +++ /dev/null @@ -1,62 +0,0 @@ -(* -*- tuareg -*- *) - -type enum = [ `Int of int ] - -type 'a c_obj_t = - C_void - | C_bool of bool - | C_char of char - | C_uchar of char - | C_short of int - | C_ushort of int - | C_int of int - | C_uint of int32 - | C_int32 of int32 - | C_int64 of int64 - | C_float of float - | C_double of float - | C_ptr of int64 * int64 - | C_array of 'a c_obj_t array - | C_list of 'a c_obj_t list - | C_obj of (string -> 'a c_obj_t -> 'a c_obj_t) - | C_string of string - | C_enum of 'a - | C_director_core of 'a c_obj_t * 'a c_obj_t option ref - -type c_obj = enum c_obj_t - -exception InvalidDirectorCall of c_obj -exception NoSuchClass of string - -val invoke : ('a c_obj_t) -> (string -> 'a c_obj_t -> 'a c_obj_t) -val fnhelper : 'a c_obj_t -> 'a c_obj_t list -val director_core_helper : 'a c_obj_t list -> 'a c_obj_t list - -val get_int : 'a c_obj_t -> int -val get_float : 'a c_obj_t -> float -val get_string : 'a c_obj_t -> string -val get_char : 'a c_obj_t -> char -val get_bool : 'a c_obj_t -> bool - -val make_float : float -> 'a c_obj_t -val make_double : float -> 'a c_obj_t -val make_string : string -> 'a c_obj_t -val make_bool : bool -> 'a c_obj_t -val make_char : char -> 'a c_obj_t -val make_char_i : int -> 'a c_obj_t -val make_uchar : char -> 'a c_obj_t -val make_uchar_i : int -> 'a c_obj_t -val make_short : int -> 'a c_obj_t -val make_ushort : int -> 'a c_obj_t -val make_int : int -> 'a c_obj_t -val make_uint : int -> 'a c_obj_t -val make_int32 : int -> 'a c_obj_t -val make_int64 : int -> 'a c_obj_t - -val new_derived_object: - ('a c_obj_t -> 'a c_obj_t) -> - ('a c_obj_t -> string -> 'a c_obj_t -> 'a c_obj_t) -> - 'a c_obj_t -> 'a c_obj_t - -val register_class_byname : string -> ('a c_obj_t -> 'a c_obj_t) -> unit -val create_class : string -> 'a c_obj_t -> 'a c_obj_t diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/swigmove.i b/win64/bin/swig/share/swig/4.1.0/ocaml/swigmove.i deleted file mode 100755 index 11db3298..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/swigmove.i +++ /dev/null @@ -1,11 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0) { - argp1 = ($&1_ltype) caml_ptr_val($input,$&1_descriptor); - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/swigp4.ml b/win64/bin/swig/share/swig/4.1.0/ocaml/swigp4.ml deleted file mode 100755 index 87145042..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/swigp4.ml +++ /dev/null @@ -1,135 +0,0 @@ -open Camlp4 - -module Id : Sig.Id = -struct - let name = "swigp4" - let version = "0.1" -end - -module Make (Syntax : Sig.Camlp4Syntax) = -struct - open Sig - include Syntax - - let _loc = Loc.ghost - let lap x y = x :: y - let c_ify e loc = - match e with - <:expr< $int:_$ >> -> <:expr< (C_int $e$) >> - | <:expr< $str:_$ >> -> <:expr< (C_string $e$) >> - | <:expr< $chr:_$ >> -> <:expr< (C_char $e$) >> - | <:expr< $flo:_$ >> -> <:expr< (C_double $e$) >> - | <:expr< True >> -> <:expr< (C_bool $e$) >> - | <:expr< False >> -> <:expr< (C_bool $e$) >> - | _ -> <:expr< $e$ >> - let mk_list args loc f = - let rec mk_list_inner args loc f = - match args with - [] -> <:expr< [] >> - | x :: xs -> - (let loc = Ast.loc_of_expr x in - <:expr< [ ($f x _loc$) ] @ ($mk_list_inner xs loc f$) >>) in - match args with - [] -> <:expr< (Obj.magic C_void) >> - | [ a ] -> <:expr< (Obj.magic $f a _loc$) >> - | _ -> <:expr< (Obj.magic (C_list ($mk_list_inner args loc f$))) >> ;; - - EXTEND Gram - GLOBAL: expr; - - expr: LEVEL "top" - [ [ e1 = expr ; "'" ; "[" ; e2 = expr ; "]" -> - <:expr< (invoke $e1$) "[]" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) $str:l$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) $str:u$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) $s$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "." ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke $e1$) "()" ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke ((invoke $e1$) "->" C_void)) $str:l$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke ((invoke $e1$) "->" C_void)) $str:u$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< (invoke ((invoke $e1$) "->" C_void)) $s$ ($mk_list args _loc c_ify$) >> - | e1 = expr ; "'" ; "++" -> - <:expr< (invoke $e1$) "++" C_void >> - | e1 = expr ; "'" ; "--" -> - <:expr< (invoke $e1$) "--" C_void >> - | e1 = expr ; "'" ; "-" ; e2 = expr -> - <:expr< (invoke $e1$) "-" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "+" ; e2 = expr -> <:expr< (invoke $e1$) "+" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "*" ; e2 = expr -> <:expr< (invoke $e1$) "*" (C_list [ $c_ify e2 _loc$ ]) >> - | "'" ; "&" ; e1 = expr -> - <:expr< (invoke $e1$) "&" C_void >> - | "'" ; "!" ; e1 = expr -> - <:expr< (invoke $e1$) "!" C_void >> - | "'" ; "~" ; e1 = expr -> - <:expr< (invoke $e1$) "~" C_void >> - | e1 = expr ; "'" ; "/" ; e2 = expr -> - <:expr< (invoke $e1$) "/" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "%" ; e2 = expr -> - <:expr< (invoke $e1$) "%" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsl" ; e2 = expr -> - <:expr< (invoke $e1$) ("<" ^ "<") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsr" ; e2 = expr -> - <:expr< (invoke $e1$) (">" ^ ">") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "<" ; e2 = expr -> - <:expr< (invoke $e1$) "<" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "<=" ; e2 = expr -> - <:expr< (invoke $e1$) "<=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; ">" ; e2 = expr -> - <:expr< (invoke $e1$) ">" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; ">=" ; e2 = expr -> - <:expr< (invoke $e1$) ">=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "==" ; e2 = expr -> - <:expr< (invoke $e1$) "==" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "!=" ; e2 = expr -> - <:expr< (invoke $e1$) "!=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "&" ; e2 = expr -> - <:expr< (invoke $e1$) "&" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "^" ; e2 = expr -> - <:expr< (invoke $e1$) "^" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "|" ; e2 = expr -> - <:expr< (invoke $e1$) "|" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "&&" ; e2 = expr -> - <:expr< (invoke $e1$) "&&" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "||" ; e2 = expr -> - <:expr< (invoke $e1$) "||" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "=" ; e2 = expr -> - <:expr< (invoke $e1$) "=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "+=" ; e2 = expr -> - <:expr< (invoke $e1$) "+=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "-=" ; e2 = expr -> - <:expr< (invoke $e1$) "-=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "*=" ; e2 = expr -> - <:expr< (invoke $e1$) "*=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "/=" ; e2 = expr -> - <:expr< (invoke $e1$) "/=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "%=" ; e2 = expr -> - <:expr< (invoke $e1$) "%=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsl" ; "=" ; e2 = expr -> - <:expr< (invoke $e1$) ("<" ^ "<=") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "lsr" ; "=" ; e2 = expr -> - <:expr< (invoke $e1$) (">" ^ ">=") (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "&=" ; e2 = expr -> - <:expr< (invoke $e1$) "&=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "^=" ; e2 = expr -> - <:expr< (invoke $e1$) "^=" (C_list [ $c_ify e2 _loc$ ]) >> - | e1 = expr ; "'" ; "|=" ; e2 = expr -> - <:expr< (invoke $e1$) "|=" (C_list [ $c_ify e2 _loc$ ]) >> - | "'" ; e = expr -> c_ify e _loc - | c = expr ; "as" ; id = LIDENT -> <:expr< $lid:"get_" ^ id$ $c$ >> - | c = expr ; "to" ; id = LIDENT -> <:expr< $uid:"C_" ^ id$ $c$ >> - | "`" ; "`" ; l = LIDENT -> <:expr< C_enum `$lid:l$ >> - | "`" ; "`" ; u = UIDENT -> <:expr< C_enum `$uid:u$ >> - | f = expr ; "'" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> - <:expr< $f$ ($mk_list args _loc c_ify$) >> - ] ] ; - END ;; - -end - -module M = Register.OCamlSyntaxExtension(Id)(Make) diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/typecheck.i b/win64/bin/swig/share/swig/4.1.0/ocaml/typecheck.i deleted file mode 100755 index 8010958c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/typecheck.i +++ /dev/null @@ -1,197 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typecheck.i - * - * Typechecking rules - * ----------------------------------------------------------------------------- */ - -%typecheck(SWIG_TYPECHECK_INT8) char, signed char, const char &, const signed char & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_char: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_UINT8) unsigned char, const unsigned char & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_uchar: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_INT16) short, signed short, const short &, const signed short &, wchar_t { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_short: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_UINT16) unsigned short, const unsigned short & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_ushort: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -// XXX arty -// Will move enum SWIGTYPE later when I figure out what to do with it... - -%typecheck(SWIG_TYPECHECK_INT32) int, signed int, const int &, const signed int &, enum SWIGTYPE { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_int: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_UINT32) unsigned int, const unsigned int & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_uint: $1 = 1; break; - case C_int32: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_INT64) - long, signed long, unsigned long, - long long, signed long long, unsigned long long, - const long &, const signed long &, const unsigned long &, - const long long &, const signed long long &, const unsigned long long &, - size_t, const size_t & -{ - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_int64: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_BOOL) bool, const bool & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_bool: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_FLOAT) float, const float & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_float: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) double, const double & { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_double: $1 = 1; break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - if( !Is_block($input) ) $1 = 0; - else { - switch( SWIG_Tag_val($input) ) { - case C_string: $1 = 1; break; - case C_ptr: { - swig_type_info *typeinfo = - (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field($input,1)); - $1 = SWIG_TypeCheck("char *",typeinfo) || - SWIG_TypeCheck("signed char *",typeinfo) || - SWIG_TypeCheck("unsigned char *",typeinfo) || - SWIG_TypeCheck("const char *",typeinfo) || - SWIG_TypeCheck("const signed char *",typeinfo) || - SWIG_TypeCheck("const unsigned char *",typeinfo) || - SWIG_TypeCheck("std::string",typeinfo); - } break; - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - if (!Is_block($input) || !(SWIG_Tag_val($input) == C_obj || SWIG_Tag_val($input) == C_ptr)) { - $1 = 0; - } else { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, $descriptor); - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - swig_type_info *typeinfo; - if (!Is_block($input)) { - $1 = 0; - } else { - switch (SWIG_Tag_val($input)) { - case C_obj: { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, $&1_descriptor); - break; - } - case C_ptr: { - typeinfo = (swig_type_info *)SWIG_Int64_val(SWIG_Field($input, 1)); - $1 = SWIG_TypeCheck("$1_type", typeinfo) != NULL; - break; - } - default: $1 = 0; break; - } - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, 0); -} - -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) CAML_VALUE "$1 = 1;" - -/* ------------------------------------------------------------ - * Exception handling - * ------------------------------------------------------------ */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short { - char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, error_msg); -} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] { - (void)$1; - SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, "C++ $1_type exception thrown"); -} - -%typemap(throws) char * { - SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1); -} diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/typemaps.i b/win64/bin/swig/share/swig/4.1.0/ocaml/typemaps.i deleted file mode 100755 index 83fa2101..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/typemaps.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ---------------------------------------------------------------------------- - * typemaps.i - * - * These typemaps provide support for input/output arguments for C/C++ pointers - * and C++ references. -* ---------------------------------------------------------------------------- */ - -%define INPUT_OUTPUT_INOUT_TYPEMAPS(type, c_to_ocaml, ocaml_to_c) -%typemap(in) type *INPUT(type temp), type &INPUT(type temp) { - temp = (type)ocaml_to_c($input); - $1 = &temp; -} -%typemap(typecheck) type *INPUT = type; -%typemap(typecheck) type &INPUT = type; - -%typemap(in, numinputs=0) type *OUTPUT($*1_ltype temp), type &OUTPUT($*1_ltype temp) "$1 = &temp;" -%typemap(argout) type *OUTPUT, type &OUTPUT { - swig_result = caml_list_append(swig_result, c_to_ocaml(*$1)); -} -%typemap(in) type *INOUT = type *INPUT; -%typemap(in) type &INOUT = type &INPUT; - -%typemap(argout) type *INOUT = type *OUTPUT; -%typemap(argout) type &INOUT = type &OUTPUT; - -%typemap(typecheck) type *INOUT = type; -%typemap(typecheck) type &INOUT = type; -%enddef - -INPUT_OUTPUT_INOUT_TYPEMAPS(bool, caml_val_bool, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(int, caml_val_int, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(long, caml_val_long, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(short, caml_val_int, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(char, caml_val_char, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(signed char, caml_val_char, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(float, caml_val_float, caml_double_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(double, caml_val_double, caml_double_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned int, caml_val_uint, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned long, caml_val_ulong, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned short, caml_val_ushort, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned char, caml_val_uchar, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(long long, caml_val_long, caml_long_val); -INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned long long, caml_val_ulong, caml_long_val); -#undef INPUT_OUTPUT_INOUT_TYPEMAPS diff --git a/win64/bin/swig/share/swig/4.1.0/ocaml/typeregister.swg b/win64/bin/swig/share/swig/4.1.0/ocaml/typeregister.swg deleted file mode 100755 index eb8e5b06..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ocaml/typeregister.swg +++ /dev/null @@ -1,2 +0,0 @@ -SWIGEXT void SWIG_init() { - SWIG_InitializeModule(0); diff --git a/win64/bin/swig/share/swig/4.1.0/octave/argcargv.i b/win64/bin/swig/share/swig/4.1.0/octave/argcargv.i deleted file mode 100755 index 6d6ba0fa..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/argcargv.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - if ($input.is_scalar_type()) { - $1 = 0; $2 = NULL; - %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' is not a list", $symname, $argnum); - } - octave_value_list list = $input.list_value(); - int i, len = list.length(); - $1 = ($1_ltype) len; - $2 = (char **) malloc((len+1)*sizeof(char *)); - for (i = 0; i < len; i++) { - if (!list(i).is_string()) { - $1 = 0; - %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' use a non-string", $symname, $argnum); - } - $2[i] = (char *)list(i).string_value().c_str(); - } - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = 0; - const octave_value& ov = $input; - if (!ov.is_scalar_type()) { - octave_value_list list = ov.list_value(); - int i, len = list.length(); - $1 = 1; - for (i = 0; i < len; i++) { - if (!list(i).is_string()) { - $1 = 0; - break; - } - } - } -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/win64/bin/swig/share/swig/4.1.0/octave/attribute.i b/win64/bin/swig/share/swig/4.1.0/octave/attribute.i deleted file mode 100755 index b18f9ae8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/boost_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/octave/boost_shared_ptr.i deleted file mode 100755 index 96cadd42..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/boost_shared_ptr.i +++ /dev/null @@ -1,401 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/octave/carrays.i b/win64/bin/swig/share/swig/4.1.0/octave/carrays.i deleted file mode 100755 index eb4fd683..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/carrays.i +++ /dev/null @@ -1,5 +0,0 @@ -%define %array_class(TYPE,NAME) - %array_class_wrap(TYPE,NAME,__paren__,__paren_asgn__) -%enddef - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/cdata.i b/win64/bin/swig/share/swig/4.1.0/octave/cdata.i deleted file mode 100755 index 1c6de446..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/cmalloc.i b/win64/bin/swig/share/swig/4.1.0/octave/cmalloc.i deleted file mode 100755 index d3a1222e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/director.swg b/win64/bin/swig/share/swig/4.1.0/octave/director.swg deleted file mode 100755 index 6b6ca91d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/director.swg +++ /dev/null @@ -1,146 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Octave proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -namespace Swig { - - class Director { - octave_swig_type *self; - bool swig_disowned; - - Director(const Director &x); - Director &operator=(const Director &rhs); - public: - - Director(void *vptr):self(0), swig_disowned(false) { - set_rtdir(vptr, this); - } - - ~Director() { - swig_director_destroyed(self, this); - if (swig_disowned) - self->decref(); - } - - void swig_set_self(octave_swig_type *new_self) { - assert(!swig_disowned); - self = new_self; - } - - octave_swig_type *swig_get_self() const { - return self; - } - - void swig_disown() { - if (swig_disowned) - return; - swig_disowned = true; - self->incref(); - } - }; - - // Base class for director exceptions. - class DirectorException : public std::exception { - public: - static void raise(const char *msg) { - // ... todo - throw DirectorException(); - } - - static void raise(const octave_value &ov, const char *msg) { - // ... todo - raise(msg); - } - }; - - class DirectorTypeMismatchException : public DirectorException { - public: - static void raise(const char *msg) { - // ... todo - throw DirectorTypeMismatchException(); - } - - static void raise(const octave_value &ov, const char *msg) { - // ... todo - raise(msg); - } - }; - - class DirectorPureVirtualException : public DirectorException { - public: - static void raise(const char *msg) { - // ... todo - throw DirectorPureVirtualException(); - } - - static void raise(const octave_value &ov, const char *msg) { - // ... todo - raise(msg); - } - }; - - SWIGINTERN rtdir_map *get_rtdir_map() { - static swig_module_info *module = 0; - if (!module) - module = SWIG_GetModule(0); - if (!module) - return 0; - if (!module->clientdata) - module->clientdata = new rtdir_map; - return (rtdir_map *) module->clientdata; - } - - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *d) { - rtdir_map *rm = get_rtdir_map(); - if (rm) - (*rm)[vptr] = d; - } - - SWIGINTERNINLINE void erase_rtdir(void *vptr) { - rtdir_map *rm = get_rtdir_map(); - if (rm) - (*rm).erase(vptr); - } - - SWIGINTERNINLINE Director *get_rtdir(void *vptr) { - rtdir_map *rm = get_rtdir_map(); - if (!rm) - return 0; - rtdir_map::const_iterator pos = rm->find(vptr); - Director *rtdir = (pos != rm->end())? pos->second : 0; - return rtdir; - } - - SWIGRUNTIME void swig_director_destroyed(octave_swig_type *self, Director *d) { - self->director_destroyed(d); - } - - SWIGRUNTIME octave_swig_type *swig_director_get_self(Director *d) { - return d->swig_get_self(); - } - - SWIGRUNTIME void swig_director_set_self(Director *d, octave_swig_type *self) { - d->swig_set_self(self); - } - -} - -SWIGRUNTIME void swig_acquire_ownership(void *vptr) { - // assert(0); - // ... todo -} - -SWIGRUNTIME void swig_acquire_ownership_array(void *vptr) { - // assert(0); - // ... todo -} - -SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own) { - // assert(0); - // ... todo -} diff --git a/win64/bin/swig/share/swig/4.1.0/octave/exception.i b/win64/bin/swig/share/swig/4.1.0/octave/exception.i deleted file mode 100755 index 73b14b72..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/exception.i +++ /dev/null @@ -1,14 +0,0 @@ -%include - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) -} - -%define SWIG_RETHROW_OCTAVE_EXCEPTIONS - /* rethrow any exceptions thrown by Octave */ -%#if SWIG_OCTAVE_PREREQ(4,2,0) - catch (octave::execution_exception& _e) { throw; } - catch (octave::exit_exception& _e) { throw; } - catch (octave::interrupt_exception& _e) { throw; } -%#endif -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/octave/extra-install.list b/win64/bin/swig/share/swig/4.1.0/octave/extra-install.list deleted file mode 100755 index 0b9ddb3d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/extra-install.list +++ /dev/null @@ -1,2 +0,0 @@ -# see top-level Makefile.in -octheaders.hpp diff --git a/win64/bin/swig/share/swig/4.1.0/octave/factory.i b/win64/bin/swig/share/swig/4.1.0/octave/factory.i deleted file mode 100755 index 377f0080..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/implicit.i b/win64/bin/swig/share/swig/4.1.0/octave/implicit.i deleted file mode 100755 index 292f65f1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/implicit.i +++ /dev/null @@ -1,7 +0,0 @@ -%include -%include - -#warning "This file provides the %implicit directive, which is an old and fragile" -#warning "way to implement the C++ implicit conversion mechanism." -#warning "Try using the more robust '%implicitconv Type;' directive instead." - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octave.swg b/win64/bin/swig/share/swig/4.1.0/octave/octave.swg deleted file mode 100755 index 2f458aa8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octave.swg +++ /dev/null @@ -1,8 +0,0 @@ -%include -%include -%include -%include -%include -%include - -%define %docstring %feature("docstring") %enddef diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octcomplex.swg b/win64/bin/swig/share/swig/4.1.0/octave/octcomplex.swg deleted file mode 100755 index 296f9926..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octcomplex.swg +++ /dev/null @@ -1,92 +0,0 @@ -/* - Defines the As/From conversors for double/float complex, you need to - provide complex Type, the Name you want to use in the conversors, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from conversor */ -%define %swig_fromcplx_conv(Type, OctConstructor, Real, Imag) - %fragment(SWIG_From_frag(Type),"header") -{ - SWIGINTERNINLINE octave_value - SWIG_From(Type)(const Type& c) - { - return octave_value(OctConstructor(Real(c), Imag(c))); - } -} -%enddef - -// the double case -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) - %fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ - SWIGINTERN int - SWIG_AsVal(Type) (const octave_value& ov, Type* val) - { - if (ov.is_complex_scalar()) { - if (val) { - Complex c(ov.complex_value()); - *val=Constructor(c.real(),c.imag()); - } - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(ov, &d)); - if (SWIG_IsOK(res)) { - if (val) - *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; - } -} -%swig_fromcplx_conv(Type, Complex, Real, Imag); -%enddef - -// the float case -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) - %fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { - SWIGINTERN int - SWIG_AsVal(Type) (const octave_value& ov, Type* val) - { - if (ov.is_complex_scalar()) { - if (val) { - Complex c(ov.complex_value()); - double re = c.real(); - double im = c.imag(); - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) - *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else - return SWIG_OverflowError; - } - } else { - float d; - int res = SWIG_AddCast(SWIG_AsVal(float)(ov, &d)); - if (SWIG_IsOK(res)) { - if (val) - *val = Constructor(d, 0.0f); - return res; - } - } - return SWIG_TypeError; - } -} - -%swig_fromcplx_conv(Type, FloatComplex, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octcontainer.swg b/win64/bin/swig/share/swig/4.1.0/octave/octcontainer.swg deleted file mode 100755 index 43994add..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octcontainer.swg +++ /dev/null @@ -1,623 +0,0 @@ -/* ----------------------------------------------------------------------------- - * octcontainer.swg - * - * Octave cell <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Octave, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - -%include - -// The Octave C++ Wrap - -%fragment(""); - -%include - -%fragment(SWIG_Traits_frag(octave_value),"header",fragment="StdTraits") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "octave_value"; } - }; - - template <> struct traits_from { - typedef octave_value value_type; - static octave_value from(const value_type& val) { - return val; - } - }; - - template <> - struct traits_check { - static bool check(const octave_value&) { - return true; - } - }; - - template <> struct traits_asval { - typedef octave_value value_type; - static int asval(const octave_value& obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} -} - -%fragment("OctSequence_Base","header",fragment="") -{ - -namespace std { - template <> - struct less - { - bool - operator()(const octave_value& v, const octave_value& w) const - { - octave_value res = do_binary_op(octave_value::op_le,v,w); - return res.is_true(); - } - }; -} - -namespace swig { - inline size_t - check_index(ptrdiff_t i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - - throw std::out_of_range("index out of range"); - } - - inline size_t - slice_index(ptrdiff_t i, size_t size) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) { - return (size_t) (i + size); - } else { - throw std::out_of_range("index out of range"); - } - } else { - return ( (size_t) i < size ) ? ((size_t) i) : size; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (jj > ii) { - typename Sequence::const_iterator vb = self->begin(); - typename Sequence::const_iterator ve = self->begin(); - std::advance(vb,ii); - std::advance(ve,jj); - return new Sequence(vb, ve); - } else { - return new Sequence(); - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj < ii) jj = ii; - size_t ssize = jj - ii; - if (ssize <= v.size()) { - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); - std::advance(sb,ii); - std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); - } else { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj > ii) { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - } - } -} -} - -%fragment("OctSequence_Cont","header", - fragment="StdTraits", - fragment="OctSequence_Base", - fragment="OctSwigIterator_T") -{ -namespace swig -{ - template - struct OctSequence_Ref // * octave can't support these, because of how assignment works - { - OctSequence_Ref(const octave_value& seq, int index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - // swig::SwigVar_PyObject item = OctSequence_GetItem(_seq, _index); - octave_value item; // * todo - try { - return swig::as(item); - } catch (const std::exception& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", _index); - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - SWIG_Octave_AddErrorMsg(msg); - SWIG_Octave_AddErrorMsg(e.what()); - throw; - } - } - - OctSequence_Ref& operator=(const T& v) - { - // OctSequence_SetItem(_seq, _index, swig::from(v)); - // * todo - return *this; - } - - private: - octave_value _seq; - int _index; - }; - - template - struct OctSequence_ArrowProxy - { - OctSequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct OctSequence_InputIterator - { - typedef OctSequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - - OctSequence_InputIterator() - { - } - - OctSequence_InputIterator(const octave_value& seq, int index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - OctSequence_ArrowProxy - operator->() const { - return OctSequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - octave_value _seq; - difference_type _index; - }; - - template - struct OctSequence_Cont - { - typedef OctSequence_Ref reference; - typedef const OctSequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - typedef int size_type; - typedef const pointer const_pointer; - typedef OctSequence_InputIterator iterator; - typedef OctSequence_InputIterator const_iterator; - - OctSequence_Cont(const octave_value& seq) : _seq(seq) - { - // * assert that we have map type etc. - /* - if (!OctSequence_Check(seq)) { - throw std::invalid_argument("a sequence is expected"); - } - _seq = seq; - Py_INCREF(_seq); - */ - } - - ~OctSequence_Cont() - { - } - - size_type size() const - { - // return static_cast(OctSequence_Size(_seq)); - return 0; // * todo - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - int s = size(); - for (int i = 0; i < s; ++i) { - // swig::SwigVar_PyObject item = OctSequence_GetItem(_seq, i); - octave_value item; // * todo - if (!swig::check(item)) - return false; - } - return true; - } - - private: - octave_value _seq; - }; - -} -} - -%define %swig_sequence_iterator(Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - class iterator; - class reverse_iterator; - class const_iterator; - class const_reverse_iterator; - - %typemap(out,noblock=1,fragment="OctSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - $result = SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &)), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN); - } - %typemap(out,fragment="OctSequence_Cont") - std::pair, std::pair { - octave_value_list tmpc; - tmpc.append(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &).first), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN)); - tmpc.append(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &).second), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN)); - $result = Cell(tmpc); - } - - %fragment("SwigPyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="OctSequence_Cont") {} - - %typemap(out,fragment="OctPairBoolOutputIterator") - std::pair, std::pair { - octave_value_list tmpc; - tmpc.append(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &).first), - swig::OctSwigIterator::descriptor(),SWIG_POINTER_OWN)); - tmpc.append(SWIG_From(bool)(%static_cast($1,const $type &).second)); - $result = Cell(tmpc); - } - - %typemap(in,noblock=1,fragment="OctSequence_Cont") - iterator(swig::OctSwigIterator *iter = 0, int res), - reverse_iterator(swig::OctSwigIterator *iter = 0, int res), - const_iterator(swig::OctSwigIterator *iter = 0, int res), - const_reverse_iterator(swig::OctSwigIterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::OctSwigIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::OctSwigIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="OctSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - swig::OctSwigIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::OctSwigIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("OctSequence_Cont"); -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - -// The octave container methods - -%define %swig_container_methods(Container...) -%enddef - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - - %fragment("OctSequence_Base"); - - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - value_type __paren__(difference_type i) throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __paren_asgn__(difference_type i, value_type x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - - void append(value_type x) { - self->push_back(x); - } - } - -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="OctSequence_Cont") -{ -namespace swig { - template - inline void - assign(const OctSeq& octseq, Seq* seq) { -%#ifdef SWIG_STD_NOASSIGN_STL - typedef typename OctSeq::value_type value_type; - typename OctSeq::const_iterator it = octseq.begin(); - for (;it != octseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } -%#else - seq->assign(octseq.begin(), octseq.end()); -%#endif - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(const octave_value& obj, sequence **seq) { - if (!obj.is_defined() || Swig::swig_value_deref(obj)) { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } -%#if SWIG_OCTAVE_PREREQ(4,4,0) - } else if (obj.iscell()) { -%#else - } else if (obj.is_cell()) { -%#endif - try { - OctSequence_Cont octseq(obj); - if (seq) { - sequence *pseq = new sequence(); - assign(octseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return octseq.check() ? SWIG_OK : SWIG_ERROR; - } - } -%#if SWIG_OCTAVE_PREREQ(6,0,0) - catch (octave::execution_exception& exec) { - } -%#endif - catch (std::exception& e) { -%#if SWIG_OCTAVE_PREREQ(6,0,0) - if (seq) // Know that octave is not in an error state -%#else - if (seq&&!error_state) -%#endif - error("swig type error: %s",e.what()); - return SWIG_ERROR; - } - } - return SWIG_ERROR; - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static octave_value from(const sequence& seq) { -#ifdef SWIG_OCTAVE_EXTRA_NATIVE_CONTAINERS - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); - } -#endif - size_type size = seq.size(); - if (size <= (size_type)INT_MAX) { - Cell c(size,1); - int i = 0; - for (const_iterator it = seq.begin(); - it != seq.end(); ++it, ++i) { - c(i) = swig::from(*it); - } - return c; - } else { - error("swig overflow error: sequence size not valid in octave"); - return octave_value(); - } - return octave_value(); - } - }; -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octfragments.swg b/win64/bin/swig/share/swig/4.1.0/octave/octfragments.swg deleted file mode 100755 index d3f5a12f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octfragments.swg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octheaders.hpp b/win64/bin/swig/share/swig/4.1.0/octave/octheaders.hpp deleted file mode 100755 index a103ebb8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octheaders.hpp +++ /dev/null @@ -1,130 +0,0 @@ -// -// This header includes all C++ headers required for generated Octave wrapper code. -// Using a single header file allows pre-compilation of Octave headers, as follows: -// * Check out this header file: -// swig -octave -co octheaders.hpp -// * Pre-compile header file into octheaders.hpp.gch: -// g++ -c ... octheaders.hpp -// * Use pre-compiled header file: -// g++ -c -include octheaders.hpp ... -// - -#if !defined(SWIG_OCTAVE_OCTHEADERS_HPP) -#define SWIG_OCTAVE_OCTHEADERS_HPP - -// Required C++ headers -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Minimal headers to define Octave version -#include -#include - -// Macro for enabling features which require Octave version >= major.minor.patch -// - Use (OCTAVE_PATCH_VERSION + 0) to handle both '' (released) and '+' (in development) patch numbers -#define SWIG_OCTAVE_PREREQ(major, minor, patch) \ - ( (OCTAVE_MAJOR_VERSION<<16) + (OCTAVE_MINOR_VERSION<<8) + (OCTAVE_PATCH_VERSION + 0) >= ((major)<<16) + ((minor)<<8) + (patch) ) - -// Reconstruct Octave major, minor, and patch versions for releases prior to 3.8.1 -#if !defined(OCTAVE_MAJOR_VERSION) - -# if !defined(OCTAVE_API_VERSION_NUMBER) - -// Hack to distinguish between Octave 3.8.0, which removed OCTAVE_API_VERSION_NUMBER but did not yet -// introduce OCTAVE_MAJOR_VERSION, and Octave <= 3.2, which did not define OCTAVE_API_VERSION_NUMBER -# include -# if defined(octave_ov_h) -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 8 -# define OCTAVE_PATCH_VERSION 0 -# else - -// Hack to distinguish between Octave 3.2 and earlier versions, before OCTAVE_API_VERSION_NUMBER existed -# define ComplexLU __ignore -# include -# undef ComplexLU -# if defined(octave_Complex_LU_h) - -// We know only that this version is prior to Octave 3.2, i.e. OCTAVE_API_VERSION_NUMBER < 37 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 1 -# define OCTAVE_PATCH_VERSION 99 - -# else - -// OCTAVE_API_VERSION_NUMBER == 37 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 2 -# define OCTAVE_PATCH_VERSION 0 - -# endif // defined(octave_Complex_LU_h) - -# endif // defined(octave_ov_h) - -// Correlation between Octave API and version numbers extracted from Octave's -// ChangeLogs; version is the *earliest* released Octave with that API number -# elif OCTAVE_API_VERSION_NUMBER >= 48 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 6 -# define OCTAVE_PATCH_VERSION 0 - -# elif OCTAVE_API_VERSION_NUMBER >= 45 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 4 -# define OCTAVE_PATCH_VERSION 1 - -# elif OCTAVE_API_VERSION_NUMBER >= 42 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 54 - -# elif OCTAVE_API_VERSION_NUMBER >= 41 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 53 - -# elif OCTAVE_API_VERSION_NUMBER >= 40 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 52 - -# elif OCTAVE_API_VERSION_NUMBER >= 39 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 51 - -# else // OCTAVE_API_VERSION_NUMBER == 38 -# define OCTAVE_MAJOR_VERSION 3 -# define OCTAVE_MINOR_VERSION 3 -# define OCTAVE_PATCH_VERSION 50 - -# endif // !defined(OCTAVE_API_VERSION_NUMBER) - -#endif // !defined(OCTAVE_MAJOR_VERSION) - -// Required Octave headers -#include -#include -#include -#include -#include -#include -#include -#if SWIG_OCTAVE_PREREQ(4,2,0) -#include -#else -#include -#endif -#include -#if SWIG_OCTAVE_PREREQ(4,2,0) -#include -#endif - -#endif // !defined(SWIG_OCTAVE_OCTHEADERS_HPP) diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octiterators.swg b/win64/bin/swig/share/swig/4.1.0/octave/octiterators.swg deleted file mode 100755 index 10bbe97d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octiterators.swg +++ /dev/null @@ -1,357 +0,0 @@ -/* ----------------------------------------------------------------------------- - * octiterators.swg - * - * Users can derive form the OctSwigIterator to implement their - * own iterators. As an example (real one since we use it for STL/STD - * containers), the template OctSwigIterator_T does the - * implementation for generic C++ iterators. - * ----------------------------------------------------------------------------- */ - -%include - -%fragment("OctSwigIterator","header",fragment="") { -namespace swig { - struct stop_iteration { - }; - - struct OctSwigIterator { - private: - octave_value _seq; - - protected: - OctSwigIterator(octave_value seq) : _seq(seq) - { - } - - public: - virtual ~OctSwigIterator() {} - - virtual octave_value value() const = 0; - - virtual OctSwigIterator *incr(size_t n = 1) = 0; - - virtual OctSwigIterator *decr(size_t n = 1) - { - throw stop_iteration(); - } - - virtual ptrdiff_t distance(const OctSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual bool equal (const OctSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual OctSwigIterator *copy() const = 0; - - octave_value next() - { - octave_value obj = value(); - incr(); - return obj; - } - - octave_value previous() - { - decr(); - return value(); - } - - OctSwigIterator *advance(ptrdiff_t n) - { - return (n > 0) ? incr(n) : decr(-n); - } - - bool operator == (const OctSwigIterator& x) const - { - return equal(x); - } - - bool operator != (const OctSwigIterator& x) const - { - return ! operator==(x); - } - - OctSwigIterator* operator ++ () { - incr(); - return this; - } - - OctSwigIterator* operator -- () { - decr(); - return this; - } - - OctSwigIterator* operator + (ptrdiff_t n) const - { - return copy()->advance(n); - } - - OctSwigIterator* operator - (ptrdiff_t n) const - { - return copy()->advance(-n); - } - - ptrdiff_t operator - (const OctSwigIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::OctSwigIterator *"); - init = 1; - } - return desc; - } - }; -} -} - -%fragment("OctSwigIterator_T","header",fragment="",fragment="OctSwigIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - template - class OctSwigIterator_T : public OctSwigIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef OctSwigIterator_T self_type; - - OctSwigIterator_T(out_iterator curr, octave_value seq) - : OctSwigIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const OctSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const OctSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef octave_value result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - template::value_type, - typename FromOper = from_oper > - class OctSwigIteratorOpen_T : public OctSwigIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef OctSwigIterator_T base; - typedef OctSwigIteratorOpen_T self_type; - - OctSwigIteratorOpen_T(out_iterator curr, octave_value seq) - : OctSwigIterator_T(curr, seq) - { - } - - octave_value value() const { - return from(static_cast(*(base::current))); - } - - OctSwigIterator *copy() const - { - return new self_type(*this); - } - - OctSwigIterator *incr(size_t n = 1) - { - while (n--) { - ++base::current; - } - return this; - } - - OctSwigIterator *decr(size_t n = 1) - { - while (n--) { - --base::current; - } - return this; - } - }; - - template::value_type, - typename FromOper = from_oper > - class OctSwigIteratorClosed_T : public OctSwigIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef OctSwigIterator_T base; - typedef OctSwigIteratorClosed_T self_type; - - OctSwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, octave_value seq) - : OctSwigIterator_T(curr, seq), begin(first), end(last) - { - } - - octave_value value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - OctSwigIterator *copy() const - { - return new self_type(*this); - } - - OctSwigIterator *incr(size_t n = 1) - { - while (n--) { - if (base::current == end) { - throw stop_iteration(); - } else { - ++base::current; - } - } - return this; - } - - OctSwigIterator *decr(size_t n = 1) - { - while (n--) { - if (base::current == begin) { - throw stop_iteration(); - } else { - --base::current; - } - } - return this; - } - - private: - out_iterator begin; - out_iterator end; - }; - - template - inline OctSwigIterator* - make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, octave_value seq = octave_value()) - { - return new OctSwigIteratorClosed_T(current, begin, end, seq); - } - - template - inline OctSwigIterator* - make_output_iterator(const OutIter& current, octave_value seq = octave_value()) - { - return new OctSwigIteratorOpen_T(current, seq); - } -} -} - - -%fragment("OctSwigIterator"); -namespace swig -{ -// Throw a StopIteration exception - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws) stop_iteration { - error("stop_iteration exception"); - SWIG_fail; - } - -// Mark methods that return new objects - %newobject OctSwigIterator::copy; - %newobject OctSwigIterator::operator + (ptrdiff_t n) const; - %newobject OctSwigIterator::operator - (ptrdiff_t n) const; - - %nodirector OctSwigIterator; - - %catches(swig::stop_iteration) OctSwigIterator::value() const; - %catches(swig::stop_iteration) OctSwigIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) OctSwigIterator::decr(size_t n = 1); - %catches(std::invalid_argument) OctSwigIterator::distance(const OctSwigIterator &x) const; - %catches(std::invalid_argument) OctSwigIterator::equal (const OctSwigIterator &x) const; - %catches(swig::stop_iteration) OctSwigIterator::next(); - %catches(swig::stop_iteration) OctSwigIterator::previous(); - %catches(swig::stop_iteration) OctSwigIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) OctSwigIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) OctSwigIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) OctSwigIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) OctSwigIterator::operator - (ptrdiff_t n) const; - - - struct OctSwigIterator - { - protected: - OctSwigIterator(octave_value seq); - - public: - virtual ~OctSwigIterator(); - - virtual octave_value value() const = 0; - - virtual OctSwigIterator *incr(size_t n = 1) = 0; - - virtual OctSwigIterator *decr(size_t n = 1); - - virtual ptrdiff_t distance(const OctSwigIterator &x) const; - - virtual bool equal (const OctSwigIterator &x) const; - - virtual OctSwigIterator *copy() const = 0; - - octave_value next(); - octave_value previous(); - OctSwigIterator *advance(ptrdiff_t n); - - bool operator == (const OctSwigIterator& x) const; - bool operator != (const OctSwigIterator& x) const; - OctSwigIterator* operator ++ (); - OctSwigIterator* operator -- (); - OctSwigIterator* operator + (ptrdiff_t n) const; - OctSwigIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const OctSwigIterator& x) const; - }; -} - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octopers.swg b/win64/bin/swig/share/swig/4.1.0/octave/octopers.swg deleted file mode 100755 index 812a3d58..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octopers.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus - -// operators supported in Octave, and the methods they are routed to - -// __brace__ a{args} -// __brace_asgn__ a{args} = rhs -// __paren__ a(args) -// __paren_asgn__ a(args) = rhs -// __str__ generates string rep - -// __not__ !a -// __uplus__ +a -// __uminus__ -a -// __transpose__ a.' -// __hermitian__ a' -// __incr__ a++ -// __decr__ a-- -// __add__ a + b -// __sub__ a - b -// __mul__ a * b -// __div__ a / b -// __pow__ a ^ b -// __ldiv__ a \ b -// __lt__ a < b -// __le__ a <= b -// __eq__ a == b -// __ge__ a >= b -// __gt__ a > b -// __ne__ a != b -// __el_mul__ a .* b -// __el_div__ a ./ b -// __el_pow__ a .^ b -// __el_ldiv__ a .\ b -// __el_and__ a & b -// __el_or__ a | b - -// operators supported in C++, and the methods that route to them - -%rename(__add__) *::operator+; -%rename(__add__) *::operator+(); -%rename(__add__) *::operator+() const; -%rename(__sub__) *::operator-; -%rename(__uminus__) *::operator-(); -%rename(__uminus__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__mod__) *::operator%; -%rename(__el_and__) *::operator&&; -%rename(__el_or__) *::operator||; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__lt__) *::operator<; -%rename(__le__) *::operator<=; -%rename(__gt__) *::operator>; -%rename(__ge__) *::operator>=; -%rename(__eq__) *::operator==; -%rename(__ne__) *::operator!=; -%rename(__not__) *::operator!; -%rename(__incr__) *::operator++; -%rename(__decr__) *::operator--; -%rename(__paren__) *::operator(); -%rename(__brace__) *::operator[]; - -// Ignored inplace operators -%ignoreoperator(PLUSEQ) operator+=; -%ignoreoperator(MINUSEQ) operator-=; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; - -// Ignored operators -%ignoreoperator(EQ) operator=; -%ignoreoperator(ARROWSTAR) operator->*; -%ignoreoperator(LSHIFT) operator<<; -%ignoreoperator(RSHIFT) operator>>; - -#endif /* __cplusplus */ diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octprimtypes.swg b/win64/bin/swig/share/swig/4.1.0/octave/octprimtypes.swg deleted file mode 100755 index d56413cb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octprimtypes.swg +++ /dev/null @@ -1,254 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - - -// boolean - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE octave_value - SWIG_From_dec(bool)(bool value) -{ - return octave_value(value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(const octave_value& ov, bool *val) -{ -%#if SWIG_OCTAVE_PREREQ(4,4,0) - if (!ov.islogical()) -%#else - if (!ov.is_bool_type()) -%#endif - return SWIG_ERROR; - if (val) - *val = ov.bool_value(); - return SWIG_OK; -} -} - -// long - -%fragment(SWIG_From_frag(long),"header") { - SWIGINTERNINLINE octave_value SWIG_From_dec(long) (long value) - { - return octave_value(value); - } -} - - -%fragment(SWIG_AsVal_frag(long),"header") { - SWIGINTERN int SWIG_AsVal_dec(long)(const octave_value& ov, long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v!=floor(v)) - return SWIG_TypeError; - } - if (val) - *val = ov.long_value(); - return SWIG_OK; - } -} - -// unsigned long - -%fragment(SWIG_From_frag(unsigned long),"header") { - SWIGINTERNINLINE octave_value SWIG_From_dec(unsigned long) (unsigned long value) - { - return octave_value(value); - } -} - - -%fragment(SWIG_AsVal_frag(unsigned long),"header") { - SWIGINTERN int SWIG_AsVal_dec(unsigned long)(const octave_value& ov, unsigned long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v<0) - return SWIG_OverflowError; - if (v!=floor(v)) - return SWIG_TypeError; - } - if (ov.is_int8_type()||ov.is_int16_type()|| - ov.is_int32_type()) { - long v=ov.long_value(); - if (v<0) - return SWIG_OverflowError; - } - if (ov.is_int64_type()) { - long long v=ov.int64_scalar_value().value(); - if (v<0) - return SWIG_OverflowError; - } - if (val) - *val = ov.ulong_value(); - return SWIG_OK; - } -} - -// long long - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERNINLINE octave_value SWIG_From_dec(long long) (long long value) - { - return octave_int64(value); - } -%#endif -} - - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERN int SWIG_AsVal_dec(long long)(const octave_value& ov, long long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v!=floor(v)) - return SWIG_TypeError; - } - if (val) { - if (ov.is_int64_type()) - *val = ov.int64_scalar_value().value(); - else if (ov.is_uint64_type()) - *val = ov.uint64_scalar_value().value(); - else - *val = ov.long_value(); - } - return SWIG_OK; - } -%#endif -} - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERNINLINE octave_value SWIG_From_dec(unsigned long long) (unsigned long long value) - { - return octave_uint64(value); - } -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE - SWIGINTERN int SWIG_AsVal_dec(unsigned long long)(const octave_value& ov, unsigned long long* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (ov.is_double_type()||ov.is_single_type()) { - double v=ov.double_value(); - if (v<0) - return SWIG_OverflowError; - if (v!=floor(v)) - return SWIG_TypeError; - } - if (ov.is_int8_type()||ov.is_int16_type()|| - ov.is_int32_type()) { - long v=ov.long_value(); - if (v<0) - return SWIG_OverflowError; - } - if (ov.is_int64_type()) { - long long v=ov.int64_scalar_value().value(); - if (v<0) - return SWIG_OverflowError; - } - if (val) { - if (ov.is_int64_type()) - *val = ov.int64_scalar_value().value(); - else if (ov.is_uint64_type()) - *val = ov.uint64_scalar_value().value(); - else - *val = ov.long_value(); - } - return SWIG_OK; - } -%#endif -} - -// double - -%fragment(SWIG_From_frag(double),"header") { - SWIGINTERNINLINE octave_value SWIG_From_dec(double) (double value) - { - return octave_value(value); - } -} - - -%fragment(SWIG_AsVal_frag(double),"header") { - SWIGINTERN int SWIG_AsVal_dec(double)(const octave_value& ov, double* val) - { - if (!ov.is_scalar_type()) - return SWIG_TypeError; - if (ov.is_complex_scalar()) - return SWIG_TypeError; - if (val) - *val = ov.double_value(); - return SWIG_OK; - } -} - -// const char* (strings) - -%fragment("SWIG_AsCharPtrAndSize","header") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(octave_value ov, char** cptr, size_t* psize, int *alloc) -{ - if ( -%#if SWIG_OCTAVE_PREREQ(4,4,0) - ov.iscell() -%#else - ov.is_cell() -%#endif - && ov.rows() == 1 && ov.columns() == 1) - ov = ov.cell_value()(0); - if (!ov.is_string()) - return SWIG_TypeError; - - std::string str=ov.string_value(); - size_t len=str.size(); - char* cstr=(char*)str.c_str(); - if (alloc) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else if (cptr) - *cptr = cstr; - if (psize) - *psize = len + 1; - return SWIG_OK; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE octave_value -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - return std::string(carray,carray+size); -} -} - - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octrun.swg b/win64/bin/swig/share/swig/4.1.0/octave/octrun.swg deleted file mode 100755 index aab557cd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octrun.swg +++ /dev/null @@ -1,1669 +0,0 @@ -#if !SWIG_OCTAVE_PREREQ(3,2,0) -#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, FS ## cname, args, nargout, doc) -#else -#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, G ## cname, args, nargout, doc) -#endif - -SWIGRUNTIME bool SWIG_check_num_args(const char *func_name, int num_args, int max_args, int min_args, int varargs) { - if (num_args > max_args && !varargs) - error("function %s takes at most %i arguments", func_name, max_args); - else if (num_args < min_args) - error("function %s requires at least %i arguments", func_name, min_args); - else - return true; - return false; -} - -SWIGRUNTIME octave_value_list *SWIG_Octave_AppendOutput(octave_value_list *ovl, const octave_value &ov) { - ovl->append(ov); - return ovl; -} - -SWIGRUNTIME octave_value SWIG_ErrorType(int code) { - switch (code) { - case SWIG_MemoryError: - return "SWIG_MemoryError"; - case SWIG_IOError: - return "SWIG_IOError"; - case SWIG_RuntimeError: - return "SWIG_RuntimeError"; - case SWIG_IndexError: - return "SWIG_IndexError"; - case SWIG_TypeError: - return "SWIG_TypeError"; - case SWIG_DivisionByZero: - return "SWIG_DivisionByZero"; - case SWIG_OverflowError: - return "SWIG_OverflowError"; - case SWIG_SyntaxError: - return "SWIG_SyntaxError"; - case SWIG_ValueError: - return "SWIG_ValueError"; - case SWIG_SystemError: - return "SWIG_SystemError"; - case SWIG_AttributeError: - return "SWIG_AttributeError"; - } - return "SWIG unknown error"; -} - -SWIGRUNTIME octave_value SWIG_Error(int code, const char *msg) { - octave_value type(SWIG_ErrorType(code)); - std::string r = msg; - r += " (" + type.string_value() + ")"; - error("%s", r.c_str()); - return octave_value(r); -} - -#define SWIG_fail goto fail - -#define SWIG_Octave_ConvertPtr(obj, pptr, type, flags) SWIG_Octave_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Octave_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Octave_ConvertPtrAndOwn(obj, pptr, type, flags, own) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Octave_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Octave_NewPointerObj(ptr, type, flags) -#define swig_owntype int - -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Octave_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Octave_NewPackedObj(ptr, sz, type) - -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Octave_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Octave_NewPackedObj(ptr, sz, type) - -#define SWIG_GetModule(clientdata) SWIG_Octave_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Octave_SetModule(clientdata,pointer); -#define SWIG_MODULE_CLIENTDATA_TYPE void* - -#define Octave_Error_Occurred() 0 -#define SWIG_Octave_AddErrorMsg(msg) {;} - -SWIGRUNTIME swig_module_info *SWIG_Octave_GetModule(void *clientdata); -SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info *pointer); - -// For backward compatibility only -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) 0 - -// Runtime API implementation - -typedef octave_value_list(*octave_func) (const octave_value_list &, int); -class octave_swig_type; - -namespace Swig { - -#ifdef SWIG_DIRECTORS - - class Director; - - typedef std::map < void *, Director * > rtdir_map; - SWIGINTERN rtdir_map* get_rtdir_map(); - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *d); - SWIGINTERNINLINE void erase_rtdir(void *vptr); - SWIGINTERNINLINE Director *get_rtdir(void *vptr); - - SWIGRUNTIME void swig_director_destroyed(octave_swig_type *self, Director *d); - SWIGRUNTIME octave_swig_type *swig_director_get_self(Director *d); - SWIGRUNTIME void swig_director_set_self(Director *d, octave_swig_type *self); - -#endif - - SWIGRUNTIME octave_base_value *swig_value_ref(octave_swig_type *ost); - SWIGRUNTIME octave_swig_type *swig_value_deref(octave_value ov); - SWIGRUNTIME octave_swig_type *swig_value_deref(const octave_base_value &ov); -} - -#ifdef SWIG_DIRECTORS -SWIGRUNTIME void swig_acquire_ownership(void *vptr); -SWIGRUNTIME void swig_acquire_ownership_array(void *vptr); -SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); -#endif - - struct swig_octave_member { - const char *name; - octave_func method; - octave_func get_method; - octave_func set_method; - int flags; // 1 static, 2 global - const char *doc; - bool is_static() const { - return flags &1; - } bool is_global() const { - return flags &2; - } - }; - - struct swig_octave_class { - const char *name; - swig_type_info **type; - int director; - octave_func constructor; - const char *constructor_doc; - octave_func destructor; - const swig_octave_member *members; - const char **base_names; - const swig_type_info **base; - }; - -#if SWIG_OCTAVE_PREREQ(4,4,0) - // in Octave 4.4 behaviour of octave_builtin() appears to have changed and 'self' argument is no longer passed - // to function (maybe because this is now a 'method'??) so need to create our own octave_function subclass -#define SWIG_OCTAVE_BOUND_FUNC(func, args) octave_value(new octave_swig_bound_func(func, args)) - class octave_swig_bound_func : public octave_function { - public: - - octave_swig_bound_func(void) : octave_function(), method(0), first_args() - { } - - octave_swig_bound_func(octave_function* _method, octave_value_list _first_args) - : octave_function("", ""), method(_method), first_args(_first_args) - { } - - octave_swig_bound_func(const octave_swig_bound_func& f) = delete; - - octave_swig_bound_func& operator= (const octave_swig_bound_func& f) = delete; - - ~octave_swig_bound_func(void) = default; - - bool is_function(void) const { return true; } - - octave_function* function_value(bool = false) { return this; } - -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave_value_list call(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { - return execute(tw,nargout,args); - } -#endif -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave_value_list execute(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { -#else - octave_value_list call(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { -#endif - octave_value_list all_args; - all_args.append(first_args); - all_args.append(args); - return method->call(tw, nargout, all_args); - } - - octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) { - octave_value_list ovl = subsref(ops, idx, 1); - return ovl.length() ? ovl(0) : octave_value(); - } - - octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) { - assert(ops.size() > 0); - assert(ops.size() == idx.size()); - if (ops != "(") - error("invalid function call"); - octave::tree_evaluator& tw = octave::interpreter::the_interpreter()->get_evaluator(); - return call(tw, nargout, *idx.begin()); - } - - protected: - - octave_function* method; - octave_value_list first_args; - - std::set dispatch_classes; - - }; -#else -#define SWIG_OCTAVE_BOUND_FUNC(func, args) octave_value(func) -#endif - - // octave_swig_type plays the role of both the shadow class and the class - // representation within Octave, since there is no support for classes. - // - // These should really be decoupled, with the class support added to Octave - // and the shadow class given by an m-file script. That would dramatically - // reduce the runtime complexity, and be more in line w/ other modules. - - class octave_swig_type:public octave_base_value { - struct cpp_ptr { - void *ptr; - bool destroyed; - cpp_ptr(void *_ptr):ptr(_ptr), destroyed(false) { - }}; - typedef std::pair < const swig_type_info *, cpp_ptr > type_ptr_pair; - - mutable swig_module_info *module; - - const swig_type_info *construct_type; // type of special type object - std::vector < type_ptr_pair > types; // our c++ base classes - int thisown; // whether we call c++ destructors when we die - - typedef std::pair < const swig_octave_member *, octave_value > member_value_pair; - typedef std::map < std::string, member_value_pair > member_map; - member_map members; - bool always_static; - - const swig_octave_member *find_member(const swig_type_info *type, const std::string &name) { - if (!type->clientdata) - return 0; - swig_octave_class *c = (swig_octave_class *) type->clientdata; - const swig_octave_member *m; - for (m = c->members; m->name; ++m) - if (m->name == name) - return m; - for (int j = 0; c->base_names[j]; ++j) { - if (!c->base[j]) { - if (!module) - module = SWIG_GetModule(0); - assert(module); - c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]); - } - if (!c->base[j]) - return 0; - if ((m = find_member(c->base[j], name))) - return m; - } - return 0; - } - - member_value_pair *find_member(const std::string &name, bool insert_if_not_found) { - member_map::iterator it = members.find(name); - if (it != members.end()) - return &it->second; - const swig_octave_member *m; - for (unsigned int j = 0; j < types.size(); ++j) - if ((m = find_member(types[j].first, name))) - return &members.insert(std::make_pair(name, std::make_pair(m, octave_value()))).first->second; - if (!insert_if_not_found) - return 0; - return &members[name]; - } - - const swig_type_info *find_base(const std::string &name, const swig_type_info *base) { - if (!base) { - for (unsigned int j = 0; j < types.size(); ++j) { - assert(types[j].first->clientdata); - swig_octave_class *cj = (swig_octave_class *) types[j].first->clientdata; - if (cj->name == name) - return types[j].first; - } - return 0; - } - assert(base->clientdata); - swig_octave_class *c = (swig_octave_class *) base->clientdata; - for (int j = 0; c->base_names[j]; ++j) { - if (!c->base[j]) { - if (!module) - module = SWIG_GetModule(0); - assert(module); - c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]); - } - if (!c->base[j]) - return 0; - assert(c->base[j]->clientdata); - swig_octave_class *cj = (swig_octave_class *) c->base[j]->clientdata; - if (cj->name == name) - return c->base[j]; - } - return 0; - } - - void load_members(const swig_octave_class* c,member_map& out) const { - for (const swig_octave_member *m = c->members; m->name; ++m) { - if (out.find(m->name) == out.end()) - out.insert(std::make_pair(m->name, std::make_pair(m, octave_value()))); - } - for (int j = 0; c->base_names[j]; ++j) { - if (!c->base[j]) { - if (!module) - module = SWIG_GetModule(0); - assert(module); - c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]); - } - if (!c->base[j]) - continue; - assert(c->base[j]->clientdata); - const swig_octave_class *cj = - (const swig_octave_class *) c->base[j]->clientdata; - load_members(cj,out); - } - } - - void load_members(member_map& out) const { - out=members; - for (unsigned int j = 0; j < types.size(); ++j) - if (types[j].first->clientdata) - load_members((const swig_octave_class *) types[j].first->clientdata, out); - } - - octave_value_list member_invoke(member_value_pair *m, const octave_value_list &args, int nargout) { - if (m->second.is_defined()) - return m->second.subsref("(", std::list < octave_value_list > (1, args), nargout); - else if (m->first && m->first->method) - return m->first->method(args, nargout); - error("member not defined or not invocable"); - return octave_value_list(); - } - - bool dispatch_unary_op(const std::string &symbol, octave_value &ret) const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - member_value_pair *m = nc_this->find_member(symbol, false); - if (!m || m->first->is_static() || m->first->is_global()) - return false; - octave_value_list args; - args.append(nc_this->as_value()); - octave_value_list argout(nc_this->member_invoke(m, args, 1)); - if (argout.length() < 1) - return false; - ret = argout(0); - return true; - } - - bool dispatch_binary_op(const std::string &symbol, const octave_base_value &rhs, octave_value &ret) const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - member_value_pair *m = nc_this->find_member(symbol, false); - if (!m || m->first->is_static() || m->first->is_global()) - return false; - octave_value_list args; - args.append(nc_this->as_value()); - args.append(make_value_hack(rhs)); - octave_value_list argout(nc_this->member_invoke(m, args, 1)); - if (argout.length() < 1) - return false; - ret = argout(0); - return true; - } - - bool dispatch_index_op(const std::string &symbol, const octave_value_list &rhs, octave_value_list &ret) const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - member_value_pair *m = nc_this->find_member(symbol, false); - if (!m || m->first->is_static() || m->first->is_global()) - return false; - octave_value_list args; - args.append(nc_this->as_value()); - args.append(rhs); - octave_value_list argout(nc_this->member_invoke(m, args, 1)); - if (argout.length() >= 1) - ret = argout(0); - return true; - } - - octave_value_list member_deref(member_value_pair *m, const octave_value_list &args) { - if (m->second.is_defined()) { - if (m->second.is_function() || m->second.is_function_handle()) { - return SWIG_OCTAVE_BOUND_FUNC(m->second.function_value(), args); - } else { - return m->second; - } - } else if (m->first) { - if (m->first->get_method) - return m->first->get_method(args, 1); - else if (m->first->method) - return SWIG_OCTAVE_BOUND_FUNC(new octave_builtin(m->first->method), args); - } - error("undefined member"); - return octave_value_list(); - } - - static octave_value make_value_hack(const octave_base_value &x) { - ((octave_swig_type &) x).count++; - return octave_value((octave_base_value *) &x); - } - - octave_swig_type(const octave_swig_type &x); - octave_swig_type &operator=(const octave_swig_type &rhs); - public: - - octave_swig_type(void *_ptr = 0, const swig_type_info *_type = 0, int _own = 0, - bool _always_static = false) - : module(0), construct_type(_ptr ? 0 : _type), thisown(_own), - always_static(_always_static) { - if (_type || _ptr) - types.push_back(std::make_pair(_type, _ptr)); -#ifdef SWIG_DIRECTORS - if (_ptr) { - Swig::Director *d = Swig::get_rtdir(_ptr); - if (d) - Swig::swig_director_set_self(d, this); - } -#endif - } - - ~octave_swig_type() { - if (thisown) { - ++count; - for (unsigned int j = 0; j < types.size(); ++j) { - if (!types[j].first || !types[j].first->clientdata) - continue; - swig_octave_class *c = (swig_octave_class *) types[j].first->clientdata; - if (c->destructor && !types[j].second.destroyed && types[j].second.ptr) { - c->destructor(as_value(), 0); - } - } - } -#ifdef SWIG_DIRECTORS - for (unsigned int j = 0; j < types.size(); ++j) - Swig::erase_rtdir(types[j].second.ptr); -#endif - } - - dim_vector dims(void) const { - octave_value out; - if (!dispatch_unary_op("__dims__", out)) - return dim_vector(1,1); - - // Return value should be cell or matrix of integers -#if SWIG_OCTAVE_PREREQ(4,4,0) - if (out.iscell()) { -#else - if (out.is_cell()) { -#endif - const Cell & c=out.cell_value(); - int ndim = c.rows(); - if (ndim==1 && c.columns()!=1) ndim = c.columns(); - - dim_vector d; - d.resize(ndim < 2 ? 2 : ndim); - d(0) = d(1) = 1; - - // Fill in dim_vector - for (int k=0;k a; - try { - a = out.int_vector_value(); - } - catch (octave::execution_exception& oee) { - return dim_vector(1,1); - } -#else - Array a = out.int_vector_value(); - if (error_state) return dim_vector(1,1); -#endif - dim_vector d; - d.resize(a.numel() < 2 ? 2 : a.numel()); - d(0) = d(1) = 1; - for (int k=0;kclientdata) - return 0; - swig_octave_class *c = (swig_octave_class *) types[0].first->clientdata; - return c->constructor_doc; - } - - std::string swig_type_name() const { - // * need some way to manually name subclasses. - // * eg optional first arg to subclass(), or named_subclass() - std::string ret; - for (unsigned int j = 0; j < types.size(); ++j) { - if (j) - ret += "_"; - if (types[j].first->clientdata) { - swig_octave_class *c = (swig_octave_class *) types[j].first->clientdata; - ret += c->name; - } else - ret += types[j].first->name; - } - return ret; - } - - void merge(octave_swig_type &rhs) { - rhs.thisown = 0; - for (unsigned int j = 0; j < rhs.types.size(); ++j) { - assert(!rhs.types[j].second.destroyed); -#ifdef SWIG_DIRECTORS - Swig::Director *d = Swig::get_rtdir(rhs.types[j].second.ptr); - if (d) - Swig::swig_director_set_self(d, this); -#endif - } - types.insert(types.end(), rhs.types.begin(), rhs.types.end()); - members.insert(rhs.members.begin(), rhs.members.end()); -#if SWIG_OCTAVE_PREREQ(4,4,0) - assign(rhs.swig_type_name(), rhs.as_value()); -#else - rhs.types.clear(); - rhs.members.clear(); -#endif - } - - typedef member_map::const_iterator swig_member_const_iterator; - swig_member_const_iterator swig_members_begin() { return members.begin(); } - swig_member_const_iterator swig_members_end() { return members.end(); } - - int cast(void **vptr, swig_type_info *type, int *own, int flags) { - int res = SWIG_ERROR; - int clear_pointer = 0; - - if (own) - *own = 0; - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !thisown) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (own) - *own = *own | thisown; - if (flags & SWIG_POINTER_DISOWN) { - thisown = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - clear_pointer = 1; - } - } - - if (!type && types.size()) { - if (vptr) { - *vptr = types[0].second.ptr; - if (clear_pointer) - types[0].second.ptr = 0; - } - return SWIG_OK; - } - for (unsigned int j = 0; j < types.size(); ++j) - if (type == types[j].first) { - if (vptr) { - *vptr = types[j].second.ptr; - if (clear_pointer) - types[j].second.ptr = 0; - } - return SWIG_OK; - } - for (unsigned int j = 0; j < types.size(); ++j) { - swig_cast_info *tc = SWIG_TypeCheck(types[j].first->name, type); - if (!tc) - continue; - if (vptr) { - int newmemory = 0; - *vptr = SWIG_TypeCast(tc, types[j].second.ptr, &newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - if (clear_pointer) - types[j].second.ptr = 0; - } - res = SWIG_OK; - break; - } - return res; - } - - bool is_owned() const { - return thisown; - } - -#ifdef SWIG_DIRECTORS - void director_destroyed(Swig::Director *d) { - bool found = false; - for (unsigned int j = 0; j < types.size(); ++j) { - Swig::Director *dj = Swig::get_rtdir(types[j].second.ptr); - if (dj == d) { - types[j].second.destroyed = true; - found = true; - } - } - assert(found); - } -#endif - - void assign(const std::string &name, const octave_value &ov) { - members[name] = std::make_pair((const swig_octave_member *) 0, ov); - } - - void assign(const std::string &name, const swig_octave_member *m) { - members[name] = std::make_pair(m, octave_value()); - } - - octave_base_value *clone() const { - // pass-by-value is probably not desired, and is harder; - // requires calling copy constructors of contained types etc. - assert(0); - *(int *) 0 = 0; - return 0; - } - - octave_base_value *empty_clone() const { - return new octave_swig_type(); - } - - bool is_defined() const { - return true; - } - -#if SWIG_OCTAVE_PREREQ(6,0,0) - virtual bool isstruct() const { -#else - virtual bool is_map() const { -#endif - return true; - } - - virtual octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) { - octave_value_list ovl = subsref(ops, idx, 1); - return ovl.length()? ovl(0) : octave_value(); - } - - virtual octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) { - assert(ops.size() > 0); - assert(ops.size() == idx.size()); - - std::list < octave_value_list >::const_iterator idx_it = idx.begin(); - int skip = 0; - octave_value_list sub_ovl; - - // constructor invocation - if (ops[skip] == '(' && construct_type) { - assert(construct_type->clientdata); - swig_octave_class *c = (swig_octave_class *) construct_type->clientdata; - if (!c->constructor) { - error("cannot create instance"); - return octave_value_list(); - } - octave_value_list args; - if (c->director) - args.append(Swig::swig_value_ref(new octave_swig_type(this, 0, 0))); - args.append(*idx_it++); - ++skip; - sub_ovl = c->constructor(args, nargout); - } - // member dereference or invocation - else if (ops[skip] == '.') { - std::string subname; - const swig_type_info *base = 0; // eg, a.base.base_cpp_mem - for (;;) { - octave_value_list subname_ovl(*idx_it++); - ++skip; - assert(subname_ovl.length() == 1 && subname_ovl(0).is_string()); - subname = subname_ovl(0).string_value(); - - const swig_type_info *next_base = find_base(subname, base); - if (!next_base || skip >= (int) ops.size() || ops[skip] != '.') - break; - base = next_base; - } - - member_value_pair tmp, *m = &tmp; - if (!base || !(m->first = find_member(base, subname))) - m = find_member(subname, false); - if (!m) { - error("member not found"); - return octave_value_list(); - } - - octave_value_list args; - if (!always_static && - (!m->first || (!m->first->is_static() && !m->first->is_global()))) - args.append(as_value()); - if (skip < (int) ops.size() && ops[skip] == '(' && - ((m->first && m->first->method) || m->second.is_function() || - m->second.is_function_handle())) { - args.append(*idx_it++); - ++skip; - sub_ovl = member_invoke(m, args, nargout); - } else { - sub_ovl = member_deref(m, args); - } - } - // index operator - else { - if (ops[skip] == '(' || ops[skip] == '{') { - const char *op_name = ops[skip] == '(' ? "__paren__" : "__brace__"; - octave_value_list args; - args.append(*idx_it++); - ++skip; - if (!dispatch_index_op(op_name, args, sub_ovl)) { - error("error evaluating index operator"); - return octave_value_list(); - } - } else { - error("unsupported subsref"); - return octave_value_list(); - } - } - - if (skip >= (int) ops.size()) - return sub_ovl; - if (sub_ovl.length() < 1) { - error("bad subs ref"); - return octave_value_list(); - } - return sub_ovl(0).next_subsref(nargout, ops, idx, skip); - } - - octave_value subsasgn(const std::string &ops, const std::list < octave_value_list > &idx, const octave_value &rhs) { - assert(ops.size() > 0); - assert(ops.size() == idx.size()); - - std::list < octave_value_list >::const_iterator idx_it = idx.begin(); - int skip = 0; - - if (ops.size() > 1) { - std::list < octave_value_list >::const_iterator last = idx.end(); - --last; - std::list < octave_value_list > next_idx(idx.begin(), last); - octave_value next_ov = subsref(ops.substr(0, ops.size() - 1), next_idx); - next_ov.subsasgn(ops.substr(ops.size() - 1), std::list < octave_value_list > (1, *last), rhs); - } - - else if (ops[skip] == '(' || ops[skip] == '{') { - const char *op_name = ops[skip] == '(' ? "__paren_asgn__" : "__brace_asgn__"; - member_value_pair *m = find_member(op_name, false); - if (m) { - octave_value_list args; - args.append(as_value()); - args.append(*idx_it); - args.append(rhs); - member_invoke(m, args, 1); - } else - error("%s member not found", op_name); - } - - else if (ops[skip] == '.') { - octave_value_list subname_ovl(*idx_it++); - ++skip; - assert(subname_ovl.length() == 1 &&subname_ovl(0).is_string()); - std::string subname = subname_ovl(0).string_value(); - - member_value_pair *m = find_member(subname, true); - if (!m->first || !m->first->set_method) { - m->first = 0; - m->second = rhs; - } else if (m->first->set_method) { - octave_value_list args; - if (!m->first->is_static() && !m->first->is_global()) - args.append(as_value()); - args.append(rhs); - m->first->set_method(args, 1); - } else - error("member not assignable"); - } else - error("unsupported subsasgn"); - - return as_value(); - } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - virtual bool isobject() const { -#else - virtual bool is_object() const { -#endif - return true; - } - - virtual bool is_string() const { - octave_swig_type *nc_this = const_cast < octave_swig_type *>(this); - return !!nc_this->find_member("__str__", false); - } - - virtual std::string string_value(bool force = false) const { - octave_value ret; - if (!dispatch_unary_op("__str__", ret)) { - error("__str__ method not defined"); - return std::string(); - } - if (!ret.is_string()) { - error("__str__ method did not return a string"); - return std::string(); - } - return ret.string_value(); - } - - virtual double scalar_value(bool frc_str_conv = false) const { - octave_value ret; - if (!dispatch_unary_op("__float__", ret)) { - error("__float__ method not defined"); - } - return ret.scalar_value(); - } - -#if SWIG_OCTAVE_PREREQ(4,2,0) - virtual octave_value as_double(void) const { - octave_value ret; - if (!dispatch_unary_op("__float__", ret)) { - error("__float__ method not defined"); - } - return ret.as_double(); - } - - virtual octave_value as_single(void) const { - octave_value ret; - if (!dispatch_unary_op("__float__", ret)) { - error("__float__ method not defined"); - } - return ret.as_single(); - } -#endif - -#if SWIG_OCTAVE_PREREQ(3,8,0) - virtual octave_value map(octave_base_value::unary_mapper_t umap) const { - const std::string opname = std::string("__") + octave_base_value::get_umap_name(umap) + std::string("__"); - octave_value ret; - if (!dispatch_unary_op(opname, ret)) { - error("%s", (opname + std::string(" method not found")).c_str()); - return octave_value(); - } - return ret; - } -#endif - -#if SWIG_OCTAVE_PREREQ(3,3,52) - virtual octave_map map_value() const { - return octave_map(); - } -#else - virtual Octave_map map_value() const { - return Octave_map(); - } -#endif - - virtual string_vector map_keys() const { - member_map tmp; - load_members(tmp); - - string_vector keys(tmp.size()); - int k = 0; - for (member_map::iterator it = tmp.begin(); it != tmp.end(); ++it) - keys(k++) = it->first; - - return keys; - } - - virtual bool save_ascii (std::ostream& os) { - return true; - } - - virtual bool load_ascii (std::istream& is) { - return true; - } - - virtual bool save_binary (std::ostream& os, bool& save_as_floats) { - return true; - } - - virtual bool load_binary (std::istream& is, bool swap, -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::mach_info::float_format fmt) { -#else - oct_mach_info::float_format fmt) { -#endif - return true; - } - -#if defined (HAVE_HDF5) -# if SWIG_OCTAVE_PREREQ(4,0,0) - virtual bool - save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# else - virtual bool - save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# endif -#endif - - virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const { - return string_value(); - } - - virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const { - return string_value(); - } - - static bool dispatch_global_op(const std::string &symbol, const octave_value_list &args, octave_value &ret) { - // we assume that SWIG_op_prefix-prefixed functions are installed in global namespace - // (rather than any module namespace). - - octave_function *fcn = is_valid_function(symbol, std::string(), false); - if (!fcn) - return false; -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::tree_evaluator& tw = octave::interpreter::the_interpreter()->get_evaluator(); - octave_value_list retval = fcn->call(tw, 1, args); - if (retval.length() == 1) - ret = retval(0); -#else - ret = fcn->do_multi_index_op(1, args)(0); -#endif - return true; - } - - static octave_value dispatch_unary_op(const octave_base_value &x, const char *op_name) { - octave_swig_type *ost = Swig::swig_value_deref(x); - assert(ost); - - octave_value ret; - if (ost->dispatch_unary_op(std::string("__") + op_name + std::string("__"), ret)) - return ret; - std::string symbol = SWIG_op_prefix + ost->swig_type_name() + "_" + op_name; - octave_value_list args; - args.append(make_value_hack(x)); - if (dispatch_global_op(symbol, args, ret)) - return ret; - - error("could not dispatch unary operator"); - return octave_value(); - } - - static octave_value dispatch_binary_op(const octave_base_value &lhs, const octave_base_value &rhs, const char *op_name) { - octave_swig_type *lhs_ost = Swig::swig_value_deref(lhs); - octave_swig_type *rhs_ost = Swig::swig_value_deref(rhs); - - octave_value ret; - if (lhs_ost && lhs_ost->dispatch_binary_op(std::string("__") + op_name + std::string("__"), rhs, ret)) - return ret; - if (rhs_ost) { - if (strlen(op_name) == 2 && (op_name[1] == 't' || op_name[1] == 'e')) { - if (op_name[0] == 'l' && rhs_ost->dispatch_binary_op(std::string("__g") + op_name[1] + std::string("__"), lhs, ret)) - return ret; - if (op_name[0] == 'g' && rhs_ost->dispatch_binary_op(std::string("__l") + op_name[1] + std::string("__"), lhs, ret)) - return ret; - } - if (rhs_ost->dispatch_binary_op(std::string("__r") + op_name + std::string("__"), lhs, ret)) - return ret; - } - - std::string symbol; - octave_value_list args; - args.append(make_value_hack(lhs)); - args.append(make_value_hack(rhs)); - - symbol = SWIG_op_prefix; - symbol += lhs_ost ? lhs_ost->swig_type_name() : lhs.type_name(); - symbol += "_"; - symbol += op_name; - symbol += "_"; - symbol += rhs_ost ? rhs_ost->swig_type_name() : rhs.type_name(); - if (dispatch_global_op(symbol, args, ret)) - return ret; - - symbol = SWIG_op_prefix; - symbol += lhs_ost ? lhs_ost->swig_type_name() : lhs.type_name(); - symbol += "_"; - symbol += op_name; - symbol += "_"; - symbol += "any"; - if (dispatch_global_op(symbol, args, ret)) - return ret; - - symbol = SWIG_op_prefix; - symbol += "any"; - symbol += "_"; - symbol += op_name; - symbol += "_"; - symbol += rhs_ost ? rhs_ost->swig_type_name() : rhs.type_name(); - if (dispatch_global_op(symbol, args, ret)) - return ret; - - error("could not dispatch binary operator"); - return octave_value(); - } - -#if SWIG_OCTAVE_PREREQ(4,0,0) - void print(std::ostream &os, bool pr_as_read_syntax = false) -#else - void print(std::ostream &os, bool pr_as_read_syntax = false) const -#endif - { - if (is_string()) { - os << string_value(); - return; - } - - member_map tmp; - load_members(tmp); - - indent(os); - os << "{"; newline(os); - increment_indent_level(); - for (unsigned int j = 0; j < types.size(); ++j) { - indent(os); - if (types[j].first->clientdata) { - const swig_octave_class *c = (const swig_octave_class *) types[j].first->clientdata; - os << c->name << ", ptr = " << types[j].second.ptr; newline(os); - } else { - os << types[j].first->name << ", ptr = " << types[j].second.ptr; newline(os); - } - } - for (member_map::const_iterator it = tmp.begin(); it != tmp.end(); ++it) { - indent(os); - if (it->second.first) { - const char *objtype = it->second.first->method ? "method" : "variable"; - const char *modifier = (it->second.first->flags &1) ? "static " : (it->second.first->flags &2) ? "global " : ""; - os << it->second.first->name << " (" << modifier << objtype << ")"; newline(os); - assert(it->second.first->name == it->first); - } else { - os << it->first; newline(os); - } - } - decrement_indent_level(); - indent(os); - os << "}"; newline(os); - } - }; - - // Octave tries hard to preserve pass-by-value semantics. Eg, assignments - // will call clone() via make_unique() if there is more than one outstanding - // reference to the lhs, and forces the clone's reference count to 1 - // (so you can't just increment your own count and return this). - // - // One way to fix this (without modifying Octave) is to add a level of - // indirection such that clone copies ref-counted pointer and we keep - // pass-by-ref semantics (which are more natural/expected for C++ bindings). - // - // Supporting both pass-by-{ref,value} and toggling via %feature/option - // might be nice. - - class octave_swig_ref:public octave_base_value { - octave_swig_type *ptr; - public: - octave_swig_ref(octave_swig_type *_ptr = 0) - :ptr(_ptr) - { - // Ensure type_id() is set correctly - if (t_id == -1) { - t_id = octave_swig_ref::static_type_id(); - } - } - - ~octave_swig_ref() - { if (ptr) ptr->decref(); } - - octave_swig_type *get_ptr() const - { return ptr; } - - octave_base_value *clone() const - { if (ptr) ptr->incref(); return new octave_swig_ref(ptr); } - - octave_base_value *empty_clone() const - { return new octave_swig_ref(0); } - - dim_vector dims(void) const - { return ptr->dims(); } - - bool is_defined() const - { return ptr->is_defined(); } - -#if SWIG_OCTAVE_PREREQ(6,0,0) - virtual bool isstruct() const - { return ptr->isstruct(); } -#else - virtual bool is_map() const - { return ptr->is_map(); } -#endif - - virtual octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) - { return ptr->subsref(ops, idx); } - - virtual octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) - { return ptr->subsref(ops, idx, nargout); } - - octave_value subsasgn(const std::string &ops, const std::list < octave_value_list > &idx, const octave_value &rhs) - { return ptr->subsasgn(ops, idx, rhs); } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - virtual bool isobject() const - { return ptr->isobject(); } -#else - virtual bool is_object() const - { return ptr->is_object(); } -#endif - - virtual bool is_string() const - { return ptr->is_string(); } - - virtual std::string string_value(bool force = false) const - { return ptr->string_value(force); } - - virtual double scalar_value(bool frc_str_conv = false) const - { return ptr->scalar_value(frc_str_conv); } - -#if SWIG_OCTAVE_PREREQ(4,2,0) - virtual octave_value as_double(void) const - { return ptr->as_double(); } - - virtual octave_value as_single(void) const - { return ptr->as_single(); } -#endif - -#if SWIG_OCTAVE_PREREQ(3,8,0) - virtual octave_value map(octave_base_value::unary_mapper_t umap) const - { return ptr->map(umap); } -#endif - -#if SWIG_OCTAVE_PREREQ(3,3,52) - virtual octave_map map_value() const - { return ptr->map_value(); } -#else - virtual Octave_map map_value() const - { return ptr->map_value(); } -#endif - - virtual string_vector map_keys() const - { return ptr->map_keys(); } - - virtual bool save_ascii (std::ostream& os) - { return ptr->save_ascii(os); } - - virtual bool load_ascii (std::istream& is) - { return ptr->load_ascii(is); } - - virtual bool save_binary (std::ostream& os, bool& save_as_floats) - { return ptr->save_binary(os, save_as_floats); } - - virtual bool load_binary (std::istream& is, bool swap, -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::mach_info::float_format fmt) -#else - oct_mach_info::float_format fmt) -#endif - { return ptr->load_binary(is, swap, fmt); } - -#if defined (HAVE_HDF5) -# if SWIG_OCTAVE_PREREQ(4,0,0) - virtual bool - save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) - { return ptr->save_hdf5(loc_id, name, save_as_floats); } - - virtual bool - load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) - { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); } -# else - virtual bool - save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) - { return ptr->save_hdf5(loc_id, name, save_as_floats); } - - virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) - { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); } -# endif -#endif - - virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const - { return ptr->convert_to_str(pad, force, type); } - - virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const - { return ptr->convert_to_str_internal(pad, force, type); } - -#if SWIG_OCTAVE_PREREQ(4,0,0) - void print(std::ostream &os, bool pr_as_read_syntax = false) -#else - void print(std::ostream &os, bool pr_as_read_syntax = false) const -#endif - { return ptr->print(os, pr_as_read_syntax); } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - static void set_type_id(int type_id) { t_id=type_id; } -#endif - - virtual type_conv_info numeric_conversion_function(void) const { - return octave_base_value::type_conv_info (default_numeric_conversion_function, - octave_scalar::static_type_id ()); - } - - private: - static octave_base_value *default_numeric_conversion_function (const octave_base_value& a) { - const octave_swig_ref& v = dynamic_cast(a); - return new octave_scalar(v.scalar_value()); - } - -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DECLARE_OCTAVE_ALLOCATOR; -#endif - DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; - }; -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DEFINE_OCTAVE_ALLOCATOR(octave_swig_ref); -#endif - DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_ref, "swig_ref", "swig_ref"); - - class octave_swig_packed:public octave_base_value { - swig_type_info *type; - std::vector < char > buf; - public: - - octave_swig_packed(swig_type_info *_type = 0, const void *_buf = 0, size_t _buf_len = 0) - : type(_type), buf((const char*)_buf, (const char*)_buf + _buf_len) - { - // Ensure type_id() is set correctly - if (t_id == -1) { - t_id = octave_swig_packed::static_type_id(); - } - } - - bool copy(swig_type_info *outtype, void *ptr, size_t sz) const { - if (outtype && outtype != type) - return false; - assert(sz <= buf.size()); - std::copy(buf.begin(), buf.begin()+sz, (char*)ptr); - return true; - } - - octave_base_value *clone() const { - return new octave_swig_packed(*this); - } - - octave_base_value *empty_clone() const { - return new octave_swig_packed(); - } - - bool is_defined() const { - return true; - } - -#if SWIG_OCTAVE_PREREQ(4,0,0) - void print(std::ostream &os, bool pr_as_read_syntax = false) -#else - void print(std::ostream &os, bool pr_as_read_syntax = false) const -#endif - { - indent(os); - os << "swig packed type: name = " << (type ? type->name : std::string()) << ", len = " << buf.size(); newline(os); - } - - - virtual bool save_ascii (std::ostream& os) { - return true; - } - - virtual bool load_ascii (std::istream& is) { - return true; - } - - virtual bool save_binary (std::ostream& os, bool& save_as_floats) { - return true; - } - - virtual bool load_binary (std::istream& is, bool swap, -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::mach_info::float_format fmt) { -#else - oct_mach_info::float_format fmt) { -#endif - return true; - } - -#if defined (HAVE_HDF5) -# if SWIG_OCTAVE_PREREQ(4,0,0) - virtual bool - save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# else - virtual bool - save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) { - return true; - } - - virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) { - return true; - } -# endif -#endif - -#if SWIG_OCTAVE_PREREQ(4,4,0) - static void set_type_id(int type_id) { t_id=type_id; } -#endif - - private: -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DECLARE_OCTAVE_ALLOCATOR; -#endif - DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; - }; -#if !SWIG_OCTAVE_PREREQ(4,0,0) - DEFINE_OCTAVE_ALLOCATOR(octave_swig_packed); -#endif - DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_packed, "swig_packed", "swig_packed"); - - SWIGRUNTIME octave_value_list octave_set_immutable(const octave_value_list &args, int nargout) { - error("attempt to set immutable member variable"); - return octave_value_list(); - } - - struct octave_value_ref { - const octave_value_list &ovl; - int j; - - octave_value_ref(const octave_value_list &_ovl, int _j) - :ovl(_ovl), j(_j) { } - - operator octave_value() const { - return ovl(j); - } - - octave_value operator*() const { - return ovl(j); - } - }; - - -namespace Swig { - - SWIGRUNTIME octave_base_value *swig_value_ref(octave_swig_type *ost) { - return new octave_swig_ref(ost); - } - - SWIGRUNTIME octave_swig_type *swig_value_deref(octave_value ov) { - if ( -#if SWIG_OCTAVE_PREREQ(4,4,0) - ov.iscell() -#else - ov.is_cell() -#endif - && ov.rows() == 1 && ov.columns() == 1) - ov = ov.cell_value()(0); - return swig_value_deref(*ov.internal_rep()); - } - - SWIGRUNTIME octave_swig_type *swig_value_deref(const octave_base_value &ov) { - if (ov.type_id() != octave_swig_ref::static_type_id()) - return 0; - const octave_swig_ref *osr = static_cast < const octave_swig_ref *>(&ov); - return osr->get_ptr(); - } - -} - - -#define swig_unary_op(name) \ -SWIGRUNTIME octave_value swig_unary_op_##name(const octave_base_value &x) { \ - return octave_swig_type::dispatch_unary_op(x,#name); \ -} -#define swig_binary_op(name) \ -SWIGRUNTIME octave_value swig_binary_op_##name(const octave_base_value&lhs,const octave_base_value &rhs) { \ - return octave_swig_type::dispatch_binary_op(lhs,rhs,#name); \ -} -#if SWIG_OCTAVE_PREREQ(4,4,0) -#define swigreg_unary_op(name) \ -if (!octave_value_typeinfo::lookup_unary_op(octave_value::op_##name,tid)) \ -typeinfo.register_unary_op(octave_value::op_##name,tid,swig_unary_op_##name); -#else -#define swigreg_unary_op(name) \ -if (!octave_value_typeinfo::lookup_unary_op(octave_value::op_##name,tid)) \ -octave_value_typeinfo::register_unary_op(octave_value::op_##name,tid,swig_unary_op_##name); -#endif -#if SWIG_OCTAVE_PREREQ(4,4,0) -#define swigreg_binary_op(name) \ -if (!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2)) \ -typeinfo.register_binary_op(octave_value::op_##name,tid1,tid2,swig_binary_op_##name); -#else -#define swigreg_binary_op(name) \ -if (!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2)) \ -octave_value_typeinfo::register_binary_op(octave_value::op_##name,tid1,tid2,swig_binary_op_##name); -#endif - - swig_unary_op(not); - swig_unary_op(uplus); - swig_unary_op(uminus); - swig_unary_op(transpose); - swig_unary_op(hermitian); - swig_unary_op(incr); - swig_unary_op(decr); - - swig_binary_op(add); - swig_binary_op(sub); - swig_binary_op(mul); - swig_binary_op(div); - swig_binary_op(pow); - swig_binary_op(ldiv); -#if !SWIG_OCTAVE_PREREQ(4,2,0) - swig_binary_op(lshift); - swig_binary_op(rshift); -#endif - swig_binary_op(lt); - swig_binary_op(le); - swig_binary_op(eq); - swig_binary_op(ge); - swig_binary_op(gt); - swig_binary_op(ne); - swig_binary_op(el_mul); - swig_binary_op(el_div); - swig_binary_op(el_pow); - swig_binary_op(el_ldiv); - swig_binary_op(el_and); - swig_binary_op(el_or); - - SWIGRUNTIME void SWIG_InstallUnaryOps(int tid) { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::type_info& typeinfo = octave::interpreter::the_interpreter()->get_type_info(); -#endif - swigreg_unary_op(not); - swigreg_unary_op(uplus); - swigreg_unary_op(uminus); - swigreg_unary_op(transpose); - swigreg_unary_op(hermitian); - swigreg_unary_op(incr); - swigreg_unary_op(decr); - } - SWIGRUNTIME void SWIG_InstallBinaryOps(int tid1, int tid2) { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::type_info& typeinfo = octave::interpreter::the_interpreter()->get_type_info(); -#endif - swigreg_binary_op(add); - swigreg_binary_op(sub); - swigreg_binary_op(mul); - swigreg_binary_op(div); - swigreg_binary_op(pow); - swigreg_binary_op(ldiv); -#if !SWIG_OCTAVE_PREREQ(4,2,0) - swigreg_binary_op(lshift); - swigreg_binary_op(rshift); -#endif - swigreg_binary_op(lt); - swigreg_binary_op(le); - swigreg_binary_op(eq); - swigreg_binary_op(ge); - swigreg_binary_op(gt); - swigreg_binary_op(ne); - swigreg_binary_op(el_mul); - swigreg_binary_op(el_div); - swigreg_binary_op(el_pow); - swigreg_binary_op(el_ldiv); - swigreg_binary_op(el_and); - swigreg_binary_op(el_or); - } - SWIGRUNTIME void SWIG_InstallOps(int tid) { - // here we assume that tid are conseq integers increasing from zero, and - // that our tid is the last one. might be better to have explicit string - // list of types we should bind to, and use lookup_type to resolve their tid. - - SWIG_InstallUnaryOps(tid); - SWIG_InstallBinaryOps(tid, tid); - for (int j = 0; j < tid; ++j) { - SWIG_InstallBinaryOps(j, tid); - SWIG_InstallBinaryOps(tid, j); - } - } - -SWIGRUNTIME octave_value SWIG_Octave_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - int own = (flags &SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - - if (ptr) { -#ifdef SWIG_DIRECTORS - Swig::Director *d = Swig::get_rtdir(ptr); - if (d && Swig::swig_director_get_self(d)) - return Swig::swig_director_get_self(d)->as_value(); -#endif - return Swig::swig_value_ref(new octave_swig_type(ptr, type, own)); - } - return octave_value(Matrix()); // null matrix -} - -SWIGRUNTIME int SWIG_Octave_ConvertPtrAndOwn(octave_value ov, void **ptr, swig_type_info *type, int flags, int *own) { - if ( -#if SWIG_OCTAVE_PREREQ(4,4,0) - ov.iscell() -#else - ov.is_cell() -#endif - && ov.rows() == 1 && ov.columns() == 1) - ov = ov.cell_value()(0); - if (!ov.is_defined() || - (ov.is_matrix_type() && ov.rows() == 0 && ov.columns() == 0) ) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - if (ov.type_id() != octave_swig_ref::static_type_id()) - return SWIG_ERROR; - octave_swig_ref *osr = static_cast < octave_swig_ref *>(ov.internal_rep()); - octave_swig_type *ost = osr->get_ptr(); - return ost->cast(ptr, type, own, flags); -} - -SWIGRUNTIME octave_value SWIG_Octave_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return new octave_swig_packed(type, (char *) ptr, sz); -} - -SWIGRUNTIME int SWIG_Octave_ConvertPacked(const octave_value &ov, void *ptr, size_t sz, swig_type_info *type) { - if (!ov.is_defined()) - return SWIG_ERROR; - if (ov.type_id() != octave_swig_packed::static_type_id()) - return SWIG_ERROR; - octave_swig_packed *ost = static_cast < octave_swig_packed *>(ov.internal_rep()); - return ost->copy(type, (char *) ptr, sz) ? SWIG_OK : SWIG_ERROR; -} - -SWIGRUNTIMEINLINE void SWIG_Octave_SetConstant(octave_swig_type *module_ns, const std::string &name, const octave_value &ov) { - module_ns->assign(name, ov); -} - -SWIGRUNTIMEINLINE octave_value SWIG_Octave_GetGlobalValue(std::string name) { -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::interpreter *interp = octave::interpreter::the_interpreter (); - return interp->global_varval(name); -#else -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - return symtab.global_varval(name); -#else - return get_global_value(name, true); -#endif -#endif -} - -SWIGRUNTIME void SWIG_Octave_SetGlobalValue(std::string name, const octave_value& value) { -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::interpreter *interp = octave::interpreter::the_interpreter (); - interp->global_assign(name, value); -#elif SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - symtab.global_assign(name, value); -#else - set_global_value(name, value); -#endif -} - -SWIGRUNTIME void SWIG_Octave_LinkGlobalValue(std::string name) { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_scope symscope = octave::interpreter::the_interpreter()->get_current_scope(); -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::interpreter *interp = octave::interpreter::the_interpreter (); - interp->assign(name, interp->global_varval(name)); - octave::tree_evaluator& tree_eval = interp->get_evaluator(); - octave::call_stack& callStack = tree_eval.get_call_stack(); - std::shared_ptr stackFrame = callStack.get_current_stack_frame(); - octave::symbol_record sym=symscope.lookup_symbol(name); - stackFrame->mark_global(sym); -#else - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - symscope.assign(name, symtab.global_varval(name)); - symscope.mark_global(name); -#endif -#else -#if !SWIG_OCTAVE_PREREQ(3,2,0) - link_to_global_variable(curr_sym_tab->lookup(name, true)); -#else -#if !SWIG_OCTAVE_PREREQ(3,8,0) - symbol_table::varref(name); -#endif - symbol_table::mark_global(name); -#endif -#endif -} - -SWIGRUNTIME swig_module_info *SWIG_Octave_GetModule(void *clientdata) { - octave_value ov = SWIG_Octave_GetGlobalValue("__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME SWIG_RUNTIME_VERSION); - if (!ov.is_defined() || - ov.type_id() != octave_swig_packed::static_type_id()) - return 0; - const octave_swig_packed* osp = - static_cast < const octave_swig_packed *> (ov.internal_rep()); - swig_module_info *pointer = 0; - osp->copy(0, &pointer, sizeof(swig_module_info *)); - return pointer; -} - -SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info *pointer) { - octave_value ov = new octave_swig_packed(0, &pointer, sizeof(swig_module_info *)); - SWIG_Octave_SetGlobalValue("__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME SWIG_RUNTIME_VERSION, ov); -} diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octruntime.swg b/win64/bin/swig/share/swig/4.1.0/octave/octruntime.swg deleted file mode 100755 index 14ad3a6a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octruntime.swg +++ /dev/null @@ -1,425 +0,0 @@ -#ifdef SWIG_OCTAVE_EXTERNAL_OCTHEADERS -%insert(runtime) %{ -#include "octheaders.hpp" -%} -#else -%insert(runtime) "octheaders.hpp"; -#endif - -%insert(runtime) "swigrun.swg"; -%insert(runtime) "swigerrors.swg"; -%insert(runtime) "octrun.swg"; - -%insert(initbeforefunc) "swiginit.swg" - -%insert(initbeforefunc) %{ - -static bool SWIG_init_user(octave_swig_type* module_ns); - -SWIGINTERN bool SWIG_Octave_LoadModule(std::string name) { - bool retn = false; - { -#if SWIG_OCTAVE_PREREQ(6,0,0) -#elif SWIG_OCTAVE_PREREQ(4,2,0) - octave::unwind_protect frame; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#elif SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect frame; - frame.protect_var(error_state); error_state = 0; - frame.protect_var(warning_state); warning_state = 0; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#else - unwind_protect::begin_frame("SWIG_Octave_LoadModule"); - unwind_protect_int(error_state); error_state = 0; - unwind_protect_int(warning_state); warning_state = 0; - unwind_protect_bool(discard_error_messages); discard_error_messages = true; - unwind_protect_bool(discard_warning_messages); discard_warning_messages = true; -#endif -#if SWIG_OCTAVE_PREREQ(4,2,0) - try { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::feval(name, octave_value_list(), 0); -#else - feval(name, octave_value_list(), 0); -#endif - retn = true; - } catch (octave::execution_exception&) { } -#else - feval(name, octave_value_list(), 0); - retn = (error_state == 0); -#endif -#if !SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect::run_frame("SWIG_Octave_LoadModule"); -#endif - } - if (!retn) { - error(SWIG_name_d ": could not load module `%s'", name.c_str()); - } - return retn; -} - -SWIGINTERN bool SWIG_Octave_InstallFunction(octave_function *octloadfcn, std::string name) { - bool retn = false; - { -#if SWIG_OCTAVE_PREREQ(6,0,0) -#elif SWIG_OCTAVE_PREREQ(4,2,0) - octave::unwind_protect frame; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#elif SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect frame; - frame.protect_var(error_state); error_state = 0; - frame.protect_var(warning_state); warning_state = 0; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -#else - unwind_protect::begin_frame("SWIG_Octave_InstallFunction"); - unwind_protect_int(error_state); error_state = 0; - unwind_protect_int(warning_state); warning_state = 0; - unwind_protect_bool(discard_error_messages); discard_error_messages = true; - unwind_protect_bool(discard_warning_messages); discard_warning_messages = true; -#endif - octave_value_list args; - args.append(name); - args.append(octloadfcn->fcn_file_name()); -#if SWIG_OCTAVE_PREREQ(4,2,0) - try { -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::feval("autoload", args, 0); -#else - feval("autoload", args, 0); -#endif - retn = true; - } catch (octave::execution_exception&) { } -#else - feval("autoload", args, 0); - retn = (error_state == 0); -#endif -#if !SWIG_OCTAVE_PREREQ(3,3,50) - unwind_protect::run_frame("SWIG_Octave_InstallFunction"); -#endif - } - if (!retn) { - error(SWIG_name_d ": could not load function `%s'", name.c_str()); - } - return retn; -} - -static const char *const subclass_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} subclass()\n\ -@deftypefnx{Loadable Function} {} subclass(@var{swigclass}, @var{name}, @var{fcn}, @dots{})\n\ -Subclass a C++ class from within Octave, and provide implementations of its virtual methods.\n\ -\n\ -See the SWIG manual for usage examples.\n\ -@end deftypefn"; - -DEFUN_DLD( subclass, args, nargout, subclass_usage ) { - octave_swig_type *top = new octave_swig_type; - for (int j = 0; j < args.length(); ++j) { - if (args(j).type_id() == octave_swig_ref::static_type_id()) { - octave_swig_ref *osr = static_cast < octave_swig_ref *>(args(j).internal_rep()); - octave_swig_type *ost = osr->get_ptr(); - if (!ost->is_owned()) { - error("subclass: cannot subclass object not constructed on octave side"); - return octave_value_list(); - } - top->merge(*ost); - } else if (args(j).is_function_handle()) { - top->assign(args(j).fcn_handle_value()->fcn_name(), args(j)); - } else if (args(j).is_string()) { - if (j + 1 >= args.length()) { - error("subclass: member assignments must be of string,value form"); - return octave_value_list(); - } - top->assign(args(j).string_value(), args(j + 1)); - ++j; - } else { - error("subclass: invalid arguments to subclass()"); - return octave_value_list(); - } - } - return octave_value(Swig::swig_value_ref(top)); -} - -static const char *const swig_type_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_type(@var{swigref})\n\ -Return the underlying C/C++ type name of a SWIG-wrapped object.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_type, args, nargout, swig_type_usage ) { - if (args.length() != 1) { - error("swig_type: must be called with only a single object"); - return octave_value_list(); - } - octave_swig_type *ost = Swig::swig_value_deref(args(0)); - if (!ost) { - error("swig_type: object is not a swig_ref"); - return octave_value_list(); - } - return octave_value(ost->swig_type_name()); -} - -static const char *const swig_typequery_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_typequery(@var{string})\n\ -Return @var{string} if it is a recognised SWIG-wrapped C/C++ type name;\n\ -otherwise return `'.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_typequery, args, nargout, swig_typequery_usage ) { - if (args.length() != 1 || !args(0).is_string()) { - error("swig_typequery: must be called with single string argument"); - return octave_value_list(); - } - swig_module_info *module = SWIG_GetModule(0); - swig_type_info *type = SWIG_TypeQueryModule(module, module, args(0).string_value().c_str()); - if (!type) - return octave_value(""); - return octave_value(type->name); -} - -static const char *const swig_this_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_this(@var{swigref})\n\ -Return the underlying C/C++ pointer of a SWIG-wrapped object.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_this, args, nargout, swig_this_usage ) { - if (args.length() != 1) { - error("swig_this: must be called with only a single object"); - return octave_value_list(); - } - if (args(0).is_matrix_type() && args(0).rows() == 0 && args(0).columns() == 0) - return octave_value(octave_uint64(0)); - octave_swig_type *ost = Swig::swig_value_deref(args(0)); - if (!ost) { - error("swig_this: object is not a swig_ref"); - return octave_value_list(); - } - return octave_value(octave_uint64((unsigned long long) ost->swig_this())); -} - -static const char *const swig_octave_prereq_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_octave_prereq(@var{major}, @var{minor}, @var{patch})\n\ -Return true if the version of Octave is at least @var{major}.@var{minor}.@var{patch}.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_octave_prereq, args, nargout, swig_octave_prereq_usage ) { - if (args.length() != 3) { - error("swig_octave_prereq: must be called with 3 arguments"); - return octave_value_list(); - } - const int major = args(0).int_value(); - const int minor = args(1).int_value(); - const int patch = args(2).int_value(); - const bool prereq = SWIG_OCTAVE_PREREQ(major, minor, patch); - return octave_value(prereq); -} - -static const char *const swig_exit_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Function} {} swig_exit([@var{exit_status}])\n\ -Exit Octave without performing any memory cleanup.\n\ -@end deftypefn"; - -DEFUN_DLD( swig_exit, args, nargout, swig_exit_usage ) { - if (args.length() > 1) { - error("swig_exit: must be called with at most one arguments"); - return octave_value_list(); - } - int exit_status = 0; - if (args.length() == 1) { - exit_status = args(0).int_value(); - } - ::_Exit(exit_status); - return octave_value(); -} - -static const char *const SWIG_name_usage = "-*- texinfo -*- \n\ -@deftypefn {Loadable Module} {} " SWIG_name_d "\n\ -Loads the SWIG-generated module `" SWIG_name_d "'.\n\ -@end deftypefn"; - -DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) { - - static octave_swig_type* module_ns = 0; - - // workaround to prevent octave seg-faulting on exit: set Octave exit function - // octave_exit to _Exit, which exits immediately without trying to cleanup memory. - // definitely affected version 3.2.*, not sure about 3.3.*, seems to be fixed in - // version 3.4.*, reappeared in 4.2.*, hack not possible in 4.4.* or later due to - // removal of octave_exit, so turn on for all versions between 3.2.*. and 4.4.*. - // can be turned off with macro definition. -#ifndef SWIG_OCTAVE_NO_SEGFAULT_HACK -#if !SWIG_OCTAVE_PREREQ(4,4,0) -#if SWIG_OCTAVE_PREREQ(3,2,0) - octave_exit = ::_Exit; -#endif -#endif -#endif - - // check for no input and output args - if (args.length() != 0 || nargout != 0) { - print_usage(); - return octave_value_list(); - } - - // create module on first function call - if (!module_ns) { - - // workaround bug in octave where installing global variable of custom type and then - // exiting without explicitly clearing the variable causes octave to segfault. -#if SWIG_OCTAVE_PREREQ(3,2,0) - octave_value_list eval_args; - eval_args.append("base"); - eval_args.append("function __swig_atexit__; " - " if mislocked() " - " clear -all; " - " else " - " mlock(); " - " endif; " - "endfunction; " - "__swig_atexit__; " - "atexit(\"__swig_atexit__\", false); " - "atexit(\"__swig_atexit__\")"); -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::feval("evalin", eval_args, 0); -#else - feval("evalin", eval_args, 0); -#endif -#endif - -#if SWIG_OCTAVE_PREREQ(4,4,0) - { - octave::type_info& typeinfo = octave::interpreter::the_interpreter()->get_type_info(); - string_vector types = typeinfo.installed_type_names(); - bool register_octave_swig_ref = true; - bool register_octave_swig_packed = true; - for (int i = 0; i < types.numel(); ++i) { - if (types(i) == octave_swig_ref::static_type_name()) { - register_octave_swig_ref = false; - octave_swig_ref::set_type_id(i); - } - if (types(i) == octave_swig_packed::static_type_name()) { - register_octave_swig_packed = false; - octave_swig_packed::set_type_id(i); - } - } - if (register_octave_swig_ref) { - octave_swig_ref::register_type(); - } - if (register_octave_swig_packed) { - octave_swig_packed::register_type(); - } - } -#else - octave_swig_ref::register_type(); - octave_swig_packed::register_type(); -#endif - SWIG_InitializeModule(0); - SWIG_PropagateClientData(); - -#if SWIG_OCTAVE_PREREQ(6,0,0) - octave::tree_evaluator& tree_eval = octave::interpreter::the_interpreter()->get_evaluator(); - octave::call_stack& stack = tree_eval.get_call_stack(); - octave_function *me = stack.current_function(); -#elif SWIG_OCTAVE_PREREQ(4,4,0) - octave::call_stack& stack = octave::interpreter::the_interpreter()->get_call_stack(); - octave_function *me = stack.current(); -#else - octave_function *me = octave_call_stack::current(); -#endif - - if (!SWIG_Octave_InstallFunction(me, "subclass")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_type")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_typequery")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_this")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_octave_prereq")) { - return octave_value_list(); - } - if (!SWIG_Octave_InstallFunction(me, "swig_exit")) { - return octave_value_list(); - } - - octave_swig_type* cvar_ns=0; - if (std::string(SWIG_global_name) != ".") { - cvar_ns=new octave_swig_type; - for (int j=0;swig_globals[j].name;++j) - if (swig_globals[j].get_method) - cvar_ns->assign(swig_globals[j].name,&swig_globals[j]); - } - - module_ns=new octave_swig_type(0, 0, 0, true); - if (std::string(SWIG_global_name) != ".") { - module_ns->assign(SWIG_global_name,Swig::swig_value_ref(cvar_ns)); - } - else { - for (int j=0;swig_globals[j].name;++j) - if (swig_globals[j].get_method) - module_ns->assign(swig_globals[j].name,&swig_globals[j]); - } - for (int j=0;swig_globals[j].name;++j) - if (swig_globals[j].method) - module_ns->assign(swig_globals[j].name,&swig_globals[j]); - - // * need better solution here; swig_type -> octave_class mapping is - // * really n-to-1, in some cases such as template partial spec, etc. - // * see failing tests. - for (int j=0;swig_types[j];++j) - if (swig_types[j]->clientdata) { - swig_octave_class* c=(swig_octave_class*)swig_types[j]->clientdata; - module_ns->assign(c->name, - Swig::swig_value_ref - (new octave_swig_type(0,swig_types[j]))); - } - - if (!SWIG_init_user(module_ns)) { - delete module_ns; - module_ns=0; - return octave_value_list(); - } - - SWIG_InstallOps(octave_swig_ref::static_type_id()); - - octave_swig_type::swig_member_const_iterator mb; - for (mb = module_ns->swig_members_begin(); mb != module_ns->swig_members_end(); ++mb) { - if (mb->second.first && mb->second.first->method) { - if (!SWIG_Octave_InstallFunction(me, mb->first)) { - return octave_value_list(); - } - } - } - -#if SWIG_OCTAVE_PREREQ(4,4,0) - octave::interpreter::the_interpreter()->mlock(); -#elif SWIG_OCTAVE_PREREQ(3,2,0) - mlock(); -#else - mlock(me->name()); -#endif - - } - - octave_swig_type::swig_member_const_iterator mb; - for (mb = module_ns->swig_members_begin(); mb != module_ns->swig_members_end(); ++mb) { - if (mb->second.second.is_defined()) { - SWIG_Octave_SetGlobalValue(mb->first, mb->second.second); - SWIG_Octave_LinkGlobalValue(mb->first); - } - } - - SWIG_Octave_SetGlobalValue(SWIG_name_d, module_ns->as_value()); - SWIG_Octave_LinkGlobalValue(SWIG_name_d); - - return octave_value_list(); - -} - -%} diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octstdcommon.swg b/win64/bin/swig/share/swig/4.1.0/octave/octstdcommon.swg deleted file mode 100755 index e5770fae..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octstdcommon.swg +++ /dev/null @@ -1,222 +0,0 @@ -%fragment("StdTraits","header",fragment="StdTraitsCommon") -{ -namespace swig { -// Traits that provides the from method - template struct traits_from_ptr { - static octave_value from(Type *val, int owner = 0) { - return SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static octave_value from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static octave_value from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static octave_value from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline octave_value from(const Type& val) { - return traits_from::from(val); - } - - template - inline octave_value from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - // Traits that provides the asval/as/check method - template - struct traits_asptr { - static int asptr(const octave_value& obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(const octave_value& obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(const octave_value& obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(const octave_value& obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(const octave_value& obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(const octave_value& obj) { - Type v; - int res = asval(obj, &v); - if (!obj.is_defined() || !SWIG_IsOK(res)) { - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(const octave_value& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(const octave_value& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - if (!Octave_Error_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(const octave_value& obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(const octave_value& obj) { - int res = asval(obj, (Type *)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(const octave_value& obj) { - int res = asptr(obj, (Type **)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(const octave_value& obj) { - return traits_check::category>::check(obj); - } -} -} - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(const octave_value& obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static octave_value from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(const octave_value& obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef - - -#define specialize_std_vector(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_list(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_deque(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octtypemaps.swg b/win64/bin/swig/share/swig/4.1.0/octave/octtypemaps.swg deleted file mode 100755 index 2321f378..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octtypemaps.swg +++ /dev/null @@ -1,99 +0,0 @@ - -// Include fundamental fragment definitions -%include - -// Look for user fragments file. -%include - -// Octave fragments for primitive types -%include - -// Octave fragments for char* strings -//%include - - -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - -// Octave types -#define SWIG_Object octave_value -#define VOID_Object octave_value() - -/* -// Octave allows implicit conversion -#define %implicitconv_flag $implicitconv -*/ - -// append output -#define SWIG_AppendOutput(result, obj) SWIG_Octave_AppendOutput(result, obj) - -// set constant -#define SWIG_SetConstant(name, obj) SWIG_Octave_SetConstant(module_ns,name,obj) - -// raise -%runtime %{ -SWIGINTERN void SWIG_Octave_Raise(const octave_value &obj, const char *type) { - if (obj.is_string()) - error("%s", obj.string_value().c_str()); - else - error("C++ side threw an exception of type %s", type); -} -%} -#define SWIG_Raise(obj, type, desc) SWIG_Octave_Raise(obj, type) - -// Include the unified typemap library -%include - -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) SWIG_Object "$1 = (*$input).is_defined();"; -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) octave_value_list "$1 = true;"; - -%typemap(in) (octave_value_list varargs,...) { - for (int j=$argnum-1;jappend($1); -} -%typemap(out,noblock=1) octave_map, Octave_map { - $result=$1; -} -%typemap(out,noblock=1) NDArray { - $result=$1; -} -%typemap(out,noblock=1) Cell { - $result=$1; -} - -/* -// Smart Pointers -%typemap(out,noblock=1) const SWIGTYPE & SMARTPOINTER { - $result = SWIG_NewPointerObj(%new_copy(*$1, $*ltype), $descriptor, SWIG_POINTER_OWN | %newpointer_flags); -} - -%typemap(ret) const SWIGTYPE & SMARTPOINTER, SWIGTYPE SMARTPOINTER { - octave_swig_type* lobj=Swig::swig_value_deref($result); - if (lobj) { - std::list idx; - idx.push_back(octave_value("__deref__")); - idx.push_back(octave_value_list()); - octave_value_list ovl(lobj->subsref(".(",idx)); - octave_swig_type* robj=ovl.length()>=1?Swig::swig_value_deref(ovl(0)):0; - if (robj && !error_state) - lobj->append(robj); - } -} -*/ diff --git a/win64/bin/swig/share/swig/4.1.0/octave/octuserdir.swg b/win64/bin/swig/share/swig/4.1.0/octave/octuserdir.swg deleted file mode 100755 index e611d09c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/octuserdir.swg +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------------------------------------- - * Special user directives - * ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ -/* - Implicit Conversion using the C++ constructor mechanism -*/ - -#define %implicitconv %feature("implicitconv") -#define %noimplicitconv %feature("implicitconv", "0") -#define %clearimplicitconv %feature("implicitconv", "") - - -/* ------------------------------------------------------------------------- */ -/* - %extend_smart_pointer extend the smart pointer support. - - For example, if you have a smart pointer as: - - template class RCPtr { - public: - ... - RCPtr(Type *p); - Type * operator->() const; - ... - }; - - you use the %extend_smart_pointer directive as: - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - - then, if you have something like: - - RCPtr make_ptr(); - int foo(A *); - - you can do the following: - - a = make_ptr(); - b = foo(a); - - ie, swig will accept a RCPtr object where a 'A *' is - expected. - - Also, when using vectors - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - %template(vector_A) std::vector >; - - you can type - - a = A(); - v = vector_A(2) - v[0] = a - - ie, an 'A *' object is accepted, via implicit conversion, - where a RCPtr object is expected. Additionally - - x = v[0] - - returns (and sets 'x' as) a copy of v[0], making reference - counting possible and consistent. -*/ - -%define %extend_smart_pointer(Type...) -%implicitconv Type; -%apply const SWIGTYPE& SMARTPOINTER { const Type& }; -%apply SWIGTYPE SMARTPOINTER { Type }; -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_alloc.i b/win64/bin/swig/share/swig/4.1.0/octave/std_alloc.i deleted file mode 100755 index 2b9342fb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/octave/std_auto_ptr.i deleted file mode 100755 index 304f1fc9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_basic_string.i b/win64/bin/swig/share/swig/4.1.0/octave/std_basic_string.i deleted file mode 100755 index 7aed125d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_basic_string.i +++ /dev/null @@ -1,64 +0,0 @@ -#if !defined(SWIG_STD_STRING) -#define SWIG_STD_BASIC_STRING -#define SWIG_STD_MODERN_STL - -%include - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(octave_value obj, std::string **val) { - if (obj.is_string()) { - if (val) - *val = new std::string(obj.string_value()); - return SWIG_NEWOBJ; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromCharPtrAndSize") { -SWIGINTERNINLINE octave_value - SWIG_From(std::basic_string)(const std::string& s) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } -} - -%ignore std::basic_string::operator +=; - -%include -%typemaps_asptrfromn(%checkcode(STRING), std::basic_string); - -#endif - - -#if !defined(SWIG_STD_WSTRING) - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsWCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(octave_value obj, std::wstring **val) { - if (obj.is_string()) { - if (val) - *val = new std::wstring(obj.string_value()); - return SWIG_NEWOBJ; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromWCharPtrAndSize") { -SWIGINTERNINLINE PyObject* - SWIG_From(std::basic_string)(const std::wstring& s) { - return SWIG_FromWCharPtrAndSize(s.data(), s.size()); - } -} - -%typemaps_asptrfromn(%checkcode(UNISTRING), std::basic_string); - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_carray.i b/win64/bin/swig/share/swig/4.1.0/octave/std_carray.i deleted file mode 100755 index e69de29b..00000000 diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_char_traits.i b/win64/bin/swig/share/swig/4.1.0/octave/std_char_traits.i deleted file mode 100755 index e60261f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_common.i b/win64/bin/swig/share/swig/4.1.0/octave/std_common.i deleted file mode 100755 index 73b79be7..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_common.i +++ /dev/null @@ -1,72 +0,0 @@ -%include -%include - - -// Generate the traits for a 'primitive' type, such as 'double', -// for which the SWIG_AsVal and SWIG_From methods are already defined. - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(octave_value obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static octave_value from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(octave_value obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static octave_value from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_complex.i b/win64/bin/swig/share/swig/4.1.0/octave/std_complex.i deleted file mode 100755 index cf10e1d4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_complex.i +++ /dev/null @@ -1,25 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); - - - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_container.i b/win64/bin/swig/share/swig/4.1.0/octave/std_container.i deleted file mode 100755 index accdb130..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_deque.i b/win64/bin/swig/share/swig/4.1.0/octave/std_deque.i deleted file mode 100755 index 75c9a883..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_deque.i +++ /dev/null @@ -1,25 +0,0 @@ -// Deques - -%fragment("StdDequeTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(octave_value obj, std::deque **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static octave_value from(const std::deque& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_except.i b/win64/bin/swig/share/swig/4.1.0/octave/std_except.i deleted file mode 100755 index 3e056e7d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_list.i b/win64/bin/swig/share/swig/4.1.0/octave/std_list.i deleted file mode 100755 index a38e8f89..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_list.i +++ /dev/null @@ -1,26 +0,0 @@ -// Lists - -%fragment("StdListTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const octave_value& obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static octave_value *from(const std::list& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_map.i b/win64/bin/swig/share/swig/4.1.0/octave/std_map.i deleted file mode 100755 index cb4a20c3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_map.i +++ /dev/null @@ -1,157 +0,0 @@ -// Maps - -%include - -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") -{ - namespace swig { - template - struct from_key_oper - { - typedef const ValueType& argument_type; - typedef octave_value result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.first); - } - }; - - template - struct from_value_oper - { - typedef const ValueType& argument_type; - typedef octave_value result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.second); - } - }; - - template - struct OctMapIterator_T : OctSwigIteratorClosed_T - { - OctMapIterator_T(OutIterator curr, OutIterator first, OutIterator last, octave_value seq) - : OctSwigIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct OctMapKeyIterator_T : OctMapIterator_T - { - OctMapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, octave_value seq) - : OctMapIterator_T(curr, first, last, seq) - { - } - }; - - template - inline OctSwigIterator* - make_output_key_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, octave_value seq = octave_value()) - { - return new OctMapKeyIterator_T(current, begin, end, seq); - } - - template > - struct OctMapValueIterator_T : OctMapIterator_T - { - OctMapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, octave_value seq) - : OctMapIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline OctSwigIterator* - make_output_value_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, octave_value seq = 0) - { - return new OctMapValueIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const OctSeq& octseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename OctSeq::const_iterator it = octseq.begin(); - for (;it != octseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::map map_type; - static int asptr(octave_value obj, map_type **val) { - /* - int res = SWIG_ERROR; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - map_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - */ - return SWIG_ERROR; - } - }; - - template - struct traits_from > { - typedef std::map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static octave_value from(const map_type& map) { - /* - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - size_type size = map.size(); - int pysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (pysize < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_OverflowError, - "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - return obj; - } - */ - return octave_value(); - } - }; - } -} - -%define %swig_map_common(Map...) - %swig_sequence_iterator(Map); - %swig_container_methods(Map); -%enddef - -%define %swig_map_methods(Map...) - %swig_map_common(Map) -%enddef - - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_pair.i b/win64/bin/swig/share/swig/4.1.0/octave/std_pair.i deleted file mode 100755 index 30202407..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_pair.i +++ /dev/null @@ -1,147 +0,0 @@ -// Pairs - -%include - -//#define SWIG_STD_PAIR_ASVAL - -%fragment("StdPairTraits","header",fragment="StdTraits") { - namespace swig { -#ifdef SWIG_STD_PAIR_ASVAL - template - struct traits_asval > { - typedef std::pair value_type; - - static int get_pair(const octave_value& first, octave_value second, - std::pair *val) - { - if (val) { - T *pfirst = &(val->first); - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) - return res1; - U *psecond = &(val->second); - int res2 = swig::asval(second, psecond); - if (!SWIG_IsOK(res2)) - return res2; - return res1 > res2 ? res1 : res2; - } else { - T *pfirst = 0; - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) - return res1; - U *psecond = 0; - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) - return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asval(const octave_value& obj, std::pair *val) { - if ( -%#if SWIG_OCTAVE_PREREQ(4,4,0) - obj.iscell() -%#else - obj.is_cell() -%#endif - ) { - Cell c=obj.cell_value(); - if (c.numel()<2) { - error("pair from Cell array requires at least two elements"); - return SWIG_ERROR; - } - return get_pair(c(0),c(1),val); - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) - *val = *p; - return res; - } - return SWIG_ERROR; - } - }; - -#else - template - struct traits_asptr > { - typedef std::pair value_type; - - static int get_pair(const octave_value& first, octave_value second, - std::pair **val) - { - if (val) { - value_type *vp = %new_instance(std::pair); - T *pfirst = &(vp->first); - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) { - %delete(vp); - return res1; - } - U *psecond = &(vp->second); - int res2 = swig::asval(second, psecond); - if (!SWIG_IsOK(res2)) { - %delete(vp); - return res2; - } - *val = vp; - return SWIG_AddNewMask(res1 > res2 ? res1 : res2); - } else { - T *pfirst = 0; - int res1 = swig::asval(first, pfirst); - if (!SWIG_IsOK(res1)) - return res1; - U *psecond = 0; - int res2 = swig::asval(second, psecond); - if (!SWIG_IsOK(res2)) - return res2; - return res1 > res2 ? res1 : res2; - } - return SWIG_ERROR; - } - - static int asptr(const octave_value& obj, std::pair **val) { - if ( -%#if SWIG_OCTAVE_PREREQ(4,4,0) - obj.iscell() -%#else - obj.is_cell() -%#endif - ) { - Cell c=obj.cell_value(); - if (c.numel()<2) { - error("pair from Cell array requires at least two elements"); - return SWIG_ERROR; - } - return get_pair(c(0),c(1),val); - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) - *val = p; - return res; - } - return SWIG_ERROR; - } - }; - -#endif - template - struct traits_from > { - static octave_value from(const std::pair& val) { - Cell c(1,2); - c(0)=swig::from(val.first); - c(1)=swig::from(val.second); - return c; - } - }; - } -} - -%define %swig_pair_methods(pair...) -%enddef - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/octave/std_shared_ptr.i deleted file mode 100755 index 01a0e9dd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_string.i b/win64/bin/swig/share/swig/4.1.0/octave/std_string.i deleted file mode 100755 index 0afc2468..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/octave/std_unique_ptr.i deleted file mode 100755 index 79320de6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_vector.i b/win64/bin/swig/share/swig/4.1.0/octave/std_vector.i deleted file mode 100755 index ba0372ea..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_vector.i +++ /dev/null @@ -1,26 +0,0 @@ -// Vectors - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const octave_value& obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static octave_value from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/std_wstring.i b/win64/bin/swig/share/swig/4.1.0/octave/std_wstring.i deleted file mode 100755 index 0afc2468..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/std_wstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/stl.i b/win64/bin/swig/share/swig/4.1.0/octave/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/octave/swigmove.i b/win64/bin/swig/share/swig/4.1.0/octave/swigmove.i deleted file mode 100755 index 03e87fa2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/octave/typemaps.i b/win64/bin/swig/share/swig/4.1.0/octave/typemaps.i deleted file mode 100755 index da64f2d0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/octave/typemaps.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/Makefile.in b/win64/bin/swig/share/swig/4.1.0/perl5/Makefile.in deleted file mode 100755 index 648c032d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/Makefile.in +++ /dev/null @@ -1,120 +0,0 @@ -# --------------------------------------------------------------- -# SWIG Perl5 Makefile -# -# This file can be used to build various Perl5 extensions with SWIG. -# By default this file is set up for dynamic loading, but it can -# be easily customized for static extensions by modifying various -# portions of the file. -# -# SRCS = C source files -# CXXSRCS = C++ source files -# OBJCSRCS = Objective-C source files -# OBJS = Additional .o files (compiled previously) -# INTERFACE = SWIG interface file -# TARGET = Name of target module or executable -# -# Many portions of this file were created by the SWIG configure -# script and should already reflect your machine. -#---------------------------------------------------------------- - -SRCS = -CXXSRCS = -OBJCSRCS = -OBJS = -INTERFACE = -WRAPFILE = $(INTERFACE:.i=_wrap.c) -WRAPOBJ = $(INTERFACE:.i=_wrap.o) -TARGET = module@SO@ # Use this kind of target for dynamic loading -#TARGET = myperl # Use this target for static linking - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -CC = @CC@ -CXX = @CXX@ -OBJC = @CC@ -Wno-import # -Wno-import needed for gcc -CFLAGS = -INCLUDES = -LIBS = - -# SWIG Options -# SWIG = location of the SWIG executable -# SWIGOPT = SWIG compiler options -# SWIGCC = Compiler used to compile the wrapper file - -SWIG = $(exec_prefix)/bin/swig -SWIGOPT = -perl5 -SWIGCC = $(CC) - -# SWIG Library files. Uncomment this to statically rebuild Perl -#SWIGLIBS = -static -lperlmain.i - -# Rules for creating .o files from source. - -COBJS = $(SRCS:.c=.o) -CXXOBJS = $(CXXSRCS:.cxx=.o) -OBJCOBJS = $(OBJCSRCS:.m=.o) -ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) - -# Command that will be used to build the final extension. -BUILD = $(SWIGCC) - -# Uncomment the following if you are using dynamic loading -CCSHARED = @CCSHARED@ -BUILD = @LDSHARED@ - -# Uncomment the following if you are using dynamic loading with C++ and -# need to provide additional link libraries (this is not always required). - -#DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ - -L/usr/local/lib -lg++ -lstdc++ -lgcc - -# Perl installation - -PERL_INCLUDE = -I@PERL5EXT@ -PERL_LIB = -L@PERL5EXT@ -lperl -PERL_FLAGS = -Dbool=char -Dexplicit= - -# Build libraries (needed for static builds) - -LIBM = @LIBM@ -LIBC = @LIBC@ -SYSLIBS = $(LIBM) $(LIBC) @LIBS@ - -# Build options - -BUILD_LIBS = $(LIBS) # Dynamic loading - -# Compilation rules for non-SWIG components - -.SUFFIXES: .c .cxx .m - -.c.o: - $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - -.cxx.o: - $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< - -.m.o: - $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - - -# ---------------------------------------------------------------------- -# Rules for building the extension -# ---------------------------------------------------------------------- - -all: $(TARGET) - -# Convert the wrapper file into an object file - -$(WRAPOBJ) : $(WRAPFILE) - $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(PERL_INCLUDE) $(PERL_FLAGS) $(WRAPFILE) - -$(WRAPFILE) : $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIBS) $(INTERFACE) - -$(TARGET): $(WRAPOBJ) $(ALLOBJS) - $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) - -clean: - rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/Makefile.pl b/win64/bin/swig/share/swig/4.1.0/perl5/Makefile.pl deleted file mode 100755 index b7eb4053..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/Makefile.pl +++ /dev/null @@ -1,19 +0,0 @@ -# File : Makefile.pl -# MakeMaker file for a SWIG module. Use this file if you are -# producing a module for general use or distribution. -# -# 1. Modify the file as appropriate. Replace $module with the -# real name of your module and wrapper file. -# 2. Run perl as 'perl Makefile.pl' -# 3. Type 'make' to build your module -# 4. Type 'make install' to install your module. -# -# See "Programming Perl", 2nd. Ed, for more gory details than -# you ever wanted to know. - -use ExtUtils::MakeMaker; -WriteMakefile( - 'NAME' => '$module', # Name of your module - 'LIBS' => [''], # Custom libraries (if any) - 'OBJECT' => '$module_wrap.o' # Object files -); diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/argcargv.i b/win64/bin/swig/share/swig/4.1.0/perl5/argcargv.i deleted file mode 100755 index e558a6c5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/argcargv.i +++ /dev/null @@ -1,32 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - int i; - I32 len; - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) { - SWIG_croak("in method '$symname', Expecting reference to argv array"); - goto fail; - } - len = av_len(av) + 1; - $1 = ($1_ltype) len; - $2 = (char **) malloc((len+1)*sizeof(char *)); - for (i = 0; i < len; i++) { - SV **tv = av_fetch(av, i, 0); - $2[i] = SvPV_nolen(*tv); - } - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - AV *av = (AV *)SvRV($input); - $1 = SvTYPE(av) == SVt_PVAV; -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/attribute.i b/win64/bin/swig/share/swig/4.1.0/perl5/attribute.i deleted file mode 100755 index b18f9ae8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/carrays.i b/win64/bin/swig/share/swig/4.1.0/perl5/carrays.i deleted file mode 100755 index 4b0f2369..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/carrays.i +++ /dev/null @@ -1,2 +0,0 @@ -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/cdata.i b/win64/bin/swig/share/swig/4.1.0/perl5/cdata.i deleted file mode 100755 index 1c6de446..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/cmalloc.i b/win64/bin/swig/share/swig/4.1.0/perl5/cmalloc.i deleted file mode 100755 index d3a1222e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/cpointer.i b/win64/bin/swig/share/swig/4.1.0/perl5/cpointer.i deleted file mode 100755 index 0e75cbcd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/cstring.i b/win64/bin/swig/share/swig/4.1.0/perl5/cstring.i deleted file mode 100755 index 033677b3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/director.swg b/win64/bin/swig/share/swig/4.1.0/perl5/director.swg deleted file mode 100755 index 9526915e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/director.swg +++ /dev/null @@ -1,317 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Perl proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DIRECTOR_PERL_HEADER_ -#define SWIG_DIRECTOR_PERL_HEADER_ - -#include -#include -#include -#include -#include - - -/* - Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the - native C++ RTTI and dynamic_cast<>. But be aware that directors - could stop working when using this option. -*/ -#ifdef SWIG_DIRECTOR_NORTTI -/* - When we don't use the native C++ RTTI, we implement a minimal one - only for Directors. -*/ -# ifndef SWIG_DIRECTOR_RTDIR -# define SWIG_DIRECTOR_RTDIR - -namespace Swig { - class Director; - SWIGINTERN std::map& get_rtdir_map() { - static std::map rtdir_map; - return rtdir_map; - } - - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *rtdir) { - get_rtdir_map()[vptr] = rtdir; - } - - SWIGINTERNINLINE Director *get_rtdir(void *vptr) { - std::map::const_iterator pos = get_rtdir_map().find(vptr); - Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0; - return rtdir; - } -} -# endif /* SWIG_DIRECTOR_RTDIR */ - -# define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast(ARG)) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast(ARG1), ARG2) - -#else - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) - -#endif /* SWIG_DIRECTOR_NORTTI */ - -extern "C" { - struct swig_type_info; -} - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() {} - - virtual int get_own() const { - return 0; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem *operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(int own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - int get_own() const { - return _own; - } - - private: - int _own; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - template - struct GCArray_T : GCItem { - GCArray_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCArray_T() { - delete[] _ptr; - } - - private: - Type *_ptr; - }; - - /* base class for director exceptions */ - class DirectorException : public std::exception { - public: - virtual SV *getNative() const = 0; - }; - - /* exceptions emitted by Perl */ - class DirectorMethodException : public DirectorException { - protected: - SV *err; - public: - DirectorMethodException(SV *sv = sv_mortalcopy(ERRSV)) : err(sv) { - SvREFCNT_inc(err); - } - - const char *what() const throw() { - return SvPV_nolen(err); - } - - SV *getNative() const { - return sv_2mortal(newSVsv(err)); - } - - static void raise(SV *sv) { - throw DirectorMethodException(sv); - } - }; - - /* exceptions emitted by wrap code */ - class DirectorWrapException : public DirectorException { - protected: - std::string msg; - DirectorWrapException(const char *str) : msg(str) { - } - - public: - virtual ~DirectorWrapException() throw() { - } - - const char *what() const throw() { - return msg.c_str(); - } - - virtual SV *getNative() const { - return sv_2mortal(newSVpvn(msg.data(), msg.size())); - } - }; - - class DirectorTypeMismatchException : public DirectorWrapException { - public: - DirectorTypeMismatchException(const char *str) : DirectorWrapException(str) { - } - - static void raise(const char *type, const char *msg) { - std::string err = std::string(type); - err += ": "; - err += msg; - throw DirectorTypeMismatchException(err.c_str()); - } - }; - - class DirectorPureVirtualException : public DirectorWrapException { - public: - DirectorPureVirtualException(const char *name) - : DirectorWrapException("SWIG director pure virtual method called: ") { - msg += name; - } - - static void raise(const char *name) { - throw DirectorPureVirtualException(name); - } - }; - - /* director base class */ - class Director { - private: - /* pointer to the wrapped perl object */ - SV *swig_self; - /* class of wrapped perl object */ - std::string swig_class; - /* flag indicating whether the object is owned by perl or c++ */ - mutable bool swig_disown_flag; - - /* decrement the reference count of the wrapped perl object */ - void swig_decref() const { - if (swig_disown_flag) { - SvREFCNT_dec(swig_self); - } - } - - public: - /* wrap a Perl object. */ - Director(SV *pkg) : swig_disown_flag(false) { - STRLEN len; - char *str = SvPV(pkg, len); - swig_class = std::string(str, len); - swig_self = newRV_inc((SV *)newHV()); - } - - /* discard our reference at destruction */ - virtual ~Director() { - swig_decref(); - } - - /* return a pointer to the wrapped Perl object */ - SV *swig_get_self() const { - return swig_self; - } - - const char *swig_get_class() const { - return swig_class.c_str(); - } - - /* acquire ownership of the wrapped Perl object (the sense of "disown" is from perl) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag=true; - swig_incref(); - } - } - - /* increase the reference count of the wrapped Perl object */ - void swig_incref() const { - if (swig_disown_flag) { - SvREFCNT_inc(swig_self); - } - } - - /* methods to implement pseudo protected director members */ - virtual bool swig_get_inner(const char * /* swig_protected_method_name */) const { - return true; - } - - virtual void swig_set_inner(const char * /* swig_protected_method_name */, bool /* swig_val */) const { - } - - /* ownership management */ - private: - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; - - public: - template - void swig_acquire_ownership_array(Type *vptr) const { - if (vptr) { - swig_owner[vptr] = new GCArray_T(vptr); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, int own) const { - if (vptr && own) { - swig_owner[vptr] = new GCItem_Object(own); - } - } - - int swig_release_ownership(void *vptr) const { - int own = 0; - if (vptr) { - swig_ownership_map::iterator iter = swig_owner.find(vptr); - if (iter != swig_owner.end()) { - own = iter->second->get_own(); - swig_owner.erase(iter); - } - } - return own; - } - }; - -} - -#endif - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/exception.i b/win64/bin/swig/share/swig/4.1.0/perl5/exception.i deleted file mode 100755 index a367fef5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/exception.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) -} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/extra-install.list b/win64/bin/swig/share/swig/4.1.0/perl5/extra-install.list deleted file mode 100755 index db5e1c76..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/extra-install.list +++ /dev/null @@ -1,2 +0,0 @@ -# see top-level Makefile.in -Makefile.pl noembed.h diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/factory.i b/win64/bin/swig/share/swig/4.1.0/perl5/factory.i deleted file mode 100755 index 377f0080..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/noembed.h b/win64/bin/swig/share/swig/4.1.0/perl5/noembed.h deleted file mode 100755 index 655e6826..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/noembed.h +++ /dev/null @@ -1,116 +0,0 @@ -/* Workaround perl5 global namespace pollution. Note that undefining library - * functions like fopen will not solve the problem on all platforms as fopen - * might be a macro on Windows but not necessarily on other operating systems. */ -#ifdef do_open - #undef do_open -#endif -#ifdef do_close - #undef do_close -#endif -#ifdef do_exec - #undef do_exec -#endif -#ifdef scalar - #undef scalar -#endif -#ifdef list - #undef list -#endif -#ifdef apply - #undef apply -#endif -#ifdef convert - #undef convert -#endif -#ifdef Error - #undef Error -#endif -#ifdef form - #undef form -#endif -#ifdef vform - #undef vform -#endif -#ifdef LABEL - #undef LABEL -#endif -#ifdef METHOD - #undef METHOD -#endif -#ifdef Move - #undef Move -#endif -#ifdef yylex - #undef yylex -#endif -#ifdef yyparse - #undef yyparse -#endif -#ifdef yyerror - #undef yyerror -#endif -#ifdef invert - #undef invert -#endif -#ifdef ref - #undef ref -#endif -#ifdef read - #undef read -#endif -#ifdef write - #undef write -#endif -#ifdef eof - #undef eof -#endif -#ifdef close - #undef close -#endif -#ifdef rewind - #undef rewind -#endif -#ifdef free - #undef free -#endif -#ifdef malloc - #undef malloc -#endif -#ifdef calloc - #undef calloc -#endif -#ifdef Stat - #undef Stat -#endif -#ifdef check - #undef check -#endif -#ifdef seekdir - #undef seekdir -#endif -#ifdef open - #undef open -#endif -#ifdef readdir - #undef readdir -#endif -#ifdef bind - #undef bind -#endif -#ifdef access - #undef access -#endif -#ifdef stat - #undef stat -#endif -#ifdef seed - #undef seed -#endif - -#ifdef bool - /* Leave if macro is from C99 stdbool.h */ - #ifndef __bool_true_false_are_defined - #undef bool - #endif -#endif - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perl5.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perl5.swg deleted file mode 100755 index 157302fd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perl5.swg +++ /dev/null @@ -1,42 +0,0 @@ -/* ------------------------------------------------------------ - * perl.swg - * - * Perl configuration module. - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Perl keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Perl initialization function - * ------------------------------------------------------------ */ -%include - - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlerrors.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlerrors.swg deleted file mode 100755 index 8b6d8efb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlerrors.swg +++ /dev/null @@ -1,34 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGINTERN const char* -SWIG_Perl_ErrorType(int code) { - switch(code) { - case SWIG_MemoryError: - return "MemoryError"; - case SWIG_IOError: - return "IOError"; - case SWIG_RuntimeError: - return "RuntimeError"; - case SWIG_IndexError: - return "IndexError"; - case SWIG_TypeError: - return "TypeError"; - case SWIG_DivisionByZero: - return "ZeroDivisionError"; - case SWIG_OverflowError: - return "OverflowError"; - case SWIG_SyntaxError: - return "SyntaxError"; - case SWIG_ValueError: - return "ValueError"; - case SWIG_SystemError: - return "SystemError"; - case SWIG_AttributeError: - return "AttributeError"; - default: - return "RuntimeError"; - } -} - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlfragments.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlfragments.swg deleted file mode 100755 index 3a0bcbe1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'perlfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the ones defined by default by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlhead.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlhead.swg deleted file mode 100755 index ee355265..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlhead.swg +++ /dev/null @@ -1,91 +0,0 @@ -#ifdef __cplusplus -/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ -#include -#include -extern "C" { -#endif - -#if __GNUC__ >= 10 -#if defined(__cplusplus) -#pragma GCC diagnostic ignored "-Wvolatile" -#endif -#endif - -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#if __GNUC__ >= 10 -#pragma GCC diagnostic pop -#endif - -/* PERL_REVISION was added in Perl 5.6. */ -#if !defined PERL_REVISION || (PERL_REVISION-0 == 5 && PERL_VERSION-0 < 8) -# error SWIG requires Perl >= 5.8.0 -#endif - -#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) -#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) -#endif - -#ifndef SvIOK_UV -# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv))) -#endif - -#ifndef SvUOK -# define SvUOK(sv) SvIOK_UV(sv) -#endif - -#ifndef IVSIZE -# ifdef LONGSIZE -# define IVSIZE LONGSIZE -# else -# define IVSIZE 4 /* A bold guess, but the best we can make. */ -# endif -#endif - -#ifndef INT2PTR -# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) -# define PTRV UV -# define INT2PTR(any,d) (any)(d) -# else -# if PTRSIZE == LONGSIZE -# define PTRV unsigned long -# else -# define PTRV unsigned -# endif -# define INT2PTR(any,d) (any)(PTRV)(d) -# endif - -# define NUM2PTR(any,d) (any)(PTRV)(d) -# define PTR2IV(p) INT2PTR(IV,p) -# define PTR2UV(p) INT2PTR(UV,p) -# define PTR2NV(p) NUM2PTR(NV,p) - -# if PTRSIZE == LONGSIZE -# define PTR2ul(p) (unsigned long)(p) -# else -# define PTR2ul(p) INT2PTR(unsigned long,p) -# endif -#endif /* !INT2PTR */ - -#ifndef SvPV_nolen -# define SvPV_nolen(x) SvPV(x,PL_na) -#endif - -#ifndef get_sv -# define get_sv perl_get_sv -#endif - -#ifndef ERRSV -# define ERRSV get_sv("@",FALSE) -#endif - -#ifndef pTHX_ -#define pTHX_ -#endif - -#include -#ifdef __cplusplus -} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlinit.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlinit.swg deleted file mode 100755 index 2a5e15c0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlinit.swg +++ /dev/null @@ -1,78 +0,0 @@ - -/* Export the SWIG initialization function */ -%header %{ -#ifdef __cplusplus -extern "C" -#endif -#ifndef MULTIPLICITY -SWIGEXPORT void SWIG_init (CV* cv); -#else -SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); -#endif -%} - -/* Module initialization function */ - -%insert(init) "swiginit.swg" - -%init %{ - -#if defined(__cplusplus) && ! defined(XSPROTO) -extern "C" -#endif - -XS(SWIG_init) { - dXSARGS; - int i; - (void)items; - - SWIG_InitializeModule(0); - - /* Install commands */ - for (i = 0; swig_commands[i].name; i++) { - /* Casts only needed for Perl < 5.10. */ -#ifdef __cplusplus - newXS(const_cast(swig_commands[i].name), swig_commands[i].wrapper, const_cast(__FILE__)); -#else - newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__); -#endif - } - - /* Install variables */ - for (i = 0; swig_variables[i].name; i++) { - SV *sv; - sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); - if (swig_variables[i].type) { - SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); - } else { - sv_setiv(sv,(IV) 0); - } - swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); - } - - /* Install constant */ - for (i = 0; swig_constants[i].type; i++) { - SV *sv; - sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); - switch(swig_constants[i].type) { - case SWIG_INT: - sv_setiv(sv, (IV) swig_constants[i].lvalue); - break; - case SWIG_FLOAT: - sv_setnv(sv, (double) swig_constants[i].dvalue); - break; - case SWIG_STRING: - sv_setpv(sv, (const char *) swig_constants[i].pvalue); - break; - case SWIG_POINTER: - SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); - break; - case SWIG_BINARY: - SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); - break; - default: - break; - } - SvREADONLY_on(sv); - } -%} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlkw.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlkw.swg deleted file mode 100755 index 45deac6c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlkw.swg +++ /dev/null @@ -1,251 +0,0 @@ -/* Warnings for Perl keywords */ -#define PERLKW(x) %keywordwarn("'" `x` "' is a perl keyword") `x` -#define PERLBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in perl") "::" `x` - - -/* - - From http://www.rocketaware.com/perl/perlfunc/ - -*/ - -/* Functions for SCALARs or strings*/ -PERLBN(chomp); -PERLBN(chop); -PERLBN(chr); -PERLBN(crypt); -PERLBN(hex); -PERLBN(index); -PERLBN(lc); -PERLBN(lcfirst); -PERLBN(length); -PERLBN(oct); -PERLBN(ord); -PERLBN(pack); -PERLBN(reverse); -PERLBN(rindex); -PERLBN(sprintf); -PERLBN(substr); -PERLBN(uc); -PERLBN(ucfirst); - -/* Regular expressions and pattern matching */ -PERLBN(m); -PERLBN(pos); -PERLBN(quotemeta); -PERLBN(split); -PERLBN(study); - -/* Numeric functions */ -PERLBN(abs); -PERLBN(atan2); -PERLBN(cos); -PERLBN(exp); -PERLBN(hex); -PERLBN(int); -PERLBN(log); -PERLBN(oct); -PERLBN(rand); -PERLBN(sin); -PERLBN(sqrt); -PERLBN(srand); - - -/* Functions for real @ARRAYs*/ -PERLBN(pop); -PERLBN(push); -PERLBN(shift); -PERLBN(splice); -PERLBN(unshift); - -/* Functions for list data*/ -PERLBN(grep); -PERLBN(join); -PERLBN(map); -PERLBN(qw); -PERLBN(reverse); -PERLBN(sort); -PERLBN(unpack); - - -/* Functions for real %HASHes*/ -PERLBN(delete); -PERLBN(each); -PERLBN(exists); -PERLBN(keys); -PERLBN(values); - - -/* Input and output functions*/ - -PERLBN(binmode); -PERLBN(close); -PERLBN(closedir); -PERLBN(dbmclose); -PERLBN(dbmopen); -PERLBN(die); -PERLBN(eof); -PERLBN(fileno); -PERLBN(flock); -PERLBN(format); -PERLBN(getc); -PERLBN(print); -PERLBN(printf); -PERLBN(read); -PERLBN(readdir); -PERLBN(rewinddir); -PERLBN(seek); -PERLBN(seekdir); -PERLBN(select); -PERLBN(syscall); -PERLBN(sysread); -PERLBN(sysseek); -PERLBN(syswrite); -PERLBN(tell); -PERLBN(telldir); -PERLBN(truncate); -PERLBN(warn); -PERLBN(write); - - -/* Functions for fixed length data or records*/ -PERLBN(pack); -PERLBN(read); -PERLBN(syscall); -PERLBN(sysread); -PERLBN(syswrite); -PERLBN(unpack); -PERLBN(vec); - - -/* Functions for filehandles, files, or directories */ -PERLBN(chdir); -PERLBN(chmod); -PERLBN(chown); -PERLBN(chroot); -PERLBN(fcntl); -PERLBN(glob); -PERLBN(ioctl); -PERLBN(link); -PERLBN(lstat); -PERLBN(mkdir); -PERLBN(open); -PERLBN(opendir); -PERLBN(readlink); -PERLBN(rename); -PERLBN(rmdir); -PERLBN(stat); -PERLBN(symlink); -PERLBN(umask); -PERLBN(unlink); -PERLBN(utime); - - -/* Keywords related to the control flow of your perl program */ -PERLKW(caller); -PERLKW(continue); -PERLKW(die); -PERLKW(do); -PERLKW(dump); -PERLKW(eval); -PERLKW(exit); -PERLKW(goto); -PERLKW(last); -PERLKW(next); -PERLKW(redo); -PERLKW(return); -PERLKW(sub); -PERLKW(wantarray); - - -/* Keywords related to scoping */ -PERLKW(caller); -PERLKW(import); -PERLKW(local); -PERLKW(my); -PERLKW(package); -PERLKW(use); - - -/* Miscellaneous functions */ -PERLBN("defined"); -PERLBN(dump); -PERLBN(eval); -PERLBN(formline); -PERLBN(local); -PERLBN(my); -PERLBN(reset); -PERLBN(scalar); -PERLBN(undef); -PERLBN(wantarray); - - -/* Functions for processes and process groups */ -PERLBN(alarm); -PERLBN(exec); -PERLBN(fork); -PERLBN(getpgrp); -PERLBN(getppid); -PERLBN(getpriority); -PERLBN(kill); -PERLBN(pipe); -PERLBN(setpgrp); -PERLBN(setpriority); -PERLBN(sleep); -PERLBN(system); -PERLBN(times); -PERLBN(wait); -PERLBN(waitpid); - - -/* Keywords related to perl modules */ -PERLKW(do); -PERLKW(import); -PERLKW(no); -PERLKW(package); -PERLKW(require); -PERLKW(use); - - -/* Keywords related to classes and object-orientedness */ -PERLKW(bless); -PERLKW(dbmclose); -PERLKW(dbmopen); -PERLKW(package); -PERLKW(ref); -PERLKW(tie); -PERLKW(tied); -PERLKW(untie); -PERLKW(use); - -/* Functions new in perl5 */ -PERLBN(abs); -PERLBN(bless); -PERLBN(chomp); -PERLBN(chr); -PERLBN(exists); -PERLBN(formline); -PERLBN(glob); -PERLBN(import); -PERLBN(lc); -PERLBN(lcfirst); -PERLBN(map); -PERLBN(my); -PERLBN(no); -PERLBN(prototype); -PERLBN(qx); -PERLBN(qw); -PERLBN(readline); -PERLBN(readpipe); -PERLBN(ref); -PERLBN(sub); -PERLBN(sysopen); -PERLBN(tie); -PERLBN(tied); -PERLBN(uc); -PERLBN(ucfirst); -PERLBN(untie); -PERLBN(use); - -#undef PERLKW -#undef PERLBN diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlmacros.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlmacros.swg deleted file mode 100755 index b14854ba..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlmacros.swg +++ /dev/null @@ -1,2 +0,0 @@ -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlmain.i b/win64/bin/swig/share/swig/4.1.0/perl5/perlmain.i deleted file mode 100755 index cc0a1200..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlmain.i +++ /dev/null @@ -1,82 +0,0 @@ -/* ----------------------------------------------------------------------------- - * perlmain.i - * - * Code to statically rebuild perl5. - * ----------------------------------------------------------------------------- */ - -#ifdef AUTODOC -%subsection "perlmain.i" -%text %{ -This module provides support for building a new version of the -Perl executable. This will be necessary on systems that do -not support shared libraries and may be necessary with C++ -extensions. - -This module may only build a stripped down version of the -Perl executable. Thus, it may be necessary (or desirable) -to hand-edit this file for your particular application. To -do this, simply copy this file from swig_lib/perl5/perlmain.i -to your working directory and make the appropriate modifications. - -This library file works with Perl 5.003. It may work with earlier -versions, but it hasn't been tested. As far as I know, this -library is C++ safe. -%} -#endif - -%{ - -static void xs_init _((pTHX)); -static PerlInterpreter *my_perl; - -int perl_eval(char *string) { - char *argv[2]; - argv[0] = string; - argv[1] = (char *) 0; - return perl_call_argv("eval",0,argv); -} - -int -main(int argc, char **argv, char **env) -{ - int exitstatus; - - my_perl = perl_alloc(); - if (!my_perl) - exit(1); - perl_construct( my_perl ); - - exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL ); - if (exitstatus) - exit( exitstatus ); - - /* Initialize all of the module variables */ - - exitstatus = perl_run( my_perl ); - - perl_destruct( my_perl ); - perl_free( my_perl ); - - exit( exitstatus ); -} - -/* Register any extra external extensions */ - -/* Do not delete this line--writemain depends on it */ -/* EXTERN_C void boot_DynaLoader _((CV* cv)); */ - -static void -xs_init(pTHX) -{ -/* dXSUB_SYS; */ - char *file = __FILE__; - { - /* newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); */ - newXS(SWIG_name, SWIG_init, file); -#ifdef SWIGMODINIT - SWIGMODINIT -#endif - } -} - -%} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlopers.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlopers.swg deleted file mode 100755 index b65e1963..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlopers.swg +++ /dev/null @@ -1,54 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus - -// These are auto-supported by the Perl-module -%rename(__plusplus__) *::operator++; -%rename(__minmin__) *::operator--; -%rename(__add__) *::operator+; -%rename(__sub__) *::operator-; -%rename(__neg__) *::operator-(); -%rename(__neg__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__eq__) *::operator==; -%rename(__ne__) *::operator!=; -%rename(__mod__) *::operator%; -%rename(__gt__) *::operator>; -%rename(__lt__) *::operator<; -%rename(__not__) *::operator!; -%rename(__le__) *::operator<=; -%rename(__ge__) *::operator>=; -%rename(__and__) *::operator&; -%rename(__or__) *::operator|; -%rename(__iadd__) *::operator+=; -%rename(__isub__) *::operator-=; - -// These are renamed, but no test exists in operator_overload_runme.pl -%ignoreoperator(EQ) operator=; - -// These are renamed, but no 'use overload...' is added -%rename(__lshift__) *::operator<<; -%rename(__rshift__) *::operator>>; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__call__) *::operator(); - -/* Ignored operators */ -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; -%ignoreoperator(ARROWSTAR) operator->*; -%ignoreoperator(INDEX) operator[]; - - -#endif /* __cplusplus */ diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlprimtypes.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlprimtypes.swg deleted file mode 100755 index e04b7439..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlprimtypes.swg +++ /dev/null @@ -1,364 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* bool */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(bool)(bool value) -{ - return boolSV(value); -} -} - -%fragment(SWIG_AsVal_frag(bool),"header") { -SWIGINTERN int -SWIG_AsVal_dec(bool)(SV *obj, bool* val) -{ - if (obj == &PL_sv_yes) { - if (val) *val = true; - return SWIG_OK; - } else if (obj == &PL_sv_no) { - if (val) *val = false; - return SWIG_OK; - } else { - if (val) *val = SvTRUE(obj) ? true : false; - return SWIG_AddCast(SWIG_OK); - } -} -} - - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(long)(long value) -{ - SV *sv; - if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX)) - sv = newSViv(value); - else - sv = newSVpvf("%ld", value); - return sv_2mortal(sv); -} -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="", - fragment="", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(long)(SV *obj, long* val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - if (UVSIZE < sizeof(*val) || v <= LONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) { - if(val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - long v; - errno = 0; - v = strtol(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(unsigned long)(unsigned long value) -{ - SV *sv; - if (UVSIZE >= sizeof(value) || value <= UV_MAX) - sv = newSVuv(value); - else - sv = newSVpvf("%lu", value); - return sv_2mortal(sv); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="", - fragment="", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(SV *obj, unsigned long *val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - if (UVSIZE <= sizeof(*val) || v <= ULONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - unsigned long v; - errno = 0; - v = strtoul(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SV * -SWIG_From_dec(long long)(long long value) -{ - SV *sv; - if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX)) - sv = newSViv((IV)(value)); - else { - //sv = newSVpvf("%lld", value); doesn't work in non 64bit Perl - char temp[256]; - sprintf(temp, "%lld", value); - sv = newSVpv(temp, 0); - } - return sv_2mortal(sv); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="", - fragment="SWIG_CanCastAsInteger") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(SV *obj, long long *val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - /* pretty sure this could allow v == LLONG MAX */ - if (UVSIZE < sizeof(*val) || v < LLONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (IVSIZE <= sizeof(*val) || (v >= LLONG_MIN && v <= LLONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - long long v; - errno = 0; - v = strtoll(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - const double mant_max = 1LL << DBL_MANT_DIG; - const double mant_min = -mant_max; - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { - if (val) *val = (long long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SV * -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - SV *sv; - if (UVSIZE >= sizeof(value) || value <= UV_MAX) - sv = newSVuv((UV)(value)); - else { - //sv = newSVpvf("%llu", value); doesn't work in non 64bit Perl - char temp[256]; - sprintf(temp, "%llu", value); - sv = newSVpv(temp, 0); - } - return sv_2mortal(sv); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="", - fragment="SWIG_CanCastAsInteger") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(SV *obj, unsigned long long *val) -{ - if (SvUOK(obj)) { - /* pretty sure this should be conditional on - * (UVSIZE <= sizeof(*val) || v <= ULLONG_MAX) */ - if (val) *val = SvUV(obj); - return SWIG_OK; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULLONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - unsigned long long v; - errno = 0; - v = strtoull(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERNINLINE SV * -SWIG_From_dec(double)(double value) -{ - return sv_2mortal(newSVnv(value)); -} -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(SV *obj, double *val) -{ - if (SvNIOK(obj)) { - if (val) *val = SvNV(obj); - return SWIG_OK; - } else if (SvIOK(obj)) { - if (val) *val = (double) SvIV(obj); - return SWIG_AddCast(SWIG_OK); - } else { - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - double v; - errno = 0; - v = strtod(nptr, &endptr); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - } - return SWIG_TypeError; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlrun.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlrun.swg deleted file mode 100755 index 2c8c4466..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlrun.swg +++ /dev/null @@ -1,493 +0,0 @@ -/* ----------------------------------------------------------------------------- - * perlrun.swg - * - * This file contains the runtime support for Perl modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -#define SWIG_PERL_OBJECT_DECL -#define SWIG_PERL_OBJECT_CALL - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) -#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own) -#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) -#define SWIG_AcquirePtr(ptr, src) SWIG_Perl_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) -#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) -#define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - -/* Perl-specific SWIG API */ - -#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags) -#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type) -#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str) - - -#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1) -#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1) -#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2) -#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2) - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 - -#ifdef __cplusplus -extern "C" { -#endif - -#define SWIG_OWNER SWIG_POINTER_OWN -#define SWIG_SHADOW SWIG_OWNER << 1 - -#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL - -/* SWIG Perl macros */ - -/* Macro to declare an XS function */ -#ifndef XSPROTO -# define XSPROTO(name) void name(pTHX_ CV* cv) -#endif - -/* Macro to call an XS function */ -#ifndef MULTIPLICITY -# define SWIG_CALLXS(_name) _name(cv) -#else -# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) -#endif - -#define MAGIC_PPERL -#define SWIGCLASS_STATIC static SWIGUNUSED - -#ifndef MULTIPLICITY -#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFunc)(SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#else /* MULTIPLICITY */ - -#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#endif /* MULTIPLICITY */ - -static void SWIGUNUSED SWIG_croak_null() -{ - SV *err = get_sv("@", GV_ADD); - if (sv_isobject(err)) - croak(0); - else - croak("%s", SvPV_nolen(err)); -} - - -/* - Define how strict is the cast between strings and integers/doubles - when overloading between these types occurs. - - The default is making it as strict as possible by using SWIG_AddCast - when needed. - - You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to - disable the SWIG_AddCast, making the casting between string and - numbers less strict. - - In the end, we try to solve the overloading between strings and - numerical types in the more natural way, but if you can avoid it, - well, avoid it using %rename, for example. -*/ -#ifndef SWIG_PERL_NO_STRICT_STR2NUM -# ifndef SWIG_PERL_STRICT_STR2NUM -# define SWIG_PERL_STRICT_STR2NUM -# endif -#endif -#ifdef SWIG_PERL_STRICT_STR2NUM -/* string takes precedence */ -#define SWIG_Str2NumCast(x) SWIG_AddCast(x) -#else -/* number takes precedence */ -#define SWIG_Str2NumCast(x) x -#endif - - - -#include - -SWIGRUNTIME const char * -SWIG_Perl_TypeProxyName(const swig_type_info *type) { - if (!type) return NULL; - if (type->clientdata != NULL) { - return (const char*) type->clientdata; - } - else { - return type->name; - } -} - -/* Identical to SWIG_TypeCheck, except for strcmp comparison */ -SWIGRUNTIME swig_cast_info * -SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, int own) { - /* TODO */ - return 0; -} - -/* Function for getting a pointer value */ - -SWIGRUNTIME int -SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) { - swig_cast_info *tc; - void *voidptr = (void *)0; - SV *tsv = 0; - int check_owned_pointer_release = (flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE; - - if (own) - *own = 0; - - /* If magical, apply more magic */ - if (SvGMAGICAL(sv)) - mg_get(sv); - - /* Check to see if this is an object */ - if (sv_isobject(sv)) { - IV tmp = 0; - tsv = (SV*) SvRV(sv); - if ((SvTYPE(tsv) == SVt_PVHV)) { - MAGIC *mg; - if (SvMAGICAL(tsv)) { - mg = mg_find(tsv,'P'); - if (mg) { - sv = mg->mg_obj; - if (sv_isobject(sv)) { - tsv = (SV*)SvRV(sv); - tmp = SvIV(tsv); - } - } - } else { - return SWIG_ERROR; - } - } else { - tmp = SvIV(tsv); - } - voidptr = INT2PTR(void *,tmp); - } else if (! SvOK(sv)) { /* Check for undef */ - *(ptr) = (void *) 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ - if (!SvROK(sv)) { - /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */ - if (SvIOK(sv)) { - return SWIG_ERROR; - } else { - /* NULL pointer (reference to undef). */ - *(ptr) = (void *) 0; - return SWIG_OK; - } - } else { - return SWIG_ERROR; - } - } else { /* Don't know what it is */ - return SWIG_ERROR; - } - if (_t) { - /* Now see if the types match */ - char *_c = HvNAME(SvSTASH(SvRV(sv))); - tc = SWIG_TypeProxyCheck(_c,_t); -#ifdef SWIG_DIRECTORS - if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) { -#else - if (!tc) { -#endif - return SWIG_ERROR; - } - { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - } else { - *ptr = voidptr; - } - - /* - * DISOWN implementation: we need a perl guru to check this one. - */ - if (tsv && ((flags & SWIG_POINTER_DISOWN) || check_owned_pointer_release)) { - /* - * almost copy paste code from below SWIG_POINTER_OWN setting - */ - SV *obj = sv; - HV *stash = SvSTASH(SvRV(obj)); - GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); - int owned = 0; - if (isGV(gv)) { - HV *hv = GvHVn(gv); - /* - * To set ownership (see below), a newSViv(1) entry is added. - * Hence, to remove ownership, we delete the entry. - */ - if (hv_exists_ent(hv, obj, 0)) { - owned = 1; - if (flags & SWIG_POINTER_DISOWN) { - hv_delete_ent(hv, obj, 0, 0); - } - } - } - if (check_owned_pointer_release && !owned) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - } - - if (tsv && (flags & SWIG_POINTER_CLEAR)) { - SvIV_set(tsv, 0); - } - - return SWIG_OK; -} - -SWIGRUNTIME int -SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { - return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0); -} - -SWIGRUNTIME void -SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { - if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) { - SV *self; - SV *obj=newSV(0); - HV *hash=newHV(); - HV *stash; - sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr); - stash=SvSTASH(SvRV(obj)); - if (flags & SWIG_POINTER_OWN) { - HV *hv; - GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); - if (!isGV(gv)) - gv_init(gv, stash, "OWNER", 5, FALSE); - hv=GvHVn(gv); - hv_store_ent(hv, obj, newSViv(1), 0); - } - sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); - SvREFCNT_dec(obj); - self=newRV_noinc((SV *)hash); - sv_setsv(sv, self); - SvREFCNT_dec((SV *)self); - sv_bless(sv, stash); - } - else { - sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr); - } -} - -SWIGRUNTIMEINLINE SV * -SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { - SV *result = sv_newmortal(); - SWIG_MakePtr(result, ptr, t, flags); - return result; -} - -SWIGRUNTIME void -SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - strcpy(r,SWIG_Perl_TypeProxyName(type)); - sv_setpv(sv, result); -} - -SWIGRUNTIME SV * -SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) { - SV *result = sv_newmortal(); - SWIG_Perl_MakePackedObj(result, ptr, sz, type); - return result; -} - -/* Convert a packed pointer value */ -SWIGRUNTIME int -SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c = 0; - - if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; - c = SvPV_nolen(obj); - /* Pointer values must start with leading underscore */ - if (*c != '_') return SWIG_ERROR; - c++; - c = SWIG_UnpackData(c,ptr,sz); - if (ty) { - tc = SWIG_TypeCheck(c,ty); - if (!tc) return SWIG_ERROR; - } - return SWIG_OK; -} - - -/* Macros for low-level exception handling */ -#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; } - - -typedef XSPROTO(SwigPerlWrapper); -typedef SwigPerlWrapper *SwigPerlWrapperPtr; - -/* Structure for command table */ -typedef struct { - const char *name; - SwigPerlWrapperPtr wrapper; -} swig_command_info; - -/* Information for constant table */ - -#define SWIG_INT 1 -#define SWIG_FLOAT 2 -#define SWIG_STRING 3 -#define SWIG_POINTER 4 -#define SWIG_BINARY 5 - -/* Constant information structure */ -typedef struct swig_constant_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_constant_info; - - -/* Structure for variable table */ -typedef struct { - const char *name; - SwigMagicFunc set; - SwigMagicFunc get; - swig_type_info **type; -} swig_variable_info; - -/* Magic variable code */ -#ifdef __cplusplus -# define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast(a),b,c) -#else -# define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c) -#endif -#ifndef MULTIPLICITY -SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) -#else -SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) -#endif -{ - MAGIC *mg; - sv_magic(sv,sv,'U',name,strlen(name)); - mg = mg_find(sv,'U'); - mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); - mg->mg_virtual->svt_get = (SwigMagicFunc) get; - mg->mg_virtual->svt_set = (SwigMagicFunc) set; - mg->mg_virtual->svt_len = 0; - mg->mg_virtual->svt_clear = 0; - mg->mg_virtual->svt_free = 0; -} - - -SWIGRUNTIME swig_module_info * -SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - static void *type_pointer = (void *)0; - SV *pointer; - - /* first check if pointer already created */ - if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); - if (pointer && SvOK(pointer)) { - type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); - } - } - - return (swig_module_info *) type_pointer; -} - -SWIGRUNTIME void -SWIG_Perl_SetModule(swig_module_info *module) { - SV *pointer; - - /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); - sv_setiv(pointer, PTR2IV(module)); -} - -#ifdef __cplusplus -} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlruntime.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlruntime.swg deleted file mode 100755 index 43ff5a71..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlruntime.swg +++ /dev/null @@ -1,8 +0,0 @@ - -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors -%runtime "perlhead.swg" // Perl includes and fixes -%runtime "perlerrors.swg" // Perl errors -%runtime "perlrun.swg" // Perl runtime functions -%runtime "noembed.h" // undefine Perl5 macros - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perlstrings.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perlstrings.swg deleted file mode 100755 index b418a04c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perlstrings.swg +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) -{ - if (SvMAGICAL(obj)) { - SV *tmp = sv_newmortal(); - SvSetSV(tmp, obj); - obj = tmp; - } - if (SvPOK(obj)) { - STRLEN len = 0; - char *cstr = SvPV(obj, len); - size_t size = len + 1; - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, size, char); - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } - } - if (psize) *psize = size; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - char* vptr = 0; - if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = vptr; - if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header") { -SWIGINTERNINLINE SV * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - SV *obj = sv_newmortal(); - if (carray) { - sv_setpvn(obj, carray, size); - } else { - sv_setsv(obj, &PL_sv_undef); - } - return obj; -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perltypemaps.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perltypemaps.swg deleted file mode 100755 index d45b86e8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perltypemaps.swg +++ /dev/null @@ -1,104 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Perl - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ - -/* - in Perl we need to pass the CPerlObj value, sometimes, so, we define - the decl/call macros as needed. -*/ - -#define SWIG_AS_DECL_ARGS SWIG_PERL_DECL_ARGS_2 -#define SWIG_AS_CALL_ARGS SWIG_PERL_CALL_ARGS_2 - -#define SWIG_FROM_DECL_ARGS SWIG_PERL_DECL_ARGS_1 -#define SWIG_FROM_CALL_ARGS SWIG_PERL_CALL_ARGS_1 - - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Perl fragments for primitive types */ -%include - -/* Perl fragments for char* strings */ -%include - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* director support in Perl is experimental */ -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Perl types */ -#define SWIG_Object SV * -#define VOID_Object &PL_sv_undef - -/* Perl $shadow flag */ -#define %newpointer_flags $shadow -#define %newinstance_flags $shadow - - -/* Complete overload of the output/constant/exception macros */ - -/* output */ -%define %set_output(obj) $result = obj; argvi++ %enddef - -/* append output */ -%define %append_output(obj) -if (argvi >= items) EXTEND(sp, argvi+1); -%set_output(obj) %enddef - -/* variable output */ -%define %set_varoutput(obj) sv_setsv($result,obj) %enddef - -/* constant */ -%define %set_constant(name, obj) %begin_block - SV *sv = get_sv((char*) SWIG_prefix name, TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, obj); - SvREADONLY_on(sv); -%end_block %enddef - -/* raise exception */ -%define %raise(obj, type, desc) sv_setsv(get_sv("@", GV_ADD), obj); SWIG_fail %enddef - -/* For directors to raise/throw the original exception */ -%typemap(throws) Swig::DirectorException -%{ sv_setsv(ERRSV, $1.getNative()); SWIG_fail; %} - -/* Include the unified typemap library */ -%include - -/* ------------------------------------------------------------ - * Perl extra typemaps / typemap overrides - * ------------------------------------------------------------ */ - -%typemap(varout,type="$1_descriptor") SWIGTYPE *, SWIGTYPE [] - "sv_setiv(SvRV($result),PTR2IV($1));"; - -%typemap(varout,type="$1_descriptor") SWIGTYPE & - "sv_setiv(SvRV($result),PTR2IV(&$1));"; - -%typemap(varout,type="$1_descriptor") SWIGTYPE && - "sv_setiv(SvRV($result),PTR2IV(&$1));"; - -%typemap(varout,type="$&1_descriptor") SWIGTYPE - "sv_setiv(SvRV($result), PTR2IV(&$1));"; - -%typemap(varout,type="$1_descriptor") SWIGTYPE (CLASS::*) { - SWIG_MakePackedObj($result, (void *) &$1, sizeof($1), $1_descriptor); -} - -%typemap(varout) SWIGTYPE *const = SWIGTYPE *; - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/perluserdir.swg b/win64/bin/swig/share/swig/4.1.0/perl5/perluserdir.swg deleted file mode 100755 index 45bd1dc6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/perluserdir.swg +++ /dev/null @@ -1,2 +0,0 @@ -#define %perlcode %insert("perl") - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/reference.i b/win64/bin/swig/share/swig/4.1.0/perl5/reference.i deleted file mode 100755 index 604d2105..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/reference.i +++ /dev/null @@ -1,261 +0,0 @@ -/* ----------------------------------------------------------------------------- - * reference.i - * - * Accept Perl references as pointers - * ----------------------------------------------------------------------------- */ - -/* -The following methods make Perl references work like simple C -pointers. References can only be used for simple input/output -values, not C arrays however. It should also be noted that -REFERENCES are specific to Perl and not supported in other -scripting languages at this time. - - int *REFERENCE - short *REFERENCE - long *REFERENCE - unsigned int *REFERENCE - unsigned short *REFERENCE - unsigned long *REFERENCE - unsigned char *REFERENCE - float *REFERENCE - double *REFERENCE - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include reference.i - void neg(double *REFERENCE); - -or you can use the %apply directive : - - %include reference.i - %apply double *REFERENCE { double *x }; - void neg(double *x); - -Unlike the INOUT mapping described in typemaps.i, this approach directly -modifies the value of a Perl reference. Thus, you could use it -as follows : - - $x = 3; - neg(\$x); - print "$x\n"; # Should print out -3. - -*/ - -%typemap(in) double *REFERENCE (double dvalue), double &REFERENCE(double dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { - printf("Received %d\n", SvTYPE(tempsv)); - SWIG_croak("Expected a double reference."); - } - dvalue = SvNV(tempsv); - $1 = &dvalue; -} - -%typemap(in) float *REFERENCE (float dvalue), float &REFERENCE(float dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { - SWIG_croak("expected a double reference"); - } - dvalue = (float) SvNV(tempsv); - $1 = &dvalue; -} - -%typemap(in) int *REFERENCE (int dvalue), int &REFERENCE (int dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = SvIV(tempsv); - $1 = &dvalue; -} - -%typemap(in) short *REFERENCE (short dvalue), short &REFERENCE(short dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (short) SvIV(tempsv); - $1 = &dvalue; -} -%typemap(in) long *REFERENCE (long dvalue), long &REFERENCE(long dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (long) SvIV(tempsv); - $1 = &dvalue; -} -%typemap(in) unsigned int *REFERENCE (unsigned int dvalue), unsigned int &REFERENCE(unsigned int dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned int) SvUV(tempsv); - $1 = &dvalue; -} -%typemap(in) unsigned short *REFERENCE (unsigned short dvalue), unsigned short &REFERENCE(unsigned short dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned short) SvUV(tempsv); - $1 = &dvalue; -} -%typemap(in) unsigned long *REFERENCE (unsigned long dvalue), unsigned long &REFERENCE(unsigned long dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned long) SvUV(tempsv); - $1 = &dvalue; -} - -%typemap(in) unsigned char *REFERENCE (unsigned char dvalue), unsigned char &REFERENCE(unsigned char dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (unsigned char) SvUV(tempsv); - $1 = &dvalue; -} - -%typemap(in) signed char *REFERENCE (signed char dvalue), signed char &REFERENCE(signed char dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = (signed char) SvIV(tempsv); - $1 = &dvalue; -} - -%typemap(in) bool *REFERENCE (bool dvalue), bool &REFERENCE(bool dvalue) -{ - SV *tempsv; - if (!SvROK($input)) { - SWIG_croak("expected a reference"); - } - tempsv = SvRV($input); - if (!SvIOK(tempsv)) { - SWIG_croak("expected an integer reference"); - } - dvalue = SvIV(tempsv) ? true : false; - $1 = &dvalue; -} - -%typemap(typecheck) int *REFERENCE, int &REFERENCE, - short *REFERENCE, short &REFERENCE, - long *REFERENCE, long &REFERENCE, - signed char *REFERENCE, signed char &REFERENCE, - bool *REFERENCE, bool &REFERENCE -{ - $1 = SvROK($input) && SvIOK(SvRV($input)); -} -%typemap(typecheck) double *REFERENCE, double &REFERENCE, - float *REFERENCE, float &REFERENCE -{ - $1 = SvROK($input); - if($1) { - SV *tmpsv = SvRV($input); - $1 = SvNOK(tmpsv) || SvIOK(tmpsv); - } -} -%typemap(typecheck) unsigned int *REFERENCE, unsigned int &REFERENCE, - unsigned short *REFERENCE, unsigned short &REFERENCE, - unsigned long *REFERENCE, unsigned long &REFERENCE, - unsigned char *REFERENCE, unsigned char &REFERENCE -{ - $1 = SvROK($input); - if($1) { - SV *tmpsv = SvRV($input); - $1 = SvUOK(tmpsv) || SvIOK(tmpsv); - } -} - -%typemap(argout) double *REFERENCE, double &REFERENCE, - float *REFERENCE, float &REFERENCE -{ - SV *tempsv; - tempsv = SvRV($arg); - if (!$1) SWIG_croak("expected a reference"); - sv_setnv(tempsv, (double) *$1); -} - -%typemap(argout) int *REFERENCE, int &REFERENCE, - short *REFERENCE, short &REFERENCE, - long *REFERENCE, long &REFERENCE, - signed char *REFERENCE, signed char &REFERENCE, - bool *REFERENCE, bool &REFERENCE -{ - SV *tempsv; - tempsv = SvRV($input); - if (!$1) SWIG_croak("expected a reference"); - sv_setiv(tempsv, (IV) *$1); -} - -%typemap(argout) unsigned int *REFERENCE, unsigned int &REFERENCE, - unsigned short *REFERENCE, unsigned short &REFERENCE, - unsigned long *REFERENCE, unsigned long &REFERENCE, - unsigned char *REFERENCE, unsigned char &REFERENCE -{ - SV *tempsv; - tempsv = SvRV($input); - if (!$1) SWIG_croak("expected a reference"); - sv_setuv(tempsv, (UV) *$1); -} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_auto_ptr.i deleted file mode 100755 index 304f1fc9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_common.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_common.i deleted file mode 100755 index e577e347..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_common.i +++ /dev/null @@ -1,28 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; - -%fragment(""); -%{ -SWIGINTERN -double SwigSvToNumber(SV* sv) { - return SvIOK(sv) ? double(SvIVX(sv)) : SvNVX(sv); -} -SWIGINTERN -std::string SwigSvToString(SV* sv) { - STRLEN len; - char *ptr = SvPV(sv, len); - return std::string(ptr, len); -} -SWIGINTERN -void SwigSvFromString(SV* sv, const std::string& s) { - sv_setpvn(sv,s.data(),s.size()); -} -%} - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_deque.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_except.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_except.i deleted file mode 100755 index 3e056e7d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_list.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_list.i deleted file mode 100755 index 0e27201d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_list.i +++ /dev/null @@ -1,377 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list types - * ----------------------------------------------------------------------------- */ - -%include -%include - -// containers - - -// ------------------------------------------------------------------------ -// std::list -// -// The aim of all that follows would be to integrate std::list with -// Perl as much as possible, namely, to allow the user to pass and -// be returned Perl arrays. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::list), f(const std::list&), f(const std::list*): -// the parameter being read-only, either a Perl sequence or a -// previously wrapped std::list can be passed. -// -- f(std::list&), f(std::list*): -// the parameter must be modified; therefore, only a wrapped std::list -// can be passed. -// -- std::list f(): -// the list is returned by copy; therefore, a Perl sequence of T:s -// is returned which is most easily used in other Perl functions -// -- std::list& f(), std::list* f(), const std::list& f(), -// const std::list* f(): -// the list is returned by reference; therefore, a wrapped std::list -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template class list { - %typemap(in) list (std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1) { - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i& (std::list temp, - std::list* v), - const list* (std::list temp, - std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i { - std::list< T >::const_iterator i; - unsigned int j; - int len = $1.size(); - SV **svs = new SV*[len]; - for (i=$1.begin(), j=0; i!=$1.end(); i++, j++) { - T* ptr = new T(*i); - svs[j] = sv_newmortal(); - SWIG_MakePtr(svs[j], (void*) ptr, - $descriptor(T *), $shadow|$owner); - } - AV *myav = av_make(len, svs); - delete[] svs; - $result = newRV_noinc((SV*) myav); - sv_2mortal($result); - argvi++; - } - %typecheck(SWIG_TYPECHECK_LIST) list { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_&descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_LIST) const list&, - const list* { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - list(); - list(const list& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(const T& x); - }; - - - // specializations for built-ins - - %define specialize_std_list(T,CHECK_T,TO_T,FROM_T) - template<> class list { - %typemap(in) list (std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1){ - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - for (int i=0; i& (std::list temp, - std::list* v), - const list* (std::list temp, - std::list* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i { - std::list< T >::const_iterator i; - unsigned int j; - int len = $1.size(); - SV **svs = new SV*[len]; - for (i=$1.begin(), j=0; i!=$1.end(); i++, j++) { - svs[j] = sv_newmortal(); - FROM_T(svs[j], *i); - } - AV *myav = av_make(len, svs); - delete[] svs; - $result = newRV_noinc((SV*) myav); - sv_2mortal($result); - argvi++; - } - %typecheck(SWIG_TYPECHECK_LIST) list { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_&descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_LIST) const list&, - const list* { - { - /* wrapped list? */ - std::list< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - SV **tv; - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef T value_type; - typedef const value_type& const_reference; - - list(); - list(const list& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T x); - }; - %enddef - - specialize_std_list(bool,SvIOK,SvIVX,sv_setiv); - specialize_std_list(char,SvIOK,SvIVX,sv_setiv); - specialize_std_list(int,SvIOK,SvIVX,sv_setiv); - specialize_std_list(short,SvIOK,SvIVX,sv_setiv); - specialize_std_list(long,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned char,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned int,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned short,SvIOK,SvIVX,sv_setiv); - specialize_std_list(unsigned long,SvIOK,SvIVX,sv_setiv); - specialize_std_list(float,SvNIOK,SwigSvToNumber,sv_setnv); - specialize_std_list(double,SvNIOK,SwigSvToNumber,sv_setnv); - specialize_std_list(std::string,SvPOK,SvPVX,SwigSvFromString); - -} - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_map.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_map.i deleted file mode 100755 index 1f029c83..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_map.i +++ /dev/null @@ -1,80 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_pair.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_pair.i deleted file mode 100755 index 539130ff..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_string.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_string.i deleted file mode 100755 index 013b834f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_string.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_unique_ptr.i deleted file mode 100755 index 79320de6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/std_vector.i b/win64/bin/swig/share/swig/4.1.0/perl5/std_vector.i deleted file mode 100755 index ddf88f04..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/std_vector.i +++ /dev/null @@ -1,592 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * - * SWIG typemaps for std::vector types - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Perl as much as possible, namely, to allow the user to pass and -// be returned Perl arrays. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector), f(const std::vector&), f(const std::vector*): -// the parameter being read-only, either a Perl sequence or a -// previously wrapped std::vector can be passed. -// -- f(std::vector&), f(std::vector*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector f(): -// the vector is returned by copy; therefore, a Perl sequence of T:s -// is returned which is most easily used in other Perl functions -// -- std::vector& f(), std::vector* f(), const std::vector& f(), -// const std::vector* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector (std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1) { - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i& (std::vector temp, - std::vector* v), - const vector* (std::vector temp, - std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - T* obj; - for (int i=0; i { - size_t len = $1.size(); - SV **svs = new SV*[len]; - for (size_t i=0; i { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - SV **tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - T* obj; - SV **tv = av_fetch(av, 0, 0); - if (SWIG_ConvertPtr(*tv, (void **)&obj, - $descriptor(T *),0) != -1) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T& get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector (std::vector* v) { - int res = SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0); - if (SWIG_IsOK(res)){ - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - I32 len = av_len(av) + 1; - for (int i=0; i& (std::vector temp,std::vector* v), - const vector* (std::vector temp,std::vector* v) { - int res = SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,0); - if (SWIG_IsOK(res)) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - I32 len = av_len(av) + 1; - for (int i=0; i { - size_t len = $1.size(); - SV **svs = new SV*[len]; - for (size_t i=0; i { - { - /* wrapped vector? */ - std::vector< T *>* v; - int res = SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0); - if (SWIG_IsOK(res)) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - void *v; - SV **tv = av_fetch(av, 0, 0); - int res = SWIG_ConvertPtr(*tv, &v, $descriptor(T *),0); - if (SWIG_IsOK(res)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&,const vector* { - { - /* wrapped vector? */ - std::vector< T *> *v; - int res = SWIG_ConvertPtr($input,%as_voidptrptr(&v), $1_descriptor,0); - if (SWIG_IsOK(res)) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - void *v; - SV **tv = av_fetch(av, 0, 0); - int res = SWIG_ConvertPtr(*tv, &v, $descriptor(T *),0); - if (SWIG_IsOK(res)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T* value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, T *value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T *x); - %extend { - T *pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T *x = self->back(); - self->pop_back(); - return x; - } - T *get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - %typemap(in) vector (std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,1) != -1){ - $1 = *v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - for (int i=0; i& (std::vector temp, - std::vector* v), - const vector* (std::vector temp, - std::vector* v) { - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,1) != -1) { - $1 = v; - } else if (SvROK($input)) { - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) != SVt_PVAV) - SWIG_croak("Type error in argument $argnum of $symname. " - "Expected an array of " #T); - SV **tv; - I32 len = av_len(av) + 1; - for (int i=0; i { - size_t len = $1.size(); - SV **svs = new SV*[len]; - for (size_t i=0; i { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $&1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SV **tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, - const vector* { - { - /* wrapped vector? */ - std::vector< T >* v; - if (SWIG_ConvertPtr($input,(void **) &v, - $1_descriptor,0) != -1) { - $1 = 1; - } else if (SvROK($input)) { - /* native sequence? */ - AV *av = (AV *)SvRV($input); - if (SvTYPE(av) == SVt_PVAV) { - I32 len = av_len(av) + 1; - if (len == 0) { - /* an empty sequence can be of any type */ - $1 = 1; - } else { - /* check the first element only */ - SV **tv = av_fetch(av, 0, 0); - if (CHECK_T(*tv)) - $1 = 1; - else - $1 = 0; - } - } - } else { - $1 = 0; - } - } - } - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, T value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/swigmove.i b/win64/bin/swig/share/swig/4.1.0/perl5/swigmove.i deleted file mode 100755 index 03e87fa2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/perl5/typemaps.i b/win64/bin/swig/share/swig/4.1.0/perl5/typemaps.i deleted file mode 100755 index 13f0c7f6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/perl5/typemaps.i +++ /dev/null @@ -1,371 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * The SWIG typemap library provides a language independent mechanism for - * supporting output arguments, input values, and other C function - * calling mechanisms. The primary use of the library is to provide a - * better interface to certain C function--especially those involving - * pointers. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_USE_OLD_TYPEMAPS) -%include -#else - - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -%define INPUT_TYPEMAP(type, converter) -%typemap(in) type *INPUT(type temp), type &INPUT(type temp) { - temp = (type) converter($input); - $1 = &temp; -} -%typemap(typecheck) type *INPUT = type; -%typemap(typecheck) type &INPUT = type; -%enddef - -INPUT_TYPEMAP(float, SvNV); -INPUT_TYPEMAP(double, SvNV); -INPUT_TYPEMAP(int, SvIV); -INPUT_TYPEMAP(long, SvIV); -INPUT_TYPEMAP(short, SvIV); -INPUT_TYPEMAP(signed char, SvIV); -INPUT_TYPEMAP(unsigned int, SvUV); -INPUT_TYPEMAP(unsigned long, SvUV); -INPUT_TYPEMAP(unsigned short, SvUV); -INPUT_TYPEMAP(unsigned char, SvUV); - -%typemap(in) bool *INPUT(bool temp), bool &INPUT(bool temp) { - temp = SvIV($input) ? true : false; - $1 = &temp; -} -%typemap(typecheck) bool *INPUT = bool; -%typemap(typecheck) bool &INPUT = bool; - -%typemap(in) long long *INPUT($*1_ltype temp), long long &INPUT($*1_ltype temp) { - temp = strtoll(SvPV_nolen($input), 0, 0); - $1 = &temp; -} -%typemap(typecheck) long long *INPUT = long long; -%typemap(typecheck) long long &INPUT = long long; - -%typemap(in) unsigned long long *INPUT($*1_ltype temp), unsigned long long &INPUT($*1_ltype temp) { - temp = strtoull(SvPV_nolen($input), 0, 0); - $1 = &temp; -} -%typemap(typecheck) unsigned long long *INPUT = unsigned long long; -%typemap(typecheck) unsigned long long &INPUT = unsigned long long; - - -#undef INPUT_TYPEMAP - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, functions will return a Perl array. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters).: - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include typemaps.i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Perl output of the function would be an array containing both -output values. - -*/ - -// Force the argument to be ignored. - -%typemap(in,numinputs=0) int *OUTPUT(int temp), int &OUTPUT(int temp), - short *OUTPUT(short temp), short &OUTPUT(short temp), - long *OUTPUT(long temp), long &OUTPUT(long temp), - unsigned int *OUTPUT(unsigned int temp), unsigned int &OUTPUT(unsigned int temp), - unsigned short *OUTPUT(unsigned short temp), unsigned short &OUTPUT(unsigned short temp), - unsigned long *OUTPUT(unsigned long temp), unsigned long &OUTPUT(unsigned long temp), - unsigned char *OUTPUT(unsigned char temp), unsigned char &OUTPUT(unsigned char temp), - signed char *OUTPUT(signed char temp), signed char &OUTPUT(signed char temp), - bool *OUTPUT(bool temp), bool &OUTPUT(bool temp), - float *OUTPUT(float temp), float &OUTPUT(float temp), - double *OUTPUT(double temp), double &OUTPUT(double temp), - long long *OUTPUT($*1_ltype temp), long long &OUTPUT($*1_ltype temp), - unsigned long long *OUTPUT($*1_ltype temp), unsigned long long &OUTPUT($*1_ltype temp) -"$1 = &temp;"; - -%typemap(argout) int *OUTPUT, int &OUTPUT, - short *OUTPUT, short &OUTPUT, - long *OUTPUT, long &OUTPUT, - signed char *OUTPUT, signed char &OUTPUT, - bool *OUTPUT, bool &OUTPUT -{ - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - $result = sv_newmortal(); - sv_setiv($result,(IV) *($1)); - argvi++; -} - -%typemap(argout) unsigned int *OUTPUT, unsigned int &OUTPUT, - unsigned short *OUTPUT, unsigned short &OUTPUT, - unsigned long *OUTPUT, unsigned long &OUTPUT, - unsigned char *OUTPUT, unsigned char &OUTPUT -{ - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - $result = sv_newmortal(); - sv_setuv($result,(UV) *($1)); - argvi++; -} - - - -%typemap(argout) float *OUTPUT, float &OUTPUT, - double *OUTPUT, double &OUTPUT -{ - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - $result = sv_newmortal(); - sv_setnv($result,(double) *($1)); - argvi++; -} - -%typemap(argout) long long *OUTPUT, long long &OUTPUT { - char temp[256]; - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - sprintf(temp,"%lld", (long long)*($1)); - $result = sv_newmortal(); - sv_setpv($result,temp); - argvi++; -} - -%typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT { - char temp[256]; - if (argvi >= items) { - EXTEND(sp, argvi+1); - } - sprintf(temp,"%llu", (unsigned long long)*($1)); - $result = sv_newmortal(); - sv_setpv($result,temp); - argvi++; -} - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Perl array. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - void neg(double *INOUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value. -Rather, the modified input value shows up as the return value of the -function. Thus, to apply this function to a Perl variable you might -do this : - - $x = neg($x); - -*/ - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) unsigned &INOUT = unsigned &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) signed char &INOUT = signed char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; - - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) unsigned *INOUT = unsigned *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; - - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) unsigned &INOUT = unsigned &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) signed char &INOUT = signed char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; - - -/* Overloading information */ - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) bool *INOUT = bool; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) float *INOUT = float; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) bool &INOUT = bool; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) float &INOUT = float; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; - -#endif - -// -------------------------------------------------------------------- -// Special types -// -------------------------------------------------------------------- - - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/php/argcargv.i b/win64/bin/swig/share/swig/4.1.0/php/argcargv.i deleted file mode 100755 index 95f87b85..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/argcargv.i +++ /dev/null @@ -1,40 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - int len, i; - zval *val; - zend_array *ar; - if (Z_TYPE($input) != IS_ARRAY) { - SWIG_PHP_Error(E_ERROR, "Type error in '$symname'. Expected array"); - goto fail; - } - ar = Z_ARR($input); - len = zend_array_count(ar); - $1 = ($1_ltype) len; - $2 = (char **) malloc((len+1)*sizeof(char *)); - i = 0; - ZEND_HASH_FOREACH_VAL(ar, val) { - if (Z_TYPE(*val) != IS_STRING) { - SWIG_PHP_Error(E_ERROR, "Array must use strings only, in '$symname'."); - goto fail; - } - if (i == len) { - SWIG_PHP_Error(E_ERROR, "Array is bigger than zend report in '$symname'."); - goto fail; - } - $2[i++] = Z_STRVAL(*val); - } ZEND_HASH_FOREACH_END(); - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = Z_TYPE($input) == IS_ARRAY; -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/win64/bin/swig/share/swig/4.1.0/php/const.i b/win64/bin/swig/share/swig/4.1.0/php/const.i deleted file mode 100755 index 99e59c9d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/const.i +++ /dev/null @@ -1,103 +0,0 @@ -/* ----------------------------------------------------------------------------- - * const.i - * - * Typemaps for constants - * ----------------------------------------------------------------------------- */ -%typemap(classconsttab) int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - unsigned char, - signed char, - enum SWIGTYPE %{ - zend_declare_class_constant_long(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, ($1_type)($value)); -%} - -%typemap(classconsttab) bool %{ - zend_declare_class_constant_bool(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, ($1_type)($value)); -%} - -%typemap(classconsttab) float, - double %{ - zend_declare_class_constant_double(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, $value); -%} - -%typemap(classconsttab) char %{ -{ - char swig_char = $value; - zend_declare_class_constant_stringl(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, &swig_char, 1); -} -%} - -%typemap(classconsttab) char *, - const char *, - char [], - const char [] %{ - zend_declare_class_constant_string(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, $value); -%} - -// This creates a zend_object to wrap the pointer, and we can't do that -// before the Zend runtime has been initialised so we delay it until -// RINIT. The downside is it then happens for every request. -%typemap(classconsttab,rinit=1) SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [] %{ -{ - zval z; - ZVAL_UNDEF(&z); - SWIG_SetPointerZval(&z, (void*)($value), $1_descriptor, 0); - zval_copy_ctor(&z); - zend_declare_class_constant(SWIG_Php_ce_$class, "$const_name", sizeof("$const_name") - 1, &z); -} -%} - -%typemap(classconsttab) SWIGTYPE (CLASS::*) "" - -%typemap(consttab) int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - unsigned char, - signed char, - enum SWIGTYPE - "SWIG_LONG_CONSTANT($symname, ($1_type)($value));"; - -%typemap(consttab) bool - "SWIG_BOOL_CONSTANT($symname, ($1_type)($value));"; - -%typemap(consttab) float, - double - "SWIG_DOUBLE_CONSTANT($symname, $value);"; - -%typemap(consttab) char - "SWIG_CHAR_CONSTANT($symname, $value);"; - -%typemap(consttab) char *, - const char *, - char [], - const char [] - "SWIG_STRING_CONSTANT($symname, $value);"; - -// This creates a zend_object to wrap the pointer, and we can't do that -// before the Zend runtime has been initialised so we delay it until -// RINIT. The downside is it then happens for every request. -%typemap(consttab,rinit=1) SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [] { - zend_constant c; - ZVAL_UNDEF(&c.value); - SWIG_SetPointerZval(&c.value, (void*)($value), $1_descriptor, 0); - zval_copy_ctor(&c.value); - c.name = zend_string_init("$symname", sizeof("$symname") - 1, 0); - SWIG_ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, module_number); - zend_register_constant(&c); -} - -/* Handled as a global variable. */ -%typemap(consttab) SWIGTYPE (CLASS::*) "" diff --git a/win64/bin/swig/share/swig/4.1.0/php/director.swg b/win64/bin/swig/share/swig/4.1.0/php/director.swg deleted file mode 100755 index 048a62b2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/director.swg +++ /dev/null @@ -1,180 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that PHP proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DIRECTOR_PHP_HEADER_ -#define SWIG_DIRECTOR_PHP_HEADER_ - -#define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -#include -#include -#include - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() { - } - - virtual int get_own() const { - return 0; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem * operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(int own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - int get_own() const { - return _own; - } - - private: - int _own; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - class Director { - private: - /* flag indicating whether the object is owned by PHP or C++ */ - mutable bool swig_disown_flag; - - protected: - // "mutable" so we can get a non-const pointer to it in const methods. - mutable zval swig_self; - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; - - public: - Director(zval *self) : swig_disown_flag(false) { - ZVAL_COPY_VALUE(&swig_self, self); - } - - ~Director() { - if (swig_disown_flag) { - Z_DELREF(swig_self); - } - } - - zend_object *swig_get_self() const { return Z_OBJ(swig_self); } - - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag = true; - Z_ADDREF(swig_self); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, int own) const { - if (vptr && own) { - swig_owner[vptr] = new GCItem_Object(own); - } - } - }; - - /* base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - public: - DirectorException(int code, const char *hdr, const char *msg) : swig_msg(hdr) { - if (msg && msg[0]) { - swig_msg += " "; - swig_msg += msg; - } - // Don't replace an already active PHP exception. - if (!EG(exception)) zend_throw_exception(NULL, swig_msg.c_str(), code); - } - - virtual ~DirectorException() throw() { - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - - static void raise(int code, const char *hdr, const char *msg) { - throw DirectorException(code, hdr, msg); - } - }; - - /* attempt to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg) - : DirectorException(E_ERROR, "SWIG director pure virtual method called", msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - /* any php exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException { - public: - DirectorMethodException() - : DirectorException(E_ERROR, "SWIG director method error", NULL) { - } - - DirectorMethodException(const char *msg) - : DirectorException(E_ERROR, "SWIG director method error", msg) { - } - - static void raise(const char *msg) { - throw DirectorMethodException(msg); - } - }; -} - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/php/factory.i b/win64/bin/swig/share/swig/4.1.0/php/factory.i deleted file mode 100755 index 56688bc1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/factory.i +++ /dev/null @@ -1,109 +0,0 @@ -/* - Implement a more natural wrap for factory methods, for example, if - you have: - - ---- geometry.h -------- - struct Geometry { - enum GeomType{ - POINT, - CIRCLE - }; - - virtual ~Geometry() {} - virtual int draw() = 0; - - // - // Factory method for all the Geometry objects - // - static Geometry *create(GeomType i); - }; - - struct Point : Geometry { - int draw() { return 1; } - double width() { return 1.0; } - }; - - struct Circle : Geometry { - int draw() { return 2; } - double radius() { return 1.5; } - }; - - // - // Factory method for all the Geometry objects - // - Geometry *Geometry::create(GeomType type) { - switch (type) { - case POINT: return new Point(); - case CIRCLE: return new Circle(); - default: return 0; - } - } - ---- geometry.h -------- - - - You can use the %factory with the Geometry::create method as follows: - - %newobject Geometry::create; - %factory(Geometry *Geometry::create, Point, Circle); - %include "geometry.h" - - and Geometry::create will return a 'Point' or 'Circle' instance - instead of the plain 'Geometry' type. For example, in python: - - circle = Geometry.create(Geometry.CIRCLE) - r = circle.radius() - - where circle is a Circle proxy instance. - - NOTES: remember to fully qualify all the type names and don't - use %factory inside a namespace declaration, ie, instead of - - namespace Foo { - %factory(Geometry *Geometry::create, Point, Circle); - } - - use - - %factory(Foo::Geometry *Foo::Geometry::create, Foo::Point, Foo::Circle); - - -*/ - -/* for loop for macro with one argument */ -%define %_formacro_1(macro, arg1,...)macro(arg1) -#if #__VA_ARGS__ != "__fordone__" -%_formacro_1(macro, __VA_ARGS__) -#endif -%enddef - -/* for loop for macro with one argument */ -%define %formacro_1(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef -%define %formacro(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef - -/* for loop for macro with two arguments */ -%define %_formacro_2(macro, arg1, arg2, ...)macro(arg1, arg2) -#if #__VA_ARGS__ != "__fordone__" -%_formacro_2(macro, __VA_ARGS__) -#endif -%enddef - -/* for loop for macro with two arguments */ -%define %formacro_2(macro,...)%_formacro_2(macro, __VA_ARGS__, __fordone__)%enddef - -%define %_factory_dispatch(Type) -if (!dcast) { - Type *dobj = dynamic_cast($1); - if (dobj) { - dcast = 1; - SWIG_SetPointerZval(return_value, SWIG_as_voidptr(dobj), $descriptor(Type *), $owner); - } -}%enddef - -%define %factory(Method,Types...) -%typemap(out, phptype="?SWIGTYPE") Method { - int dcast = 0; - %formacro(%_factory_dispatch, Types) - if (!dcast) { - SWIG_SetPointerZval(return_value, SWIG_as_voidptr($1), $descriptor, $owner); - } -}%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/php/php.swg b/win64/bin/swig/share/swig/4.1.0/php/php.swg deleted file mode 100755 index 4abb3e93..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/php.swg +++ /dev/null @@ -1,594 +0,0 @@ -/* ----------------------------------------------------------------------------- - * php.swg - * - * PHP configuration file - * ----------------------------------------------------------------------------- */ - -// Default to generating PHP type declarations (for PHP >= 8) except for -// cases which are liable to cause compatibility issues with existing -// bindings. -%feature("php:type", "compat"); - -%runtime "swigrun.swg" // Common C API type-checking code -%runtime "swigerrors.swg" // SWIG errors -%runtime "phprun.swg" // PHP runtime functions - -%include // PHP initialization routine. - -%include - -// use %init %{ "/*code goes here*/ " %} -// or %minit %{ "/* code goes here*/ " %} to -// insert code in the PHP_MINIT_FUNCTION -#define %minit %insert("init") - -// use %rinit %{ "/* code goes here*/ " %} to -// insert code in the PHP_RINIT_FUNCTION -#define %rinit %insert("rinit") - -// use %shutdown %{ " /*code goes here*/ " %} to -// insert code in the PHP_MSHUTDOWN_FUNCTION -#define %shutdown %insert("shutdown") -#define %mshutdown %insert("shutdown") - -// use %rshutdown %{ " /*code goes here*/" %} to -// insert code in the PHP_RSHUTDOWN_FUNCTION -#define %rshutdown %insert("rshutdown") - -/* Typemaps for input parameters by value */ - -%include - -%pass_by_val(bool, "bool", CONVERT_BOOL_IN); - -%pass_by_val(size_t, "int", CONVERT_INT_IN); - -%pass_by_val(enum SWIGTYPE, "int", CONVERT_INT_IN); - -%pass_by_val(signed int, "int", CONVERT_INT_IN); -%pass_by_val(int,"int", CONVERT_INT_IN); -%pass_by_val(unsigned int,"int", CONVERT_INT_IN); - -%pass_by_val(signed short, "int", CONVERT_INT_IN); -%pass_by_val(short,"int", CONVERT_INT_IN); -%pass_by_val(unsigned short, "int", CONVERT_INT_IN); - -%pass_by_val(signed long, "int", CONVERT_INT_IN); -%pass_by_val(long, "int", CONVERT_INT_IN); -%pass_by_val(unsigned long, "int", CONVERT_INT_IN); - -%pass_by_val(signed long long, "int|string", CONVERT_LONG_LONG_IN); -%pass_by_val(long long, "int|string", CONVERT_LONG_LONG_IN); -%pass_by_val(unsigned long long, "int|string", CONVERT_UNSIGNED_LONG_LONG_IN); - -%pass_by_val(signed char, "int", CONVERT_INT_IN); -%pass_by_val(char, "string", CONVERT_CHAR_IN); -%pass_by_val(unsigned char, "int", CONVERT_INT_IN); - -%pass_by_val(float, "float", CONVERT_FLOAT_IN); - -%pass_by_val(double, "float", CONVERT_FLOAT_IN); - -%pass_by_val(char *, "string", CONVERT_STRING_IN); -%typemap(in) char *& = const char *&; -%typemap(directorout) char *& = const char *&; - -// char array can be in/out, though the passed string may not be big enough... -// so we have to size it -%typemap(in, phptype="string") char[ANY] -%{ - convert_to_string(&$input); - $1 = ($1_ltype) Z_STRVAL($input); -%} - -%typemap(in, phptype="string") (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) %{ - convert_to_string(&$input); - $1 = ($1_ltype) Z_STRVAL($input); - $2 = ($2_ltype) Z_STRLEN($input); -%} - -/* Object passed by value. Convert to a pointer */ -%typemap(in, phptype="SWIGTYPE") SWIGTYPE ($&1_ltype tmp) -%{ - if (SWIG_ConvertPtr(&$input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { - zend_type_error("Expected $&1_descriptor for argument $argnum of $symname"); - return; - } - $1 = *tmp; -%} - -%typemap(directorout) SWIGTYPE ($&1_ltype tmp) -%{ - if (SWIG_ConvertPtr($input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { - zend_type_error("Expected $&1_descriptor for argument $argnum of $symname"); - SWIG_fail; - } - $result = *tmp; -%} - -%typemap(in, phptype="?SWIGTYPE") SWIGTYPE *, - SWIGTYPE [] -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } -%} - -%typemap(directorout) SWIGTYPE * (swig_owntype own), - SWIGTYPE [] (swig_owntype own) -%{ - if (SWIG_ConvertPtrAndOwn($input, (void **)&$result, $1_descriptor, SWIG_POINTER_DISOWN, &own) < 0) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - SWIG_fail; - } - swig_acquire_ownership_obj((void*)$result, own); -%} - -%typemap(in, phptype="SWIGTYPE") SWIGTYPE & -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0 || $1 == NULL) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } -%} -%typemap(in, fragment="") SWIGTYPE && (void *argp = 0, int res = 0, std::unique_ptr<$*1_ltype> rvrdeleter) %{ - res = SWIG_ConvertPtr(&$input, &argp, $descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $1_descriptor of $symname"); - return; - } else { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } - } - if (!argp) { - zend_type_error("Invalid null reference for argument $argnum of $1_descriptor of $symname"); - return; - } - $1 = ($1_ltype)argp; - rvrdeleter.reset($1); -%} - -%typemap(directorout) SWIGTYPE & ($1_ltype tmp), - SWIGTYPE && ($1_ltype tmp) -%{ - if (SWIG_ConvertPtr($input, (void **) &tmp, $1_descriptor, 0) < 0 || tmp == NULL) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - SWIG_fail; - } - $result = tmp; -%} - -%typemap(in, phptype="?SWIGTYPE") SWIGTYPE *const& ($*ltype temp) -%{ - if (SWIG_ConvertPtr(&$input, (void **) &temp, $*1_descriptor, 0) < 0) { - zend_type_error("Expected $*1_descriptor for argument $argnum of $symname"); - return; - } - $1 = ($1_ltype)&temp; -%} - -%typemap(in, phptype="?SWIGTYPE") SWIGTYPE *DISOWN -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, SWIG_POINTER_DISOWN) < 0) { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } -%} - -%typemap(argout) SWIGTYPE *, - SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE &&; - -%typemap(in, phptype="?SWIGTYPE") void * -%{ - if (SWIG_ConvertPtr(&$input, (void **) &$1, 0, 0) < 0) { - /* Allow NULL from php for void* */ - if (Z_ISNULL($input)) { - $1=0; - } else { - zend_type_error("Expected $1_descriptor for argument $argnum of $symname"); - return; - } - } -%} - -/* Special case when void* is passed by reference so it can be made to point - to opaque api structs */ -%typemap(in, phptype="?SWIG\\_p_void", byref=1) void ** ($*1_ltype ptr, int force), - void *& ($*1_ltype ptr, int force) -{ - /* If they pass NULL by reference, make it into a void* - This bit should go in arginit if arginit support init-ing scripting args */ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ - if (!(Z_ISREF($input) && Z_ISNULL_P(Z_REFVAL($input)))) { - /* wasn't a pre/ref/thing, OR anything like an int thing */ - zend_throw_exception(zend_ce_type_error, "Type error in argument $arg of $symname", 0); - goto fail; - } - } - force=0; - if (arg1==NULL) { -#ifdef __cplusplus - ptr=new $*1_ltype(); -#else - ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); -#endif - $1=&ptr; - /* have to passback arg$arg too */ - force=1; - } -} -%typemap(argout) void **, - void *& -%{ - if (force$argnum && Z_ISREF($input)) { - SWIG_SetPointerZval(Z_REFVAL($input), (void*) ptr$argnum, $*1_descriptor, 1); - } -%} - -/* Typemap for output values */ - -%typemap(out, phptype="int") - int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - signed char, - unsigned char, - size_t -%{ - RETVAL_LONG($1); -%} - -%typemap(out, phptype="int") enum SWIGTYPE -%{ - RETVAL_LONG((long)$1); -%} - -%typemap(out, phptype="int|string") long long -%{ - if ((long long)LONG_MIN <= $1 && $1 <= (long long)LONG_MAX) { - RETVAL_LONG((long)($1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%lld", (long long)$1)); - } -%} -%typemap(out, phptype="int|string") unsigned long long -%{ - if ($1 <= (unsigned long long)LONG_MAX) { - RETVAL_LONG((long)($1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%llu", (unsigned long long)$1)); - } -%} - -%typemap(out, phptype="int") - const int &, - const unsigned int &, - const short &, - const unsigned short &, - const long &, - const unsigned long &, - const signed char &, - const unsigned char &, - const bool &, - const size_t & -%{ - RETVAL_LONG(*$1); -%} - -%typemap(out, phptype="int") const enum SWIGTYPE & -%{ - RETVAL_LONG((long)*$1); -%} - -%typemap(out, phptype="int") const enum SWIGTYPE && -%{ - RETVAL_LONG((long)*$1); -%} - -%typemap(out, phptype="int|string") const long long & -%{ - if ((long long)LONG_MIN <= *$1 && *$1 <= (long long)LONG_MAX) { - RETVAL_LONG((long)(*$1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%lld", (long long)(*$1))); - } -%} -%typemap(out, phptype="int|string") const unsigned long long & -%{ - if (*$1 <= (unsigned long long)LONG_MAX) { - RETVAL_LONG((long)(*$1)); - } else { - RETVAL_NEW_STR(zend_strpprintf(0, "%llu", (unsigned long long)(*$1))); - } -%} - -%typemap(directorin) int, - unsigned int, - short, - unsigned short, - long, - unsigned long, - signed char, - unsigned char, - size_t, - enum SWIGTYPE -%{ - ZVAL_LONG($input,$1); -%} - -%typemap(directorin) enum SWIGTYPE -%{ - ZVAL_LONG($input, (long)$1_name); -%} - -%typemap(directorin) char *, char [] -%{ - if(!$1) { - ZVAL_NULL($input); - } else { - ZVAL_STRING($input, (const char*)$1); - } -%} - -%typemap(out, phptype="bool") bool -%{ - RETVAL_BOOL(($1) ? 1 : 0); -%} - -%typemap(out, phptype="bool") const bool & -%{ - RETVAL_BOOL((*$1) ? 1 : 0); -%} - -%typemap(directorin) bool -%{ - ZVAL_BOOL($input, ($1) ? 1 : 0); -%} - -%typemap(out, phptype="float") float, - double -%{ - RETVAL_DOUBLE($1); -%} - -%typemap(out, phptype="float") const float &, - const double & -%{ - RETVAL_DOUBLE(*$1); -%} - -%typemap(directorin) float, - double -%{ - ZVAL_DOUBLE($input, $1); -%} - -%typemap(out, phptype="string") char -%{ - RETVAL_STRINGL(&$1, 1); -%} - -%typemap(out, phptype="string") const char & -%{ - RETVAL_STRINGL(&*$1, 1); -%} - -%typemap(out, phptype="string") char [] -%{ - RETVAL_STRING((const char *)$1); -%} - -%typemap(out, phptype="?string") char * -%{ - if (!$1) { - RETVAL_NULL(); - } else { - RETVAL_STRING((const char *)$1); - } -%} - -%typemap(out, phptype="?string") char *& -%{ - if (!*$1) { - RETVAL_NULL(); - } else { - RETVAL_STRING((const char *)*$1); - } -%} - -%typemap(out, phptype="?SWIGTYPE") SWIGTYPE * -%{ - SWIG_SetPointerZval($result, (void *)$1, $1_descriptor, $owner); -%} - -%typemap(out, phptype="SWIGTYPE") - SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE && -%{ - SWIG_SetPointerZval($result, (void *)$1, $1_descriptor, $owner); -%} - -%typemap(out, phptype="?SWIGTYPE") SWIGTYPE *const& -%{ - SWIG_SetPointerZval($result, (void *)*$1, $*1_descriptor, $owner); -%} - -%typemap(directorin) SWIGTYPE *, - SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE && -%{ - ZVAL_UNDEF($input); - SWIG_SetPointerZval($input, (void *)&$1, $1_descriptor, $owner); -%} - -%typemap(out, phptype="SWIGTYPE") SWIGTYPE (CLASS::*) -{ - void * p = emalloc(sizeof($1)); - memcpy(p, &$1, sizeof($1)); - SWIG_SetPointerZval($result, (void *)p, $&1_descriptor, 1); -} - -%typemap(in, phptype="SWIGTYPE") SWIGTYPE (CLASS::*) -{ - void * p = SWIG_Z_FETCH_OBJ_P(&$input)->ptr; - memcpy(&$1, p, sizeof($1)); -} - -%typemap(out, phptype="?SWIGTYPE") SWIGTYPE *DYNAMIC -{ - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_SetPointerZval($result, (void *)$1, ty, $owner); -} - -%typemap(out, phptype="SWIGTYPE") SWIGTYPE &DYNAMIC -{ - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_SetPointerZval($result, (void *)$1, ty, $owner); -} - -%typemap(out, phptype="SWIGTYPE") SWIGTYPE -{ -#ifdef __cplusplus - $&1_ltype resultobj = new $1_ltype($1); -#else - $&1_ltype resultobj = ($&1_ltype) malloc(sizeof($1_type)); - memcpy(resultobj, &$1, sizeof($1_type)); -#endif - SWIG_SetPointerZval($result, (void *)resultobj, $&1_descriptor, 1); -} - -%typemap(directorin) SWIGTYPE -%{ - ZVAL_UNDEF($input); - SWIG_SetPointerZval($input, (new $1_ltype(SWIG_STD_MOVE($1))), $&1_descriptor, 1); -%} - -%typemap(out, phptype="void") void "" - -%typemap(out, phptype="string") char [ANY] -{ - size_t len = 0; - while (len < $1_dim0 && $1[len]) ++len; - RETVAL_STRINGL($1, len); -} - -// This typecheck does hard checking for proper argument type. If you want -// an argument to be converted from a different PHP type, you must convert -// it yourself before passing it (e.g. (string)4.7 or (int)"6"). -%define %php_typecheck(_type,_prec,is) -%typemap(typecheck,precedence=_prec) _type, const _type & - " $1 = (Z_TYPE($input) == is);" -%enddef - -// Like %php_typecheck but allows either of two values. -%define %php_typecheck2(_type,_prec,is1,is2) -%typemap(typecheck,precedence=_prec) _type, const _type & - " $1 = (Z_TYPE($input) == is1 || Z_TYPE($input) == is2);" -%enddef - -%php_typecheck(int,SWIG_TYPECHECK_INTEGER,IS_LONG) -%php_typecheck(unsigned int,SWIG_TYPECHECK_UINT32,IS_LONG) -%php_typecheck(short,SWIG_TYPECHECK_INT16,IS_LONG) -%php_typecheck(unsigned short,SWIG_TYPECHECK_UINT16,IS_LONG) -%php_typecheck(long,SWIG_TYPECHECK_INT32,IS_LONG) -%php_typecheck(unsigned long,SWIG_TYPECHECK_UINT32,IS_LONG) -%php_typecheck(long long,SWIG_TYPECHECK_INT64,IS_LONG) -%php_typecheck(unsigned long long,SWIG_TYPECHECK_UINT64,IS_LONG) -%php_typecheck(signed char,SWIG_TYPECHECK_INT8,IS_LONG) -%php_typecheck(unsigned char,SWIG_TYPECHECK_UINT8,IS_LONG) -%php_typecheck(size_t,SWIG_TYPECHECK_SIZE,IS_LONG) -%php_typecheck(enum SWIGTYPE,SWIG_TYPECHECK_INTEGER,IS_LONG) -%php_typecheck2(bool,SWIG_TYPECHECK_BOOL,IS_TRUE,IS_FALSE) -%php_typecheck(float,SWIG_TYPECHECK_FLOAT,IS_DOUBLE) -%php_typecheck(double,SWIG_TYPECHECK_DOUBLE,IS_DOUBLE) -%php_typecheck(char,SWIG_TYPECHECK_CHAR,IS_STRING) - -%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char *, char *& - " $1 = (Z_TYPE($input) == IS_STRING || Z_TYPE($input) == IS_NULL); " - -%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char [] - " $1 = (Z_TYPE($input) == IS_STRING); " - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, SWIG_POINTER_NO_NULL) >= 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE *, - SWIGTYPE [], - SWIGTYPE *const& -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, 0) >= 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) - SWIGTYPE &, - SWIGTYPE && -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, SWIG_POINTER_NO_NULL) >= 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $*1_descriptor, 0) >= 0); -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * -{ - void *tmp; - $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, 0, 0) >= 0); -} - -/* Exception handling */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short %{ - zend_throw_exception(NULL, "C++ $1_type exception thrown", $1); - goto fail; -%} - -%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] %{ - (void)$1; - zend_throw_exception(NULL, "C++ $1_type exception thrown", 0); - goto fail; -%} - -%typemap(throws) char * %{ - zend_throw_exception(NULL, $1, 0); - goto fail; -%} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* php keywords */ -%include - -/* PHP known interfaces */ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/php/phpinit.swg b/win64/bin/swig/share/swig/4.1.0/php/phpinit.swg deleted file mode 100755 index 41d84238..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/phpinit.swg +++ /dev/null @@ -1,16 +0,0 @@ - -/* ------------------------------------------------------------ - * The start of the PHP initialization function - * ------------------------------------------------------------ */ - -%insert(init) "swiginit.swg" - -%init %{ -SWIG_php_minit { - zend_class_entry SWIGUNUSED internal_ce; - SWIG_InitializeModule((void*)&module_number); -#if PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION == 0 - /* This hack is needed to avoid segfaults. */ - EG(class_table) = CG(class_table); -#endif -%} diff --git a/win64/bin/swig/share/swig/4.1.0/php/phpinterfaces.i b/win64/bin/swig/share/swig/4.1.0/php/phpinterfaces.i deleted file mode 100755 index 7ea1f53c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/phpinterfaces.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * phpinterfaces.i - * - * Define "known" PHP interfaces. - * - * These can be added at MINIT time (which is when PHP loads the extension - * module). - * - * Any interface can be added via phpinterfaces, but looking up the - * zend_class_entry by name has to wait until RINIT time, which means it - * happens for every request. - * ----------------------------------------------------------------------------- */ - -// Note: Abstract interfaces such as "Traversable" can't be used in -// "implements" so are not relevant here. - -%insert(header) %{ - -#define SWIG_PHP_INTERFACE_Iterator_CE zend_ce_iterator -#define SWIG_PHP_INTERFACE_Iterator_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_IteratorAggregate_CE zend_ce_aggregate -#define SWIG_PHP_INTERFACE_IteratorAggregate_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_ArrayAccess_CE zend_ce_arrayaccess -#define SWIG_PHP_INTERFACE_ArrayAccess_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_Serializable_CE zend_ce_serializable -#define SWIG_PHP_INTERFACE_Serializable_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_Countable_CE zend_ce_countable -#define SWIG_PHP_INTERFACE_Countable_HEADER "zend_interfaces.h" - -#define SWIG_PHP_INTERFACE_OuterIterator_CE spl_ce_OuterIterator -#define SWIG_PHP_INTERFACE_OuterIterator_HEADER "ext/spl/spl_iterators.h" - -#define SWIG_PHP_INTERFACE_RecursiveIterator_CE spl_ce_RecursiveIterator -#define SWIG_PHP_INTERFACE_RecursiveIterator_HEADER "ext/spl/spl_iterators.h" - -#define SWIG_PHP_INTERFACE_SeekableIterator_CE spl_ce_SeekableIterator -#define SWIG_PHP_INTERFACE_SeekableIterator_HEADER "ext/spl/spl_iterators.h" - -#define SWIG_PHP_INTERFACE_SplObserver_CE spl_ce_SplObserver -#define SWIG_PHP_INTERFACE_SplObserver_HEADER "ext/spl/spl_observer.h" - -#define SWIG_PHP_INTERFACE_SplSubject_CE spl_ce_SplSubject -#define SWIG_PHP_INTERFACE_SplSubject_HEADER "ext/spl/spl_observer.h" - -#define SWIG_PHP_INTERFACE_DateTimeInterface_CE php_date_get_interface_ce() -#define SWIG_PHP_INTERFACE_DateTimeInterface_HEADER "ext/date/php_date.h" - -// The "json" extension needs to be loaded earlier that us for this to work. -#define SWIG_PHP_INTERFACE_JsonSerializable_CE php_json_serializable_ce -#define SWIG_PHP_INTERFACE_JsonSerializable_HEADER "ext/json/php_json.h" - -// New in PHP 8.0. -#if PHP_MAJOR_VERSION >= 8 -# define SWIG_PHP_INTERFACE_Stringable_CE zend_ce_stringable -# define SWIG_PHP_INTERFACE_Stringable_HEADER "zend_interfaces.h" -#endif - -%} diff --git a/win64/bin/swig/share/swig/4.1.0/php/phpkw.swg b/win64/bin/swig/share/swig/4.1.0/php/phpkw.swg deleted file mode 100755 index 039e32b0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/phpkw.swg +++ /dev/null @@ -1,888 +0,0 @@ -/* ----------------------------------------------------------------------------- - * phpkw.swg - * ----------------------------------------------------------------------------- */ - -/* Keyword (case insensitive) */ -#define PHPKW(x) %keywordwarn("'" `x` "' is a PHP keyword",sourcefmt="%(lower)s",rename="c_%s") `x` - -/* Keyword, except ok as a function */ -#define PHPKW_ok_as_function(x) %keywordwarn("'" `x` "' is a PHP keyword, renaming to 'c_" `x` "'",%$not %$isfunction,sourcefmt="%(lower)s",rename="c_%s") `x` - -/* Class (case insensitive) */ -#define PHPCN(x) %keywordwarn("'" `x` "' is a PHP reserved class name",%$isclass,sourcefmt="%(lower)s",rename="c_%s") `x` - -/* Constant (case insensitive) */ -#define PHPBN1a(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "enum conflicts with a built-in constant '"`x`"' in PHP"),%$isenumitem,sourcefmt="%(lower)s") `x` -#define PHPBN1b(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "constant conflicts with a built-in constant '"`x`"' in PHP"),%$isconstant,sourcefmt="%(lower)s") `x` -%define PHPBN1(X) - PHPBN1a(X); PHPBN1b(X) -%enddef - -/* Constant (case sensitive) */ -#define PHPBN2a(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "enum conflicts with a built-in constant '"`x`"' in PHP"),%$isenumitem) `x` -#define PHPBN2b(x) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, "constant conflicts with a built-in constant '"`x`"' in PHP"),%$isconstant) `x` -%define PHPBN2(X) - PHPBN2a(X); PHPBN2b(X) -%enddef - -#define PHPFN(x) %keywordwarn("'" `x` "' is a PHP built-in function",sourcefmt="%(lower)s",%$isfunction,%$not %$ismember,rename="c_%s") `x` - -/* From: http://php.net/manual/en/reserved.keywords.php - * "You cannot use any of the following words as constants, class names, - * function or method names. Using them as variable names is generally OK, but - * could lead to confusion." - */ -/* Check is case insensitive - these *MUST* be listed in lower case here */ -PHPKW(abstract); -PHPKW(and); -PHPKW(as); -PHPKW(break); -PHPKW(callable); -PHPKW(case); -PHPKW(catch); -PHPKW(class); -PHPKW(clone); -PHPKW(const); -PHPKW(continue); -PHPKW(declare); -PHPKW(default); -PHPKW(do); -PHPKW(else); -PHPKW(elseif); -PHPKW(enddeclare); -PHPKW(endfor); -PHPKW(endforeach); -PHPKW(endif); -PHPKW(endswitch); -PHPKW(endwhile); -PHPKW(extends); -PHPKW(final); -PHPKW(finally); -PHPKW(fn); // as of PHP 7.4 -PHPKW(for); -PHPKW(foreach); -PHPKW(function); -PHPKW(global); -PHPKW(goto); -PHPKW(if); -PHPKW(implements); -PHPKW(instanceof); -PHPKW(insteadof); -PHPKW(interface); -PHPKW(match); // as of PHP 8.0 -PHPKW(namespace); -PHPKW(new); -PHPKW(or); -PHPKW(private); -PHPKW(protected); -PHPKW(public); -PHPKW(static); -PHPKW(switch); -PHPKW(throw); -PHPKW(trait); -PHPKW(try); -PHPKW(use); -PHPKW(var); -PHPKW(while); -PHPKW(xor); -PHPKW(yield); - -/* PHP 8.1 made `readonly` a keyword, but (unlike any other keyword it seems) - * it may still be used as a function name. - */ -PHPKW_ok_as_function(readonly); - -// Compile-time "magic" constants -// From: http://php.net/manual/en/reserved.keywords.php -// also at: http://php.net/manual/en/language.constants.predefined.php -/* These *MUST* be listed in lower case here */ -PHPKW(__class__); -PHPKW(__dir__); -PHPKW(__file__); -PHPKW(__function__); -PHPKW(__line__); -PHPKW(__method__); -PHPKW(__namespace__); -PHPKW(__trait__); - -/* We classify these as built-in names since they conflict, but PHP still runs */ - -/* Predefined case-insensitive constants */ -/* These *MUST* be listed in lower case here */ -PHPBN1(null); -PHPBN1(true); -PHPBN1(false); - -/* "Core Predefined Constants" from http://php.net/manual/en/reserved.constants.php */ -/* These are case sensitive */ -PHPBN2(PHP_VERSION); -PHPBN2(PHP_MAJOR_VERSION); -PHPBN2(PHP_MINOR_VERSION); -PHPBN2(PHP_RELEASE_VERSION); -PHPBN2(PHP_VERSION_ID); -PHPBN2(PHP_EXTRA_VERSION); -PHPBN2(PHP_ZTS); -PHPBN2(PHP_DEBUG); -PHPBN2(PHP_MAXPATHLEN); -PHPBN2(PHP_OS); -PHPBN2(PHP_SAPI); -PHPBN2(PHP_EOL); -PHPBN2(PHP_INT_MAX); -PHPBN2(PHP_INT_SIZE); -PHPBN2(PHP_FLOAT_DIG); // Since 7.2.0 -PHPBN2(PHP_FLOAT_EPSILON); // Since 7.2.0 -PHPBN2(PHP_FLOAT_MIN); // Since 7.2.0 -PHPBN2(PHP_FLOAT_MAX); // Since 7.2.0 -PHPBN2(DEFAULT_INCLUDE_PATH); -PHPBN2(PEAR_INSTALL_DIR); -PHPBN2(PEAR_EXTENSION_DIR); -PHPBN2(PHP_EXTENSION_DIR); -PHPBN2(PHP_PREFIX); -PHPBN2(PHP_BINDIR); -PHPBN2(PHP_BINARY); -PHPBN2(PHP_MANDIR); -PHPBN2(PHP_LIBDIR); -PHPBN2(PHP_DATADIR); -PHPBN2(PHP_SYSCONFDIR); -PHPBN2(PHP_LOCALSTATEDIR); -PHPBN2(PHP_CONFIG_FILE_PATH); -PHPBN2(PHP_CONFIG_FILE_SCAN_DIR); -PHPBN2(PHP_SHLIB_SUFFIX); -PHPBN2(PHP_FD_SETSIZE); // Since 7.1.0 -PHPBN2(E_ERROR); -PHPBN2(E_WARNING); -PHPBN2(E_PARSE); -PHPBN2(E_NOTICE); -PHPBN2(E_CORE_ERROR); -PHPBN2(E_CORE_WARNING); -PHPBN2(E_COMPILE_ERROR); -PHPBN2(E_COMPILE_WARNING); -PHPBN2(E_USER_ERROR); -PHPBN2(E_USER_WARNING); -PHPBN2(E_USER_NOTICE); -PHPBN2(E_RECOVERABLE_ERROR); -PHPBN2(E_DEPRECATED); -PHPBN2(E_USER_DEPRECATED); -PHPBN2(E_ALL); -PHPBN2(E_STRICT); -PHPBN2(__COMPILER_HALT_OFFSET__); -// TRUE, FALSE, NULL are listed on the same page, but are actually -// case-insensitive, whereas all the other constants listed there seem to be -// case-sensitive, so we handle TRUE, FALSE, NULL in PHPBN1. -PHPBN2(PHP_OUTPUT_HANDLER_START); -PHPBN2(PHP_OUTPUT_HANDLER_CONT); -PHPBN2(PHP_OUTPUT_HANDLER_END); -/* Since 7.4.0 (Microsoft Windows only) */ -PHPBN2(PHP_WINDOWS_EVENT_CTRL_C); -PHPBN2(PHP_WINDOWS_EVENT_CTRL_BREAK); -/* These don't actually seem to be set (tested on Linux, I guess they're - * Windows only?) */ -PHPBN2(PHP_WINDOWS_NT_DOMAIN_CONTROLLER); -PHPBN2(PHP_WINDOWS_NT_SERVER); -PHPBN2(PHP_WINDOWS_NT_WORKSTATION); -PHPBN2(PHP_WINDOWS_VERSION_BUILD); -PHPBN2(PHP_WINDOWS_VERSION_MAJOR); -PHPBN2(PHP_WINDOWS_VERSION_MINOR); -PHPBN2(PHP_WINDOWS_VERSION_PLATFORM); -PHPBN2(PHP_WINDOWS_VERSION_PRODUCTTYPE); -PHPBN2(PHP_WINDOWS_VERSION_SP_MAJOR); -PHPBN2(PHP_WINDOWS_VERSION_SP_MINOR); -PHPBN2(PHP_WINDOWS_VERSION_SUITEMASK); -/* "Standard Predefined Constants" from http://php.net/manual/en/reserved.constants.php */ -PHPBN2(EXTR_OVERWRITE); -PHPBN2(EXTR_SKIP); -PHPBN2(EXTR_PREFIX_SAME); -PHPBN2(EXTR_PREFIX_ALL); -PHPBN2(EXTR_PREFIX_INVALID); -PHPBN2(EXTR_PREFIX_IF_EXISTS); -PHPBN2(EXTR_IF_EXISTS); -PHPBN2(SORT_ASC); -PHPBN2(SORT_DESC); -PHPBN2(SORT_REGULAR); -PHPBN2(SORT_NUMERIC); -PHPBN2(SORT_STRING); -PHPBN2(CASE_LOWER); -PHPBN2(CASE_UPPER); -PHPBN2(COUNT_NORMAL); -PHPBN2(COUNT_RECURSIVE); -PHPBN2(ASSERT_ACTIVE); -PHPBN2(ASSERT_CALLBACK); -PHPBN2(ASSERT_BAIL); -PHPBN2(ASSERT_WARNING); -PHPBN2(ASSERT_QUIET_EVAL); -PHPBN2(CONNECTION_ABORTED); -PHPBN2(CONNECTION_NORMAL); -PHPBN2(CONNECTION_TIMEOUT); -PHPBN2(INI_USER); -PHPBN2(INI_PERDIR); -PHPBN2(INI_SYSTEM); -PHPBN2(INI_ALL); -PHPBN2(INI_SCANNER_NORMAL); -PHPBN2(INI_SCANNER_RAW); -PHPBN2(M_E); -PHPBN2(M_LOG2E); -PHPBN2(M_LOG10E); -PHPBN2(M_LN2); -PHPBN2(M_LN10); -PHPBN2(M_PI); -PHPBN2(M_PI_2); -PHPBN2(M_PI_4); -PHPBN2(M_1_PI); -PHPBN2(M_2_PI); -PHPBN2(M_2_SQRTPI); -PHPBN2(M_SQRT2); -PHPBN2(M_SQRT1_2); -PHPBN2(M_EULER); -PHPBN2(M_LNPI); -PHPBN2(M_SQRT3); -PHPBN2(M_SQRTPI); -PHPBN2(CRYPT_SALT_LENGTH); -PHPBN2(CRYPT_STD_DES); -PHPBN2(CRYPT_EXT_DES); -PHPBN2(CRYPT_MD5); -PHPBN2(CRYPT_BLOWFISH); -PHPBN2(DIRECTORY_SEPARATOR); -PHPBN2(SEEK_SET); -PHPBN2(SEEK_CUR); -PHPBN2(SEEK_END); -PHPBN2(LOCK_SH); -PHPBN2(LOCK_EX); -PHPBN2(LOCK_UN); -PHPBN2(LOCK_NB); -PHPBN2(HTML_SPECIALCHARS); -PHPBN2(HTML_ENTITIES); -PHPBN2(ENT_COMPAT); -PHPBN2(ENT_QUOTES); -PHPBN2(ENT_NOQUOTES); -PHPBN2(INFO_GENERAL); -PHPBN2(INFO_CREDITS); -PHPBN2(INFO_CONFIGURATION); -PHPBN2(INFO_MODULES); -PHPBN2(INFO_ENVIRONMENT); -PHPBN2(INFO_VARIABLES); -PHPBN2(INFO_LICENSE); -PHPBN2(INFO_ALL); -PHPBN2(CREDITS_GROUP); -PHPBN2(CREDITS_GENERAL); -PHPBN2(CREDITS_SAPI); -PHPBN2(CREDITS_MODULES); -PHPBN2(CREDITS_DOCS); -PHPBN2(CREDITS_FULLPAGE); -PHPBN2(CREDITS_QA); -PHPBN2(CREDITS_ALL); -PHPBN2(STR_PAD_LEFT); -PHPBN2(STR_PAD_RIGHT); -PHPBN2(STR_PAD_BOTH); -PHPBN2(PATHINFO_DIRNAME); -PHPBN2(PATHINFO_BASENAME); -PHPBN2(PATHINFO_EXTENSION); -PHPBN2(PATHINFO_FILENAME); -PHPBN2(PATH_SEPARATOR); -PHPBN2(CHAR_MAX); -PHPBN2(LC_CTYPE); -PHPBN2(LC_NUMERIC); -PHPBN2(LC_TIME); -PHPBN2(LC_COLLATE); -PHPBN2(LC_MONETARY); -PHPBN2(LC_ALL); -PHPBN2(LC_MESSAGES); -PHPBN2(ABDAY_1); -PHPBN2(ABDAY_2); -PHPBN2(ABDAY_3); -PHPBN2(ABDAY_4); -PHPBN2(ABDAY_5); -PHPBN2(ABDAY_6); -PHPBN2(ABDAY_7); -PHPBN2(DAY_1); -PHPBN2(DAY_2); -PHPBN2(DAY_3); -PHPBN2(DAY_4); -PHPBN2(DAY_5); -PHPBN2(DAY_6); -PHPBN2(DAY_7); -PHPBN2(ABMON_1); -PHPBN2(ABMON_2); -PHPBN2(ABMON_3); -PHPBN2(ABMON_4); -PHPBN2(ABMON_5); -PHPBN2(ABMON_6); -PHPBN2(ABMON_7); -PHPBN2(ABMON_8); -PHPBN2(ABMON_9); -PHPBN2(ABMON_10); -PHPBN2(ABMON_11); -PHPBN2(ABMON_12); -PHPBN2(MON_1); -PHPBN2(MON_2); -PHPBN2(MON_3); -PHPBN2(MON_4); -PHPBN2(MON_5); -PHPBN2(MON_6); -PHPBN2(MON_7); -PHPBN2(MON_8); -PHPBN2(MON_9); -PHPBN2(MON_10); -PHPBN2(MON_11); -PHPBN2(MON_12); -PHPBN2(AM_STR); -PHPBN2(PM_STR); -PHPBN2(D_T_FMT); -PHPBN2(D_FMT); -PHPBN2(T_FMT); -PHPBN2(T_FMT_AMPM); -PHPBN2(ERA); -PHPBN2(ERA_YEAR); -PHPBN2(ERA_D_T_FMT); -PHPBN2(ERA_D_FMT); -PHPBN2(ERA_T_FMT); -PHPBN2(ALT_DIGITS); -PHPBN2(INT_CURR_SYMBOL); -PHPBN2(CURRENCY_SYMBOL); -PHPBN2(CRNCYSTR); -PHPBN2(MON_DECIMAL_POINT); -PHPBN2(MON_THOUSANDS_SEP); -PHPBN2(MON_GROUPING); -PHPBN2(POSITIVE_SIGN); -PHPBN2(NEGATIVE_SIGN); -PHPBN2(INT_FRAC_DIGITS); -PHPBN2(FRAC_DIGITS); -PHPBN2(P_CS_PRECEDES); -PHPBN2(P_SEP_BY_SPACE); -PHPBN2(N_CS_PRECEDES); -PHPBN2(N_SEP_BY_SPACE); -PHPBN2(P_SIGN_POSN); -PHPBN2(N_SIGN_POSN); -PHPBN2(DECIMAL_POINT); -PHPBN2(RADIXCHAR); -PHPBN2(THOUSANDS_SEP); -PHPBN2(THOUSEP); -PHPBN2(GROUPING); -PHPBN2(YESEXPR); -PHPBN2(NOEXPR); -PHPBN2(YESSTR); -PHPBN2(NOSTR); -PHPBN2(CODESET); -PHPBN2(LOG_EMERG); -PHPBN2(LOG_ALERT); -PHPBN2(LOG_CRIT); -PHPBN2(LOG_ERR); -PHPBN2(LOG_WARNING); -PHPBN2(LOG_NOTICE); -PHPBN2(LOG_INFO); -PHPBN2(LOG_DEBUG); -PHPBN2(LOG_KERN); -PHPBN2(LOG_USER); -PHPBN2(LOG_MAIL); -PHPBN2(LOG_DAEMON); -PHPBN2(LOG_AUTH); -PHPBN2(LOG_SYSLOG); -PHPBN2(LOG_LPR); -PHPBN2(LOG_NEWS); -PHPBN2(LOG_UUCP); -PHPBN2(LOG_CRON); -PHPBN2(LOG_AUTHPRIV); -PHPBN2(LOG_LOCAL0); -PHPBN2(LOG_LOCAL1); -PHPBN2(LOG_LOCAL2); -PHPBN2(LOG_LOCAL3); -PHPBN2(LOG_LOCAL4); -PHPBN2(LOG_LOCAL5); -PHPBN2(LOG_LOCAL6); -PHPBN2(LOG_LOCAL7); -PHPBN2(LOG_PID); -PHPBN2(LOG_CONS); -PHPBN2(LOG_ODELAY); -PHPBN2(LOG_NDELAY); -PHPBN2(LOG_NOWAIT); -PHPBN2(LOG_PERROR); - -PHPBN2(PREG_BACKTRACK_LIMIT_ERROR); -PHPBN2(PREG_BAD_UTF8_ERROR); -PHPBN2(PREG_INTERNAL_ERROR); -PHPBN2(PREG_NO_ERROR); -PHPBN2(PREG_RECURSION_LIMIT_ERROR); -PHPBN2(UPLOAD_ERR_EXTENSION); -PHPBN2(STREAM_SHUT_RD); -PHPBN2(STREAM_SHUT_WR); -PHPBN2(STREAM_SHUT_RDWR); -PHPBN2(CURLE_FILESIZE_EXCEEDED); -PHPBN2(CURLE_FTP_SSL_FAILED); -PHPBN2(CURLE_LDAP_INVALID_URL); -PHPBN2(CURLFTPAUTH_DEFAULT); -PHPBN2(CURLFTPAUTH_SSL); -PHPBN2(CURLFTPAUTH_TLS); -PHPBN2(CURLFTPSSL_ALL); -PHPBN2(CURLFTPSSL_CONTROL); -PHPBN2(CURLFTPSSL_NONE); -PHPBN2(CURLFTPSSL_TRY); -PHPBN2(CURLOPT_FTP_SSL); -PHPBN2(CURLOPT_FTPSSLAUTH); -PHPBN2(CURLOPT_TCP_NODELAY); -PHPBN2(CURLOPT_TIMEOUT_MS); -PHPBN2(CURLOPT_CONNECTTIMEOUT_MS); -PHPBN2(GMP_VERSION); -PHPBN2(OPENSSL_VERSION_NUMBER); -PHPBN2(SNMP_OID_OUTPUT_FULL); -PHPBN2(SNMP_OID_OUTPUT_NUMERIC); -PHPBN2(MSG_EAGAIN); -PHPBN2(MSG_ENOMSG); - -PHPBN2(CURLOPT_PROGRESSFUNCTION); -PHPBN2(IMG_FILTER_PIXELATE); -PHPBN2(JSON_ERROR_CTRL_CHAR); -PHPBN2(JSON_ERROR_DEPTH); -PHPBN2(JSON_ERROR_NONE); -PHPBN2(JSON_ERROR_STATE_MISMATCH); -PHPBN2(JSON_ERROR_SYNTAX); -PHPBN2(JSON_FORCE_OBJECT); -PHPBN2(JSON_HEX_TAG); -PHPBN2(JSON_HEX_AMP); -PHPBN2(JSON_HEX_APOS); -PHPBN2(JSON_HEX_QUOT); -PHPBN2(LDAP_OPT_NETWORK_TIMEOUT); -PHPBN2(LIBXML_LOADED_VERSION); -PHPBN2(PREG_BAD_UTF8_OFFSET_ERROR); -PHPBN2(BUS_ADRALN); -PHPBN2(BUS_ADRERR); -PHPBN2(BUS_OBJERR); -PHPBN2(CLD_CONTIUNED); -PHPBN2(CLD_DUMPED); -PHPBN2(CLD_EXITED); -PHPBN2(CLD_KILLED); -PHPBN2(CLD_STOPPED); -PHPBN2(CLD_TRAPPED); -PHPBN2(FPE_FLTDIV); -PHPBN2(FPE_FLTINV); -PHPBN2(FPE_FLTOVF); -PHPBN2(FPE_FLTRES); -PHPBN2(FPE_FLTSUB); -PHPBN2(FPE_FLTUND); -PHPBN2(FPE_INTDIV); -PHPBN2(FPE_INTOVF); -PHPBN2(ILL_BADSTK); -PHPBN2(ILL_COPROC); -PHPBN2(ILL_ILLADR); -PHPBN2(ILL_ILLOPC); -PHPBN2(ILL_ILLOPN); -PHPBN2(ILL_ILLTRP); -PHPBN2(ILL_PRVOPC); -PHPBN2(ILL_PRVREG); -PHPBN2(POLL_ERR); -PHPBN2(POLL_HUP); -PHPBN2(POLL_IN); -PHPBN2(POLL_MSG); -PHPBN2(POLL_OUT); -PHPBN2(POLL_PRI); -PHPBN2(SEGV_ACCERR); -PHPBN2(SEGV_MAPERR); -PHPBN2(SI_ASYNCIO); -PHPBN2(SI_KERNEL); -PHPBN2(SI_MESGQ); -PHPBN2(SI_NOINFO); -PHPBN2(SI_QUEUE); -PHPBN2(SI_SIGIO); -PHPBN2(SI_TIMER); -PHPBN2(SI_TKILL); -PHPBN2(SI_USER); -PHPBN2(SIG_BLOCK); -PHPBN2(SIG_SETMASK); -PHPBN2(SIG_UNBLOCK); -PHPBN2(TRAP_BRKPT); -PHPBN2(TRAP_TRACE); - -PHPBN2(ENT_DISALLOWED); -PHPBN2(ENT_HTML401); -PHPBN2(ENT_HTML5); -PHPBN2(ENT_SUBSTITUTE); -PHPBN2(ENT_XML1); -PHPBN2(ENT_XHTML); -PHPBN2(IPPROTO_IP); -PHPBN2(IPPROTO_IPV6); -PHPBN2(IPV6_MULTICAST_HOPS); -PHPBN2(IPV6_MULTICAST_IF); -PHPBN2(IPV6_MULTICAST_LOOP); -PHPBN2(IP_MULTICAST_IF); -PHPBN2(IP_MULTICAST_LOOP); -PHPBN2(IP_MULTICAST_TTL); -PHPBN2(MCAST_JOIN_GROUP); -PHPBN2(MCAST_LEAVE_GROUP); -PHPBN2(MCAST_BLOCK_SOURCE); -PHPBN2(MCAST_UNBLOCK_SOURCE); -PHPBN2(MCAST_JOIN_SOURCE_GROUP); -PHPBN2(MCAST_LEAVE_SOURCE_GROUP); -PHPBN2(CURLOPT_MAX_RECV_SPEED_LARGE); -PHPBN2(CURLOPT_MAX_SEND_SPEED_LARGE); -PHPBN2(LIBXML_HTML_NODEFDTD); -PHPBN2(LIBXML_HTML_NOIMPLIED); -PHPBN2(LIBXML_PEDANTIC); -PHPBN2(OPENSSL_CIPHER_AES_128_CBC); -PHPBN2(OPENSSL_CIPHER_AES_192_CBC); -PHPBN2(OPENSSL_CIPHER_AES_256_CBC); -PHPBN2(OPENSSL_RAW_DATA); -PHPBN2(OPENSSL_ZERO_PADDING); -PHPBN2(PHP_OUTPUT_HANDLER_CLEAN); -PHPBN2(PHP_OUTPUT_HANDLER_CLEANABLE); -PHPBN2(PHP_OUTPUT_HANDLER_DISABLED); -PHPBN2(PHP_OUTPUT_HANDLER_FINAL); -PHPBN2(PHP_OUTPUT_HANDLER_FLUSH); -PHPBN2(PHP_OUTPUT_HANDLER_FLUSHABLE); -PHPBN2(PHP_OUTPUT_HANDLER_REMOVABLE); -PHPBN2(PHP_OUTPUT_HANDLER_STARTED); -PHPBN2(PHP_OUTPUT_HANDLER_STDFLAGS); -PHPBN2(PHP_OUTPUT_HANDLER_WRITE); -PHPBN2(PHP_SESSION_ACTIVE); -PHPBN2(PHP_SESSION_DISABLED); -PHPBN2(PHP_SESSION_NONE); -PHPBN2(STREAM_META_ACCESS); -PHPBN2(STREAM_META_GROUP); -PHPBN2(STREAM_META_GROUP_NAME); -PHPBN2(STREAM_META_OWNER); -PHPBN2(STREAM_META_OWNER_NAME); -PHPBN2(STREAM_META_TOUCH); -PHPBN2(ZLIB_ENCODING_DEFLATE); -PHPBN2(ZLIB_ENCODING_GZIP); -PHPBN2(ZLIB_ENCODING_RAW); -PHPBN2(U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR); -PHPBN2(IDNA_CHECK_BIDI); -PHPBN2(IDNA_CHECK_CONTEXTJ); -PHPBN2(IDNA_NONTRANSITIONAL_TO_ASCII); -PHPBN2(IDNA_NONTRANSITIONAL_TO_UNICODE); -PHPBN2(INTL_IDNA_VARIANT_2003); -PHPBN2(INTL_IDNA_VARIANT_UTS46); -PHPBN2(IDNA_ERROR_EMPTY_LABEL); -PHPBN2(IDNA_ERROR_LABEL_TOO_LONG); -PHPBN2(IDNA_ERROR_DOMAIN_NAME_TOO_LONG); -PHPBN2(IDNA_ERROR_LEADING_HYPHEN); -PHPBN2(IDNA_ERROR_TRAILING_HYPHEN); -PHPBN2(IDNA_ERROR_HYPHEN_3_4); -PHPBN2(IDNA_ERROR_LEADING_COMBINING_MARK); -PHPBN2(IDNA_ERROR_DISALLOWED); -PHPBN2(IDNA_ERROR_PUNYCODE); -PHPBN2(IDNA_ERROR_LABEL_HAS_DOT); -PHPBN2(IDNA_ERROR_INVALID_ACE_LABEL); -PHPBN2(IDNA_ERROR_BIDI); -PHPBN2(IDNA_ERROR_CONTEXTJ); -PHPBN2(JSON_PRETTY_PRINT); -PHPBN2(JSON_UNESCAPED_SLASHES); -PHPBN2(JSON_NUMERIC_CHECK); -PHPBN2(JSON_UNESCAPED_UNICODE); -PHPBN2(JSON_BIGINT_AS_STRING); - -PHPBN2(IMG_AFFINE_TRANSLATE); -PHPBN2(IMG_AFFINE_SCALE); -PHPBN2(IMG_AFFINE_ROTATE); -PHPBN2(IMG_AFFINE_SHEAR_HORIZONTAL); -PHPBN2(IMG_AFFINE_SHEAR_VERTICAL); -PHPBN2(IMG_CROP_DEFAULT); -PHPBN2(IMG_CROP_TRANSPARENT); -PHPBN2(IMG_CROP_BLACK); -PHPBN2(IMG_CROP_WHITE); -PHPBN2(IMG_CROP_SIDES); -PHPBN2(IMG_FLIP_BOTH); -PHPBN2(IMG_FLIP_HORIZONTAL); -PHPBN2(IMG_FLIP_VERTICAL); -PHPBN2(IMG_BELL); -PHPBN2(IMG_BESSEL); -PHPBN2(IMG_BICUBIC); -PHPBN2(IMG_BICUBIC_FIXED); -PHPBN2(IMG_BLACKMAN); -PHPBN2(IMG_BOX); -PHPBN2(IMG_BSPLINE); -PHPBN2(IMG_CATMULLROM); -PHPBN2(IMG_GAUSSIAN); -PHPBN2(IMG_GENERALIZED_CUBIC); -PHPBN2(IMG_HERMITE); -PHPBN2(IMG_HAMMING); -PHPBN2(IMG_HANNING); -PHPBN2(IMG_MITCHELL); -PHPBN2(IMG_POWER); -PHPBN2(IMG_QUADRATIC); -PHPBN2(IMG_SINC); -PHPBN2(IMG_NEAREST_NEIGHBOUR); -PHPBN2(IMG_WEIGHTED4); -PHPBN2(IMG_TRIANGLE); -PHPBN2(JSON_ERROR_RECURSION); -PHPBN2(JSON_ERROR_INF_OR_NAN); -PHPBN2(JSON_ERROR_UNSUPPORTED_TYPE); -PHPBN2(MYSQLI_SERVER_PUBLIC_KEY); - -PHPBN2(LDAP_ESCAPE_DN); -PHPBN2(LDAP_ESCAPE_FILTER); -PHPBN2(OPENSSL_DEFAULT_STREAM_CIPHERS); -PHPBN2(STREAM_CRYPTO_METHOD_ANY_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_ANY_SERVER); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_0_SERVER); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_1_SERVER); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT); -PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_2_SERVER); -PHPBN2(PGSQL_CONNECT_ASYNC); -PHPBN2(PGSQL_CONNECTION_AUTH_OK); -PHPBN2(PGSQL_CONNECTION_AWAITING_RESPONSE); -PHPBN2(PGSQL_CONNECTION_MADE); -PHPBN2(PGSQL_CONNECTION_SETENV); -PHPBN2(PGSQL_CONNECTION_SSL_STARTUP); -PHPBN2(PGSQL_CONNECTION_STARTED); -PHPBN2(PGSQL_DML_ESCAPE); -PHPBN2(PGSQL_POLLING_ACTIVE); -PHPBN2(PGSQL_POLLING_FAILED); -PHPBN2(PGSQL_POLLING_OK); -PHPBN2(PGSQL_POLLING_READING); -PHPBN2(PGSQL_POLLING_WRITING); - -/* Class names reserved by PHP. */ -/* Check is case insensitive - these *MUST* be listed in lower case here. */ -PHPCN(directory); -PHPCN(stdclass); -PHPCN(__php_incomplete_class); -PHPCN(exception); -PHPCN(errorexception); -PHPCN(php_user_filter); -PHPCN(closure); -PHPCN(generator); -PHPCN(self); -PHPCN(parent); -/* http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.other.classes */ -PHPCN(bool); // As of PHP 7.0 -PHPCN(int); // As of PHP 7.0 -PHPCN(float); // As of PHP 7.0 -PHPCN(string); // As of PHP 7.0 -PHPCN(null); // As of PHP 7.0 -PHPCN(true); // As of PHP 7.0 -PHPCN(false); // As of PHP 7.0 -PHPCN(resource); // As of PHP 7.0 (currently works but reserved) -PHPCN(object); // As of PHP 7.0 (currently works but reserved) -PHPCN(mixed); // As of PHP 7.0 (currently works but reserved) -PHPCN(numeric); // As of PHP 7.0 (currently works but reserved) -/* http://php.net/manual/en/migration71.incompatible.php#migration71.incompatible.invalid-class-names */ -PHPCN(iterable); // As of PHP 7.1 -PHPCN(void); // As of PHP 7.1 -/* Predefined interfaces and classes, introduced in PHP 7.0.0 */ -PHPCN(arithmeticerror); -PHPCN(assertionerror); -PHPCN(divisionbyzeroerror); -PHPCN(error); -PHPCN(throwable); -PHPCN(parseerror); -PHPCN(typeerror); -/* From extensions (which of these are actually predefined depends which - * extensions are loaded by default). */ -PHPCN(xmlwriter); -PHPCN(libxmlerror); -PHPCN(simplexmlelement); -PHPCN(soapclient); -PHPCN(soapvar); -PHPCN(soapserver); -PHPCN(soapfault); -PHPCN(soapparam); -PHPCN(soapheader); -PHPCN(recursiveiteratoriterator); -PHPCN(filteriterator); -PHPCN(recursivefilteriterator); -PHPCN(parentiterator); -PHPCN(limititerator); -PHPCN(cachingiterator); -PHPCN(recursivecachingiterator); -PHPCN(iteratoriterator); -PHPCN(norewinditerator); -PHPCN(appenditerator); -PHPCN(infiniteiterator); -PHPCN(emptyiterator); -PHPCN(arrayobject); -PHPCN(arrayiterator); -PHPCN(recursivearrayiterator); -PHPCN(splfileinfo); -PHPCN(directoryiterator); -PHPCN(recursivedirectoryiterator); -PHPCN(splfileobject); -PHPCN(spltempfileobject); -PHPCN(simplexmliterator); -PHPCN(logicexception); -PHPCN(badfunctioncallexception); -PHPCN(badmethodcallexception); -PHPCN(domainexception); -PHPCN(invalidargumentexception); -PHPCN(lengthexception); -PHPCN(outofrangeexception); -PHPCN(runtimeexception); -PHPCN(outofboundsexception); -PHPCN(overflowexception); -PHPCN(rangeexception); -PHPCN(underflowexception); -PHPCN(unexpectedvalueexception); -PHPCN(splobjectstorage); -PHPCN(reflectionexception); -PHPCN(reflection); -PHPCN(reflectionfunction); -PHPCN(reflectionparameter); -PHPCN(reflectionmethod); -PHPCN(reflectionclass); -PHPCN(reflectionobject); -PHPCN(reflectionproperty); -PHPCN(reflectionextension); -PHPCN(domexception); -PHPCN(domstringlist); -PHPCN(domnamelist); -PHPCN(domimplementationlist); -PHPCN(domimplementationsource); -PHPCN(domimplementation); -PHPCN(domnode); -PHPCN(domnamespacenode); -PHPCN(domdocumentfragment); -PHPCN(domdocument); -PHPCN(domnodelist); -PHPCN(domnamednodemap); -PHPCN(domcharacterdata); -PHPCN(domattr); -PHPCN(domelement); -PHPCN(domtext); -PHPCN(domcomment); -PHPCN(domtypeinfo); -PHPCN(domuserdatahandler); -PHPCN(domdomerror); -PHPCN(domerrorhandler); -PHPCN(domlocator); -PHPCN(domconfiguration); -PHPCN(domcdatasection); -PHPCN(domdocumenttype); -PHPCN(domnotation); -PHPCN(domentity); -PHPCN(domentityreference); -PHPCN(domprocessinginstruction); -PHPCN(domstringextend); -PHPCN(domxpath); -PHPCN(xmlreader); -PHPCN(sqlitedatabase); -PHPCN(sqliteresult); -PHPCN(sqliteunbuffered); -PHPCN(sqliteexception); -PHPCN(datetime); - -/* Built-in PHP functions (incomplete). */ -/* Includes Array Functions - http://php.net/manual/en/ref.array.php */ -/* Check is case insensitive - these *MUST* be listed in lower case here */ -PHPFN(__halt_compiler); -PHPFN(acos); -PHPFN(array); -PHPFN(array_change_key_case); -PHPFN(array_chunk); -PHPFN(array_column); -PHPFN(array_combine); -PHPFN(array_count_values); -PHPFN(array_diff); -PHPFN(array_diff_assoc); -PHPFN(array_diff_key); -PHPFN(array_diff_uassoc); -PHPFN(array_diff_ukey); -PHPFN(array_fill); -PHPFN(array_fill_keys); -PHPFN(array_filter); -PHPFN(array_flip); -PHPFN(array_intersect); -PHPFN(array_intersect_assoc); -PHPFN(array_intersect_key); -PHPFN(array_intersect_uassoc); -PHPFN(array_intersect_ukey); -PHPFN(array_key_exists); -PHPFN(array_keys); -PHPFN(array_map); -PHPFN(array_merge); -PHPFN(array_merge_recursive); -PHPFN(array_multisort); -PHPFN(array_pad); -PHPFN(array_pop); -PHPFN(array_product); -PHPFN(array_push); -PHPFN(array_rand); -PHPFN(array_reduce); -PHPFN(array_replace); -PHPFN(array_replace_recursive); -PHPFN(array_reverse); -PHPFN(array_search); -PHPFN(array_shift); -PHPFN(array_slice); -PHPFN(array_splice); -PHPFN(array_sum); -PHPFN(array_udiff); -PHPFN(array_udiff_assoc); -PHPFN(array_udiff_uassoc); -PHPFN(array_uintersect); -PHPFN(array_uintersect_assoc); -PHPFN(array_uintersect_uassoc); -PHPFN(array_unique); -PHPFN(array_unshift); -PHPFN(array_values); -PHPFN(array_walk); -PHPFN(array_walk_recursive); -PHPFN(arsort); -PHPFN(asin); -PHPFN(asort); -PHPFN(atan); -PHPFN(atan2); -PHPFN(ceil); -PHPFN(compact); -PHPFN(cos); -PHPFN(cosh); -PHPFN(count); -PHPFN(current); -PHPFN(die); // "Language construct" -PHPFN(each); -PHPFN(echo); // "Language construct" -PHPFN(empty); -PHPFN(end); -PHPFN(eval); // "Language construct" -PHPFN(exit); // "Language construct" -PHPFN(exp); -PHPFN(extract); -PHPFN(floor); -PHPFN(fmod); -PHPFN(in_array); -PHPFN(include); // "Language construct" -PHPFN(include_once); // "Language construct" -PHPFN(isset); // "Language construct" -PHPFN(key); -PHPFN(key_exists); -PHPFN(krsort); -PHPFN(ksort); -PHPFN(list); // "Language construct" -PHPFN(log); -PHPFN(log10); -PHPFN(max); -PHPFN(min); -PHPFN(natcasesort); -PHPFN(natsort); -PHPFN(next); -PHPFN(pos); -PHPFN(pow); -PHPFN(prev); -PHPFN(print); // "Language construct" -PHPFN(range); -PHPFN(reset); -PHPFN(rsort); -PHPFN(require); // "Language construct" -PHPFN(require_once); // "Language construct" -PHPFN(return); // "Language construct" -PHPFN(shuffle); -PHPFN(sin); -PHPFN(sinh); -PHPFN(sizeof); -PHPFN(sort); -PHPFN(sqrt); -PHPFN(tan); -PHPFN(tanh); -PHPFN(uasort); -PHPFN(uksort); -PHPFN(unset); // "Language construct" -PHPFN(usort); - -#undef PHPKW -#undef PHPKW_ok_as_function -#undef PHPBN1a -#undef PHPBN1b -#undef PHPBN1 -#undef PHPBN2a -#undef PHPBN2b -#undef PHPBN2 -#undef PHPCN -#undef PHPFN diff --git a/win64/bin/swig/share/swig/4.1.0/php/phppointers.i b/win64/bin/swig/share/swig/4.1.0/php/phppointers.i deleted file mode 100755 index 70f9586e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/phppointers.i +++ /dev/null @@ -1,42 +0,0 @@ -%define %pass_by_ref( TYPE, PHP_TYPE, CONVERT_IN, CONVERT_OUT ) -%typemap(in,byref=1,phptype=PHP_TYPE) TYPE *REF ($*1_ltype tmp), - TYPE &REF ($*1_ltype tmp) -%{ - if (Z_ISREF($input)) { - CONVERT_IN(tmp, $*1_ltype, $input); - $1 = &tmp; - } else { - zend_type_error(SWIG_PHP_Arg_Error_Msg($argnum, Expected a reference)); - } -%} -%typemap(argout) TYPE *REF, - TYPE &REF -%{ - if (Z_ISREF($input)) { - CONVERT_OUT(Z_REFVAL($input), tmp$argnum); - } -%} -%enddef - -%pass_by_ref( size_t, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed int, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( int, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( unsigned int, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed short, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( short, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( unsigned short, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed long, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( long, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( unsigned long, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( signed char, "int", CONVERT_INT_IN, ZVAL_LONG ); -%pass_by_ref( char, "string", CONVERT_CHAR_IN, ZVAL_STRING ); -%pass_by_ref( unsigned char, "int", CONVERT_INT_IN, ZVAL_LONG ); - -%pass_by_ref( float, "float", CONVERT_FLOAT_IN, ZVAL_DOUBLE ); -%pass_by_ref( double, "float", CONVERT_FLOAT_IN, ZVAL_DOUBLE ); - -%pass_by_ref( char *, "string", CONVERT_CHAR_IN, ZVAL_STRING ); diff --git a/win64/bin/swig/share/swig/4.1.0/php/phprun.swg b/win64/bin/swig/share/swig/4.1.0/php/phprun.swg deleted file mode 100755 index 108f0ba0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/phprun.swg +++ /dev/null @@ -1,272 +0,0 @@ -/* ----------------------------------------------------------------------------- - * phprun.swg - * - * PHP runtime library - * ----------------------------------------------------------------------------- */ - -#define swig_owntype int - -#ifdef __cplusplus -extern "C" { -#endif - -#if PHP_MAJOR_VERSION < 7 -# error These bindings need PHP 7 or later - to generate PHP5 bindings use: SWIG < 4.0.0 and swig -php5 -#endif - -#include "zend_inheritance.h" -#include "zend_exceptions.h" -#include "zend_inheritance.h" - -#if PHP_MAJOR_VERSION == 7 -/* These macros were new in PHP 8.0. For PHP 7.x we define them to give the - * same result except without any type declarations. PHP 7.x supports type - * declarations, but not for the return type, and alternate types aren't - * supported, so we don't try to support these. - */ -# define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(name, byref, num_req, classes, types) \ - ZEND_BEGIN_ARG_INFO_EX(name, 0, byref, num_req) -# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, byref, num_req, types) \ - ZEND_BEGIN_ARG_INFO_EX(name, 0, byref, num_req) - -/* NB We can just ignore `default` here we currently always pass NULL for it - * (this mechanism for specifying default parameter values was new in PHP 8.0 - * so it's not useful while we still want to support PHP7 too). - */ -# define ZEND_ARG_OBJ_TYPE_MASK(byref, name, classes, types, default) \ - ZEND_ARG_INFO(byref, name) -# define ZEND_ARG_TYPE_MASK(byref, name, types, default) \ - ZEND_ARG_INFO(byref, name) -#endif - -#include /* for abort(), used in generated code. */ - -#define SWIG_BOOL_CONSTANT(N, V) REGISTER_BOOL_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) -#define SWIG_LONG_CONSTANT(N, V) REGISTER_LONG_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) -#define SWIG_DOUBLE_CONSTANT(N, V) REGISTER_DOUBLE_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) -#define SWIG_STRING_CONSTANT(N, V) REGISTER_STRING_CONSTANT(#N, (char*)V, CONST_CS | CONST_PERSISTENT) -#define SWIG_CHAR_CONSTANT(N, V) do {\ - char swig_char = (V);\ - REGISTER_STRINGL_CONSTANT(#N, &swig_char, 1, CONST_CS | CONST_PERSISTENT);\ -} while (0) - -/* ZEND_CONSTANT_SET_FLAGS was new in PHP 7.3. */ -#ifdef ZEND_CONSTANT_SET_FLAGS -# define SWIG_ZEND_CONSTANT_SET_FLAGS ZEND_CONSTANT_SET_FLAGS -#else -# define SWIG_ZEND_CONSTANT_SET_FLAGS(C, F, N) do { (C)->flags = (F); (C)->module_number = (N); } while (0) -#endif - -/* zend_object_alloc was new in PHP 7.3. */ -#if PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION < 3 -static zend_always_inline void *zend_object_alloc(size_t obj_size, zend_class_entry *ce) { - void *obj = emalloc(obj_size + zend_object_properties_size(ce)); - memset(obj, 0, obj_size - sizeof(zval)); - return obj; -} -#endif - -/* ZEND_THIS was new in PHP 7.4. */ -#ifndef ZEND_THIS -# define ZEND_THIS &EX(This) -#endif - -#ifdef __cplusplus -} -#endif - -#define SWIG_fail goto fail - -static const char *default_error_msg = "Unknown error occurred"; -static int default_error_code = E_ERROR; - -#define SWIG_PHP_Arg_Error_Msg(argnum,extramsg) "Error in argument " #argnum " "#extramsg - -#define SWIG_PHP_Error(code,msg) do { zend_throw_exception(NULL, msg, code); SWIG_fail; } while (0) - -#define SWIG_contract_assert(expr,msg) \ - do { if (!(expr)) zend_printf("Contract Assert Failed %s\n", msg); } while (0) - -/* Standard SWIG API */ -#define SWIG_GetModule(clientdata) SWIG_Php_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer, *(int*)clientdata) - -static zend_class_entry SWIG_Php_swig_wrapped_interface_ce; - -#if PHP_MAJOR_VERSION == 7 -/* zend_class_implements_interface() was new in PHP 8.0. - * - * We could use instanceof_function_ex(C, I, 1) here for 7.4, but for 7.3 - * and earlier that doesn't work, so instead we just provide a compatibility - * implementation which does what zend_class_implements_interface() does in 8.x - * and use that for all 7.x so there are fewer variants to worry about testing. - */ -static int zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) { - uint32_t i; - if (class_ce->num_interfaces) { - for (i = 0; i < class_ce->num_interfaces; i++) { - if (class_ce->interfaces[i] == interface_ce) { - return 1; - } - } - } - return 0; -} -#endif - -/* used to wrap returned objects in so we know whether they are newobject - and need freeing, or not */ -typedef struct { - void * ptr; - int newobject; - const swig_type_info * type; - zend_object std; -} swig_object_wrapper; - -#define SWIG_Z_FETCH_OBJ_P(zv) swig_php_fetch_object(Z_OBJ_P(zv)) - -static inline -swig_object_wrapper * swig_php_fetch_object(zend_object *obj) { - return (swig_object_wrapper *)((char *)obj - XtOffsetOf(swig_object_wrapper, std)); -} - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) - -static void -SWIG_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject) { - // Return PHP NULL for a C/C++ NULL pointer. - if (!ptr) { - ZVAL_NULL(z); - return; - } - - if (!type->clientdata) { - zend_type_error("Type: %s not registered with zend", type->name); - return; - } - - { - zend_object *obj; - swig_object_wrapper *value; - if (Z_TYPE_P(z) == IS_OBJECT) { - /* The PHP object is already initialised - this is the case when wrapping - * the return value from a PHP constructor. */ - obj = Z_OBJ_P(z); - } else { - zend_class_entry *ce = (zend_class_entry*)(type->clientdata); - obj = ce->create_object(ce); - ZVAL_OBJ(z, obj); - } - value = swig_php_fetch_object(obj); - value->ptr = ptr; - value->newobject = (newobject & 1); - value->type = type; - } -} - -/* We wrap C/C++ pointers as PHP objects. */ -static int -SWIG_ConvertPtrAndOwn(zval *z, void **ptr, swig_type_info *ty, int flags, swig_owntype *own) { - if (own) - *own = 0; - - if (z == NULL) { - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - switch (Z_TYPE_P(z)) { - case IS_OBJECT: { - zend_object *obj = Z_OBJ_P(z); - swig_object_wrapper *value; - if (ty && ty->clientdata == (void*)obj->ce) { - // Object is exactly the class asked for - this handles common cases cheaply, - // and in particular the PHP classes we use to wrap a pointer to a non-class. - } else if (!zend_class_implements_interface(obj->ce, &SWIG_Php_swig_wrapped_interface_ce)) { - // Not an object we've wrapped. - return -1; - } - - /* convert and cast value->ptr from value->type to ptr as ty. */ - value = swig_php_fetch_object(obj); - if (!ty) { - /* They don't care about the target type, so just pass on the pointer! */ - *ptr = value->ptr; - } else { - swig_cast_info *tc = SWIG_TypeCheck(value->type->name, ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, value->ptr, &newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own |= SWIG_CAST_NEW_MEMORY; - } - } else { - *ptr = NULL; - } - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !value->newobject) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (*ptr == NULL) - return SWIG_ERROR; /* should be SWIG_NullReferenceError?? */ - if (flags & SWIG_POINTER_DISOWN) { - value->newobject = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - value->ptr = 0; - } - } - - return SWIG_OK; - } - case IS_NULL: - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - return -1; -} - -static int -SWIG_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags) { - return SWIG_ConvertPtrAndOwn(z, ptr, ty, flags, 0); -} - -static const char const_name[] = "swig_runtime_data_type_pointer"; -static swig_module_info *SWIG_Php_GetModule(void) { - zval *pointer = zend_get_constant_str(const_name, sizeof(const_name) - 1); - if (pointer) { - if (Z_TYPE_P(pointer) == IS_LONG) { - return (swig_module_info *) pointer->value.lval; - } - } - return NULL; -} - -static void SWIG_Php_SetModule(swig_module_info *pointer, int module_number) { - REGISTER_LONG_CONSTANT(const_name, (long) pointer, CONST_CS | CONST_PERSISTENT); -} - -/* Common parts of the "create_object" object handler. */ -static zend_object *SWIG_Php_do_create_object(zend_class_entry *ce, zend_object_handlers *handlers) { - swig_object_wrapper *obj = (swig_object_wrapper*)zend_object_alloc(sizeof(swig_object_wrapper), ce); - zend_object_std_init(&obj->std, ce); - object_properties_init(&obj->std, ce); - obj->std.handlers = handlers; - obj->newobject = 1; - return &obj->std; -} - -/* Common parts of the "free_obj" object handler. - Returns void* pointer if the C/C++ object should be destroyed. */ -static void* SWIG_Php_free_obj(zend_object *object) { - if (object) { - swig_object_wrapper *obj = swig_php_fetch_object(object); - zend_object_std_dtor(&obj->std); - if (obj->newobject) return obj->ptr; - } - return NULL; -} diff --git a/win64/bin/swig/share/swig/4.1.0/php/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/php/std_auto_ptr.i deleted file mode 100755 index c4d20245..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/std_auto_ptr.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(&$input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $descriptor(TYPE *) of $symname"); - return; - } else { - zend_type_error("Expected $descriptor(TYPE *) for argument $argnum of $symname"); - return; - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/php/std_common.i b/win64/bin/swig/share/swig/4.1.0/php/std_common.i deleted file mode 100755 index 87ad2322..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/std_common.i +++ /dev/null @@ -1,9 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%apply size_t { std::size_t }; diff --git a/win64/bin/swig/share/swig/4.1.0/php/std_deque.i b/win64/bin/swig/share/swig/4.1.0/php/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/php/std_map.i b/win64/bin/swig/share/swig/4.1.0/php/std_map.i deleted file mode 100755 index f869f61e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/std_map.i +++ /dev/null @@ -1,82 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - bool is_empty() const { - return self->empty(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/win64/bin/swig/share/swig/4.1.0/php/std_pair.i b/win64/bin/swig/share/swig/4.1.0/php/std_pair.i deleted file mode 100755 index 539130ff..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * SWIG typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/php/std_string.i b/win64/bin/swig/share/swig/4.1.0/php/std_string.i deleted file mode 100755 index 7d812e23..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/std_string.i +++ /dev/null @@ -1,90 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string types - * ----------------------------------------------------------------------------- */ - -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - %typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) string, const string& %{ - $1 = (Z_TYPE($input) == IS_STRING) ? 1 : 0; - %} - - %typemap(in, phptype="string") string %{ - convert_to_string(&$input); - $1.assign(Z_STRVAL($input), Z_STRLEN($input)); - %} - - %typemap(directorout) string %{ - convert_to_string($input); - $result.assign(Z_STRVAL_P($input), Z_STRLEN_P($input)); - %} - - %typemap(out, phptype="string") string %{ - ZVAL_STRINGL($result, $1.data(), $1.size()); - %} - - %typemap(directorin) string, const string& %{ - ZVAL_STRINGL($input, $1.data(), $1.size()); - %} - - %typemap(out, phptype="string") const string & %{ - ZVAL_STRINGL($result, $1->data(), $1->size()); - %} - - %typemap(throws) string, const string& %{ - zend_throw_exception(NULL, $1.c_str(), 0); - goto fail; - %} - - %typemap(in, phptype="string") const string & ($*1_ltype temp) %{ - convert_to_string(&$input); - temp.assign(Z_STRVAL($input), Z_STRLEN($input)); - $1 = &temp; - %} - - /* These next two handle a function which takes a non-const reference to - * a std::string and modifies the string. */ - %typemap(in,byref=1, phptype="string") string & ($*1_ltype temp) %{ - { - zval * p = Z_ISREF($input) ? Z_REFVAL($input) : &$input; - convert_to_string(p); - temp.assign(Z_STRVAL_P(p), Z_STRLEN_P(p)); - $1 = &temp; - } - %} - - %typemap(directorout) string & ($*1_ltype *temp) %{ - convert_to_string($input); - temp = new $*1_ltype(Z_STRVAL_P($input), Z_STRLEN_P($input)); - swig_acquire_ownership(temp); - $result = temp; - %} - - %typemap(argout) string & %{ - if (Z_ISREF($input)) { - ZVAL_STRINGL(Z_REFVAL($input), $1->data(), $1->size()); - } - %} - - /* SWIG will apply the non-const typemap above to const string& without - * this more specific typemap. */ - %typemap(argout) const string & "" -} diff --git a/win64/bin/swig/share/swig/4.1.0/php/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/php/std_unique_ptr.i deleted file mode 100755 index 8e511301..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/std_unique_ptr.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(&$input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $descriptor(TYPE *) of $symname"); - return; - } else { - zend_type_error("Expected $descriptor(TYPE *) for argument $argnum of $symname"); - return; - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/php/std_vector.i b/win64/bin/swig/share/swig/4.1.0/php/std_vector.i deleted file mode 100755 index 664a04a1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/std_vector.i +++ /dev/null @@ -1,114 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -%{ -#include -#include -%} - -namespace std { - - template class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - void clear(); - %rename(push) push_back; - void push_back(const value_type& x); - %extend { - bool is_empty() const { - return $self->empty(); - } - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - const_reference get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i class vector { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef bool value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef bool const_reference; - - vector(); - vector(size_type n); - vector(const vector& other); - - size_type size() const; - size_type capacity() const; - void reserve(size_type n); - void clear(); - %rename(push) push_back; - void push_back(const value_type& x); - %extend { - bool is_empty() const { - return $self->empty(); - } - bool pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - bool x = self->back(); - self->pop_back(); - return x; - } - bool get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i>=0 && isize()); - if (i>=0 && i -%include -%include -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/php/swigmove.i b/win64/bin/swig/share/swig/4.1.0/php/swigmove.i deleted file mode 100755 index 44e592fc..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/swigmove.i +++ /dev/null @@ -1,24 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigmove.i - * - * Input typemaps library for implementing full move semantics when passing - * parameters by value. - * ----------------------------------------------------------------------------- */ - -%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr(&$input, &argp, $&1_descriptor, SWIG_POINTER_RELEASE); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - zend_type_error("Cannot release ownership as memory is not owned for argument $argnum of $&1_descriptor of $symname"); - return; - } else { - zend_type_error("Expected $&1_descriptor for argument $argnum of $symname"); - return; - } - } - if (!argp) { - zend_type_error("Invalid null reference for argument $argnum of $&1_descriptor of $symname"); - return; - } - SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp); -} diff --git a/win64/bin/swig/share/swig/4.1.0/php/typemaps.i b/win64/bin/swig/share/swig/4.1.0/php/typemaps.i deleted file mode 100755 index b281cd0b..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/typemaps.i +++ /dev/null @@ -1,295 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i. - * - * SWIG Typemap library for PHP. - * - * This library provides standard typemaps for modifying SWIG's behavior. - * With enough entries in this file, I hope that very few people actually - * ever need to write a typemap. - * - * Define macros to define the following typemaps: - * - * TYPE *INPUT. Argument is passed in as native variable by value. - * TYPE *OUTPUT. Argument is returned as an array from the function call. - * TYPE *INOUT. Argument is passed in by value, and out as part of returned list - * TYPE *REFERENCE. Argument is passed in as native variable with value - * semantics. Variable value is changed with result. - * Use like this: - * int foo(int *REFERENCE); - * - * $a = 0; - * $rc = foo($a); - * - * Even though $a looks like it's passed by value, - * its value can be changed by foo(). - * ----------------------------------------------------------------------------- */ - -%define BOOL_TYPEMAP(TYPE) -%typemap(in, phptype="bool") TYPE *INPUT(TYPE temp), TYPE &INPUT(TYPE temp) -%{ - convert_to_boolean(&$input); - temp = (Z_TYPE($input) == IS_TRUE); - $1 = &temp; -%} -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" -%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;" -%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT -{ - zval o; - ZVAL_BOOL(&o, temp$argnum); - t_output_helper($result, &o); -} -%typemap(in, phptype="float") TYPE *REFERENCE (TYPE lvalue), TYPE &REFERENCE (TYPE lvalue) -%{ - convert_to_boolean($input); - lvalue = (Z_TYPE_P($input) == IS_TRUE); - $1 = &lvalue; -%} -%typemap(argout) TYPE *REFERENCE, TYPE &REFERENCE -%{ - ZVAL_BOOL(&$arg, lvalue$argnum ? true : false); -%} -%enddef - -%define DOUBLE_TYPEMAP(TYPE) -%typemap(in, phptype="float") TYPE *INPUT(TYPE temp), TYPE &INPUT(TYPE temp) -%{ - temp = (TYPE) zval_get_double(&$input); - $1 = &temp; -%} -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" -%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;" -%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT -{ - zval o; - ZVAL_DOUBLE(&o, temp$argnum); - t_output_helper($result, &o); -} -%typemap(in, phptype="float") TYPE *REFERENCE (TYPE dvalue), TYPE &REFERENCE (TYPE dvalue) -%{ - dvalue = (TYPE) zval_get_double(&$input); - $1 = &dvalue; -%} -%typemap(argout) TYPE *REFERENCE, TYPE &REFERENCE -%{ - ZVAL_DOUBLE(&$arg, (double)(lvalue$argnum)); -%} -%enddef - -%define INT_TYPEMAP(TYPE) -%typemap(in, phptype="int") TYPE *INPUT(TYPE temp), TYPE &INPUT(TYPE temp) -%{ - temp = (TYPE) zval_get_long(&$input); - $1 = &temp; -%} -%typemap(argout) TYPE *INPUT, TYPE &INPUT "" -%typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp), TYPE &OUTPUT(TYPE temp) "$1 = &temp;" -%typemap(argout,fragment="t_output_helper") TYPE *OUTPUT, TYPE &OUTPUT -{ - zval o; - ZVAL_LONG(&o, temp$argnum); - t_output_helper($result, &o); -} -%typemap(in, phptype="int") TYPE *REFERENCE (TYPE lvalue), TYPE &REFERENCE (TYPE lvalue) -%{ - lvalue = (TYPE) zval_get_long(&$input); - $1 = &lvalue; -%} -%typemap(argout) TYPE *REFERENCE, TYPE &REFERENCE -%{ - ZVAL_LONG(&$arg, (long)(lvalue$argnum)); -%} -%enddef - -BOOL_TYPEMAP(bool); - -DOUBLE_TYPEMAP(float); -DOUBLE_TYPEMAP(double); - -INT_TYPEMAP(int); -INT_TYPEMAP(short); -INT_TYPEMAP(long); -INT_TYPEMAP(unsigned int); -INT_TYPEMAP(unsigned short); -INT_TYPEMAP(unsigned long); -INT_TYPEMAP(unsigned char); -INT_TYPEMAP(signed char); - -INT_TYPEMAP(long long); -%typemap(argout,fragment="t_output_helper") long long *OUTPUT -{ - zval o; - if ((long long)LONG_MIN <= temp$argnum && temp$argnum <= (long long)LONG_MAX) { - ZVAL_LONG(&o, (long)temp$argnum); - } else { - ZVAL_NEW_STR(&o, zend_strpprintf(0, "%lld", (long long)temp$argnum)); - } - t_output_helper($result, &o); -} -%typemap(in, phptype="int|string") TYPE *REFERENCE (long long lvalue) -%{ - CONVERT_LONG_LONG_IN(lvalue, long long, $input) - $1 = &lvalue; -%} -%typemap(argout) long long *REFERENCE -%{ - if ((long long)LONG_MIN <= lvalue$argnum && lvalue$argnum <= (long long)LONG_MAX) { - ZVAL_LONG(&$arg, (long)temp$argnum); - } else { - ZVAL_NEW_STR(&$arg, zend_strpprintf(0, "%lld", (long long)lvalue$argnum)); - } -%} -%typemap(argout) long long &OUTPUT -%{ - if ((long long)LONG_MIN <= *arg$argnum && *arg$argnum <= (long long)LONG_MAX) { - ZVAL_LONG($result, (long)(*arg$argnum)); - } else { - ZVAL_NEW_STR($result, zend_strpprintf(0, "%lld", (long long)(*arg$argnum))); - } -%} - -INT_TYPEMAP(unsigned long long); -%typemap(argout,fragment="t_output_helper") unsigned long long *OUTPUT -{ - zval o; - if (temp$argnum <= (unsigned long long)LONG_MAX) { - ZVAL_LONG(&o, temp$argnum); - } else { - ZVAL_NEW_STR(&o, zend_strpprintf(0, "%llu", (unsigned long long)temp$argnum)); - } - t_output_helper($result, &o); -} -%typemap(in, phptype="int|string") TYPE *REFERENCE (unsigned long long lvalue) -%{ - CONVERT_UNSIGNED_LONG_LONG_IN(lvalue, unsigned long long, $input) - $1 = &lvalue; -%} -%typemap(argout) unsigned long long *REFERENCE -%{ - if (lvalue$argnum <= (unsigned long long)LONG_MAX) { - ZVAL_LONG($arg, (long)(lvalue$argnum)); - } else { - ZVAL_NEW_STR((*$arg), zend_strpprintf(0, "%llu", (unsigned long long)lvalue$argnum)); - } -%} -%typemap(argout) unsigned long long &OUTPUT -%{ - if (*arg$argnum <= (unsigned long long)LONG_MAX) { - ZVAL_LONG($result, (long)(*arg$argnum)); - } else { - ZVAL_NEW_STR($result, zend_strpprintf(0, "%llu", (unsigned long long)(*arg$argnum))); - } -%} - -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; - -%typemap(in) bool &INOUT = bool *INPUT; -%typemap(in) float &INOUT = float *INPUT; -%typemap(in) double &INOUT = double *INPUT; - -%typemap(in) int &INOUT = int *INPUT; -%typemap(in) short &INOUT = short *INPUT; -%typemap(in) long &INOUT = long *INPUT; -%typemap(in) long long &INOUT = long long *INPUT; -%typemap(in) long long &INPUT = long long *INPUT; -%typemap(in) unsigned &INOUT = unsigned *INPUT; -%typemap(in) unsigned short &INOUT = unsigned short *INPUT; -%typemap(in) unsigned long &INOUT = unsigned long *INPUT; -%typemap(in) unsigned char &INOUT = unsigned char *INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long *INPUT; -%typemap(in) unsigned long long &INPUT = unsigned long long *INPUT; -%typemap(in) signed char &INOUT = signed char *INPUT; - -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT= double *OUTPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT= long *OUTPUT; -%typemap(argout) long long *INOUT= long long *OUTPUT; -%typemap(argout) unsigned short *INOUT= unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; - -%typemap(argout) bool &INOUT = bool *OUTPUT; -%typemap(argout) float &INOUT = float *OUTPUT; -%typemap(argout) double &INOUT= double *OUTPUT; - -%typemap(argout) int &INOUT = int *OUTPUT; -%typemap(argout) short &INOUT = short *OUTPUT; -%typemap(argout) long &INOUT= long *OUTPUT; -%typemap(argout) long long &INOUT= long long *OUTPUT; -%typemap(argout) unsigned short &INOUT= unsigned short *OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char *OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long *OUTPUT; -%typemap(argout) signed char &INOUT = signed char *OUTPUT; - -%typemap(in, phptype="string") char INPUT[ANY] ( char temp[$1_dim0] ) -%{ - convert_to_string(&$input); - strncpy(temp, Z_STRVAL($input), $1_dim0); - $1 = temp; -%} -%typemap(in,numinputs=0) char OUTPUT[ANY] ( char temp[$1_dim0] ) - "$1 = temp;"; -%typemap(argout,fragment="t_output_helper") char OUTPUT[ANY] -{ - zval o; - ZVAL_STRINGL(&o, temp$argnum, $1_dim0); - t_output_helper($result, &o); -} - -%typemap(in,numinputs=0,phptype="?SWIGTYPE") void **OUTPUT (int force), - void *&OUTPUT (int force) -%{ - /* If they pass NULL by reference, make it into a void* - This bit should go in arginit if arginit support init-ing scripting args */ - if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, 0) < 0) { - /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ - if (!(Z_ISREF($input) && Z_ISNULL_P(Z_REFVAL($input)))) { - /* wasn't a pre/ref/thing, OR anything like an int thing */ - zend_type_error("Expected reference or NULL for argument $arg of $symname"); - return; - } - } - force=0; - if (arg1==NULL) { -#ifdef __cplusplus - ptr=new $*1_ltype(); -#else - ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); -#endif - $1=&ptr; - /* have to passback arg$arg too */ - force=1; - } -%} - -%typemap(argout) void **OUTPUT, - void *&OUTPUT -%{ - if (force$argnum) { /* pass back arg$argnum through params ($arg) if we can */ - if (!Z_ISREF($arg)) { - SWIG_PHP_Error(E_WARNING, "Parameter $argnum of $symname wasn't passed by reference"); - } else { - SWIG_SetPointerZval(*$arg, (void *) ptr$argnum, $*1_descriptor, 1); - } - } -%} diff --git a/win64/bin/swig/share/swig/4.1.0/php/utils.i b/win64/bin/swig/share/swig/4.1.0/php/utils.i deleted file mode 100755 index f3f66462..00000000 --- a/win64/bin/swig/share/swig/4.1.0/php/utils.i +++ /dev/null @@ -1,115 +0,0 @@ - -%define CONVERT_BOOL_IN(lvar,t,invar) - lvar = (t) zval_is_true(&invar); -%enddef - -%define CONVERT_INT_IN(lvar,t,invar) - lvar = (t) zval_get_long(&invar); -%enddef - -%define CONVERT_LONG_LONG_IN(lvar,t,invar) - switch (Z_TYPE(invar)) { - case IS_DOUBLE: - lvar = (t) Z_DVAL(invar); - break; - case IS_STRING: { - char * endptr; - errno = 0; - lvar = (t) strtoll(Z_STRVAL(invar), &endptr, 10); - if (*endptr == '\0' && !errno) break; - } - /* FALL THRU */ - default: - lvar = (t) zval_get_long(&invar); - } -%enddef - -%define CONVERT_UNSIGNED_LONG_LONG_IN(lvar,t,invar) - switch (Z_TYPE(invar)) { - case IS_DOUBLE: - lvar = (t) Z_DVAL(invar); - break; - case IS_STRING: { - char * endptr; - errno = 0; - lvar = (t) strtoull(Z_STRVAL(invar), &endptr, 10); - if (*endptr == '\0' && !errno) break; - } - /* FALL THRU */ - default: - lvar = (t) zval_get_long(&invar); - } -%enddef - -%define CONVERT_INT_OUT(lvar,invar) - lvar = (t) zval_get_long(&invar); -%enddef - -%define CONVERT_FLOAT_IN(lvar,t,invar) - lvar = (t) zval_get_double(&invar); -%enddef - -%define CONVERT_CHAR_IN(lvar,t,invar) - convert_to_string(&invar); - lvar = (t) Z_STRVAL(invar)[0]; -%enddef - -%define CONVERT_STRING_IN(lvar,t,invar) - if (Z_ISNULL(invar)) { - lvar = (t) 0; - } else { - convert_to_string(&invar); - lvar = (t) Z_STRVAL(invar); - } -%enddef - -%define %pass_by_val( TYPE, PHP_TYPE, CONVERT_IN ) -%typemap(in, phptype=PHP_TYPE) TYPE -%{ - CONVERT_IN($1,$1_ltype,$input); -%} -%typemap(in, phptype=PHP_TYPE) const TYPE & ($*1_ltype temp) -%{ - CONVERT_IN(temp,$*1_ltype,$input); - $1 = &temp; -%} -%typemap(directorout) TYPE -%{ - CONVERT_IN($result, $1_ltype, *$input); -%} -%typemap(directorout) const TYPE & -%{ - $*1_ltype swig_val; - CONVERT_IN(swig_val, $*1_ltype, *$input); - $1_ltype temp = new $*1_ltype(swig_val); - swig_acquire_ownership(temp); - $result = temp; -%} -%typemap(directorfree) const TYPE & -%{ - if (director) { - director->swig_release_ownership(%as_voidptr($input)); - } -%} -%enddef - -%fragment("t_output_helper","header") %{ -static void -t_output_helper(zval *target, zval *o) { - zval tmp; - if (Z_TYPE_P(target) == IS_ARRAY) { - /* it's already an array, just append */ - add_next_index_zval(target, o); - return; - } - if (Z_TYPE_P(target) == IS_NULL) { - /* NULL isn't refcounted */ - ZVAL_COPY_VALUE(target, o); - return; - } - ZVAL_DUP(&tmp, target); - array_init(target); - add_next_index_zval(target, &tmp); - add_next_index_zval(target, o); -} -%} diff --git a/win64/bin/swig/share/swig/4.1.0/pointer.i b/win64/bin/swig/share/swig/4.1.0/pointer.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/python/Makefile.in b/win64/bin/swig/share/swig/4.1.0/python/Makefile.in deleted file mode 100755 index 0ef33f29..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/Makefile.in +++ /dev/null @@ -1,119 +0,0 @@ -# --------------------------------------------------------------- -# SWIG Python Makefile -# -# This file can be used to build various Python extensions with SWIG. -# By default this file is set up for dynamic loading, but it can -# be easily customized for static extensions by modifying various -# portions of the file. -# -# SRCS = C source files -# CXXSRCS = C++ source files -# OBJCSRCS = Objective-C source files -# OBJS = Additional .o files (compiled previously) -# INTERFACE = SWIG interface file -# TARGET = Name of target module or executable -# -# Many portions of this file were created by the SWIG configure -# script and should already reflect your machine. -#---------------------------------------------------------------- - -SRCS = -CXXSRCS = -OBJCSRCS = -OBJS = -INTERFACE = -WRAPFILE = $(INTERFACE:.i=_wrap.c) -WRAPOBJ = $(INTERFACE:.i=_wrap.o) -TARGET = module@SO@ # Use this kind of target for dynamic loading -#TARGET = mypython # Use this target for static linking - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -CC = @CC@ -CXX = @CXX@ -OBJC = @CC@ -Wno-import # -Wno-import needed for gcc -CFLAGS = -INCLUDES = -LIBS = - -# SWIG Options -# SWIG = location of the SWIG executable -# SWIGOPT = SWIG compiler options -# SWIGCC = Compiler used to compile the wrapper file - -SWIG = $(exec_prefix)/bin/swig -SWIGOPT = -python -SWIGCC = $(CC) - -# SWIG Library files. Uncomment if rebuilding the Python interpreter -#SWIGLIBS = -lembed.i - -# Rules for creating .o files from source. - -COBJS = $(SRCS:.c=.o) -CXXOBJS = $(CXXSRCS:.cxx=.o) -OBJCOBJS = $(OBJCSRCS:.m=.o) -ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) - -# Command that will be used to build the final extension. -BUILD = $(SWIGCC) - -# Uncomment the following if you are using dynamic loading -CCSHARED = @CCSHARED@ -BUILD = @LDSHARED@ - -# Uncomment the following if you are using dynamic loading with C++ and -# need to provide additional link libraries (this is not always required). - -#DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ - -L/usr/local/lib -lg++ -lstdc++ -lgcc - -# Python installation - -PY_INCLUDE = -DHAVE_CONFIG_H @PYINCLUDE@ -PY_LIB = @PYLIB@ - -# Build libraries (needed for static builds) - -LIBM = @LIBM@ -LIBC = @LIBC@ -SYSLIBS = $(LIBM) $(LIBC) @LIBS@ - -# Build options - -BUILD_LIBS = $(LIBS) # Dynamic loading - -# Compilation rules for non-SWIG components - -.SUFFIXES: .c .cxx .m - -.c.o: - $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - -.cxx.o: - $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< - -.m.o: - $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - - -# ---------------------------------------------------------------------- -# Rules for building the extension -# ---------------------------------------------------------------------- - -all: $(TARGET) - -# Convert the wrapper file into an object file - -$(WRAPOBJ) : $(WRAPFILE) - $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDES) $(PY_INCLUDE) - -$(WRAPFILE) : $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIBS) $(INTERFACE) - -$(TARGET): $(WRAPOBJ) $(ALLOBJS) - $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) - -clean: - rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) diff --git a/win64/bin/swig/share/swig/4.1.0/python/README b/win64/bin/swig/share/swig/4.1.0/python/README deleted file mode 100755 index 28605a16..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/README +++ /dev/null @@ -1,103 +0,0 @@ -/* ----------------------------------------------------------------------------- - * - * User interfaces: include these ones as needed - * - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Special types and user helpers - * ----------------------------------------------------------------------------- */ - -argcargv.i Handler for (int argc, char **argv) -attribute.i Convert a pair of set/get methods into a "native" python attribute -ccomplex.i C99 complex type -complex.i C99 or C++ complex type -cstring.i Various forms of C character string handling -cwstring.i Various forms of C wchar_t string handling -embed.i embedding the Python interpreter in something else -file.i FILE C type -implicit.i Allow the use of implicit C++ constructors -wchar.i wchar_t C type - -/* ----------------------------------------------------------------------------- - * C++ STD + STL - * ----------------------------------------------------------------------------- */ - -std_alloc.i allocator -std_basic_string.i basic string -std_char_traits.i char traits -std_complex.i complex -std_deque.i deque -std_except.i exceptions -std_ios.i ios -std_iostream.i istream/ostream -std_list.i list -std_map.i map -std_multimap.i multimap -std_multiset.i multiset -std_pair.i pair -std_set.i set -std_sstream.i string stream -std_streambuf.i streambuf -std_string.i string -std_vector.i vector -std_wios.i wios -std_wiostream.i wistream/wostream -std_wsstream.i wstring stream -std_wstreambuf.i wstreambuf -std_wstring.i wstring - - - -/* ----------------------------------------------------------------------------- -/* - * Implementation files: don't look at them unless you are really drunk - * - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Basic files - * ----------------------------------------------------------------------------- */ - -python.swg Main language file, it just includes what is needed. -pyuserdir.swg User visible directives (%pythonnondynamic, etc) -pymacros.swg Internal macros used for typemaps -pyfragments.swg Allow the user to overload the default fragments -pyopers.swg Python operations (+=, *=, etc) -pythonkw.swg Python keywords and special names -pyinit.swg Python Init method - -/* ----------------------------------------------------------------------------- - * The runtime part - * ----------------------------------------------------------------------------- */ - -pyruntime.swg Main runtime file definition -pyapi.swg SWIG/Python API declarations -pyrun.swg Python run-time code - -/* ----------------------------------------------------------------------------- - * Internal typemap specializations - * ----------------------------------------------------------------------------- */ - -pyswigtype.swg SWIGTYPE -pystrings.swg Char strings (char *) -pywstrings.swg Wchar Strings (wchar_t *) -pyprimtypes.swg Primitive types (shot,int,double,etc) -pycomplex.swg PyComplex and helper for C/C++ complex types -pydocs.swg Typemaps documentation - -/* ----------------------------------------------------------------------------- - * C++ STD + STL - * ----------------------------------------------------------------------------- */ - -pycontainer.swg python container iterators -std_common.i general common code for the STD/STL implementation -std_container.i general common code for the STD/STL containers - - -/*----------------------------------------------------------------------------- - * Backward compatibility and deprecated - * ----------------------------------------------------------------------------- */ - -std_vectora.i vector + allocator (allocators are now supported in STD/STL) -typemaps.i old in/out typemaps (doesn't need to be included) diff --git a/win64/bin/swig/share/swig/4.1.0/python/argcargv.i b/win64/bin/swig/share/swig/4.1.0/python/argcargv.i deleted file mode 100755 index c0c65f0a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/argcargv.i +++ /dev/null @@ -1,89 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsArgcArgv","header",fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsArgcArgv(PyObject *input, swig_type_info *ppchar_info, size_t *argc, char ***argv, int *owner) { - void *vptr; - int res = SWIG_ConvertPtr(input, &vptr, ppchar_info, 0); - if (!SWIG_IsOK(res)) { - int list = 0; - PyErr_Clear(); - list = PyList_Check(input); - if (list || PyTuple_Check(input)) { - size_t i = 0; - size_t size = list ? PyList_Size(input) : PyTuple_Size(input); - if (argc) *argc = size; - if (argv) { - *argv = %new_array(size + 1, char*); - for (; i < size; ++i) { - PyObject *obj = list ? PyList_GetItem(input,i) : PyTuple_GetItem(input,i); - char *cptr = 0; size_t sz = 0; int alloc = 0; - res = SWIG_AsCharPtrAndSize(obj, &cptr, &sz, &alloc); - if (SWIG_IsOK(res)) { - if (cptr && sz) { - (*argv)[i] = (alloc == SWIG_NEWOBJ) ? cptr : %new_copy_array(cptr, sz, char); - } else { - (*argv)[i] = 0; - } - } else { - return SWIG_TypeError; - } - } - (*argv)[i] = 0; - if (owner) *owner = 1; - } else { - for (; i < size; ++i) { - PyObject *obj = list ? PyList_GetItem(input,i) : PyTuple_GetItem(input,i); - res = SWIG_AsCharPtrAndSize(obj, 0, 0, 0); - if (!SWIG_IsOK(res)) return SWIG_TypeError; - } - if (owner) *owner = 0; - } - return SWIG_OK; - } else { - return SWIG_TypeError; - } - } else { - /* seems dangerous, but the user asked for it... */ - size_t i = 0; - if (argv) { while (*argv[i] != 0) ++i;} - if (argc) *argc = i; - if (owner) *owner = 0; - return SWIG_OK; - } -} -} - -/* - This typemap works with either a char **, a python list or a python - tuple - */ - -%typemap(in,noblock=0,fragment="SWIG_AsArgcArgv") (int ARGC, char **ARGV) (int res,char **argv = 0, size_t argc = 0, int owner= 0) { - res = SWIG_AsArgcArgv($input, $descriptor(char**), &argc, &argv, &owner); - if (!SWIG_IsOK(res)) { - $1 = 0; $2 = 0; - %argument_fail(SWIG_TypeError, "int ARGC, char **ARGV", $symname, $argnum); - } else { - $1 = %static_cast(argc,$1_ltype); - $2 = %static_cast(argv, $2_ltype); - } -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - int res = SWIG_AsArgcArgv($input, $descriptor(char**), 0, 0, 0); - $1 = SWIG_IsOK(res); -} - -%typemap(freearg,noblock=1) (int ARGC, char **ARGV) { - if (owner$argnum) { - size_t i = argc$argnum; - while (i) { - %delete_array(argv$argnum[--i]); - } - %delete_array(argv$argnum); - } -} - diff --git a/win64/bin/swig/share/swig/4.1.0/python/attribute.i b/win64/bin/swig/share/swig/4.1.0/python/attribute.i deleted file mode 100755 index b18f9ae8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/boost_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/python/boost_shared_ptr.i deleted file mode 100755 index 2cfaf3ec..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/boost_shared_ptr.i +++ /dev/null @@ -1,411 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -%fragment("SWIG_null_deleter_python", "header", fragment="SWIG_null_deleter") { -%#define SWIG_NO_NULL_DELETER_SWIG_BUILTIN_INIT -} - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter_python") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter_python") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter_python") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter_python") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter_python") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter_python") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter_python") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter_python") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - -%typemap(doctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - %{TYPE%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/python/builtin.swg b/win64/bin/swig/share/swig/4.1.0/python/builtin.swg deleted file mode 100755 index 237417dd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/builtin.swg +++ /dev/null @@ -1,764 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -SWIGINTERN Py_hash_t -SwigPyObject_hash(PyObject *obj) { - SwigPyObject *sobj = (SwigPyObject *)obj; - void *ptr = sobj->ptr; -#if PY_VERSION_HEX < 0x03020000 - return (Py_hash_t)(Py_ssize_t)ptr; -#else - return (Py_hash_t)ptr; -#endif -} - -SWIGINTERN Py_hash_t -SWIG_PyNumber_AsPyHash(PyObject *obj) { - Py_hash_t result = -1; -#if PY_VERSION_HEX < 0x03020000 - if (PyInt_Check(obj)) - result = PyInt_AsLong(obj); - else if (PyLong_Check(obj)) - result = PyLong_AsLong(obj); -#else - if (PyNumber_Check(obj)) - result = PyNumber_AsSsize_t(obj, NULL); -#endif - else - PyErr_Format(PyExc_TypeError, "Wrong type for hash function"); - return PyErr_Occurred() ? -1 : result; -} - -SWIGINTERN int -SwigPyBuiltin_BadInit(PyObject *self, PyObject *SWIGUNUSEDPARM(args), PyObject *SWIGUNUSEDPARM(kwds)) { - PyErr_Format(PyExc_TypeError, "Cannot create new instances of type '%.300s'", self->ob_type->tp_name); - return -1; -} - -SWIGINTERN void -SwigPyBuiltin_BadDealloc(PyObject *obj) { - SwigPyObject *sobj = (SwigPyObject *)obj; - if (sobj->own) { - PyErr_Format(PyExc_TypeError, "Swig detected a memory leak in type '%.300s': no callable destructor found.", obj->ob_type->tp_name); - } -} - -typedef struct { - PyCFunction get; - PyCFunction set; -} SwigPyGetSet; - -SWIGINTERN PyObject * -SwigPyBuiltin_GetterClosure (PyObject *obj, void *closure) { - SwigPyGetSet *getset; - PyObject *tuple, *result; - if (!closure) - return SWIG_Py_Void(); - getset = (SwigPyGetSet *)closure; - if (!getset->get) - return SWIG_Py_Void(); - tuple = PyTuple_New(0); - assert(tuple); - result = (*getset->get)(obj, tuple); - Py_DECREF(tuple); - return result; -} - -SWIGINTERN PyObject * -SwigPyBuiltin_FunpackGetterClosure (PyObject *obj, void *closure) { - SwigPyGetSet *getset; - PyObject *result; - if (!closure) - return SWIG_Py_Void(); - getset = (SwigPyGetSet *)closure; - if (!getset->get) - return SWIG_Py_Void(); - result = (*getset->get)(obj, NULL); - return result; -} - -SWIGINTERN int -SwigPyBuiltin_SetterClosure (PyObject *obj, PyObject *val, void *closure) { - SwigPyGetSet *getset; - PyObject *tuple, *result; - if (!closure) { - PyErr_Format(PyExc_TypeError, "Missing getset closure"); - return -1; - } - getset = (SwigPyGetSet *)closure; - if (!getset->set) { - PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name); - return -1; - } - tuple = PyTuple_New(1); - assert(tuple); - Py_INCREF(val); - PyTuple_SET_ITEM(tuple, 0, val); - result = (*getset->set)(obj, tuple); - Py_DECREF(tuple); - Py_XDECREF(result); - return result ? 0 : -1; -} - -SWIGINTERN int -SwigPyBuiltin_FunpackSetterClosure (PyObject *obj, PyObject *val, void *closure) { - SwigPyGetSet *getset; - PyObject *result; - if (!closure) { - PyErr_Format(PyExc_TypeError, "Missing getset closure"); - return -1; - } - getset = (SwigPyGetSet *)closure; - if (!getset->set) { - PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name); - return -1; - } - result = (*getset->set)(obj, val); - Py_XDECREF(result); - return result ? 0 : -1; -} - -SWIGINTERN void -SwigPyStaticVar_dealloc(PyDescrObject *descr) { - PyObject_GC_UnTrack(descr); - Py_XDECREF(PyDescr_TYPE(descr)); - Py_XDECREF(PyDescr_NAME(descr)); - PyObject_GC_Del(descr); -} - -SWIGINTERN PyObject * -SwigPyStaticVar_repr(PyGetSetDescrObject *descr) { -#if PY_VERSION_HEX >= 0x03000000 - - return PyUnicode_FromFormat("", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); -#else - return PyString_FromFormat("", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); -#endif -} - -SWIGINTERN int -SwigPyStaticVar_traverse(PyObject *self, visitproc visit, void *arg) { - PyDescrObject *descr; - descr = (PyDescrObject *)self; - Py_VISIT((PyObject*) PyDescr_TYPE(descr)); - return 0; -} - -SWIGINTERN PyObject * -SwigPyStaticVar_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *SWIGUNUSEDPARM(type)) { - if (descr->d_getset->get != NULL) - return descr->d_getset->get(obj, descr->d_getset->closure); -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not readable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); -#else - PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not readable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); -#endif - return NULL; -} - -SWIGINTERN int -SwigPyStaticVar_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value) { - if (descr->d_getset->set != NULL) - return descr->d_getset->set(obj, value, descr->d_getset->closure); -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not writable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); -#else - PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not writable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); -#endif - return -1; -} - -SWIGINTERN int -SwigPyObjectType_setattro(PyObject *typeobject, PyObject *name, PyObject *value) { - PyObject *attribute; - PyTypeObject *type; - descrsetfunc local_set; - - assert(PyType_Check(typeobject)); - type = (PyTypeObject *)typeobject; - attribute = _PyType_Lookup(type, name); - if (attribute != NULL) { - /* Implement descriptor functionality, if any */ - local_set = attribute->ob_type->tp_descr_set; - if (local_set != NULL) - return local_set(attribute, (PyObject *)type, value); -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400S'", type->tp_name, name); -#else - PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400s'", type->tp_name, PyString_AS_STRING(name)); -#endif - } else { -#if PY_VERSION_HEX >= 0x03000000 - PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400S'", type->tp_name, name); -#else - PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400s'", type->tp_name, PyString_AS_STRING(name)); -#endif - } - - return -1; -} - -SWIGINTERN PyTypeObject* -SwigPyStaticVar_Type(void) { - static PyTypeObject staticvar_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#else - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ -#endif - "swig_static_var_getset_descriptor", /* tp_name */ - sizeof(PyGetSetDescrObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyStaticVar_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /* tp_print */ -#else - (Py_ssize_t)0, /* tp_vectorcall_offset */ -#endif - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc)SwigPyStaticVar_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */ - 0, /* tp_doc */ - SwigPyStaticVar_traverse, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - (descrgetfunc)SwigPyStaticVar_get, /* tp_descr_get */ - (descrsetfunc)SwigPyStaticVar_set, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - staticvar_type = tmp; - type_init = 1; - if (PyType_Ready(&staticvar_type) < 0) - return NULL; - } - return &staticvar_type; -} - -SWIGINTERN PyTypeObject* -SwigPyObjectType(void) { - static char swigpyobjecttype_doc[] = "Metaclass for SWIG wrapped types"; - static PyTypeObject swigpyobjecttype_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#else - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ -#endif - "SwigPyObjectType", /* tp_name */ - PyType_Type.tp_basicsize, /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /* tp_print */ -#else - (Py_ssize_t)0, /* tp_vectorcall_offset */ -#endif - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - SwigPyObjectType_setattro, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */ - swigpyobjecttype_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - swigpyobjecttype_type = tmp; - type_init = 1; - swigpyobjecttype_type.tp_base = &PyType_Type; - if (PyType_Ready(&swigpyobjecttype_type) < 0) - return NULL; - } - return &swigpyobjecttype_type; -} - -SWIGINTERN PyGetSetDescrObject * -SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) { - - PyGetSetDescrObject *descr; - descr = (PyGetSetDescrObject *)PyType_GenericAlloc(SwigPyStaticVar_Type(), 0); - assert(descr); - Py_XINCREF(type); - PyDescr_TYPE(descr) = type; - PyDescr_NAME(descr) = PyString_InternFromString(getset->name); - descr->d_getset = getset; - if (PyDescr_NAME(descr) == NULL) { - Py_DECREF(descr); - descr = NULL; - } - return descr; -} - -SWIGINTERN void -SwigPyBuiltin_InitBases (PyTypeObject *type, PyTypeObject **bases) { - Py_ssize_t base_count = 0; - PyTypeObject **b; - PyObject *tuple; - Py_ssize_t i; - - if (!bases[0]) { - bases[0] = SwigPyObject_type(); - bases[1] = NULL; - } - type->tp_base = bases[0]; - Py_INCREF((PyObject *)bases[0]); - for (b = bases; *b != NULL; ++b) - ++base_count; - tuple = PyTuple_New(base_count); - for (i = 0; i < base_count; ++i) { - Py_INCREF((PyObject *)bases[i]); - PyTuple_SET_ITEM(tuple, i, (PyObject *)bases[i]); - } - type->tp_bases = tuple; -} - -SWIGINTERN PyObject * -SwigPyBuiltin_ThisClosure (PyObject *self, void *SWIGUNUSEDPARM(closure)) { - PyObject *result; - result = (PyObject *)SWIG_Python_GetSwigThis(self); - Py_XINCREF(result); - return result; -} - -SWIGINTERN void -SwigPyBuiltin_SetMetaType (PyTypeObject *type, PyTypeObject *metatype) -{ -#if PY_VERSION_HEX >= 0x030900a4 - Py_SET_TYPE(type, metatype); -#else - Py_TYPE(type) = metatype; -#endif -} - - -/* Start of callback function macros for use in PyTypeObject */ - -typedef PyObject *(*SwigPyWrapperFunction)(PyObject *, PyObject *); - -#define SWIGPY_UNARYFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_unaryfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_unaryfunc_closure(wrapper, a); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_unaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -#define SWIGPY_DESTRUCTOR_CLOSURE(wrapper) \ -SWIGINTERN void \ -wrapper##_destructor_closure(PyObject *a) { \ - SwigPyBuiltin_destructor_closure(wrapper, #wrapper, a); \ -} -SWIGINTERN void -SwigPyBuiltin_destructor_closure(SwigPyWrapperFunction wrapper, const char *wrappername, PyObject *a) { - SwigPyObject *sobj; - sobj = (SwigPyObject *)a; - Py_XDECREF(sobj->dict); - if (sobj->own) { - PyObject *o; - PyObject *type = 0, *value = 0, *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - o = wrapper(a, NULL); - if (!o) { - PyObject *deallocname = PyString_FromString(wrappername); - PyErr_WriteUnraisable(deallocname); - Py_DECREF(deallocname); - } - PyErr_Restore(type, value, traceback); - Py_XDECREF(o); - } - if (PyType_IS_GC(a->ob_type)) { - PyObject_GC_Del(a); - } else { - PyObject_Del(a); - } -} - -#define SWIGPY_INQUIRY_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_inquiry_closure(PyObject *a) { \ - return SwigPyBuiltin_inquiry_closure(wrapper, a); \ -} -SWIGINTERN int -SwigPyBuiltin_inquiry_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - PyObject *pyresult; - int result; - pyresult = wrapper(a, NULL); - result = pyresult && PyObject_IsTrue(pyresult) ? 1 : 0; - Py_XDECREF(pyresult); - return result; -} - -#define SWIGPY_GETITERFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_getiterfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_getiterfunc_closure(wrapper, a); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_getiterfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -#define SWIGPY_BINARYFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_binaryfunc_closure(PyObject *a, PyObject *b) { \ - return SwigPyBuiltin_binaryfunc_closure(wrapper, a, b); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_binaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { - PyObject *tuple, *result; - tuple = PyTuple_New(1); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -typedef ternaryfunc ternarycallfunc; - -#define SWIGPY_TERNARYFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ternaryfunc_closure(PyObject *a, PyObject *b, PyObject *c) { \ - return SwigPyBuiltin_ternaryfunc_closure(wrapper, a, b, c); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ternaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { - PyObject *tuple, *result; - tuple = PyTuple_New(2); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_TERNARYCALLFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ternarycallfunc_closure(PyObject *a, PyObject *b, PyObject *c) { \ - return SwigPyBuiltin_ternarycallfunc_closure(wrapper, a, b, c); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ternarycallfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { - (void) c; - return wrapper(a, b); -} - -#define SWIGPY_LENFUNC_CLOSURE(wrapper) \ -SWIGINTERN Py_ssize_t \ -wrapper##_lenfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_lenfunc_closure(wrapper, a); \ -} -SWIGINTERN Py_ssize_t -SwigPyBuiltin_lenfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - PyObject *resultobj; - Py_ssize_t result; - resultobj = wrapper(a, NULL); - result = PyNumber_AsSsize_t(resultobj, NULL); - Py_DECREF(resultobj); - return result; -} - -#define SWIGPY_SSIZESSIZEARGFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ssizessizeargfunc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c) { \ - return SwigPyBuiltin_ssizessizeargfunc_closure(wrapper, a, b, c); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ssizessizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c) { - PyObject *tuple, *result; - tuple = PyTuple_New(2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c)); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_SSIZESSIZEOBJARGPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_ssizessizeobjargproc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) { \ - return SwigPyBuiltin_ssizessizeobjargproc_closure(wrapper, a, b, c, d); \ -} -SWIGINTERN int -SwigPyBuiltin_ssizessizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) { - PyObject *tuple, *resultobj; - int result; - tuple = PyTuple_New(d ? 3 : 2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c)); - if (d) { - Py_INCREF(d); - PyTuple_SET_ITEM(tuple, 2, d); - } - resultobj = wrapper(a, tuple); - result = resultobj ? 0 : -1; - Py_DECREF(tuple); - Py_XDECREF(resultobj); - return result; -} - -#define SWIGPY_SSIZEARGFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) { \ - return SwigPyBuiltin_funpack_ssizeargfunc_closure(wrapper, a, b); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_funpack_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) { - PyObject *tuple, *result; - tuple = PyTuple_New(1); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - result = wrapper(a, tuple); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_FUNPACK_SSIZEARGFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) { \ - return SwigPyBuiltin_ssizeargfunc_closure(wrapper, a, b); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) { - PyObject *arg, *result; - arg = _PyLong_FromSsize_t(b); - result = wrapper(a, arg); - Py_DECREF(arg); - return result; -} - -#define SWIGPY_SSIZEOBJARGPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_ssizeobjargproc_closure(PyObject *a, Py_ssize_t b, PyObject *c) { \ - return SwigPyBuiltin_ssizeobjargproc_closure(wrapper, a, b, c); \ -} -SWIGINTERN int -SwigPyBuiltin_ssizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, PyObject *c) { - PyObject *tuple, *resultobj; - int result; - tuple = PyTuple_New(2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); - resultobj = wrapper(a, tuple); - result = resultobj ? 0 : -1; - Py_XDECREF(resultobj); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_OBJOBJPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_objobjproc_closure(PyObject *a, PyObject *b) { \ - return SwigPyBuiltin_objobjproc_closure(wrapper, a, b); \ -} -SWIGINTERN int -SwigPyBuiltin_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { - int result; - PyObject *pyresult; - PyObject *tuple; - tuple = PyTuple_New(1); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - pyresult = wrapper(a, tuple); - result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1; - Py_XDECREF(pyresult); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_FUNPACK_OBJOBJPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_objobjproc_closure(PyObject *a, PyObject *b) { \ - return SwigPyBuiltin_funpack_objobjproc_closure(wrapper, a, b); \ -} -SWIGINTERN int -SwigPyBuiltin_funpack_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { - int result; - PyObject *pyresult; - pyresult = wrapper(a, b); - result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1; - Py_XDECREF(pyresult); - return result; -} - -#define SWIGPY_OBJOBJARGPROC_CLOSURE(wrapper) \ -SWIGINTERN int \ -wrapper##_objobjargproc_closure(PyObject *a, PyObject *b, PyObject *c) { \ - return SwigPyBuiltin_objobjargproc_closure(wrapper, a, b, c); \ -} -SWIGINTERN int -SwigPyBuiltin_objobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { - PyObject *tuple, *resultobj; - int result; - tuple = PyTuple_New(c ? 2 : 1); - assert(tuple); - Py_INCREF(b); - PyTuple_SET_ITEM(tuple, 0, b); - if (c) { - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); - } - resultobj = wrapper(a, tuple); - result = resultobj ? 0 : -1; - Py_XDECREF(resultobj); - Py_DECREF(tuple); - return result; -} - -#define SWIGPY_REPRFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_reprfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_reprfunc_closure(wrapper, a); \ -} -SWIGINTERN PyObject * -SwigPyBuiltin_reprfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -#define SWIGPY_HASHFUNC_CLOSURE(wrapper) \ -SWIGINTERN Py_hash_t \ -wrapper##_hashfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_hashfunc_closure(wrapper, a); \ -} -SWIGINTERN Py_hash_t -SwigPyBuiltin_hashfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - PyObject *pyresult; - Py_hash_t result; - pyresult = wrapper(a, NULL); - if (!pyresult) - return -1; - result = SWIG_PyNumber_AsPyHash(pyresult); - Py_DECREF(pyresult); - return result; -} - -#define SWIGPY_ITERNEXTFUNC_CLOSURE(wrapper) \ -SWIGINTERN PyObject * \ -wrapper##_iternextfunc_closure(PyObject *a) { \ - return SwigPyBuiltin_iternextfunc_closure(wrapper, a);\ -} -SWIGINTERN PyObject * -SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { - return wrapper(a, NULL); -} - -/* End of callback function macros for use in PyTypeObject */ - -#ifdef __cplusplus -} -#endif - diff --git a/win64/bin/swig/share/swig/4.1.0/python/carrays.i b/win64/bin/swig/share/swig/4.1.0/python/carrays.i deleted file mode 100755 index 24562805..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/carrays.i +++ /dev/null @@ -1,13 +0,0 @@ -%define %array_class(TYPE,NAME) -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "sq_item", functype="ssizeargfunc") NAME::__getitem__; - %feature("python:slot", "sq_ass_item", functype="ssizeobjargproc") NAME::__setitem__; -#endif -%array_class_wrap(TYPE,NAME,__getitem__,__setitem__) -%enddef - -%include - - - - diff --git a/win64/bin/swig/share/swig/4.1.0/python/ccomplex.i b/win64/bin/swig/share/swig/4.1.0/python/ccomplex.i deleted file mode 100755 index e8082ae3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/ccomplex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ccomplex.i - * - * C complex typemaps - * ISO C99: 7.3 Complex arithmetic - * ----------------------------------------------------------------------------- */ - - -%include - -%{ -#include -%} - -#define complex _Complex - -/* C complex constructor */ -#define CCplxConst(r, i) ((r) + I*(i)) - -%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); - -/* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/win64/bin/swig/share/swig/4.1.0/python/cdata.i b/win64/bin/swig/share/swig/4.1.0/python/cdata.i deleted file mode 100755 index 1c6de446..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/cmalloc.i b/win64/bin/swig/share/swig/4.1.0/python/cmalloc.i deleted file mode 100755 index d3a1222e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/complex.i b/win64/bin/swig/share/swig/4.1.0/python/complex.i deleted file mode 100755 index ee3e1d3c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/complex.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __cplusplus -%include -#else -%include -#endif - diff --git a/win64/bin/swig/share/swig/4.1.0/python/cpointer.i b/win64/bin/swig/share/swig/4.1.0/python/cpointer.i deleted file mode 100755 index 0e75cbcd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/cstring.i b/win64/bin/swig/share/swig/4.1.0/python/cstring.i deleted file mode 100755 index 033677b3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/cwstring.i b/win64/bin/swig/share/swig/4.1.0/python/cwstring.i deleted file mode 100755 index c268d395..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/cwstring.i +++ /dev/null @@ -1,3 +0,0 @@ -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/python/director.swg b/win64/bin/swig/share/swig/4.1.0/python/director.swg deleted file mode 100755 index e8592e58..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/director.swg +++ /dev/null @@ -1,389 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Python proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -#ifndef SWIG_DIRECTOR_PYTHON_HEADER_ -#define SWIG_DIRECTOR_PYTHON_HEADER_ - -#include -#include -#include -#include -#include - - -/* - Use -DSWIG_PYTHON_DIRECTOR_NO_VTABLE if you don't want to generate a 'virtual - table', and avoid multiple GetAttr calls to retrieve the python - methods. -*/ - -#ifndef SWIG_PYTHON_DIRECTOR_NO_VTABLE -#ifndef SWIG_PYTHON_DIRECTOR_VTABLE -#define SWIG_PYTHON_DIRECTOR_VTABLE -#endif -#endif - - - -/* - Use -DSWIG_DIRECTOR_NO_UEH if you prefer to avoid the use of the - Undefined Exception Handler provided by swig. -*/ -#ifndef SWIG_DIRECTOR_NO_UEH -#ifndef SWIG_DIRECTOR_UEH -#define SWIG_DIRECTOR_UEH -#endif -#endif - - -/* - Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the - native C++ RTTI and dynamic_cast<>. But be aware that directors - could stop working when using this option. -*/ -#ifdef SWIG_DIRECTOR_NORTTI -/* - When we don't use the native C++ RTTI, we implement a minimal one - only for Directors. -*/ -# ifndef SWIG_DIRECTOR_RTDIR -# define SWIG_DIRECTOR_RTDIR - -namespace Swig { - class Director; - SWIGINTERN std::map& get_rtdir_map() { - static std::map rtdir_map; - return rtdir_map; - } - - SWIGINTERNINLINE void set_rtdir(void *vptr, Director *rtdir) { - get_rtdir_map()[vptr] = rtdir; - } - - SWIGINTERNINLINE Director *get_rtdir(void *vptr) { - std::map::const_iterator pos = get_rtdir_map().find(vptr); - Director *rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0; - return rtdir; - } -} -# endif /* SWIG_DIRECTOR_RTDIR */ - -# define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast(ARG)) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast(ARG1), ARG2) - -#else - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) -# define SWIG_DIRECTOR_RGTR(ARG1, ARG2) - -#endif /* SWIG_DIRECTOR_NORTTI */ - -extern "C" { - struct swig_type_info; -} - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() {} - - virtual int get_own() const { - return 0; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem * operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(int own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - int get_own() const { - return _own; - } - - private: - int _own; - }; - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - template - struct GCArray_T : GCItem { - GCArray_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCArray_T() { - delete[] _ptr; - } - - private: - Type *_ptr; - }; - - /* base class for director exceptions */ - class DirectorException : public std::exception { - protected: - std::string swig_msg; - public: - DirectorException(PyObject *error, const char *hdr ="", const char *msg ="") : swig_msg(hdr) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (msg[0]) { - swig_msg += " "; - swig_msg += msg; - } - if (!PyErr_Occurred()) { - PyErr_SetString(error, what()); - } - SWIG_PYTHON_THREAD_END_BLOCK; - } - - virtual ~DirectorException() throw() { - } - - /* Deprecated, use what() instead */ - const char *getMessage() const { - return what(); - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - - static void raise(PyObject *error, const char *msg) { - throw DirectorException(error, msg); - } - - static void raise(const char *msg) { - raise(PyExc_RuntimeError, msg); - } - }; - - /* type mismatch in the return value from a python method call */ - class DirectorTypeMismatchException : public DirectorException { - public: - DirectorTypeMismatchException(PyObject *error, const char *msg="") - : DirectorException(error, "SWIG director type mismatch", msg) { - } - - DirectorTypeMismatchException(const char *msg="") - : DirectorException(PyExc_TypeError, "SWIG director type mismatch", msg) { - } - - static void raise(PyObject *error, const char *msg) { - throw DirectorTypeMismatchException(error, msg); - } - - static void raise(const char *msg) { - throw DirectorTypeMismatchException(msg); - } - }; - - /* any python exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException { - public: - DirectorMethodException(const char *msg = "") - : DirectorException(PyExc_RuntimeError, "SWIG director method error.", msg) { - } - - static void raise(const char *msg) { - throw DirectorMethodException(msg); - } - }; - - /* attempt to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException { - public: - DirectorPureVirtualException(const char *msg = "") - : DirectorException(PyExc_RuntimeError, "SWIG director pure virtual method called", msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - -#if defined(SWIG_PYTHON_THREADS) -/* __THREAD__ is the old macro to activate some thread support */ -# if !defined(__THREAD__) -# define __THREAD__ 1 -# endif -#endif - -#ifdef __THREAD__ -# include "pythread.h" - class Guard { - PyThread_type_lock &mutex_; - - public: - Guard(PyThread_type_lock & mutex) : mutex_(mutex) { - PyThread_acquire_lock(mutex_, WAIT_LOCK); - } - - ~Guard() { - PyThread_release_lock(mutex_); - } - }; -# define SWIG_GUARD(mutex) Guard _guard(mutex) -#else -# define SWIG_GUARD(mutex) -#endif - - /* director base class */ - class Director { - private: - /* pointer to the wrapped python object */ - PyObject *swig_self; - /* flag indicating whether the object is owned by python or c++ */ - mutable bool swig_disown_flag; - - /* decrement the reference count of the wrapped python object */ - void swig_decref() const { - if (swig_disown_flag) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_DECREF(swig_self); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - public: - /* wrap a python object. */ - Director(PyObject *self) : swig_self(self), swig_disown_flag(false) { - } - - /* discard our reference at destruction */ - virtual ~Director() { - swig_decref(); - } - - /* return a pointer to the wrapped python object */ - PyObject *swig_get_self() const { - return swig_self; - } - - /* acquire ownership of the wrapped python object (the sense of "disown" is from python) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag=true; - swig_incref(); - } - } - - /* increase the reference count of the wrapped python object */ - void swig_incref() const { - if (swig_disown_flag) { - Py_INCREF(swig_self); - } - } - - /* methods to implement pseudo protected director members */ - virtual bool swig_get_inner(const char * /* swig_protected_method_name */) const { - return true; - } - - virtual void swig_set_inner(const char * /* swig_protected_method_name */, bool /* swig_val */) const { - } - - /* ownership management */ - private: - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; -#ifdef __THREAD__ - static PyThread_type_lock swig_mutex_own; -#endif - - public: - template - void swig_acquire_ownership_array(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCArray_T(vptr); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, int own) const { - if (vptr && own) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_Object(own); - } - } - - int swig_release_ownership(void *vptr) const { - int own = 0; - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_ownership_map::iterator iter = swig_owner.find(vptr); - if (iter != swig_owner.end()) { - own = iter->second->get_own(); - swig_owner.erase(iter); - } - } - return own; - } - - template - static PyObject *swig_pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args)) { - SwigPyObject *sobj = (SwigPyObject *)pyobj; - sobj->own = 0; - Director *d = SWIG_DIRECTOR_CAST(reinterpret_cast(sobj->ptr)); - if (d) - d->swig_disown(); - return PyWeakref_NewProxy(pyobj, NULL); - } - }; - -#ifdef __THREAD__ - PyThread_type_lock Director::swig_mutex_own = PyThread_allocate_lock(); -#endif -} - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/python/embed.i b/win64/bin/swig/share/swig/4.1.0/python/embed.i deleted file mode 100755 index 242e55af..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/embed.i +++ /dev/null @@ -1,120 +0,0 @@ -// -// embed.i -// SWIG file embedding the Python interpreter in something else. -// This file is deprecated and no longer actively maintained, but it still -// seems to work with Python 2.7. Status with Python 3 is unknown. -// -// This file makes it possible to extend Python and all of its -// built-in functions without having to hack its setup script. -// - - -#ifdef AUTODOC -%subsection "embed.i" -%text %{ -This module provides support for building a new version of the -Python executable. This will be necessary on systems that do -not support shared libraries and may be necessary with C++ -extensions. This file contains everything you need to build -a new version of Python from include files and libraries normally -installed with the Python language. - -This module will automatically grab all of the Python modules -present in your current Python executable (including any special -purpose modules you have enabled such as Tkinter). Thus, you -may need to provide additional link libraries when compiling. - -As far as I know, this module is C++ safe. -%} -#endif - -%wrapper %{ -#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) -#define PY_SSIZE_T_CLEAN -#endif - -#if __GNUC__ >= 7 -#pragma GCC diagnostic push -#if defined(__cplusplus) && __cplusplus >=201703L -#pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */ -#endif -#endif - -#include - -#if __GNUC__ >= 7 -#pragma GCC diagnostic pop -#endif - -#ifdef __cplusplus -extern "C" -#endif -void SWIG_init(); /* Forward reference */ - -#define _PyImport_Inittab swig_inittab - -/* Grab Python's inittab[] structure */ - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#undef _PyImport_Inittab - -/* Now define our own version of it. - Hopefully someone does not have more than 1000 built-in modules */ - -struct _inittab SWIG_Import_Inittab[1000]; - -static int swig_num_modules = 0; - -/* Function for adding modules to Python */ - -static void swig_add_module(char *name, void (*initfunc)()) { - SWIG_Import_Inittab[swig_num_modules].name = name; - SWIG_Import_Inittab[swig_num_modules].initfunc = initfunc; - swig_num_modules++; - SWIG_Import_Inittab[swig_num_modules].name = (char *) 0; - SWIG_Import_Inittab[swig_num_modules].initfunc = 0; -} - -/* Function to add all of Python's built-in modules to our interpreter */ - -static void swig_add_builtin() { - int i = 0; - while (swig_inittab[i].name) { - swig_add_module(swig_inittab[i].name, swig_inittab[i].initfunc); - i++; - } -#ifdef SWIGMODINIT - SWIGMODINIT -#endif - /* Add SWIG builtin function */ - swig_add_module(SWIG_name, SWIG_init); -} - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -extern int Py_Main(int, char **); - -#ifdef __cplusplus -} -#endif - -extern struct _inittab *PyImport_Inittab; - -int -main(int argc, char **argv) { - swig_add_builtin(); - PyImport_Inittab = SWIG_Import_Inittab; - return Py_Main(argc,argv); -} - -%} diff --git a/win64/bin/swig/share/swig/4.1.0/python/exception.i b/win64/bin/swig/share/swig/4.1.0/python/exception.i deleted file mode 100755 index fc96bca5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/exception.i +++ /dev/null @@ -1,6 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) -} diff --git a/win64/bin/swig/share/swig/4.1.0/python/factory.i b/win64/bin/swig/share/swig/4.1.0/python/factory.i deleted file mode 100755 index 377f0080..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/file.i b/win64/bin/swig/share/swig/4.1.0/python/file.i deleted file mode 100755 index d7e3d2c9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/file.i +++ /dev/null @@ -1,41 +0,0 @@ -/* ----------------------------------------------------------------------------- - * file.i - * - * Typemaps for FILE* - * ----------------------------------------------------------------------------- */ - -%types(FILE *); - -/* defining basic methods */ -%fragment("SWIG_AsValFilePtr","header") { -SWIGINTERN int -SWIG_AsValFilePtr(PyObject *obj, FILE **val) { - static swig_type_info* desc = 0; - void *vptr = 0; - if (!desc) desc = SWIG_TypeQuery("FILE *"); - if ((SWIG_ConvertPtr(obj, &vptr, desc, 0)) == SWIG_OK) { - if (val) *val = (FILE *)vptr; - return SWIG_OK; - } -%#if PY_VERSION_HEX < 0x03000000 - if (PyFile_Check(obj)) { - if (val) *val = PyFile_AsFile(obj); - return SWIG_OK; - } -%#endif - return SWIG_TypeError; -} -} - - -%fragment("SWIG_AsFilePtr","header",fragment="SWIG_AsValFilePtr") { -SWIGINTERNINLINE FILE* -SWIG_AsFilePtr(PyObject *obj) { - FILE *val = 0; - SWIG_AsValFilePtr(obj, &val); - return val; -} -} - -/* defining the typemaps */ -%typemaps_asval(%checkcode(POINTER), SWIG_AsValFilePtr, "SWIG_AsValFilePtr", FILE*); diff --git a/win64/bin/swig/share/swig/4.1.0/python/implicit.i b/win64/bin/swig/share/swig/4.1.0/python/implicit.i deleted file mode 100755 index 292f65f1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/implicit.i +++ /dev/null @@ -1,7 +0,0 @@ -%include -%include - -#warning "This file provides the %implicit directive, which is an old and fragile" -#warning "way to implement the C++ implicit conversion mechanism." -#warning "Try using the more robust '%implicitconv Type;' directive instead." - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyabc.i b/win64/bin/swig/share/swig/4.1.0/python/pyabc.i deleted file mode 100755 index 4a3ef5b4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyabc.i +++ /dev/null @@ -1,14 +0,0 @@ -%define %pythonabc(Type, Abc) - %feature("python:abc", Abc) Type; -%enddef -%pythoncode %{if _swig_python_version_info[0:2] >= (3, 3): - import collections.abc -else: - import collections -%} -%pythonabc(std::vector, "collections.abc.MutableSequence if _swig_python_version_info >= (3, 3) else collections.MutableSequence"); -%pythonabc(std::list, "collections.abc.MutableSequence if _swig_python_version_info >= (3, 3) else collections.MutableSequence"); -%pythonabc(std::map, "collections.abc.MutableMapping if _swig_python_version_info >= (3, 3) else collections.MutableMapping"); -%pythonabc(std::multimap, "collections.abc.MutableMapping if _swig_python_version_info >= (3, 3) else collections.MutableMapping"); -%pythonabc(std::set, "collections.abc.MutableSet if _swig_python_version_info >= (3, 3) else collections.MutableSet"); -%pythonabc(std::multiset, "collections.abc.MutableSet if _swig_python_version_info >= (3, 3) else collections.MutableSet"); diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyapi.swg b/win64/bin/swig/share/swig/4.1.0/python/pyapi.swg deleted file mode 100755 index d6ff54b8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyapi.swg +++ /dev/null @@ -1,30 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -#ifdef __cplusplus -} -#endif - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pybackward.swg b/win64/bin/swig/share/swig/4.1.0/python/pybackward.swg deleted file mode 100755 index f41f2a6f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pybackward.swg +++ /dev/null @@ -1,45 +0,0 @@ -/* - adding backward compatibility macros -*/ - -#define SWIG_arg(x...) %arg(x) -#define SWIG_Mangle(x...) %mangle(x) - -#define SWIG_As_frag(Type...) %fragment_name(As, Type) -#define SWIG_As_name(Type...) %symbol_name(As, Type) -#define SWIG_As(Type...) SWIG_As_name(Type) SWIG_AS_CALL_ARGS - -#define SWIG_Check_frag(Type...) %fragment_name(Check, Type) -#define SWIG_Check_name(Type...) %symbol_name(Check, Type) -#define SWIG_Check(Type...) SWIG_Check_name(Type) SWIG_AS_CALL_ARGS - -%define %ascheck_methods(Code, Type...) -%fragment(SWIG_As_frag(Type),"header", fragment=SWIG_AsVal_frag(Type)) { -SWIGINTERNINLINE Type -SWIG_As(Type)(PyObject* obj) -{ - Type v; - int res = SWIG_AsVal(Type)(obj, &v); - if (!SWIG_IsOK(res)) { - /* - this is needed to make valgrind/purify happier. - */ - memset((void*)&v, 0, sizeof(Type)); - SWIG_Error(res, ""); - } - return v; -} -} - -%fragment(SWIG_Check_frag(Type),"header",fragment=SWIG_AsVal_frag(Type)) { -SWIGINTERNINLINE int -SWIG_Check(Type)(PyObject* obj) -{ - int res = SWIG_AsVal(Type)(obj, (Type*)0); - return SWIG_IsOK(res); -} -} -%enddef - -%apply_checkctypes(%ascheck_methods) - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pybuffer.i b/win64/bin/swig/share/swig/4.1.0/python/pybuffer.i deleted file mode 100755 index 370483a9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pybuffer.i +++ /dev/null @@ -1,119 +0,0 @@ -/* Implementing buffer protocol typemaps */ - -/* %pybuffer_mutable_binary(TYPEMAP, SIZE) - * - * Macro for functions accept mutable buffer pointer with a size. - * This can be used for both input and output. For example: - * - * %pybuffer_mutable_binary(char *buff, int size); - * void foo(char *buff, int size) { - * for(int i=0; i; - - or as a member variable: - - struct A { - SwigPtr_PyObject obj; - A(PyObject *o) : _obj(o) { - } - }; - - or as a input/output value - - SwigPtr_PyObject func(SwigPtr_PyObject obj) { - SwigPtr_PyObject out = PyString_FromFormat("hello %s", PyObject_AsString(obj)); - Py_DECREF(out); - return out; - } - - just remember to pair the object creation with the proper DECREF, - the same as with plain PyObject *ptr, since SwigPtr_PyObject always add - one reference at construction. - - SwigPtr_PyObject is 'visible' at the wrapped side, so you can do: - - - %template(pyvector) std::vector; - - and all the proper typemaps will be used. - -*/ - -namespace swig { - %ignore SwigPtr_PyObject; - struct SwigPtr_PyObject {}; - %apply PyObject * {SwigPtr_PyObject}; - %apply PyObject * const& {SwigPtr_PyObject const&}; - - %typemap(typecheck,precedence=SWIG_TYPECHECK_SWIGOBJECT,noblock=1) SwigPtr_PyObject const& "$1 = ($input != 0);" - - - /* For output */ - %typemap(out,noblock=1) SwigPtr_PyObject { - $result = (PyObject *)$1; - Py_INCREF($result); - } - - %typemap(out,noblock=1) SwigPtr_PyObject const & { - $result = (PyObject *)*$1; - Py_INCREF($result); - } - -} - -%{ -namespace swig { - class SwigPtr_PyObject { - protected: - PyObject *_obj; - - public: - SwigPtr_PyObject() :_obj(0) - { - } - - SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) - { - if (initial_ref) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(item._obj); - Py_XDECREF(_obj); - _obj = item._obj; - SWIG_PYTHON_THREAD_END_BLOCK; - return *this; - } - - ~SwigPtr_PyObject() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XDECREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - operator PyObject *() const - { - return _obj; - } - - PyObject *operator->() const - { - return _obj; - } - }; -} -%} - -/* - SwigVar_PyObject is used to manage 'in the scope' PyObject * variables, - as in - - int func () { - SwigVar_PyObject obj = PyString_FromString("hello"); - } - - ie, 'obj' is created and destructed in the same scope from - a python object that carries at least one reference value. - - SwigVar_PyObject just take care of applying the proper Py_DECREF. - - Hence, this class is purely internal and not visible at the wrapped side. - */ -namespace swig { - %ignore SwigVar_PyObject; - struct SwigVar_PyObject {}; - %apply PyObject * {SwigVar_PyObject}; - %apply PyObject * const& {SwigVar_PyObject const&}; -} - -%{ -namespace swig { - struct SwigVar_PyObject : SwigPtr_PyObject { - SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - - SwigVar_PyObject & operator = (PyObject* obj) - { - Py_XDECREF(_obj); - _obj = obj; - return *this; - } - }; -} -%} - - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/python/pycomplex.swg b/win64/bin/swig/share/swig/4.1.0/python/pycomplex.swg deleted file mode 100755 index 0f2c1d97..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pycomplex.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* - Defines the As/From converters for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header") -{ -SWIGINTERNINLINE PyObject* -SWIG_From(Type)(%ifcplusplus(const Type&, Type) c) -{ - return PyComplex_FromDoubles(Real(c), Imag(c)); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double)) -{ -SWIGINTERN int -SWIG_AsVal(Type) (PyObject *o, Type* val) -{ - if (PyComplex_Check(o)) { - if (val) *val = Constructor(PyComplex_RealAsDouble(o), PyComplex_ImagAsDouble(o)); - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float)) { -SWIGINTERN int -SWIG_AsVal(Type)(PyObject *o, Type *val) -{ - if (PyComplex_Check(o)) { - double re = PyComplex_RealAsDouble(o); - double im = PyComplex_ImagAsDouble(o); - if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0f); - return res; - } - } - return SWIG_TypeError; -} -} - -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) - - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pycontainer.swg b/win64/bin/swig/share/swig/4.1.0/python/pycontainer.swg deleted file mode 100755 index b2cac287..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pycontainer.swg +++ /dev/null @@ -1,1082 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pycontainer.swg - * - * Python sequence <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Python, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -%{ -#include - -#if PY_VERSION_HEX >= 0x03020000 -# define SWIGPY_SLICEOBJECT PyObject -#else -# define SWIGPY_SLICEOBJECT PySliceObject -#endif -%} - - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - -%include - -/**** The PySequence C++ Wrap ***/ - -%fragment(""); - -%include - -%fragment("container_owner_attribute_init", "init") { - // thread safe initialization - swig::container_owner_attribute(); -} - -%fragment("reference_container_owner", "header", fragment="container_owner_attribute_init") { -namespace swig { - static PyObject* container_owner_attribute() { - static PyObject* attr = SWIG_Python_str_FromChar("__swig_container"); - return attr; - } - - template - struct container_owner { - // By default, do not add the back-reference (for value types) - // Specialization below will check the reference for pointer types. - static bool back_reference(PyObject* /*child*/, PyObject* /*owner*/) { - return false; - } - }; - - template <> - struct container_owner { - /* - * Call to add a back-reference to the owning object when returning a - * reference from a container. Will only set the reference if child - * is a SWIG wrapper object that does not own the pointer. - * - * returns whether the reference was set or not - */ - static bool back_reference(PyObject* child, PyObject* owner) { - SwigPyObject* swigThis = SWIG_Python_GetSwigThis(child); - if (swigThis && (swigThis->own & SWIG_POINTER_OWN) != SWIG_POINTER_OWN) { - return PyObject_SetAttr(child, container_owner_attribute(), owner) != -1; - } - return false; - } - }; -} -} - -%fragment(SWIG_Traits_frag(swig::SwigPtr_PyObject),"header",fragment="StdTraits") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "SwigPtr_PyObject"; } - }; - - template <> struct traits_from { - typedef SwigPtr_PyObject value_type; - static PyObject *from(const value_type& val) { - PyObject *obj = static_cast(val); - Py_XINCREF(obj); - return obj; - } - }; - - template <> - struct traits_check { - static bool check(SwigPtr_PyObject) { - return true; - } - }; - - template <> struct traits_asval { - typedef SwigPtr_PyObject value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} -} - -%fragment(SWIG_Traits_frag(swig::SwigVar_PyObject),"header",fragment="StdTraits") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "SwigVar_PyObject"; } - }; - - template <> struct traits_from { - typedef SwigVar_PyObject value_type; - static PyObject *from(const value_type& val) { - PyObject *obj = static_cast(val); - Py_XINCREF(obj); - return obj; - } - }; - - template <> - struct traits_check { - static bool check(SwigVar_PyObject) { - return true; - } - }; - - template <> struct traits_asval { - typedef SwigVar_PyObject value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} -} - -%fragment("SwigPySequence_Base","header",fragment="",fragment="StdTraits") -{ -%#include - -namespace std { - template <> - struct less - { - bool - operator()(PyObject * v, PyObject *w) const - { - bool res; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false; - /* This may fall into a case of inconsistent - eg. ObjA > ObjX > ObjB - but ObjA < ObjB - */ - if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) ) - { - /* Objects can't be compared, this mostly occurred in Python 3.0 */ - /* Compare their ptr directly for a workaround */ - res = (v < w); - PyErr_Clear(); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } - }; - - template <> - struct less - { - bool - operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const - { - return std::less()(v, w); - } - }; - - template <> - struct less - { - bool - operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const - { - return std::less()(v, w); - } - }; - -} - -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "PyObject *"; } - }; - - template <> struct traits_asval { - typedef PyObject * value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; - - template <> - struct traits_check { - static bool check(PyObject *) { - return true; - } - }; - - template <> struct traits_from { - typedef PyObject * value_type; - static PyObject *from(const value_type& val) { - Py_XINCREF(val); - return val; - } - }; - -} - -namespace swig { - template - inline size_t - check_index(Difference i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - throw std::out_of_range("index out of range"); - } - - template - void - slice_adjust(Difference i, Difference j, Py_ssize_t step, size_t size, Difference &ii, Difference &jj, bool insert = false) { - if (step == 0) { - throw std::invalid_argument("slice step cannot be zero"); - } else if (step > 0) { - // Required range: 0 <= i < size, 0 <= j < size, i <= j - if (i < 0) { - ii = 0; - } else if (i < (Difference)size) { - ii = i; - } else if (insert && (i >= (Difference)size)) { - ii = (Difference)size; - } - if (j < 0) { - jj = 0; - } else { - jj = (j < (Difference)size) ? j : (Difference)size; - } - if (jj < ii) - jj = ii; - } else { - // Required range: -1 <= i < size-1, -1 <= j < size-1, i >= j - if (i < -1) { - ii = -1; - } else if (i < (Difference) size) { - ii = i; - } else if (i >= (Difference)(size-1)) { - ii = (Difference)(size-1); - } - if (j < -1) { - jj = -1; - } else { - jj = (j < (Difference)size ) ? j : (Difference)(size-1); - } - if (ii < jj) - ii = jj; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline void - erase(Sequence* seq, const typename Sequence::iterator& position) { - seq->erase(position); - } - - template - struct traits_reserve { - static void reserve(Sequence & /*seq*/, typename Sequence::size_type /*n*/) { - // This should be specialized for types that support reserve - } - }; - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j, Py_ssize_t step) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj); - - if (step > 0) { - typename Sequence::const_iterator sb = self->begin(); - typename Sequence::const_iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - if (step == 1) { - return new Sequence(sb, se); - } else { - Sequence *sequence = new Sequence(); - swig::traits_reserve::reserve(*sequence, (jj - ii + step - 1) / step); - typename Sequence::const_iterator it = sb; - while (it!=se) { - sequence->push_back(*it); - for (Py_ssize_t c=0; c::reserve(*sequence, (ii - jj - step - 1) / -step); - typename Sequence::const_reverse_iterator sb = self->rbegin(); - typename Sequence::const_reverse_iterator se = self->rbegin(); - std::advance(sb,size-ii-1); - std::advance(se,size-jj-1); - typename Sequence::const_reverse_iterator it = sb; - while (it!=se) { - sequence->push_back(*it); - for (Py_ssize_t c=0; c<-step && it!=se; ++c) - it++; - } - return sequence; - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - if (step > 0) { - if (step == 1) { - size_t ssize = jj - ii; - if (ssize <= is.size()) { - // expanding/staying the same size - swig::traits_reserve::reserve(*self, self->size() - ssize + is.size()); - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator isit = is.begin(); - std::advance(sb,ii); - std::advance(isit, jj - ii); - self->insert(std::copy(is.begin(), isit, sb), isit, is.end()); - } else { - // shrinking - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - sb = self->begin(); - std::advance(sb,ii); - self->insert(sb, is.begin(), is.end()); - } - } else { - size_t replacecount = (jj - ii + step - 1) / step; - if (is.size() != replacecount) { - char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); - throw std::invalid_argument(msg); - } - typename Sequence::const_iterator isit = is.begin(); - typename Sequence::iterator it = self->begin(); - std::advance(it,ii); - for (size_t rc=0; rcend(); ++rc) { - *it++ = *isit++; - for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) - it++; - } - } - } else { - size_t replacecount = (ii - jj - step - 1) / -step; - if (is.size() != replacecount) { - char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); - throw std::invalid_argument(msg); - } - typename Sequence::const_iterator isit = is.begin(); - typename Sequence::reverse_iterator it = self->rbegin(); - std::advance(it,size-ii-1); - for (size_t rc=0; rcrend(); ++rc) { - *it++ = *isit++; - for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) - it++; - } - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j, Py_ssize_t step) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - if (step > 0) { - typename Sequence::iterator sb = self->begin(); - std::advance(sb,ii); - if (step == 1) { - typename Sequence::iterator se = self->begin(); - std::advance(se,jj); - self->erase(sb,se); - } else { - typename Sequence::iterator it = sb; - size_t delcount = (jj - ii + step - 1) / step; - while (delcount) { - it = self->erase(it); - for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) - it++; - delcount--; - } - } - } else { - typename Sequence::reverse_iterator sb = self->rbegin(); - std::advance(sb,size-ii-1); - typename Sequence::reverse_iterator it = sb; - size_t delcount = (ii - jj - step - 1) / -step; - while (delcount) { - it = typename Sequence::reverse_iterator(self->erase((++it).base())); - for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) - it++; - delcount--; - } - } - } -} -} - -%fragment("SwigPySequence_Cont","header", - fragment="StdTraits", - fragment="SwigPySequence_Base", - fragment="SwigPyIterator_T") -{ -namespace swig -{ - template - struct SwigPySequence_Ref - { - SwigPySequence_Ref(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index); - try { - return swig::as(item); - } catch (const std::invalid_argument& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", (int)_index); - if (!PyErr_Occurred()) { - ::%type_error(swig::type_name()); - } - SWIG_Python_AddErrorMsg(msg); - SWIG_Python_AddErrorMsg(e.what()); - throw; - } - } - - SwigPySequence_Ref& operator=(const T& v) - { - PySequence_SetItem(_seq, _index, swig::from(v)); - return *this; - } - - private: - PyObject* _seq; - Py_ssize_t _index; - }; - - template - struct SwigPySequence_ArrowProxy - { - SwigPySequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct SwigPySequence_InputIterator - { - typedef SwigPySequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - - SwigPySequence_InputIterator() - { - } - - SwigPySequence_InputIterator(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - SwigPySequence_ArrowProxy - operator->() const { - return SwigPySequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index) && (_seq == ri._seq); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - PyObject* _seq; - difference_type _index; - }; - - // STL container wrapper around a Python sequence - template - struct SwigPySequence_Cont - { - typedef SwigPySequence_Ref reference; - typedef const SwigPySequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - typedef size_t size_type; - typedef const pointer const_pointer; - typedef SwigPySequence_InputIterator iterator; - typedef SwigPySequence_InputIterator const_iterator; - - SwigPySequence_Cont(PyObject* seq) : _seq(0) - { - if (!PySequence_Check(seq)) { - throw std::invalid_argument("a sequence is expected"); - } - _seq = seq; - Py_INCREF(_seq); - } - - ~SwigPySequence_Cont() - { - Py_XDECREF(_seq); - } - - size_type size() const - { - return static_cast(PySequence_Size(_seq)); - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - Py_ssize_t s = size(); - for (Py_ssize_t i = 0; i < s; ++i) { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i); - if (!swig::check(item)) - return false; - } - return true; - } - - private: - PyObject* _seq; - }; - -} -} - -%define %swig_sequence_iterator(Sequence...) - %swig_sequence_iterator_with_making_function(swig::make_output_iterator,Sequence...) -%enddef - -%define %swig_sequence_forward_iterator(Sequence...) - %swig_sequence_iterator_with_making_function(swig::make_output_forward_iterator,Sequence...) -%enddef - -%define %swig_sequence_iterator_with_making_function(Make_output_iterator,Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - class iterator; - class reverse_iterator; - class const_iterator; - class const_reverse_iterator; - - %typemap(out,noblock=1,fragment="SwigPySequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - $result = SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &)), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); - } - %typemap(out,noblock=1,fragment="SwigPySequence_Cont") - std::pair, std::pair { - $result = PyTuple_New(2); - PyTuple_SetItem($result,0,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).first), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); - PyTuple_SetItem($result,1,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).second), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); - } - - %fragment("SwigPyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="SwigPySequence_Cont") {} - - %typemap(out,noblock=1,fragment="SwigPyPairBoolOutputIterator") - std::pair, std::pair { - $result = PyTuple_New(2); - PyTuple_SetItem($result,0,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).first), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); - PyTuple_SetItem($result,1,SWIG_From(bool)(%static_cast($1,const $type &).second)); - } - - %typemap(in,noblock=1,fragment="SwigPySequence_Cont") - iterator(swig::SwigPyIterator *iter = 0, int res), - reverse_iterator(swig::SwigPyIterator *iter = 0, int res), - const_iterator(swig::SwigPyIterator *iter = 0, int res), - const_reverse_iterator(swig::SwigPyIterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::SwigPyIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="SwigPySequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - swig::SwigPyIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("SwigPySequence_Cont"); - - %newobject iterator(PyObject **PYTHON_SELF); - %extend { - swig::SwigPyIterator* iterator(PyObject **PYTHON_SELF) { - return Make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "tp_iter", functype="getiterfunc") iterator; -#else - %pythoncode %{def __iter__(self): - return self.iterator()%} -#endif - } - -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - - -/**** The python container methods ****/ - -%define %swig_container_methods(Container...) - -/* deprecated in Python 2 */ -#if 1 - %newobject __getslice__; -#endif - %newobject __getitem__(SWIGPY_SLICEOBJECT *slice); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "nb_nonzero", functype="inquiry") __nonzero__; - %feature("python:slot", "sq_length", functype="lenfunc") __len__; -#endif // SWIGPYTHON_BUILTIN - - %extend { - bool __nonzero__() const { - return !(self->empty()); - } - - /* Alias for Python 3 compatibility */ - bool __bool__() const { - return !(self->empty()); - } - - size_type __len__() const { - return self->size(); - } - - // Although __getitem__, front, back actually use a const value_type& return type, the typemaps below - // use non-const so that they can be easily overridden by users if necessary. - %typemap(ret, fragment="reference_container_owner", noblock=1) value_type& __getitem__, value_type& front, value_type& back { - (void)swig::container_owner::category>::back_reference($result, $self); - } - } -%enddef - - - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - - %fragment("SwigPySequence_Base"); - -#if defined(SWIGPYTHON_BUILTIN) - //%feature("python:slot", "sq_item", functype="ssizeargfunc") __getitem__; - //%feature("python:slot", "sq_slice", functype="ssizessizeargfunc") __getslice__; - //%feature("python:slot", "sq_ass_item", functype="ssizeobjargproc") __setitem__; - //%feature("python:slot", "sq_ass_slice", functype="ssizessizeobjargproc") __setslice__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif // SWIGPYTHON_BUILTIN - - %extend { - /* typemap for slice object support */ - %typemap(in) SWIGPY_SLICEOBJECT* { - if (!PySlice_Check($input)) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - $1 = (SWIGPY_SLICEOBJECT *) $input; - } - %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) SWIGPY_SLICEOBJECT* { - $1 = PySlice_Check($input); - } - -/* deprecated in Python 2 */ -#if 1 - Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range, std::invalid_argument) { - return swig::getslice(self, i, j, 1); - } - - void __setslice__(difference_type i, difference_type j) throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, 1, Sequence()); - } - - void __setslice__(difference_type i, difference_type j, const Sequence& v) throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, 1, v); - } - - void __delslice__(difference_type i, difference_type j) throw (std::out_of_range, std::invalid_argument) { - swig::delslice(self, i, j, 1); - } -#endif - - void __delitem__(difference_type i) throw (std::out_of_range, std::invalid_argument) { - swig::erase(self, swig::getpos(self, i)); - } - - /* Overloaded methods for Python 3 compatibility - * (Also useful in Python 2.x) - */ - Sequence* __getitem__(SWIGPY_SLICEOBJECT *slice) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return NULL; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - return swig::getslice(self, id, jd, step); - } - - void __setitem__(SWIGPY_SLICEOBJECT *slice, const Sequence& v) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - swig::setslice(self, id, jd, step, v); - } - - void __setitem__(SWIGPY_SLICEOBJECT *slice) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - swig::delslice(self, id, jd, step); - } - - void __delitem__(SWIGPY_SLICEOBJECT *slice) throw (std::out_of_range, std::invalid_argument) { - Py_ssize_t i, j, step; - if( !PySlice_Check(slice) ) { - SWIG_Error(SWIG_TypeError, "Slice object expected."); - return; - } - PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); - Sequence::difference_type id = i; - Sequence::difference_type jd = j; - swig::delslice(self, id, jd, step); - } - - } -%enddef - -%define %swig_sequence_methods_non_resizable(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - const value_type& __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, const value_type& x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - -#if defined(SWIGPYTHON_BUILTIN) - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(difference_type i) throw (std::out_of_range, std::invalid_argument) { - swig::erase(self, swig::getpos(self, i)); - } -#endif - - } -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_non_resizable(%arg(Sequence)) - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - void append(const value_type& x) { - self->push_back(x); - } - } -%enddef - -%define %swig_sequence_methods_non_resizable_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - value_type __getitem__(difference_type i) throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, value_type x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - -#if defined(SWIGPYTHON_BUILTIN) - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(difference_type i) throw (std::out_of_range, std::invalid_argument) { - swig::erase(self, swig::getpos(self, i)); - } -#endif - } -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_non_resizable_val(%arg(Sequence)) - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - void append(value_type x) { - self->push_back(x); - } - } -%enddef - - - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="SwigPySequence_Cont") -{ -namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, Seq* seq) { - // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(PyObject *obj, sequence **seq) { - if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(::SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } - } else if (PySequence_Check(obj)) { - try { - SwigPySequence_Cont swigpyseq(obj); - if (seq) { - sequence *pseq = new sequence(); - assign(swigpyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return swigpyseq.check() ? SWIG_OK : SWIG_ERROR; - } - } catch (std::exception& e) { - if (seq) { - if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, e.what()); - } - } - return SWIG_ERROR; - } - } - return SWIG_ERROR; - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static PyObject *from(const sequence& seq) { -%#ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); - } -%#endif - size_type size = seq.size(); - if (size <= (size_type)INT_MAX) { - PyObject *obj = PyTuple_New((Py_ssize_t)size); - Py_ssize_t i = 0; - for (const_iterator it = seq.begin(); it != seq.end(); ++it, ++i) { - PyTuple_SetItem(obj,i,swig::from(*it)); - } - return obj; - } else { - PyErr_SetString(PyExc_OverflowError,"sequence size not valid in python"); - return NULL; - } - } - }; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/python/pydocs.swg b/win64/bin/swig/share/swig/4.1.0/python/pydocs.swg deleted file mode 100755 index 0c9197ba..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pydocs.swg +++ /dev/null @@ -1,45 +0,0 @@ - -// Documentation for use with the autodoc feature. - -#ifdef SWIG_DOC_DOXYGEN_STYLE -%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) enum SWIGTYPE "@param $1_name enum $1_type" - -%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 *OUTPUT, SWIGTYPE &OUTPUT "@param $1_name $1_type (output)" -#else -%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) enum SWIGTYPE "$1_name: enum $1_type" - -%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 *OUTPUT, SWIGTYPE &OUTPUT "$1_name: $1_type (output)" -#endif - - -// Types to use in Python documentation for the parameters of the given C++ type. -%typemap(doctype) bool "boolean" - -%define int_doctype_for_cppint_type(cppint_type) - %typemap(doctype) cppint_type, unsigned cppint_type "int" -%enddef -%formacro(int_doctype_for_cppint_type, short, int, long, long long) - -%typemap(doctype) size_t "int" - -%typemap(doctype) enum SWIGTYPE "int" - -%typemap(doctype) float, double, long double "float" - -%typemap(doctype) char*, std::string "string" - -%typemap(doctype) SWIGTYPE "$1_basetype" -%typemap(doctype) SWIGTYPE * "$typemap(doctype, $*1_ltype)" -%typemap(doctype) SWIGTYPE & "$typemap(doctype, $*1_ltype)" diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyerrors.swg b/win64/bin/swig/share/swig/4.1.0/python/pyerrors.swg deleted file mode 100755 index 793bc228..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyerrors.swg +++ /dev/null @@ -1,107 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - PyErr_Clear(); - Py_XINCREF(type); - if (tmp) - PyErr_Format(type, "%s %s", tmp, mesg); - else - PyErr_Format(type, "%s", mesg); - Py_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -SWIGRUNTIME int -SWIG_Python_TypeErrorOccurred(PyObject *obj) -{ - PyObject *error; - if (obj) - return 0; - error = PyErr_Occurred(); - return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); -} - -SWIGRUNTIME void -SWIG_Python_RaiseOrModifyTypeError(const char *message) -{ - if (SWIG_Python_TypeErrorOccurred(NULL)) { - /* Use existing TypeError to preserve stacktrace and enhance with given message */ - PyObject *newvalue; - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); -#if PY_VERSION_HEX >= 0x03000000 - newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); -#else - newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); -#endif - if (newvalue) { - Py_XDECREF(value); - PyErr_Restore(type, newvalue, traceback); - } else { - PyErr_Restore(type, value, traceback); - } - } else { - /* Raise TypeError using given message */ - PyErr_SetString(PyExc_TypeError, message); - } -} diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyfragments.swg b/win64/bin/swig/share/swig/4.1.0/python/pyfragments.swg deleted file mode 100755 index c1e61517..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'pyfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the default ones defined by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(PyObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyhead.swg b/win64/bin/swig/share/swig/4.1.0/python/pyhead.swg deleted file mode 100755 index 3886365a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyhead.swg +++ /dev/null @@ -1,75 +0,0 @@ -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) -#define PyString_Check(name) PyBytes_Check(name) -#define PyString_FromString(x) PyUnicode_FromString(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -#define PyString_AsString(str) PyBytes_AsString(str) -#define PyString_Size(str) PyBytes_Size(str) -#define PyString_InternFromString(key) PyUnicode_InternFromString(key) -#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE -#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) - -#endif - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#endif - - -SWIGINTERN char* -SWIG_Python_str_AsChar(PyObject *str) -{ -#if PY_VERSION_HEX >= 0x03030000 - return (char *)PyUnicode_AsUTF8(str); -#else - return PyString_AsString(str); -#endif -} - -/* Was useful for Python 3.0.x-3.2.x - now provided only for compatibility - * with any uses in user interface files. */ -#define SWIG_Python_str_DelForPy3(x) - - -SWIGINTERN PyObject* -SWIG_Python_str_FromChar(const char *c) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -/* SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user interface files check for it. */ -# define SWIGPY_USE_CAPSULE -#ifdef SWIGPYTHON_BUILTIN -# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule_builtin" SWIG_TYPE_TABLE_NAME -#else -# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule" SWIG_TYPE_TABLE_NAME -#endif -# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION "." SWIGPY_CAPSULE_ATTR_NAME) - -#if PY_VERSION_HEX < 0x03020000 -#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) -#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyinit.swg b/win64/bin/swig/share/swig/4.1.0/python/pyinit.swg deleted file mode 100755 index dbb219ef..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyinit.swg +++ /dev/null @@ -1,325 +0,0 @@ -/* ------------------------------------------------------------ - * The start of the Python initialization function - * ------------------------------------------------------------ */ - -%insert(init) "swiginit.swg" - -#if defined(SWIGPYTHON_BUILTIN) -%fragment(""); // For offsetof -#endif - -#if defined SWIGPYTHON_FASTPROXY && !defined SWIGPYTHON_BUILTIN - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" { -#endif - -/* Method creation and docstring support functions */ - -SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); -SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); -SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); - -#ifdef __cplusplus -} -#endif -%} - -#endif - -%init %{ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - -/* Install Constants */ -SWIGINTERN void -SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } -} - -/* ----------------------------------------------------------------------------- - * Patch %callback methods' docstrings to hold the callback ptrs - * -----------------------------------------------------------------------------*/ - -SWIGINTERN void -SWIG_Python_FixMethods(PyMethodDef *methods, const swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) { - size_t i; - for (i = 0; methods[i].ml_name; ++i) { - const char *c = methods[i].ml_doc; - if (!c) continue; - c = strstr(c, "swig_ptr: "); - if (c) { - int j; - const swig_const_info *ci = 0; - const char *name = c + 10; - for (j = 0; const_table[j].type; ++j) { - if (strncmp(const_table[j].name, name, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - memcpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - memcpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } -} - -#ifdef __cplusplus -} -#endif - -%} - -#if defined SWIGPYTHON_FASTPROXY && !defined SWIGPYTHON_BUILTIN - -%init %{ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Method creation and docstring support functions - * ----------------------------------------------------------------------------- */ - -/* ----------------------------------------------------------------------------- - * Function to find the method definition with the correct docstring for the - * proxy module as opposed to the low-level API - * ----------------------------------------------------------------------------- */ - -SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) { - /* Find the function in the modified method table */ - size_t offset = 0; - int found = 0; - while (SwigMethods_proxydocs[offset].ml_meth != NULL) { - if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) { - found = 1; - break; - } - offset++; - } - /* Use the copy with the modified docstring if available */ - return found ? &SwigMethods_proxydocs[offset] : NULL; -} - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - -SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } -#if PY_VERSION_HEX >= 0x03000000 - return PyInstanceMethod_New(func); -#else - return PyMethod_New(func, NULL, NULL); -#endif -} - -/* ----------------------------------------------------------------------------- - * Wrapper of PyStaticMethod_New() - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - -SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } - return PyStaticMethod_New(func); -} - -#ifdef __cplusplus -} -#endif - -%} - -#endif - -%init %{ - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 - PyObject* -#else - void -#endif -SWIG_init(void) { - PyObject *m, *d, *md, *globals; - -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { - PyModuleDef_HEAD_INIT, - SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - -#if defined(SWIGPYTHON_BUILTIN) - static SwigPyClientData SwigPyObject_clientdata = {0, 0, 0, 0, 0, 0, 0}; - static PyGetSetDef this_getset_def = { - (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL - }; - static SwigPyGetSet thisown_getset_closure = { - SwigPyObject_own, - SwigPyObject_own - }; - static PyGetSetDef thisown_getset_def = { - (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure - }; - PyTypeObject *builtin_pytype; - int builtin_base_count; - swig_type_info *builtin_basetype; - PyObject *tuple; - PyGetSetDescrObject *static_getset; - PyTypeObject *metatype; - PyTypeObject *swigpyobject; - SwigPyClientData *cd; - PyObject *public_interface, *public_symbol; - PyObject *this_descr; - PyObject *thisown_descr; - PyObject *self = 0; - int i; - - (void)builtin_pytype; - (void)builtin_base_count; - (void)builtin_basetype; - (void)tuple; - (void)static_getset; - (void)self; - - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); - assert(metatype); -#endif - - (void)globals; - - /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ - SWIG_This(); - SWIG_Python_TypeCache(); - SwigPyPacked_type(); -#ifndef SWIGPYTHON_BUILTIN - SwigPyObject_type(); -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule(SWIG_name, SwigMethods); -#endif - - md = d = PyModule_GetDict(m); - (void)md; - - SWIG_InitializeModule(0); - -#ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - if (!cd) { - SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { - PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); -# if PY_VERSION_HEX >= 0x03000000 - return NULL; -# else - return; -# endif - } - - /* All objects have a 'this' attribute */ - this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); - (void)this_descr; - - /* All objects have a 'thisown' attribute */ - thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); - (void)thisown_descr; - - public_interface = PyList_New(0); - public_symbol = 0; - (void)public_symbol; - - PyDict_SetItemString(md, "__all__", public_interface); - Py_DECREF(public_interface); - for (i = 0; SwigMethods[i].ml_name != NULL; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); - for (i = 0; swig_const_table[i].name != 0; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); -#endif - - SWIG_InstallConstants(d,swig_const_table); -%} - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyiterators.swg b/win64/bin/swig/share/swig/4.1.0/python/pyiterators.swg deleted file mode 100755 index 65a12cb2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyiterators.swg +++ /dev/null @@ -1,458 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pyiterators.swg - * - * Implement a python 'output' iterator for Python 2.2 or higher. - * - * Users can derive form the SwigPyIterator to implement their - * own iterators. As an example (real one since we use it for STL/STD - * containers), the template SwigPyIterator_T does the - * implementation for generic C++ iterators. - * ----------------------------------------------------------------------------- */ - -%include - -%fragment("SwigPyIterator","header",fragment="") { -namespace swig { - struct stop_iteration { - }; - - struct SwigPyIterator { - private: - SwigPtr_PyObject _seq; - - protected: - SwigPyIterator(PyObject *seq) : _seq(seq) - { - } - - public: - virtual ~SwigPyIterator() {} - - // Access iterator method, required by Python - virtual PyObject *value() const = 0; - - // Forward iterator method, required by Python - virtual SwigPyIterator *incr(size_t n = 1) = 0; - - // Backward iterator method, very common in C++, but not required in Python - virtual SwigPyIterator *decr(size_t /*n*/ = 1) - { - throw stop_iteration(); - } - - // Random access iterator methods, but not required in Python - virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual bool equal (const SwigPyIterator &/*x*/) const - { - throw std::invalid_argument("operation not supported"); - } - - // C++ common/needed methods - virtual SwigPyIterator *copy() const = 0; - - PyObject *next() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads - PyObject *obj = value(); - incr(); - SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads - return obj; - } - - /* Make an alias for Python 3.x */ - PyObject *__next__() - { - return next(); - } - - PyObject *previous() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads - decr(); - PyObject *obj = value(); - SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads - return obj; - } - - SwigPyIterator *advance(ptrdiff_t n) - { - return (n > 0) ? incr(n) : decr(-n); - } - - bool operator == (const SwigPyIterator& x) const - { - return equal(x); - } - - bool operator != (const SwigPyIterator& x) const - { - return ! operator==(x); - } - - SwigPyIterator& operator += (ptrdiff_t n) - { - return *advance(n); - } - - SwigPyIterator& operator -= (ptrdiff_t n) - { - return *advance(-n); - } - - SwigPyIterator* operator + (ptrdiff_t n) const - { - return copy()->advance(n); - } - - SwigPyIterator* operator - (ptrdiff_t n) const - { - return copy()->advance(-n); - } - - ptrdiff_t operator - (const SwigPyIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::SwigPyIterator *"); - init = 1; - } - return desc; - } - }; - -%#if defined(SWIGPYTHON_BUILTIN) - inline PyObject* make_output_iterator_builtin (PyObject *pyself) - { - Py_INCREF(pyself); - return pyself; - } -%#endif -} -} - -%fragment("SwigPyIterator_T","header",fragment="",fragment="SwigPyIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - template - class SwigPyIterator_T : public SwigPyIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef SwigPyIterator_T self_type; - - SwigPyIterator_T(out_iterator curr, PyObject *seq) - : SwigPyIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const SwigPyIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const SwigPyIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyForwardIteratorOpen_T : public SwigPyIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyForwardIteratorOpen_T self_type; - - SwigPyForwardIteratorOpen_T(out_iterator curr, PyObject *seq) - : SwigPyIterator_T(curr, seq) - { - } - - PyObject *value() const { - return from(static_cast(*(base::current))); - } - - SwigPyIterator *copy() const - { - return new self_type(*this); - } - - SwigPyIterator *incr(size_t n = 1) - { - while (n--) { - ++base::current; - } - return this; - } - - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyIteratorOpen_T : public SwigPyForwardIteratorOpen_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyIteratorOpen_T self_type; - - SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq) - : SwigPyForwardIteratorOpen_T(curr, seq) - { - } - - SwigPyIterator *decr(size_t n = 1) - { - while (n--) { - --base::current; - } - return this; - } - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyForwardIteratorClosed_T : public SwigPyIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyForwardIteratorClosed_T self_type; - - SwigPyForwardIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) - : SwigPyIterator_T(curr, seq), begin(first), end(last) - { - } - - PyObject *value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - SwigPyIterator *copy() const - { - return new self_type(*this); - } - - SwigPyIterator *incr(size_t n = 1) - { - while (n--) { - if (base::current == end) { - throw stop_iteration(); - } else { - ++base::current; - } - } - return this; - } - - protected: - out_iterator begin; - out_iterator end; - }; - - template::value_type, - typename FromOper = from_oper > - class SwigPyIteratorClosed_T : public SwigPyForwardIteratorClosed_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigPyIterator_T base; - typedef SwigPyForwardIteratorClosed_T base0; - typedef SwigPyIteratorClosed_T self_type; - - SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) - : SwigPyForwardIteratorClosed_T(curr, first, last, seq) - { - } - - SwigPyIterator *decr(size_t n = 1) - { - while (n--) { - if (base::current == base0::begin) { - throw stop_iteration(); - } else { - --base::current; - } - } - return this; - } - }; - - - template - inline SwigPyIterator* - make_output_forward_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) - { - return new SwigPyForwardIteratorClosed_T(current, begin, end, seq); - } - - template - inline SwigPyIterator* - make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) - { - return new SwigPyIteratorClosed_T(current, begin, end, seq); - } - - template - inline SwigPyIterator* - make_output_forward_iterator(const OutIter& current, PyObject *seq = 0) - { - return new SwigPyForwardIteratorOpen_T(current, seq); - } - - template - inline SwigPyIterator* - make_output_iterator(const OutIter& current, PyObject *seq = 0) - { - return new SwigPyIteratorOpen_T(current, seq); - } - -} -} - - -%fragment("SwigPyIterator"); -namespace swig -{ - /* - Throw a StopIteration exception - */ - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws) stop_iteration { - (void)$1; - SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); - SWIG_fail; - } - - /* - Mark methods that return new objects - */ - %newobject SwigPyIterator::copy; - %newobject SwigPyIterator::operator + (ptrdiff_t n) const; - %newobject SwigPyIterator::operator - (ptrdiff_t n) const; - - %nodirector SwigPyIterator; - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:tp_iter") SwigPyIterator "&swig::make_output_iterator_builtin"; - %feature("python:slot", "tp_iternext", functype="iternextfunc") SwigPyIterator::__next__; -#else - %extend SwigPyIterator { - %pythoncode %{def __iter__(self): - return self%} - } -#endif - - %catches(swig::stop_iteration) SwigPyIterator::value() const; - %catches(swig::stop_iteration) SwigPyIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) SwigPyIterator::decr(size_t n = 1); - %catches(std::invalid_argument) SwigPyIterator::distance(const SwigPyIterator &x) const; - %catches(std::invalid_argument) SwigPyIterator::equal (const SwigPyIterator &x) const; - %catches(swig::stop_iteration) SwigPyIterator::__next__(); - %catches(swig::stop_iteration) SwigPyIterator::next(); - %catches(swig::stop_iteration) SwigPyIterator::previous(); - %catches(swig::stop_iteration) SwigPyIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) SwigPyIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) SwigPyIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) SwigPyIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) SwigPyIterator::operator - (ptrdiff_t n) const; - - struct SwigPyIterator - { - protected: - SwigPyIterator(PyObject *seq); - - public: - virtual ~SwigPyIterator(); - - // Access iterator method, required by Python - virtual PyObject *value() const = 0; - - // Forward iterator method, required by Python - virtual SwigPyIterator *incr(size_t n = 1) = 0; - - // Backward iterator method, very common in C++, but not required in Python - virtual SwigPyIterator *decr(size_t n = 1); - - // Random access iterator methods, but not required in Python - virtual ptrdiff_t distance(const SwigPyIterator &x) const; - - virtual bool equal (const SwigPyIterator &x) const; - - // C++ common/needed methods - virtual SwigPyIterator *copy() const = 0; - - PyObject *next(); - PyObject *__next__(); - PyObject *previous(); - SwigPyIterator *advance(ptrdiff_t n); - - bool operator == (const SwigPyIterator& x) const; - bool operator != (const SwigPyIterator& x) const; - SwigPyIterator& operator += (ptrdiff_t n); - SwigPyIterator& operator -= (ptrdiff_t n); - SwigPyIterator* operator + (ptrdiff_t n) const; - SwigPyIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const SwigPyIterator& x) const; - }; -} - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pymacros.swg b/win64/bin/swig/share/swig/4.1.0/python/pymacros.swg deleted file mode 100755 index c063d360..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pymacros.swg +++ /dev/null @@ -1,4 +0,0 @@ -%include - - - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyname_compat.i b/win64/bin/swig/share/swig/4.1.0/python/pyname_compat.i deleted file mode 100755 index 544dcb2b..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyname_compat.i +++ /dev/null @@ -1,85 +0,0 @@ -/* -* From SWIG 1.3.37 we deprecated all SWIG symbols that start with Py, -* since they are inappropriate and discouraged in Python documentation -* (from http://www.python.org/doc/2.5.2/api/includes.html): -* -* "All user visible names defined by Python.h (except those defined by the included -* standard headers) have one of the prefixes "Py" or "_Py". Names beginning with -* "_Py" are for internal use by the Python implementation and should not be used -* by extension writers. Structure member names do not have a reserved prefix. -* -* Important: user code should never define names that begin with "Py" or "_Py". -* This confuses the reader, and jeopardizes the portability of the user code to -* future Python versions, which may define additional names beginning with one -* of these prefixes." -* -* This file defined macros to provide backward compatibility for these deprecated -* symbols. In the case you have these symbols in your interface file, you can simply -* include this file at beginning of it. -* -* However, this file may be removed in future release of SWIG, so using this file to -* keep these inappropriate names in your SWIG interface file is also not recommended. -* Instead, we provide a simple tool for converting your interface files to -* the new naming convention. You can get the tool from the SWIG distribution: -* Tools/pyname_patch.py -*/ - -%fragment("PySequence_Base", "header", fragment="SwigPySequence_Base") {} -%fragment("PySequence_Cont", "header", fragment="SwigPySequence_Cont") {} -%fragment("PySwigIterator_T", "header", fragment="SwigPyIterator_T") {} -%fragment("PyPairBoolOutputIterator", "header", fragment="SwigPyPairBoolOutputIterator") {} -%fragment("PySwigIterator", "header", fragment="SwigPyIterator") {} -%fragment("PySwigIterator_T", "header", fragment="SwigPyIterator_T") {} - -%inline %{ -#define PyMapIterator_T SwigPyMapIterator_T -#define PyMapKeyIterator_T SwigPyMapKeyIterator_T -#define PyMapValueIterator_T SwigPyMapValueIterator_T -#define PyObject_ptr SwigPtr_PyObject -#define PyObject_var SwigVar_PyObject -#define PyOper SwigPyOper -#define PySeq SwigPySeq -#define PySequence_ArrowProxy SwigPySequence_ArrowProxy -#define PySequence_Cont SwigPySequence_Cont -#define PySequence_InputIterator SwigPySequence_InputIterator -#define PySequence_Ref SwigPySequence_Ref -#define PySwigClientData SwigPyClientData -#define PySwigClientData_Del SwigPyClientData_Del -#define PySwigClientData_New SwigPyClientData_New -#define PySwigIterator SwigPyIterator -#define PySwigIteratorClosed_T SwigPyIteratorClosed_T -#define PySwigIteratorOpen_T SwigPyIteratorOpen_T -#define PySwigIterator_T SwigPyIterator_T -#define PySwigObject SwigPyObject -#define PySwigObject_Check SwigPyObject_Check -#define PySwigObject_GetDesc SwigPyObject_GetDesc -#define PySwigObject_New SwigPyObject_New -#define PySwigObject_acquire SwigPyObject_acquire -#define PySwigObject_append SwigPyObject_append -#define PySwigObject_as_number SwigPyObject_as_number -#define PySwigObject_compare SwigPyObject_compare -#define PySwigObject_dealloc SwigPyObject_dealloc -#define PySwigObject_disown SwigPyObject_disown -#define PySwigObject_format SwigPyObject_format -#define PySwigObject_getattr SwigPyObject_getattr -#define PySwigObject_hex SwigPyObject_hex -#define PySwigObject_long SwigPyObject_long -#define PySwigObject_next SwigPyObject_next -#define PySwigObject_oct SwigPyObject_oct -#define PySwigObject_own SwigPyObject_own -#define PySwigObject_repr SwigPyObject_repr -#define PySwigObject_richcompare SwigPyObject_richcompare -#define PySwigObject_type SwigPyObject_type -#define PySwigPacked SwigPyPacked -#define PySwigPacked_Check SwigPyPacked_Check -#define PySwigPacked_New SwigPyPacked_New -#define PySwigPacked_UnpackData SwigPyPacked_UnpackData -#define PySwigPacked_compare SwigPyPacked_compare -#define PySwigPacked_dealloc SwigPyPacked_dealloc -#define PySwigPacked_repr SwigPyPacked_repr -#define PySwigPacked_str SwigPyPacked_str -#define PySwigPacked_type SwigPyPacked_type -#define pyseq swigpyseq -#define pyswigobject_type swigpyobject_type -#define pyswigpacked_type swigpypacked_type -%} diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyopers.swg b/win64/bin/swig/share/swig/4.1.0/python/pyopers.swg deleted file mode 100755 index ec6eaafd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyopers.swg +++ /dev/null @@ -1,264 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - - The directives in this file apply whether or not you use the - -builtin option to SWIG, but operator overloads are particularly - attractive when using -builtin, because they are much faster - than named methods. - - If you're using the -builtin option to SWIG, and you want to define - python operator overloads beyond the defaults defined in this file, - here's what you need to know: - - There are two ways to define a python slot function: dispatch to a - statically defined function; or dispatch to a method defined on the - operand. - - To dispatch to a statically defined function, use %feature("python:"), - where is the name of a field in a PyTypeObject, PyNumberMethods, - PyMappingMethods, PySequenceMethods, or PyBufferProcs. For example: - - %feature("python:tp_hash") MyClass "myHashFunc"; - - class MyClass { - public: - ... - }; - - %{ - // Note: Py_hash_t was introduced in Python 3.2 - static Py_hash_t myHashFunc(PyObject *pyobj) { - MyClass *cobj; - // Convert pyobj to cobj - return (cobj->field1 * (cobj->field2 << 7)); - } - %} - - NOTE: It is the responsibility of the programmer (that's you) to ensure - that a statically defined slot function has the correct signature. - - If, instead, you want to dispatch to an instance method, you can - use %feature("python:slot"). For example: - - %feature("python:slot", "tp_hash", functype="hashfunc") MyClass::myHashFunc; - - class MyClass { - public: - Py_hash_t myHashFunc () const; - ... - }; - - NOTE: Some python slots use a method signature which does not - match the signature of SWIG-wrapped methods. For those slots, - SWIG will automatically generate a "closure" function to re-marshall - the arguments before dispatching to the wrapped method. Setting - the "functype" attribute of the feature enables SWIG to generate - a correct closure function. - - -------------------------------------------------------------- - - The tp_richcompare slot is a special case: SWIG automatically generates - a rich compare function for all wrapped types. If a type defines C++ - operator overloads for comparison (operator==, operator<, etc.), they - will be called from the generated rich compare function. If you - want to explicitly choose a method to handle a certain comparison - operation, you may use a different feature, %feature("python:compare") - like this: - - %feature("python:compare", "Py_LT") MyClass::lessThan; - - class MyClass { - public: - bool lessThan(const MyClass& other) const; - ... - }; - - ... where "Py_LT" is one of the rich comparison opcodes defined in the - python header file object.h. - - If there's no method defined to handle a particular comparison operation, - the default behavior is to compare pointer values of the wrapped - C++ objects. - - -------------------------------------------------------------- - - - For more information about python slots, including their names and - signatures, you may refer to the python documentation : - - http://docs.python.org/c-api/typeobj.html - - * ------------------------------------------------------------ */ - - -#ifdef __cplusplus - -#if defined(SWIGPYTHON_BUILTIN) -#define %pybinoperator(pyname,oper,functp,slt) %rename(pyname) oper; %pythonmaybecall oper; %feature("python:slot", #slt, functype=#functp) oper; %feature("python:slot", #slt, functype=#functp) pyname; -#define %pycompare(pyname,oper,comptype) %rename(pyname) oper; %pythonmaybecall oper; %feature("python:compare", #comptype) oper; %feature("python:compare", #comptype) pyname; -#else -#define %pybinoperator(pyname,oper,functp,slt) %rename(pyname) oper; %pythonmaybecall oper -#define %pycompare(pyname,oper,comptype) %pybinoperator(pyname,oper,,comptype) -#endif - -%pybinoperator(__add__, *::operator+, binaryfunc, nb_add); -%pybinoperator(__pos__, *::operator+(), unaryfunc, nb_positive); -%pybinoperator(__pos__, *::operator+() const, unaryfunc, nb_positive); -%pybinoperator(__sub__, *::operator-, binaryfunc, nb_subtract); -%pybinoperator(__neg__, *::operator-(), unaryfunc, nb_negative); -%pybinoperator(__neg__, *::operator-() const, unaryfunc, nb_negative); -%pybinoperator(__mul__, *::operator*, binaryfunc, nb_multiply); -%pybinoperator(__mod__, *::operator%, binaryfunc, nb_remainder); -%pybinoperator(__lshift__, *::operator<<, binaryfunc, nb_lshift); -%pybinoperator(__rshift__, *::operator>>, binaryfunc, nb_rshift); -%pybinoperator(__and__, *::operator&, binaryfunc, nb_and); -%pybinoperator(__or__, *::operator|, binaryfunc, nb_or); -%pybinoperator(__xor__, *::operator^, binaryfunc, nb_xor); -%pycompare(__lt__, *::operator<, Py_LT); -%pycompare(__le__, *::operator<=, Py_LE); -%pycompare(__gt__, *::operator>, Py_GT); -%pycompare(__ge__, *::operator>=, Py_GE); -%pycompare(__eq__, *::operator==, Py_EQ); -%pycompare(__ne__, *::operator!=, Py_NE); - -/* Special cases */ -%rename(__invert__) *::operator~; -%feature("python:slot", "nb_invert", functype="unaryfunc") *::operator~; -%rename(__call__) *::operator(); -%feature("python:slot", "tp_call", functype="ternarycallfunc") *::operator(); - -#if defined(SWIGPYTHON_BUILTIN) -%pybinoperator(__nonzero__, *::operator bool, inquiry, nb_nonzero); -%pybinoperator(__truediv__, *::operator/ , binaryfunc, nb_divide); -#else -%feature("shadow") *::operator bool %{ -def __nonzero__(self): - return $action(self) -__bool__ = __nonzero__ -%}; -%rename(__nonzero__) *::operator bool; -%feature("shadow") *::operator/ %{ -def __truediv__(self, *args): - return $action(self, *args) -__div__ = __truediv__ -%}; -%rename(__truediv__) *::operator/; -%pythonmaybecall *::operator/; -#endif - -/* Ignored operators */ -%ignoreoperator(LNOT) operator!; -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; -%ignoreoperator(EQ) *::operator=; -%ignoreoperator(PLUSPLUS) *::operator++; -%ignoreoperator(MINUSMINUS) *::operator--; -%ignoreoperator(ARROWSTAR) *::operator->*; -%ignoreoperator(INDEX) *::operator[]; - -/* - Inplace operator declarations. - - They translate the inplace C++ operators (+=, -=, ...) into the - corresponding python equivalents(__iadd__,__isub__), etc, - disabling the ownership of the input 'this' pointer, and assigning - it to the returning object: - - %feature("del") *::Operator; // disables ownership by generating SWIG_POINTER_DISOWN - %feature("new") *::Operator; // claims ownership by generating SWIG_POINTER_OWN - - This makes the most common case safe, ie: - - A& A::operator+=(int i) { ...; return *this; } - ^^^^ ^^^^^^ - - will work fine, even when the resulting python object shares the - 'this' pointer with the input one. The input object is usually - deleted after the operation, including the shared 'this' pointer, - producing 'strange' seg faults, as reported by Lucriz - (lucriz@sitilandia.it). - - If you have an interface that already takes care of that, ie, you - already are using inplace operators and you are not getting - seg. faults, with the new scheme you could end with 'free' elements - that never get deleted (maybe, not sure, it depends). But if that is - the case, you could recover the old behaviour using - - %feature("del","0") A::operator+=; - %feature("new","0") A::operator+=; - - which recovers the old behaviour for the class 'A', or if you are - 100% sure your entire system works fine in the old way, use: - - %feature("del","") *::operator+=; - %feature("new","") *::operator+=; - - The default behaviour assumes that the 'this' pointer's memory is - already owned by the SWIG object; it relinquishes ownership then - takes it back. This may not be the case though as the SWIG object - might be owned by memory managed elsewhere, eg after calling a - function that returns a C++ reference. In such case you will need - to use the features above to recover the old behaviour too. -*/ - -#if defined(SWIGPYTHON_BUILTIN) -#define %pyinplaceoper(SwigPyOper, Oper, functp, slt) %delobject Oper; %newobject Oper; %feature("python:slot", #slt, functype=#functp) Oper; %rename(SwigPyOper) Oper -#else -#define %pyinplaceoper(SwigPyOper, Oper, functp, slt) %delobject Oper; %newobject Oper; %rename(SwigPyOper) Oper -#endif - -%pyinplaceoper(__iadd__ , *::operator +=, binaryfunc, nb_inplace_add); -%pyinplaceoper(__isub__ , *::operator -=, binaryfunc, nb_inplace_subtract); -%pyinplaceoper(__imul__ , *::operator *=, binaryfunc, nb_inplace_multiply); -%pyinplaceoper(__imod__ , *::operator %=, binaryfunc, nb_inplace_remainder); -%pyinplaceoper(__iand__ , *::operator &=, binaryfunc, nb_inplace_and); -%pyinplaceoper(__ior__ , *::operator |=, binaryfunc, nb_inplace_or); -%pyinplaceoper(__ixor__ , *::operator ^=, binaryfunc, nb_inplace_xor); -%pyinplaceoper(__ilshift__, *::operator <<=, binaryfunc, nb_inplace_lshift); -%pyinplaceoper(__irshift__, *::operator >>=, binaryfunc, nb_inplace_rshift); - -/* Special cases */ -#if defined(SWIGPYTHON_BUILTIN) -%pyinplaceoper(__itruediv__ , *::operator /=, binaryfunc, nb_inplace_divide); -#else -%delobject *::operator /=; -%newobject *::operator /=; -%feature("shadow") *::operator /= %{ -def __itruediv__(self, *args): - return $action(self, *args) -__idiv__ = __itruediv__ -%}; -%rename(__itruediv__) *::operator /=; -#endif - -/* Finally, in python we need to mark the binary operations to fail as - 'maybecall' methods */ - -#define %pybinopermaybecall(oper) %pythonmaybecall __ ## oper ## __; %pythonmaybecall __r ## oper ## __ - -%pybinopermaybecall(add); -%pybinopermaybecall(pos); -%pybinopermaybecall(pos); -%pybinopermaybecall(sub); -%pybinopermaybecall(neg); -%pybinopermaybecall(neg); -%pybinopermaybecall(mul); -%pybinopermaybecall(div); -%pybinopermaybecall(truediv); -%pybinopermaybecall(mod); -%pybinopermaybecall(lshift); -%pybinopermaybecall(rshift); -%pybinopermaybecall(and); -%pybinopermaybecall(or); -%pybinopermaybecall(xor); -%pybinopermaybecall(lt); -%pybinopermaybecall(le); -%pybinopermaybecall(gt); -%pybinopermaybecall(ge); -%pybinopermaybecall(eq); -%pybinopermaybecall(ne); - -#endif - - - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyprimtypes.swg b/win64/bin/swig/share/swig/4.1.0/python/pyprimtypes.swg deleted file mode 100755 index 768cd809..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyprimtypes.swg +++ /dev/null @@ -1,353 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE PyObject* - SWIG_From_dec(bool)(bool value) -{ - return PyBool_FromLong(value ? 1 : 0); -} -} - -#ifdef SWIG_PYTHON_LEGACY_BOOL -// Default prior to SWIG 3.0.0 -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(PyObject *obj, bool *val) -{ - int r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} -} -#else -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(long)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(PyObject *obj, bool *val) -{ - int r; - if (!PyBool_Check(obj)) - return SWIG_ERROR; - r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} -} -#endif - -/* int */ - -%fragment(SWIG_From_frag(int),"header") { -SWIGINTERNINLINE PyObject* - SWIG_From_dec(int)(int value) -{ - return PyInt_FromLong((long) value); -} -} - -/* unsigned int */ - -%fragment(SWIG_From_frag(unsigned int),"header") { -SWIGINTERNINLINE PyObject* - SWIG_From_dec(unsigned int)(unsigned int value) -{ - return PyInt_FromSize_t((size_t) value); -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header") { - %define_as(SWIG_From_dec(long), PyInt_FromLong) -} - -%fragment(SWIG_AsVal_frag(long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(long)(PyObject *obj, long* val) -{ -%#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else -%#endif - if (PyLong_Check(obj)) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - long v = PyInt_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } -%#endif - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE PyObject* -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(%numeric_cast(value,long)); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="SWIG_CanCastAsInteger") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(PyObject *obj, unsigned long *val) -{ -%#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else -%#endif - if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -%#endif - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_dec(long long)(long long value) -{ - return ((value < LONG_MIN) || (value > LONG_MAX)) ? - PyLong_FromLongLong(value) : PyInt_FromLong(%numeric_cast(value,long)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment=SWIG_AsVal_frag(long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(PyObject *obj, long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - long long v = PyLong_AsLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - long v; - res = SWIG_AsVal(long)(obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - const double mant_min = -mant_max; - double d; - res = SWIG_AsVal(double)(obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, mant_min, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { - if (val) *val = (long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -%#endif - return res; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(%numeric_cast(value,long)); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_CanCastAsInteger", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(PyObject *obj, unsigned long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - unsigned long long v = PyLong_AsUnsignedLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - unsigned long v; - res = SWIG_AsVal(unsigned long)(obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - res = SWIG_AsVal(double)(obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -%#endif - return res; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { - %define_as(SWIG_From_dec(double), PyFloat_FromDouble) -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(PyObject *obj, double *val) -{ - int res = SWIG_TypeError; - if (PyFloat_Check(obj)) { - if (val) *val = PyFloat_AsDouble(obj); - return SWIG_OK; -%#if PY_VERSION_HEX < 0x03000000 - } else if (PyInt_Check(obj)) { - if (val) *val = (double) PyInt_AsLong(obj); - return SWIG_OK; -%#endif - } else if (PyLong_Check(obj)) { - double v = PyLong_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -%#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - double d = PyFloat_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = d; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); - } else { - PyErr_Clear(); - } - } - } -%#endif - return res; -} -} - - - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyrun.swg b/win64/bin/swig/share/swig/4.1.0/python/pyrun.swg deleted file mode 100755 index a3839cec..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyrun.swg +++ /dev/null @@ -1,1913 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ -# error "This version of SWIG only supports Python >= 2.7" -#endif - -#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03030000 -# error "This version of SWIG only supports Python 3 >= 3.3" -#endif - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) - -#ifdef SWIGPYTHON_BUILTIN -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) -#else -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) -#endif - -#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) - -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -#if defined(SWIGPYTHON_BUILTIN) - -SWIGINTERN void -SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { - PyObject *s = PyString_InternFromString(key); - PyList_Append(seq, s); - Py_DECREF(s); -} - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); - if (public_interface) - SwigPyBuiltin_AddPublicSymbol(public_interface, name); -} - -#else - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { - PyDict_SetItemString(d, name, obj); - Py_DECREF(obj); -} - -#endif - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - if (result) { - PyList_SET_ITEM(result, 0, o2); - } else { - Py_DECREF(obj); - return o2; - } - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -} - -/* Unpack the argument tuple */ - -SWIGINTERN Py_ssize_t -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - if (min <= 1 && max >= 1) { - Py_ssize_t i; - objs[0] = args; - for (i = 1; i < max; ++i) { - objs[i] = 0; - } - return 2; - } - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - Py_ssize_t i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -SWIGINTERN int -SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) { - int no_kwargs = 1; - if (kwargs) { - assert(PyDict_Check(kwargs)); - if (PyDict_Size(kwargs) > 0) { - PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name); - no_kwargs = 0; - } - } - return no_kwargs; -} - -/* A functor is a function object with one single object argument */ -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Python-specific SWIG API */ -#define SWIG_newvarlink() SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) - -/* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - -typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; -} swig_globalvar; - -typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; -} swig_varlinkobject; - -SWIGINTERN PyObject * -swig_varlink_repr(PyObject *SWIGUNUSEDPARM(v)) { -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_InternFromString(""); -#else - return PyString_FromString(""); -#endif -} - -SWIGINTERN PyObject * -swig_varlink_str(PyObject *o) { - swig_varlinkobject *v = (swig_varlinkobject *) o; -#if PY_VERSION_HEX >= 0x03000000 - PyObject *str = PyUnicode_InternFromString("("); - PyObject *tail; - PyObject *joined; - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - tail = PyUnicode_FromString(var->name); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - if (var->next) { - tail = PyUnicode_InternFromString(", "); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - } - } - tail = PyUnicode_InternFromString(")"); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; -#else - PyObject *str = PyString_FromString("("); - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - PyString_ConcatAndDel(&str,PyString_FromString(var->name)); - if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); - } - PyString_ConcatAndDel(&str,PyString_FromString(")")); -#endif - return str; -} - -SWIGINTERN void -swig_varlink_dealloc(PyObject *o) { - swig_varlinkobject *v = (swig_varlinkobject *) o; - swig_globalvar *var = v->vars; - while (var) { - swig_globalvar *n = var->next; - free(var->name); - free(var); - var = n; - } -} - -SWIGINTERN PyObject * -swig_varlink_getattr(PyObject *o, char *n) { - swig_varlinkobject *v = (swig_varlinkobject *) o; - PyObject *res = NULL; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->get_attr)(); - break; - } - var = var->next; - } - if (res == NULL && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; -} - -SWIGINTERN int -swig_varlink_setattr(PyObject *o, char *n, PyObject *p) { - swig_varlinkobject *v = (swig_varlinkobject *) o; - int res = 1; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->set_attr)(p); - break; - } - var = var->next; - } - if (res == 1 && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; -} - -SWIGINTERN PyTypeObject* -swig_varlink_type(void) { - static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "swigvarlink", /* tp_name */ - sizeof(swig_varlinkobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) swig_varlink_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /*tp_print*/ -#else - (Py_ssize_t)0, /*tp_vectorcall_offset*/ -#endif - (getattrfunc) swig_varlink_getattr, /* tp_getattr */ - (setattrfunc) swig_varlink_setattr, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) swig_varlink_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - varlink__doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - varlink_type = tmp; - type_init = 1; - if (PyType_Ready(&varlink_type) < 0) - return NULL; - } - return &varlink_type; -} - -/* Create a variable linking object for use later */ -SWIGINTERN PyObject * -SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); - if (result) { - result->vars = 0; - } - return ((PyObject*) result); -} - -SWIGINTERN void -SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v = (swig_varlinkobject *) p; - swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - if (gv) { - size_t size = strlen(name)+1; - gv->name = (char *)malloc(size); - if (gv->name) { - memcpy(gv->name, name, size); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - } - } - v->vars = gv; -} - - -static PyObject *Swig_Globals_global = NULL; - -SWIGINTERN PyObject * -SWIG_globals(void) { - if (Swig_Globals_global == NULL) { - Swig_Globals_global = SWIG_newvarlink(); - } - return Swig_Globals_global; -} - -#ifdef __cplusplus -} -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) -#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) - -#ifdef __cplusplus -extern "C" { -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; - PyTypeObject *pytype; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - int fail = data ? data->implicitconv : 0; - if (fail) - PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); - return fail; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* the newraw method and newargs arguments used to create a new raw instance */ - if (PyClass_Check(obj)) { - data->newraw = 0; - Py_INCREF(obj); - data->newargs = obj; - } else { - data->newraw = PyObject_GetAttrString(data->klass, "__new__"); - if (data->newraw) { - data->newargs = PyTuple_New(1); - if (data->newargs) { - Py_INCREF(obj); - PyTuple_SET_ITEM(data->newargs, 0, obj); - } else { - Py_DECREF(data->newraw); - Py_DECREF(data->klass); - free(data); - return 0; - } - } else { - Py_INCREF(obj); - data->newargs = obj; - } - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - data->delargs = !(PyCFunction_GET_FLAGS(data->destroy) & METH_O); - } else { - data->delargs = 0; - } - data->implicitconv = 0; - data->pytype = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) -{ - Py_XDECREF(data->klass); - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); - free(data); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -#ifdef SWIGPYTHON_BUILTIN - PyObject *dict; -#endif -} SwigPyObject; - - -#ifdef SWIGPYTHON_BUILTIN - -SWIGRUNTIME PyObject * -SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - - if (!sobj->dict) - sobj->dict = PyDict_New(); - - Py_XINCREF(sobj->dict); - return sobj->dict; -} - -#endif - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -SwigPyObject_format(const char* fmt, SwigPyObject *v) -{ - PyObject *res = NULL; - PyObject *args = PyTuple_New(1); - if (args) { - PyObject *val = SwigPyObject_long(v); - if (val) { - PyObject *ofmt; - PyTuple_SET_ITEM(args, 0, val); - ofmt = SWIG_Python_str_FromChar(fmt); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - } - Py_DECREF(args); - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_repr(SwigPyObject *v) -{ - const char *name = SWIG_TypePrettyName(v->ty); - PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); - if (repr && v->next) { - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); - if (nrep) { -# if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -# else - PyString_ConcatAndDel(&repr,nrep); -# endif - } else { - Py_DecRef(repr); - repr = NULL; - } - } - return repr; -} - -/* We need a version taking two PyObject* parameters so it's a valid - * PyCFunction to use in swigobject_methods[]. */ -SWIGRUNTIME PyObject * -SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - return SwigPyObject_repr((SwigPyObject*)v); -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -SWIGRUNTIME PyObject* -SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) -{ - PyObject* res; - if( op != Py_EQ && op != Py_NE ) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); - return res; -} - - -SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); - -#ifdef SWIGPYTHON_BUILTIN -static swig_type_info *SwigPyObject_stype = 0; -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - SwigPyClientData *cd; - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - assert(cd); - assert(cd->pytype); - return cd->pytype; -} -#else -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); - return type; -} -#endif - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN - PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) - return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); -#else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -#endif -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -static PyObject* Swig_Capsule_global = NULL; - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - - /* PyObject_CallFunction() has the potential to silently drop - the active exception. In cases of unnamed temporary - variable or where we just finished iterating over a generator - StopIteration will be active right now, and this needs to - remain true upon return from SwigPyObject_dealloc. So save - and restore. */ - - PyObject *type = NULL, *value = NULL, *traceback = NULL; - PyErr_Fetch(&type, &value, &traceback); - - if (data->delargs) { - /* we need to create a temporary object to carry the destroy operation */ - PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); - if (tmp) { - res = SWIG_Python_CallFunctor(destroy, tmp); - } else { - res = 0; - } - Py_XDECREF(tmp); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - if (!res) - PyErr_WriteUnraisable(destroy); - - PyErr_Restore(type, value, traceback); - - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - Py_XDECREF(Swig_Capsule_global); - } - Py_XDECREF(next); -#ifdef SWIGPYTHON_BUILTIN - Py_XDECREF(sobj->dict); -#endif - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (!SwigPyObject_Check(next)) { - PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); - return NULL; - } - ((SwigPyObject *)next)->next = sobj->next; - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) { - return NULL; - } else { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { - if (PyObject_IsTrue(val)) { - Py_DECREF(SwigPyObject_acquire(v,args)); - } else { - Py_DECREF(SwigPyObject_disown(v,args)); - } - } - return obj; - } -} - -static PyMethodDef -swigobject_methods[] = { - {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"}, - {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"}, - {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"}, - {"append", SwigPyObject_append, METH_O, "appends another 'this' object"}, - {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"}, - {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"}, - {0, 0, 0, 0} -}; - -SWIGRUNTIME PyTypeObject* -SwigPyObject_TypeOnce(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ -#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#else - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#endif - }; - - static PyTypeObject swigpyobject_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /*tp_print*/ -#else - (Py_ssize_t)0, /*tp_vectorcall_offset*/ -#endif - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - swigpyobject_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpyobject_type) != 0) - return NULL; - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; -#ifdef SWIGPYTHON_BUILTIN - sobj->dict = 0; -#endif - if (own == SWIG_POINTER_OWN) { - /* Obtain a reference to the Python capsule wrapping the module information, so that the - * module information is correctly destroyed after all SWIG python objects have been freed - * by the GC (and corresponding destructors invoked) */ - Py_XINCREF(Swig_Capsule_global); - } - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_TypeOnce(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX>=0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ -#if PY_VERSION_HEX < 0x030800b4 - (printfunc)0, /*tp_print*/ -#else - (Py_ssize_t)0, /*tp_vectorcall_offset*/ -#endif - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - swigpypacked_type = tmp; - type_init = 1; - if (PyType_Ready(&swigpypacked_type) != 0) - return NULL; - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -static PyObject *Swig_This_global = NULL; - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - if (Swig_This_global == NULL) - Swig_This_global = SWIG_Python_str_FromChar("this"); - return Swig_This_global; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - PyObject *obj; - - if (SwigPyObject_Check(pyobj)) - return (SwigPyObject *) pyobj; - -#ifdef SWIGPYTHON_BUILTIN - (void)obj; -# ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - pyobj = PyWeakref_GET_OBJECT(pyobj); - if (pyobj && SwigPyObject_Check(pyobj)) - return (SwigPyObject*) pyobj; - } -# endif - return NULL; -#else - - obj = 0; - -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; -#endif -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - int res; - SwigPyObject *sobj; - int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; - - if (!obj) - return SWIG_ERROR; - if (obj == Py_None && !implicit_conv) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - res = SWIG_ERROR; - - sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !sobj->own) { - res = SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - if (flags & SWIG_POINTER_CLEAR) { - sobj->ptr = 0; - } - res = SWIG_OK; - } - } else { - if (implicit_conv) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; - } - } - } - return res; -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - swig_cast_info *tc; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - return SWIG_OK; - } -} - -/* Convert a packed pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - } else{ - Py_DECREF(inst); - inst = 0; - } - } -#else - if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { - Py_DECREF(inst); - inst = 0; - } -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *empty_args = PyTuple_New(0); - if (empty_args) { - PyObject *empty_kwargs = PyDict_New(); - if (empty_kwargs) { - inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); - Py_DECREF(empty_kwargs); - if (inst) { - if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { - Py_DECREF(inst); - inst = 0; - } else { - PyType_Modified(Py_TYPE(inst)); - } - } - } - Py_DECREF(empty_args); - } -#else - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } -#endif - } - return inst; -} - -SWIGRUNTIME int -SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) -{ -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - if (dict) { - return PyDict_SetItem(dict, SWIG_This(), swig_this); - } else{ - return -1; - } - } -#endif - return PyObject_SetAttr(inst, SWIG_This(), swig_this); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - Py_DECREF(SwigPyObject_append((PyObject*) sthis, obj[1])); - } else { - if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) - return NULL; - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { - SwigPyClientData *clientdata; - PyObject * robj; - int own; - - if (!ptr) - return SWIG_Py_Void(); - - clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - if (clientdata && clientdata->pytype) { - SwigPyObject *newobj; - if (flags & SWIG_BUILTIN_TP_INIT) { - newobj = (SwigPyObject*) self; - if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); - while (newobj->next) - newobj = (SwigPyObject *) newobj->next; - newobj->next = next_self; - newobj = (SwigPyObject *)next_self; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - } else { - newobj = PyObject_New(SwigPyObject, clientdata->pytype); -#ifdef SWIGPYTHON_BUILTIN - if (newobj) { - newobj->dict = 0; - } -#endif - } - if (newobj) { - newobj->ptr = ptr; - newobj->ty = type; - newobj->own = own; - newobj->next = 0; - return (PyObject*) newobj; - } - return SWIG_Py_Void(); - } - - assert(!(flags & SWIG_BUILTIN_TP_INIT)); - - robj = SwigPyObject_New(ptr, type, own); - if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - Py_DECREF(robj); - robj = inst; - } - return robj; -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -static PyObject *Swig_TypeCache_global = NULL; - -/* The python cached type query */ -SWIGRUNTIME PyObject * -SWIG_Python_TypeCache(void) { - if (Swig_TypeCache_global == NULL) { - Swig_TypeCache_global = PyDict_New(); - } - return Swig_TypeCache_global; -} - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { -#ifdef SWIG_LINK_RUNTIME - static void *type_pointer = (void *)0; - /* first check if module already created */ - if (!type_pointer) { - type_pointer = SWIG_ReturnGlobalTypeList((void *)0); - } -#else - void *type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif - return (swig_module_info *) type_pointer; -} - - -static int interpreter_counter = 0; // how many (sub-)interpreters are using swig_module's types - -SWIGRUNTIME void -SWIG_Python_DestroyModule(PyObject *obj) -{ - swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); - swig_type_info **types = swig_module->types; - size_t i; - if (--interpreter_counter != 0) // another sub-interpreter may still be using the swig_module's types - return; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - ty->clientdata = 0; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); - Swig_This_global = NULL; - Py_DECREF(SWIG_globals()); - Swig_Globals_global = NULL; - Py_DECREF(SWIG_Python_TypeCache()); - Swig_TypeCache_global = NULL; - Swig_Capsule_global = NULL; -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); -#endif - PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); - if (pointer && module) { - if (PyModule_AddObject(module, SWIGPY_CAPSULE_ATTR_NAME, pointer) == 0) { - ++interpreter_counter; - Swig_Capsule_global = pointer; - } else { - Py_DECREF(pointer); - } - } else { - Py_XDECREF(pointer); - } -} - -SWIGRUNTIME swig_type_info * -SWIG_Python_TypeQuery(const char *type) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { - descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); - } else { - swig_module_info *swig_module = SWIG_GetModule(0); - descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); - if (descriptor) { - obj = PyCapsule_New((void*) descriptor, NULL, NULL); - if (obj) { - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); - } - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); - const char *errmesg = tmp ? tmp : "Invalid error message"; - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, errmesg); - } else { - PyErr_Format(type, "%s %s", errmesg, mesg); - } - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : ""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - const char *otype = (obj ? obj->ob_type->tp_name : 0); - if (otype) { - PyObject *str = PyObject_Str(obj); - const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; - if (cstr) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", - type, otype, cstr); - } else { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", - type, otype); - } - Py_XDECREF(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { - void *result; - if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { - PyErr_Clear(); - } - return result; -} - -#ifdef SWIGPYTHON_BUILTIN -SWIGRUNTIME int -SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { - PyTypeObject *tp = obj->ob_type; - PyObject *descr; - PyObject *encoded_name; - descrsetfunc f; - int res = -1; - -# ifdef Py_USING_UNICODE - if (PyString_Check(name)) { - name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); - if (!name) - return -1; - } else if (!PyUnicode_Check(name)) -# else - if (!PyString_Check(name)) -# endif - { - PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); - return -1; - } else { - Py_INCREF(name); - } - - if (!tp->tp_dict) { - if (PyType_Ready(tp) != 0) - goto done; - } - - descr = _PyType_Lookup(tp, name); - f = NULL; - if (descr != NULL) - f = descr->ob_type->tp_descr_set; - if (!f) { - if (PyString_Check(name)) { - encoded_name = name; - Py_INCREF(name); - } else { - encoded_name = PyUnicode_AsUTF8String(name); - if (!encoded_name) - goto done; - } - PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); - Py_DECREF(encoded_name); - } else { - res = f(descr, obj, value); - } - - done: - Py_DECREF(name); - return res; -} -#endif - - -#ifdef __cplusplus -} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyruntime.swg b/win64/bin/swig/share/swig/4.1.0/python/pyruntime.swg deleted file mode 100755 index 1a6b72c5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyruntime.swg +++ /dev/null @@ -1,49 +0,0 @@ -%insert(runtime) %{ -#if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND) -/* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */ -# include -#endif - -#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) -#define PY_SSIZE_T_CLEAN -#endif - -#if __GNUC__ >= 7 -#pragma GCC diagnostic push -#if defined(__cplusplus) && __cplusplus >=201703L -#pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */ -#endif -#endif - -#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) -/* Use debug wrappers with the Python release dll */ - -#if defined(_MSC_VER) && _MSC_VER >= 1929 -/* Workaround compilation errors when redefining _DEBUG in MSVC 2019 version 16.10 and later - * See https://github.com/swig/swig/issues/2090 */ -# include -#endif - -# undef _DEBUG -# include -# define _DEBUG 1 -#else -# include -#endif - -#if __GNUC__ >= 7 -#pragma GCC diagnostic pop -#endif -%} - -%insert(runtime) "swigrun.swg"; /* SWIG API */ -%insert(runtime) "swigerrors.swg"; /* SWIG errors */ -%insert(runtime) "pyhead.swg"; /* Python includes and fixes */ -%insert(runtime) "pyerrors.swg"; /* Python errors */ -%insert(runtime) "pythreads.swg"; /* Python thread code */ -%insert(runtime) "pyapi.swg"; /* Python API */ -%insert(runtime) "pyrun.swg"; /* Python run-time code */ - -#if defined(SWIGPYTHON_BUILTIN) -%insert(runtime) "builtin.swg"; /* Specialization for classes with single inheritance */ -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/python/pystdcommon.swg b/win64/bin/swig/share/swig/4.1.0/python/pystdcommon.swg deleted file mode 100755 index 448d92f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pystdcommon.swg +++ /dev/null @@ -1,265 +0,0 @@ -%fragment("StdTraits","header",fragment="StdTraitsCommon") -{ -namespace swig { - /* - Traits that provides the from method - */ - template struct traits_from_ptr { - static PyObject *from(Type *val, int owner = 0) { - return SWIG_InternalNewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static PyObject *from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static PyObject *from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static PyObject *from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline PyObject *from(const Type& val) { - return traits_from::from(val); - } - - template - inline PyObject *from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - /* - Traits that provides the asval/as/check method - */ - template - struct traits_asptr { - static int asptr(PyObject *obj, Type **val) { - int res = SWIG_ERROR; - swig_type_info *descriptor = type_info(); - if (val) { - Type *p = 0; - int newmem = 0; - res = descriptor ? SWIG_ConvertPtrAndOwn(obj, (void **)&p, descriptor, 0, &newmem) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (newmem & SWIG_CAST_NEW_MEMORY) { - res |= SWIG_NEWOBJMASK; - } - *val = p; - } - } else { - res = descriptor ? SWIG_ConvertPtr(obj, 0, descriptor, 0) : SWIG_ERROR; - } - return res; - } - }; - - template - inline int asptr(PyObject *obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(PyObject *obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(PyObject *obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(PyObject *obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(PyObject *obj) { - Type v; - int res = asval(obj, &v); - if (!obj || !SWIG_IsOK(res)) { - if (!PyErr_Occurred()) { - ::%type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(PyObject *obj) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - if (!PyErr_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(PyObject *obj) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res)) { - return v; - } else { - if (!PyErr_Occurred()) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(PyObject *obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(PyObject *obj) { - int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(PyObject *obj) { - int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(PyObject *obj) { - return traits_check::category>::check(obj); - } -} -} - -// -// Backward compatibility -// - -#ifdef SWIG_PYTHON_BACKWARD_COMP -%fragment(""); -%{ -PyObject* SwigInt_FromBool(bool b) { - return PyInt_FromLong(b ? 1L : 0L); -} -double SwigNumber_Check(PyObject* o) { - return PyFloat_Check(o) || PyInt_Check(o) || PyLong_Check(o); -} -double SwigNumber_AsDouble(PyObject* o) { - return PyFloat_Check(o) ? PyFloat_AsDouble(o) - : (PyInt_Check(o) ? double(PyInt_AsLong(o)) - : double(PyLong_AsLong(o))); -} -PyObject* SwigString_FromString(const std::string& s) { - return PyString_FromStringAndSize(s.data(),s.size()); -} -std::string SwigString_AsString(PyObject* o) { - return std::string(PyString_AsString(o)); -} -%} - -#endif - - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(PyObject *obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static PyObject *from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(PyObject *obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef - - -#define specialize_std_vector(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_list(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_deque(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_unordered_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_unordered_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) diff --git a/win64/bin/swig/share/swig/4.1.0/python/pystrings.swg b/win64/bin/swig/share/swig/4.1.0/python/pystrings.swg deleted file mode 100755 index acf6df70..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pystrings.swg +++ /dev/null @@ -1,139 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ -%#if PY_VERSION_HEX>=0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (PyBytes_Check(obj)) -%#else - if (PyUnicode_Check(obj)) -%#endif -%#else - if (PyString_Check(obj)) -%#endif - { - char *cstr; Py_ssize_t len; - int ret = SWIG_OK; -%#if PY_VERSION_HEX>=0x03000000 -%#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (!alloc && cptr) { - /* We can't allow converting without allocation, since the internal - representation of string in Python 3 is UCS-2/UCS-4 but we require - a UTF-8 representation. - TODO(bhy) More detailed explanation */ - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (!obj) - return SWIG_TypeError; - if (alloc) - *alloc = SWIG_NEWOBJ; -%#endif - if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) - return SWIG_TypeError; -%#else - if (PyString_AsStringAndSize(obj, &cstr, &len) == -1) - return SWIG_TypeError; -%#endif - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } else { -%#if PY_VERSION_HEX>=0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - *cptr = PyBytes_AsString(obj); -%#else - assert(0); /* Should never reach here with Unicode strings in Python 3 */ -%#endif -%#else - *cptr = SWIG_Python_str_AsChar(obj); - if (!*cptr) - ret = SWIG_TypeError; -%#endif - } - } - if (psize) *psize = len + 1; -%#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - Py_XDECREF(obj); -%#endif - return ret; - } else { -%#if defined(SWIG_PYTHON_2_UNICODE) -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) -%#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" -%#endif -%#if PY_VERSION_HEX<0x03000000 - if (PyUnicode_Check(obj)) { - char *cstr; Py_ssize_t len; - if (!alloc && cptr) { - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (!obj) - return SWIG_TypeError; - if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { - if (cptr) { - if (alloc) *alloc = SWIG_NEWOBJ; - *cptr = %new_copy_array(cstr, len + 1, char); - } - if (psize) *psize = len + 1; - - Py_XDECREF(obj); - return SWIG_OK; - } else { - Py_XDECREF(obj); - } - } -%#endif -%#endif - - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -%#if PY_VERSION_HEX >= 0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, %numeric_cast(size, Py_ssize_t)); -%#else - return PyUnicode_DecodeUTF8(carray, %numeric_cast(size, Py_ssize_t), "surrogateescape"); -%#endif -%#else - return PyString_FromStringAndSize(carray, %numeric_cast(size, Py_ssize_t)); -%#endif - } - } else { - return SWIG_Py_Void(); - } -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/python/python.swg b/win64/bin/swig/share/swig/4.1.0/python/python.swg deleted file mode 100755 index a46ea301..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/python.swg +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------------------------ - * python.swg - * - * Python configuration module. - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Python keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Python autodoc support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Python classes, for C++ - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Python initialization function - * ------------------------------------------------------------ */ -%include - - -/* ------------------------------------------------------------ - * For backward compatibility - * ------------------------------------------------------------ */ -%include - - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pythonkw.swg b/win64/bin/swig/share/swig/4.1.0/python/pythonkw.swg deleted file mode 100755 index 7bbf93d5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pythonkw.swg +++ /dev/null @@ -1,140 +0,0 @@ -/* - Warnings for Python keywords, built-in names and bad names. -*/ - -#define PYTHONKW(x) %keywordwarn("'" `x` "' is a python keyword", rename="_%s") `x` -#define PYTHONBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in python") `x` - - -/* - Warnings for Python keywords - https://docs.python.org/2/reference/lexical_analysis.html#keywords -*/ - -PYTHONKW(and); -PYTHONKW(as); -PYTHONKW(assert); -PYTHONKW(async); -PYTHONKW(await); -PYTHONKW(break); -PYTHONKW(class); -PYTHONKW(continue); -PYTHONKW(def); -PYTHONKW(del); -PYTHONKW(elif); -PYTHONKW(else); -PYTHONKW(except); -PYTHONKW(exec); -PYTHONKW(finally); -PYTHONKW(for); -PYTHONKW(from); -PYTHONKW(global); -PYTHONKW(if); -PYTHONKW(import); -PYTHONKW(in); -PYTHONKW(is); -PYTHONKW(lambda); -PYTHONKW(not); -PYTHONKW(or); -PYTHONKW(pass); -PYTHONKW(print); -PYTHONKW(raise); -PYTHONKW(return); -PYTHONKW(try); -PYTHONKW(while); -PYTHONKW(with); -PYTHONKW(yield); - -/* - built-in functions - https://docs.python.org/2/library/functions.html - */ - -PYTHONBN(abs); -PYTHONBN(apply); -PYTHONBN(bool); -PYTHONBN(buffer); -PYTHONBN(callable); -PYTHONBN(chr); -PYTHONBN(classmethod); -PYTHONBN(cmp); -PYTHONBN(coerce); -PYTHONBN(compile); -PYTHONBN(complex); -PYTHONBN(delattr); -PYTHONBN(dict); -PYTHONBN(dir); -PYTHONBN(divmod); -PYTHONBN(enumerate); -PYTHONBN(eval); -PYTHONBN(execfile); -PYTHONBN(file); -PYTHONBN(filter); -PYTHONBN(float); -PYTHONBN(frozenset); -PYTHONBN(getattr); -PYTHONBN(globals); -PYTHONBN(hasattr); -PYTHONBN(hash); -PYTHONBN(hex); -PYTHONBN(id); -PYTHONBN(input); -PYTHONBN(int); -PYTHONBN(intern); -PYTHONBN(isinstance); -PYTHONBN(issubclass); -PYTHONBN(iter); -PYTHONBN(len); -PYTHONBN(list); -PYTHONBN(locals); -PYTHONBN(long); -PYTHONBN(map); -PYTHONBN(max); -PYTHONBN(min); -PYTHONBN(object); -PYTHONBN(oct); -PYTHONBN(open); -PYTHONBN(ord); -PYTHONBN(pow); -PYTHONBN(property); -PYTHONBN(range); -PYTHONBN(raw_input); -PYTHONBN(reduce); -PYTHONBN(reload); -PYTHONBN(repr); -PYTHONBN(reversed); -PYTHONBN(round); -PYTHONBN(set); -PYTHONBN(setattr); -PYTHONBN(slice); -PYTHONBN(sorted); -PYTHONBN(staticmethod); -PYTHONBN(str); -PYTHONBN(sum); -PYTHONBN(super); -PYTHONBN(tuple); -PYTHONBN(type); -PYTHONBN(unichr); -PYTHONBN(unicode); -PYTHONBN(vars); -PYTHONBN(xrange); -PYTHONBN(zip); - - -/* - built-in names - boolean type and None -*/ -PYTHONBN(True); -PYTHONBN(False); - -PYTHONKW(None); - - -/* - 'self' is also a bad Name -*/ -PYTHONKW(self); - -#undef PYTHONBN -#undef PYTHONKW diff --git a/win64/bin/swig/share/swig/4.1.0/python/pythreads.swg b/win64/bin/swig/share/swig/4.1.0/python/pythreads.swg deleted file mode 100755 index fd837d67..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pythreads.swg +++ /dev/null @@ -1,68 +0,0 @@ -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# define SWIG_PYTHON_USE_GIL -# endif -# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# if PY_VERSION_HEX < 0x03070000 -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() -# else -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/python/pytuplehlp.swg b/win64/bin/swig/share/swig/4.1.0/python/pytuplehlp.swg deleted file mode 100755 index 7666499a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pytuplehlp.swg +++ /dev/null @@ -1,8 +0,0 @@ -/* - Helper function to return output types, now we need to use a list - instead of a tuple since all the other types - (std::pair,std::vector,std::list,etc) return tuples. -*/ - -#warning "Deprecated file: Don't use t_output_helper anymore," -#warning "use SWIG_Python_AppendOutput or %append_output instead." diff --git a/win64/bin/swig/share/swig/4.1.0/python/pytypemaps.swg b/win64/bin/swig/share/swig/4.1.0/python/pytypemaps.swg deleted file mode 100755 index 9c35a41e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pytypemaps.swg +++ /dev/null @@ -1,105 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Python - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ -#ifdef SWIG_PYTHON_LEGACY_BOOL -// Default prior to SWIG 3.0.0 -#undef SWIG_TYPECHECK_BOOL -%define SWIG_TYPECHECK_BOOL 10000 %enddef -#endif - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Python fragments for fundamental types */ -%include - -/* Python fragments for char* strings */ -%include - -/* Backward compatibility output helper */ -%fragment("t_output_helper","header") %{ -#define t_output_helper SWIG_Python_AppendOutput -%} - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* directors are supported in Python */ -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Python types */ -#define SWIG_Object PyObject * -#define VOID_Object SWIG_Py_Void() - -/* Python allows implicit conversion */ -#define %implicitconv_flag $implicitconv - - -/* Overload of the output/constant/exception/dirout handling */ - -/* append output */ -#define SWIG_AppendOutput(result, obj) SWIG_Python_AppendOutput(result, obj) - -/* set constant */ -#if defined(SWIGPYTHON_BUILTIN) -#define SWIG_SetConstant(name, obj) SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, name,obj) -#else -#define SWIG_SetConstant(name, obj) SWIG_Python_SetConstant(d, name,obj) -#endif - -/* raise */ -#define SWIG_Raise(obj, type, desc) SWIG_Python_Raise(obj, type, desc) - -/* Include the unified typemap library */ -%include - - -/* ------------------------------------------------------------ - * Python extra typemaps / typemap overrides - * ------------------------------------------------------------ */ - -/* Get the address of the 'python self' object */ - -%typemap(in,numinputs=0,noblock=1) PyObject **PYTHON_SELF { - $1 = &$self; -} - - -/* Consttab, needed for callbacks, it should be removed later */ - -%typemap(consttab) SWIGTYPE ((*)(ANY)) -{ SWIG_PY_POINTER, "$symname", 0, 0, (void *)($value), &$descriptor } -%typemap(consttab) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY)); - -%typemap(constcode) SWIGTYPE ((*)(ANY)) "" -%typemap(constcode) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY)); - - -/* Smart Pointers */ -%typemap(out,noblock=1) const SWIGTYPE & SMARTPOINTER { - $result = SWIG_NewPointerObj(%new_copy(*$1, $*ltype), $descriptor, SWIG_POINTER_OWN | %newpointer_flags); -} - -%typemap(ret,noblock=1) const SWIGTYPE & SMARTPOINTER, SWIGTYPE SMARTPOINTER { - if ($result) { - PyObject *robj = PyObject_CallMethod($result, (char *)"__deref__", NULL); - if (robj && !PyErr_Occurred()) { - SwigPyObject_append((PyObject *) SWIG_Python_GetSwigThis($result), - (PyObject *) SWIG_Python_GetSwigThis(robj)); - Py_DECREF(robj); - } - } -} - diff --git a/win64/bin/swig/share/swig/4.1.0/python/pyuserdir.swg b/win64/bin/swig/share/swig/4.1.0/python/pyuserdir.swg deleted file mode 100755 index 2cad3a84..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pyuserdir.swg +++ /dev/null @@ -1,242 +0,0 @@ -/* ------------------------------------------------------------------------- - * Special user directives - * ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ - -/* shadow code */ -#define %shadow %insert("shadow") -#define %pythoncode %insert("python") -#define %pythonbegin %insert("pythonbegin") - - -/* ------------------------------------------------------------------------- */ -/* -Use the "nondynamic" feature to make a wrapped class behave as a "nondynamic" -one, ie, a python class that doesn't dynamically add new attributes. - -For example, for the class - -%pythonnondynamic A; -struct A -{ - int a; - int b; -}; - -you will get: - - aa = A() - aa.a = 1 # Ok - aa.b = 1 # Ok - aa.c = 3 # error - -Since nondynamic is a feature, if you use it like - - %pythonnondynamic; - -it will make all the wrapped classes nondynamic ones. - -The implementation is based on this recipe: - - http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252158 - -*/ - -#define %pythonnondynamic %feature("python:nondynamic", "1") -#define %nopythonnondynamic %feature("python:nondynamic", "0") -#define %clearpythonnondynamic %feature("python:nondynamic", "") -#define %pythondynamic %nopythonnondynamic - - -/* ------------------------------------------------------------------------- */ -/* - -Use %pythonmaybecall to flag a method like __add__ or __radd__. These -don't produce an error when called, they just return NotImplemented. - -These methods "may be called" if needed. - -*/ - -#define %pythonmaybecall %feature("python:maybecall", "1") -#define %nopythonmaybecall %feature("python:maybecall", "0") -#define %clearpythonmaybecall %feature("python:maybecall", "") - -/* ------------------------------------------------------------------------- */ -/* - The %pythoncallback feature produce a more natural callback wrapper - than the %callback mechanism, ie, it uses the original name for - the callback and callable objects. - - Just use it as - - %pythoncallback(1) foo; - int foo(int a); - - %pythoncallback(1) A::foo; - struct A { - static int foo(int a); - }; - - int bar(int, int (*pf)(int)); - - then, you can use it as: - - a = foo(1) - b = bar(2, foo) - - c = A.foo(3) - d = bar(4, A.foo) - - - If you use it with a member method - %pythoncallback(1) A::foom; - struct A { - int foom(int a); - }; - - then you can use it as - - r = a.foom(3) # eval the method - mptr = A.foom_cb_ptr # returns the callback pointer - - where the '_cb_ptr' suffix is added for the callback pointer. - -*/ - -#define %pythoncallback %feature("python:callback") -#define %nopythoncallback %feature("python:callback","0") -#define %clearpythoncallback %feature("python:callback","") - -/* ------------------------------------------------------------------------- */ -/* - Support for the old %callback directive name -*/ -#ifdef %callback -#undef %callback -#endif - -#ifdef %nocallback -#undef %nocallback -#endif - -#ifdef %clearcallback -#undef %clearcallback -#endif - -#define %callback(x) %feature("python:callback",`x`) -#define %nocallback %nopythoncallback -#define %clearcallback %clearpythoncallback - -/* ------------------------------------------------------------------------- */ -/* - Thread support - Advance control - -*/ - -#define %nothread %feature("nothread") -#define %thread %feature("nothread","0") -#define %clearnothread %feature("nothread","") - -#define %nothreadblock %feature("nothreadblock") -#define %threadblock %feature("nothreadblock","0") -#define %clearnothreadblock %feature("nothreadblock","") - -#define %nothreadallow %feature("nothreadallow") -#define %threadallow %feature("nothreadallow","0") -#define %clearnothreadallow %feature("nothreadallow","") - - -/* ------------------------------------------------------------------------- */ -/* - Implicit Conversion using the C++ constructor mechanism -*/ - -#define %implicitconv %feature("implicitconv") -#define %noimplicitconv %feature("implicitconv", "0") -#define %clearimplicitconv %feature("implicitconv", "") - - -/* ------------------------------------------------------------------------- */ -/* - Enable keywords parameters -*/ - -#define %kwargs %feature("kwargs") -#define %nokwargs %feature("kwargs", "0") -#define %clearkwargs %feature("kwargs", "") - -/* ------------------------------------------------------------------------- */ -/* - Add python code to the proxy/shadow code - - %pythonprepend - Add code before the C++ function is called - %pythonappend - Add code after the C++ function is called -*/ - -#define %pythonprepend %feature("pythonprepend") -#define %clearpythonprepend %feature("pythonprepend","") - -#define %pythonappend %feature("pythonappend") -#define %clearpythonappend %feature("pythonappend","") - - -/* ------------------------------------------------------------------------- */ -/* - %extend_smart_pointer extend the smart pointer support. - - For example, if you have a smart pointer as: - - template class RCPtr { - public: - ... - RCPtr(Type *p); - Type * operator->() const; - ... - }; - - you use the %extend_smart_pointer directive as: - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - - then, if you have something like: - - RCPtr make_ptr(); - int foo(A *); - - you can do the following: - - a = make_ptr(); - b = foo(a); - - ie, swig will accept a RCPtr object where a 'A *' is - expected. - - Also, when using vectors - - %extend_smart_pointer(RCPtr); - %template(RCPtr_A) RCPtr; - %template(vector_A) std::vector >; - - you can type - - a = A(); - v = vector_A(2) - v[0] = a - - ie, an 'A *' object is accepted, via implicit conversion, - where a RCPtr object is expected. Additionally - - x = v[0] - - returns (and sets 'x' as) a copy of v[0], making reference - counting possible and consistent. -*/ - -%define %extend_smart_pointer(Type...) -%implicitconv Type; -%apply const SWIGTYPE& SMARTPOINTER { const Type& }; -%apply SWIGTYPE SMARTPOINTER { Type }; -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/python/pywstrings.swg b/win64/bin/swig/share/swig/4.1.0/python/pywstrings.swg deleted file mode 100755 index df469f0c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/pywstrings.swg +++ /dev/null @@ -1,85 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for wchar_t strings - * ------------------------------------------------------------ */ - -%{ -#if PY_VERSION_HEX >= 0x03020000 -# define SWIGPY_UNICODE_ARG(obj) ((PyObject*) (obj)) -#else -# define SWIGPY_UNICODE_ARG(obj) ((PyUnicodeObject*) (obj)) -#endif -%} - -%fragment("SWIG_AsWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor") { -SWIGINTERN int -SWIG_AsWCharPtrAndSize(PyObject *obj, wchar_t **cptr, size_t *psize, int *alloc) -{ - PyObject *tmp = 0; - int isunicode = PyUnicode_Check(obj); -%#if PY_VERSION_HEX < 0x03000000 && !defined(SWIG_PYTHON_STRICT_UNICODE_WCHAR) - if (!isunicode && PyString_Check(obj)) { - tmp = PyUnicode_FromObject(obj); - if (tmp) { - isunicode = 1; - obj = tmp; - } else { - PyErr_Clear(); - return SWIG_TypeError; - } - } -%#endif - if (isunicode) { -%#if PY_VERSION_HEX >= 0x03030000 - Py_ssize_t len = PyUnicode_GetLength(obj); -%#else - Py_ssize_t len = PyUnicode_GetSize(obj); -%#endif - if (cptr) { - Py_ssize_t length; - *cptr = %new_array(len + 1, wchar_t); - length = PyUnicode_AsWideChar(SWIGPY_UNICODE_ARG(obj), *cptr, len); - if (length == -1) { - PyErr_Clear(); - Py_XDECREF(tmp); - return SWIG_TypeError; - } - (*cptr)[length] = 0; - } - if (psize) *psize = (size_t) len + 1; - if (alloc) *alloc = cptr ? SWIG_NEWOBJ : 0; - Py_XDECREF(tmp); - return SWIG_OK; - } else { - swig_type_info* pwchar_descriptor = SWIG_pwchar_descriptor(); - if (pwchar_descriptor) { - void * vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pwchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (wchar_t *)vptr; - if (psize) *psize = vptr ? (wcslen((wchar_t *)vptr) + 1) : 0; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor") { -SWIGINTERNINLINE PyObject * -SWIG_FromWCharPtrAndSize(const wchar_t * carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pwchar_descriptor = SWIG_pwchar_descriptor(); - return pwchar_descriptor ? - SWIG_InternalNewPointerObj(%const_cast(carray,wchar_t *), pwchar_descriptor, 0) : SWIG_Py_Void(); - } else { - return PyUnicode_FromWideChar(carray, %numeric_cast(size, Py_ssize_t)); - } - } else { - return SWIG_Py_Void(); - } -} -} - - diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_alloc.i b/win64/bin/swig/share/swig/4.1.0/python/std_alloc.i deleted file mode 100755 index 2b9342fb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_array.i b/win64/bin/swig/share/swig/4.1.0/python/std_array.i deleted file mode 100755 index b25f30e6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_array.i +++ /dev/null @@ -1,91 +0,0 @@ -/* - std::array -*/ - -%fragment("StdArrayTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::array **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::array& vec) { - return traits_from_stdseq >::from(vec); - } - }; - - template - inline void - assign(const SwigPySeq& swigpyseq, std::array* seq) { - if (swigpyseq.size() < seq->size()) - throw std::invalid_argument("std::array cannot be expanded in size"); - else if (swigpyseq.size() > seq->size()) - throw std::invalid_argument("std::array cannot be reduced in size"); - std::copy(swigpyseq.begin(), swigpyseq.end(), seq->begin()); - } - - template - inline void - erase(std::array* SWIGUNUSEDPARM(seq), const typename std::array::iterator& SWIGUNUSEDPARM(position)) { - throw std::invalid_argument("std::array object does not support item deletion"); - } - - // Only limited slicing is supported as std::array is fixed in size - template - inline std::array* - getslice(const std::array* self, Difference i, Difference j, Py_ssize_t step) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj); - - if (step == 1 && ii == 0 && static_cast(jj) == size) { - Sequence *sequence = new Sequence(); - std::copy(self->begin(), self->end(), sequence->begin()); - return sequence; - } else if (step == -1 && static_cast(ii) == (size - 1) && jj == -1) { - Sequence *sequence = new Sequence(); - std::copy(self->rbegin(), self->rend(), sequence->begin()); - return sequence; - } else { - throw std::invalid_argument("std::array object only supports getting a slice that is the size of the array"); - } - } - - template - inline void - setslice(std::array* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - - if (step == 1 && ii == 0 && static_cast(jj) == size) { - std::copy(is.begin(), is.end(), self->begin()); - } else if (step == -1 && static_cast(ii) == (size - 1) && jj == -1) { - std::copy(is.rbegin(), is.rend(), self->begin()); - } else { - throw std::invalid_argument("std::array object only supports setting a slice that is the size of the array"); - } - } - - template - inline void - delslice(std::array* SWIGUNUSEDPARM(self), Difference SWIGUNUSEDPARM(i), Difference SWIGUNUSEDPARM(j), Py_ssize_t SWIGUNUSEDPARM(step)) { - throw std::invalid_argument("std::array object does not support item deletion"); - } - } -%} - -#define %swig_array_methods(Type...) %swig_sequence_methods_non_resizable(Type) -#define %swig_array_methods_val(Type...) %swig_sequence_methods_non_resizable_val(Type); - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/python/std_auto_ptr.i deleted file mode 100755 index 304f1fc9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_basic_string.i b/win64/bin/swig/share/swig/4.1.0/python/std_basic_string.i deleted file mode 100755 index 73ce35ec..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_basic_string.i +++ /dev/null @@ -1,89 +0,0 @@ -#if !defined(SWIG_STD_STRING) -#define SWIG_STD_BASIC_STRING - -%include - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(PyObject* obj, std::string **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::string *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - PyErr_Clear(); - char* buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::string(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } else { - if (val) *val = 0; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromCharPtrAndSize") { -SWIGINTERNINLINE PyObject* - SWIG_From(std::basic_string)(const std::string& s) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } -} - -%include -%typemaps_asptrfromn(%checkcode(STRING), std::basic_string); - -#endif - - -#if !defined(SWIG_STD_WSTRING) - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsWCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(PyObject* obj, std::wstring **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::wstring *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - PyErr_Clear(); - wchar_t *buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsWCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::wstring(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } else { - if (val) *val = 0; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromWCharPtrAndSize") { -SWIGINTERNINLINE PyObject* - SWIG_From(std::basic_string)(const std::wstring& s) { - return SWIG_FromWCharPtrAndSize(s.data(), s.size()); - } -} - -%typemaps_asptrfromn(%checkcode(UNISTRING), std::basic_string); - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_carray.i b/win64/bin/swig/share/swig/4.1.0/python/std_carray.i deleted file mode 100755 index 739eda9f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_carray.i +++ /dev/null @@ -1,54 +0,0 @@ -%include - - -%fragment("StdCarrayTraits","header",fragment="StdSequenceTraits") -{ -namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::carray **array) { - return traits_asptr_stdseq >::asptr(obj, array); - } - }; -} -} - -%warnfilter(SWIGWARN_IGNORE_OPERATOR_INDEX) std::carray::operator[]; - -%extend std::carray { - %fragment(SWIG_Traits_frag(std::carray<_Type, _Size >), "header", - fragment="SwigPyIterator_T", - fragment=SWIG_Traits_frag(_Type), - fragment="StdCarrayTraits") { - namespace swig { - template <> struct traits > { - typedef pointer_category category; - static const char* type_name() { - return "std::carray<" #_Type "," #_Size " >"; - } - }; - } - } - - %typemaps_asptr(SWIG_TYPECHECK_VECTOR, swig::asptr, - SWIG_Traits_frag(std::carray<_Type, _Size >), - std::carray<_Type, _Size >); - - %typemap(out,noblock=1) iterator, const_iterator { - $result = SWIG_NewPointerObj(swig::make_output_iterator((const $type &)$1), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); - } - - inline size_t __len__() const { return self->size(); } - - inline const _Type& __getitem__(size_t i) const { return (*self)[i]; } - - inline void __setitem__(size_t i, const _Type& v) { (*self)[i] = v; } - - - swig::SwigPyIterator* __iter__(PyObject **PYTHON_SELF) { - return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } -} - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_char_traits.i b/win64/bin/swig/share/swig/4.1.0/python/std_char_traits.i deleted file mode 100755 index e60261f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_common.i b/win64/bin/swig/share/swig/4.1.0/python/std_common.i deleted file mode 100755 index 8fc10fcf..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_common.i +++ /dev/null @@ -1,74 +0,0 @@ -%include -%include - - -/* - Generate the traits for a 'primitive' type, such as 'double', - for which the SWIG_AsVal and SWIG_From methods are already defined. -*/ - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(PyObject *obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static PyObject *from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(PyObject *obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static PyObject *from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_complex.i b/win64/bin/swig/share/swig/4.1.0/python/std_complex.i deleted file mode 100755 index dcd33c13..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_complex.i +++ /dev/null @@ -1,27 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); - diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_container.i b/win64/bin/swig/share/swig/4.1.0/python/std_container.i deleted file mode 100755 index 4303bc04..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_deque.i b/win64/bin/swig/share/swig/4.1.0/python/std_deque.i deleted file mode 100755 index 3bb68ae2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_deque.i +++ /dev/null @@ -1,27 +0,0 @@ -/* - Deques -*/ - -%fragment("StdDequeTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::deque **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::deque& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_except.i b/win64/bin/swig/share/swig/4.1.0/python/std_except.i deleted file mode 100755 index 3e056e7d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_ios.i b/win64/bin/swig/share/swig/4.1.0/python/std_ios.i deleted file mode 100755 index 41c461b6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_ios.i +++ /dev/null @@ -1,3 +0,0 @@ -%rename(ios_base_in) std::ios_base::in; - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_iostream.i b/win64/bin/swig/share/swig/4.1.0/python/std_iostream.i deleted file mode 100755 index b5bde321..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_iostream.i +++ /dev/null @@ -1,8 +0,0 @@ -namespace std -{ -%callback(1) endl; -%callback(1) ends; -%callback(1) flush; -} - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_list.i b/win64/bin/swig/share/swig/4.1.0/python/std_list.i deleted file mode 100755 index 09fe0772..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_list.i +++ /dev/null @@ -1,28 +0,0 @@ -/* - Lists -*/ - -%fragment("StdListTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::list& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_map.i b/win64/bin/swig/share/swig/4.1.0/python/std_map.i deleted file mode 100755 index 678a7010..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_map.i +++ /dev/null @@ -1,310 +0,0 @@ -/* - Maps -*/ - -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") -{ - namespace swig { - template - struct from_key_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.first); - } - }; - - template - struct from_value_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.second); - } - }; - - template - struct SwigPyMapIterator_T : SwigPyIteratorClosed_T - { - SwigPyMapIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct SwigPyMapKeyIterator_T : SwigPyMapIterator_T - { - SwigPyMapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapIterator_T(curr, first, last, seq) - { - } - }; - - template - inline SwigPyIterator* - make_output_key_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapKeyIterator_T(current, begin, end, seq); - } - - template > - struct SwigPyMapValueIterator_T : SwigPyMapIterator_T - { - SwigPyMapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline SwigPyIterator* - make_output_value_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapValueIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::map map_type; - static int asptr(PyObject *obj, map_type **val) { - int res = SWIG_ERROR; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq >::asptr(items, val); - } else { - map_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } - }; - - template - struct traits_from > { - typedef std::map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static PyObject *asdict(const map_type& map) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - size_type size = map.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return obj; - } - - static PyObject *from(const map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - return asdict(map); - } - } - }; - } -} - -%define %swig_map_common(Map...) - %swig_sequence_iterator(Map); - %swig_container_methods(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_length", functype="lenfunc") __len__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "tp_iter", functype="getiterfunc") key_iterator; - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; - - %extend { - %newobject iterkeys(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iterkeys(PyObject **PYTHON_SELF) { - return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject itervalues(PyObject **PYTHON_SELF); - swig::SwigPyIterator* itervalues(PyObject **PYTHON_SELF) { - return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject iteritems(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iteritems(PyObject **PYTHON_SELF) { - return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -#else - %extend { - %pythoncode %{def __iter__(self): - return self.key_iterator()%} - %pythoncode %{def iterkeys(self): - return self.key_iterator()%} - %pythoncode %{def itervalues(self): - return self.value_iterator()%} - %pythoncode %{def iteritems(self): - return self.iterator()%} - } -#endif - - %extend { - mapped_type const & __getitem__(const key_type& key) throw (std::out_of_range) { - Map::const_iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - - void __delitem__(const key_type& key) throw (std::out_of_range) { - Map::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - - bool has_key(const key_type& key) const { - Map::const_iterator i = self->find(key); - return i != self->end(); - } - - PyObject* keys() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* keyList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(keyList, j, swig::from(i->first)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return keyList; - } - - PyObject* values() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* valList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(valList, j, swig::from(i->second)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return valList; - } - - PyObject* items() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* itemList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(itemList, j, swig::from(*i)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return itemList; - } - - bool __contains__(const key_type& key) { - return self->find(key) != self->end(); - } - - %newobject key_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* key_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject value_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* value_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -%enddef - -%define %swig_map_methods(Map...) - %swig_map_common(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - (*self)[key] = x; - } - - PyObject* asdict() { - return swig::traits_from< Map >::asdict(*self); - } - } - - -%enddef - - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_multimap.i b/win64/bin/swig/share/swig/4.1.0/python/std_multimap.i deleted file mode 100755 index 25dd8637..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_multimap.i +++ /dev/null @@ -1,93 +0,0 @@ -/* - Multimaps -*/ -%include - -%fragment("StdMultimapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::multimap *multimap) { - typedef typename std::multimap::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::multimap multimap_type; - static int asptr(PyObject *obj, std::multimap **val) { - int res = SWIG_ERROR; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - multimap_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::multimap multimap_type; - typedef typename multimap_type::const_iterator const_iterator; - typedef typename multimap_type::size_type size_type; - - static PyObject *from(const multimap_type& multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new multimap_type(multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = multimap.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_OverflowError, "multimap size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - return obj; - } - } - }; - } -} - -%define %swig_multimap_methods(Type...) - %swig_map_common(Type); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - self->insert(Type::value_type(key,x)); - } - } -%enddef - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_multiset.i b/win64/bin/swig/share/swig/4.1.0/python/std_multiset.i deleted file mode 100755 index 3c61c0fb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_multiset.i +++ /dev/null @@ -1,41 +0,0 @@ -/* - Multisets -*/ - -%include - -%fragment("StdMultisetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::multiset* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_multiset_methods(Set...) %swig_set_methods(Set) - - - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_pair.i b/win64/bin/swig/share/swig/4.1.0/python/std_pair.i deleted file mode 100755 index 1adbcf1d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_pair.i +++ /dev/null @@ -1,206 +0,0 @@ -/* - Pairs -*/ -%include - -//#define SWIG_STD_PAIR_ASVAL - -%fragment("StdPairTraits","header",fragment="StdTraits") { - namespace swig { -#ifdef SWIG_STD_PAIR_ASVAL - template - struct traits_asval > { - typedef std::pair value_type; - - static int get_pair(PyObject* first, PyObject* second, - std::pair *val) - { - if (val) { - T *pfirst = &(val->first); - int res1 = swig::asval((PyObject*)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = &(val->second); - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } else { - T *pfirst = 0; - int res1 = swig::asval((PyObject*)first, 0); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asval(PyObject *obj, std::pair *val) { - int res = SWIG_ERROR; - if (PyTuple_Check(obj)) { - if (PyTuple_GET_SIZE(obj) == 2) { - res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val); - } - } else if (PySequence_Check(obj)) { - if (PySequence_Size(obj) == 2) { - swig::SwigVar_PyObject first = PySequence_GetItem(obj,0); - swig::SwigVar_PyObject second = PySequence_GetItem(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = *p; - } - return res; - } - }; - -#else - template - struct traits_asptr > { - typedef std::pair value_type; - - static int get_pair(PyObject* first, PyObject* second, - std::pair **val) - { - if (val) { - value_type *vp = %new_instance(std::pair); - T *pfirst = &(vp->first); - int res1 = swig::asval((PyObject*)first, pfirst); - if (!SWIG_IsOK(res1)) { - %delete(vp); - return res1; - } - U *psecond = &(vp->second); - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) { - %delete(vp); - return res2; - } - *val = vp; - return SWIG_AddNewMask(res1 > res2 ? res1 : res2); - } else { - T *pfirst = 0; - int res1 = swig::asval((PyObject*)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((PyObject*)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asptr(PyObject *obj, std::pair **val) { - int res = SWIG_ERROR; - if (PyTuple_Check(obj)) { - if (PyTuple_GET_SIZE(obj) == 2) { - res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val); - } - } else if (PySequence_Check(obj)) { - if (PySequence_Size(obj) == 2) { - swig::SwigVar_PyObject first = PySequence_GetItem(obj,0); - swig::SwigVar_PyObject second = PySequence_GetItem(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - -#endif - template - struct traits_from > { - static PyObject *from(const std::pair& val) { - PyObject* obj = PyTuple_New(2); - PyTuple_SetItem(obj,0,swig::from(val.first)); - PyTuple_SetItem(obj,1,swig::from(val.second)); - return obj; - } - }; - } - -#if defined(SWIGPYTHON_BUILTIN) -SWIGINTERN Py_ssize_t -SwigPython_std_pair_len (PyObject *a) -{ - return 2; -} - -SWIGINTERN PyObject* -SwigPython_std_pair_repr (PyObject *o) -{ - PyObject *tuple = PyTuple_New(2); - assert(tuple); - PyTuple_SET_ITEM(tuple, 0, PyObject_GetAttrString(o, (char*) "first")); - PyTuple_SET_ITEM(tuple, 1, PyObject_GetAttrString(o, (char*) "second")); - PyObject *result = PyObject_Repr(tuple); - Py_DECREF(tuple); - return result; -} - -SWIGINTERN PyObject* -SwigPython_std_pair_getitem (PyObject *a, Py_ssize_t b) -{ - PyObject *result = PyObject_GetAttrString(a, b % 2 ? (char*) "second" : (char*) "first"); - return result; -} - -SWIGINTERN int -SwigPython_std_pair_setitem (PyObject *a, Py_ssize_t b, PyObject *c) -{ - int result = PyObject_SetAttrString(a, b % 2 ? (char*) "second" : (char*) "first", c); - return result; -} -#endif - -} - -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; -%feature("python:sq_length") std::pair "SwigPython_std_pair_len"; - -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; -%feature("python:tp_repr") std::pair "SwigPython_std_pair_repr"; - -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; -%feature("python:sq_item") std::pair "SwigPython_std_pair_getitem"; - -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; -%feature("python:sq_ass_item") std::pair "SwigPython_std_pair_setitem"; - -%define %swig_pair_methods(pair...) -#if !defined(SWIGPYTHON_BUILTIN) -%extend { -%pythoncode %{def __len__(self): - return 2 -def __repr__(self): - return str((self.first, self.second)) -def __getitem__(self, index): - if not (index % 2): - return self.first - else: - return self.second -def __setitem__(self, index, val): - if not (index % 2): - self.first = val - else: - self.second = val%} -} -#endif -%enddef - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_set.i b/win64/bin/swig/share/swig/4.1.0/python/std_set.i deleted file mode 100755 index 4b4102f8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_set.i +++ /dev/null @@ -1,67 +0,0 @@ -/* - Sets -*/ - -%fragment("StdSetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::set* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%define %swig_set_methods(set...) - %swig_sequence_iterator(set); - %swig_container_methods(set); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; -#endif - - %extend { - void append(value_type x) { - self->insert(x); - } - - bool __contains__(value_type x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void add(value_type x) { - self->insert(x); - } - - void discard(value_type x) { - self->erase(x); - } - } -%enddef - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/python/std_shared_ptr.i deleted file mode 100755 index 01a0e9dd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_sstream.i b/win64/bin/swig/share/swig/4.1.0/python/std_sstream.i deleted file mode 100755 index cf5efe60..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_sstream.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_streambuf.i b/win64/bin/swig/share/swig/4.1.0/python/std_streambuf.i deleted file mode 100755 index 7b3552f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_streambuf.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_string.i b/win64/bin/swig/share/swig/4.1.0/python/std_string.i deleted file mode 100755 index 0afc2468..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/python/std_unique_ptr.i deleted file mode 100755 index 79320de6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_unordered_map.i b/win64/bin/swig/share/swig/4.1.0/python/std_unordered_map.i deleted file mode 100755 index 0759251c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_unordered_map.i +++ /dev/null @@ -1,296 +0,0 @@ -/* - Unordered Maps -*/ -%include - -%fragment("StdUnorderedMapForwardIteratorTraits","header") -{ - namespace swig { - template - struct SwigPyMapForwardIterator_T : SwigPyForwardIteratorClosed_T - { - SwigPyMapForwardIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyForwardIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct SwigPyMapKeyForwardIterator_T : SwigPyMapForwardIterator_T - { - SwigPyMapKeyForwardIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapForwardIterator_T(curr, first, last, seq) - { - } - }; - - template - inline SwigPyIterator* - make_output_key_forward_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapKeyForwardIterator_T(current, begin, end, seq); - } - - template > - struct SwigPyMapValueForwardIterator_T : SwigPyMapForwardIterator_T - { - SwigPyMapValueForwardIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq) - : SwigPyMapForwardIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline SwigPyIterator* - make_output_value_forward_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0) - { - return new SwigPyMapValueForwardIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_map *unordered_map) { - typedef typename std::unordered_map::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - unordered_map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_map &seq, typename std::unordered_map::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - typedef std::unordered_map unordered_map_type; - static int asptr(PyObject *obj, unordered_map_type **val) { - int res = SWIG_ERROR; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - unordered_map_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_map unordered_map_type; - typedef typename unordered_map_type::const_iterator const_iterator; - typedef typename unordered_map_type::size_type size_type; - - static PyObject *asdict(const unordered_map_type& map) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - size_type size = map.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return obj; - } - - static PyObject *from(const unordered_map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new unordered_map_type(map), desc, SWIG_POINTER_OWN); - } else { - return asdict(map); - } - } - }; - } -} - -%define %swig_unordered_map_common(Map...) - %swig_sequence_forward_iterator(Map); - %swig_container_methods(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_length", functype="lenfunc") __len__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; - %feature("python:slot", "tp_iter", functype="getiterfunc") key_iterator; - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; - - %extend { - %newobject iterkeys(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iterkeys(PyObject **PYTHON_SELF) { - return swig::make_output_key_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject itervalues(PyObject **PYTHON_SELF); - swig::SwigPyIterator* itervalues(PyObject **PYTHON_SELF) { - return swig::make_output_value_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject iteritems(PyObject **PYTHON_SELF); - swig::SwigPyIterator* iteritems(PyObject **PYTHON_SELF) { - return swig::make_output_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -#else - %extend { - %pythoncode %{def __iter__(self): - return self.key_iterator()%} - %pythoncode %{def iterkeys(self): - return self.key_iterator()%} - %pythoncode %{def itervalues(self): - return self.value_iterator()%} - %pythoncode %{def iteritems(self): - return self.iterator()%} - } -#endif - - %extend { - mapped_type const & __getitem__(const key_type& key) throw (std::out_of_range) { - Map::const_iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - - void __delitem__(const key_type& key) throw (std::out_of_range) { - Map::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - - bool has_key(const key_type& key) const { - Map::const_iterator i = self->find(key); - return i != self->end(); - } - - PyObject* keys() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "unordered_map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* keyList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(keyList, j, swig::from(i->first)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return keyList; - } - - PyObject* values() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "unordered_map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* valList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(valList, j, swig::from(i->second)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return valList; - } - - PyObject* items() { - Map::size_type size = self->size(); - Py_ssize_t pysize = (size <= (Map::size_type) INT_MAX) ? (Py_ssize_t) size : -1; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (pysize < 0) { - PyErr_SetString(PyExc_OverflowError, "unordered_map size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject* itemList = PyList_New(pysize); - Map::const_iterator i = self->begin(); - for (Py_ssize_t j = 0; j < pysize; ++i, ++j) { - PyList_SET_ITEM(itemList, j, swig::from(*i)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return itemList; - } - - bool __contains__(const key_type& key) { - return self->find(key) != self->end(); - } - - %newobject key_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* key_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_key_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - - %newobject value_iterator(PyObject **PYTHON_SELF); - swig::SwigPyIterator* value_iterator(PyObject **PYTHON_SELF) { - return swig::make_output_value_forward_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } - } - -%enddef - -%define %swig_unordered_map_methods(Map...) - %swig_unordered_map_common(Map) - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - (*self)[key] = x; - } - - PyObject* asdict() { - return swig::traits_from< Map >::asdict(*self); - } - } - - -%enddef - - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_unordered_multimap.i b/win64/bin/swig/share/swig/4.1.0/python/std_unordered_multimap.i deleted file mode 100755 index 1b4545f2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_unordered_multimap.i +++ /dev/null @@ -1,100 +0,0 @@ -/* - Unordered Multimaps -*/ -%include - -%fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") -{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multimap *unordered_multimap) { - typedef typename std::unordered_multimap::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - unordered_multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_multimap &seq, typename std::unordered_multimap::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - typedef std::unordered_multimap unordered_multimap_type; - static int asptr(PyObject *obj, std::unordered_multimap **val) { - int res = SWIG_ERROR; - if (PyDict_Check(obj)) { - SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); -%#if PY_VERSION_HEX >= 0x03000000 - /* In Python 3.x the ".items()" method returns a dict_items object */ - items = PySequence_Fast(items, ".items() didn't return a sequence!"); -%#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - unordered_multimap_type *p = 0; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_multimap unordered_multimap_type; - typedef typename unordered_multimap_type::const_iterator const_iterator; - typedef typename unordered_multimap_type::size_type size_type; - - static PyObject *from(const unordered_multimap_type& unordered_multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new unordered_multimap_type(unordered_multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = unordered_multimap.size(); - Py_ssize_t pysize = (size <= (size_type) INT_MAX) ? (Py_ssize_t) size : -1; - if (pysize < 0) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_OverflowError, "unordered_multimap size not valid in python"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - PyObject *obj = PyDict_New(); - for (const_iterator i= unordered_multimap.begin(); i!= unordered_multimap.end(); ++i) { - swig::SwigVar_PyObject key = swig::from(i->first); - swig::SwigVar_PyObject val = swig::from(i->second); - PyDict_SetItem(obj, key, val); - } - return obj; - } - } - }; - } -} - -%define %swig_unordered_multimap_methods(Type...) - %swig_unordered_map_common(Type); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__; -#endif - - %extend { - // This will be called through the mp_ass_subscript slot to delete an entry. - void __setitem__(const key_type& key) { - self->erase(key); - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - self->insert(Type::value_type(key,x)); - } - } -%enddef - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_unordered_multiset.i b/win64/bin/swig/share/swig/4.1.0/python/std_unordered_multiset.i deleted file mode 100755 index a846be41..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_unordered_multiset.i +++ /dev/null @@ -1,48 +0,0 @@ -/* - Unordered Multisets -*/ - -%include - -%fragment("StdUnorderedMultisetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multiset* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_multiset &seq, typename std::unordered_multiset::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::unordered_multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::unordered_multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_unordered_multiset_methods(Set...) %swig_unordered_set_methods(Set) - - - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_unordered_set.i b/win64/bin/swig/share/swig/4.1.0/python/std_unordered_set.i deleted file mode 100755 index 567ee14e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_unordered_set.i +++ /dev/null @@ -1,67 +0,0 @@ -/* - Unordered Sets -*/ - -%fragment("StdUnorderedSetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_set* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_reserve > { - static void reserve(std::unordered_set &seq, typename std::unordered_set::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::unordered_set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::unordered_set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%define %swig_unordered_set_methods(unordered_set...) - %swig_sequence_forward_iterator(unordered_set); - %swig_container_methods(unordered_set); - -#if defined(SWIGPYTHON_BUILTIN) - %feature("python:slot", "sq_contains", functype="objobjproc") __contains__; - %feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__; -#endif - - - %extend { - void append(value_type x) { - self->insert(x); - } - - bool __contains__(value_type x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - } -%enddef - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_vector.i b/win64/bin/swig/share/swig/4.1.0/python/std_vector.i deleted file mode 100755 index 7e866b59..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_vector.i +++ /dev/null @@ -1,34 +0,0 @@ -/* - Vectors -*/ - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_reserve > { - static void reserve(std::vector &seq, typename std::vector::size_type n) { - seq.reserve(n); - } - }; - - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static PyObject *from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_vectora.i b/win64/bin/swig/share/swig/4.1.0/python/std_vectora.i deleted file mode 100755 index 5de2b6cb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_vectora.i +++ /dev/null @@ -1,31 +0,0 @@ -/* - Vectors + allocators -*/ - -%fragment("StdVectorATraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - typedef std::vector vector_type; - typedef T value_type; - static int asptr(PyObject *obj, vector_type **vec) { - return traits_asptr_stdseq::asptr(obj, vec); - } - }; - - template - struct traits_from > { - typedef std::vector vector_type; - static PyObject *from(const vector_type& vec) { - return traits_from_stdseq::from(vec); - } - }; - } -%} - - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_wios.i b/win64/bin/swig/share/swig/4.1.0/python/std_wios.i deleted file mode 100755 index a09c4721..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_wios.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_wiostream.i b/win64/bin/swig/share/swig/4.1.0/python/std_wiostream.i deleted file mode 100755 index f81ca4e4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_wiostream.i +++ /dev/null @@ -1,10 +0,0 @@ -namespace std -{ -%callback(1) wendl; -%callback(1) wends; -%callback(1) wflush; -} - -%include -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_wsstream.i b/win64/bin/swig/share/swig/4.1.0/python/std_wsstream.i deleted file mode 100755 index 2edc40ef..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_wsstream.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_wstreambuf.i b/win64/bin/swig/share/swig/4.1.0/python/std_wstreambuf.i deleted file mode 100755 index 372a83b1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_wstreambuf.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/std_wstring.i b/win64/bin/swig/share/swig/4.1.0/python/std_wstring.i deleted file mode 100755 index 185ee7e6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/std_wstring.i +++ /dev/null @@ -1,3 +0,0 @@ -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/python/stl.i b/win64/bin/swig/share/swig/4.1.0/python/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/python/swigmove.i b/win64/bin/swig/share/swig/4.1.0/python/swigmove.i deleted file mode 100755 index 03e87fa2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/typemaps.i b/win64/bin/swig/share/swig/4.1.0/python/typemaps.i deleted file mode 100755 index a1946a01..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/typemaps.i +++ /dev/null @@ -1,148 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Python tuple. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Python output of the function would be a tuple containing both -output values. - -*/ - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Python tuple. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include - void neg(double *INOUT); - -or you can use the %apply directive : - - %include - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Python). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Python variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/python/wchar.i b/win64/bin/swig/share/swig/4.1.0/python/wchar.i deleted file mode 100755 index 09471795..00000000 --- a/win64/bin/swig/share/swig/4.1.0/python/wchar.i +++ /dev/null @@ -1,21 +0,0 @@ -#ifdef __cplusplus - -%{ -#include -%} - -#else - -%{ -#include -%} - -#endif - -%types(wchar_t *); -%include - -/* - Enable swig wchar support. -*/ -#define SWIG_WCHAR diff --git a/win64/bin/swig/share/swig/4.1.0/r/boost_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/r/boost_shared_ptr.i deleted file mode 100755 index 8942403a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/boost_shared_ptr.i +++ /dev/null @@ -1,420 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - -%typemap(rtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - "$typemap(rtype, TYPE)" - -%typemap(scoercein) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - %{ if (inherits($input, "ExternalReference")) $input = slot($input,"ref"); %} - -%typemap(scoerceout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& - %{ $result <- if (is.null($result)) $result - else new("$typemap(rtype, TYPE)", ref=$result); %} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/r/cdata.i b/win64/bin/swig/share/swig/4.1.0/r/cdata.i deleted file mode 100755 index 1c6de446..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/r/exception.i b/win64/bin/swig/share/swig/4.1.0/r/exception.i deleted file mode 100755 index 13026e80..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/exception.i +++ /dev/null @@ -1,8 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), -%block(switch (code) {case SWIG_IndexError: return Rf_ScalarLogical(NA_LOGICAL); default: %error(code, msg); SWIG_fail;} )) -} - diff --git a/win64/bin/swig/share/swig/4.1.0/r/r.swg b/win64/bin/swig/share/swig/4.1.0/r/r.swg deleted file mode 100755 index c555a7de..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/r.swg +++ /dev/null @@ -1,281 +0,0 @@ -/* */ - - -%insert("header") "swiglabels.swg" - -%insert("init") "swiginit.swg" -%insert("runtime") "swigrun.swg" -%insert("runtime") "swigerrors.swg" -%insert("runtime") "rrun.swg" - -%init %{ -SWIGEXPORT void SWIG_init(void) { -%} - -%include - -#define %Rruntime %insert("s") - -#define SWIG_Object SEXP -#define VOID_Object R_NilValue - -#define %append_output(obj) SET_VECTOR_ELT($result, $n, obj) - -%define %set_constant(name, obj) %begin_block - SEXP _obj = obj; - assign(name, _obj); -%end_block %enddef - -%runtime %{ -SWIGINTERN void SWIG_R_Raise(SEXP obj, const char *msg) { - Rf_error(Rf_isString(obj) ? CHAR(Rf_asChar(obj)) : msg); -} -%} - -#define %raise(OBJ, TYPE, DESC) SWIG_R_Raise(OBJ, "C/C++ exception of type " TYPE); return R_NilValue - -%insert("sinit") "srun.swg" - -%insert("sinitroutine") %{ -SWIG_init(); -SWIG_InitializeModule(0); -%} - -%include -%typemap(in) (double *x, int len) %{ - $1 = REAL(x); - $2 = Rf_length(x); -%} - -/* XXX - Need to worry about inheritance, e.g. if B extends A - and we are looking for an A[], then B elements are okay. -*/ -%typemap(scheck) SWIGTYPE[ANY] - %{ -# assert(length($input) > $1_dim0) - assert(all(sapply($input, class) == "$R_class")); - %} - -%typemap(out) void "" - -%typemap(in) int *, int[ANY], - signed int *, signed int[ANY], - unsigned int *, unsigned int[ANY], - short *, short[ANY], - signed short *, signed short[ANY], - unsigned short *, unsigned short[ANY], - long *, long[ANY], - signed long *, signed long[ANY], - unsigned long *, unsigned long[ANY], - long long *, long long[ANY], - signed long long *, signed long long[ANY], - unsigned long long *, unsigned long long[ANY] - -{ -{ int _rswigi; - int _rswiglen = LENGTH($input); - $1 = %static_cast(calloc(sizeof($1_basetype), _rswiglen), $1_ltype); - for (_rswigi=0; _rswigi< _rswiglen; _rswigi++) { - $1[_rswigi] = INTEGER($input)[_rswigi]; - } -} -} - -%typemap(in) float *, float[ANY], - double *, double[ANY] - -{ -{ int _rswigi; - int _rswiglen = LENGTH($input); - $1 = %static_cast(calloc(sizeof($1_basetype), _rswiglen), $1_ltype); - for (_rswigi=0; _rswigi<_rswiglen; _rswigi++) { - $1[_rswigi] = REAL($input)[_rswigi]; - } -} -} - -%typemap(freearg,noblock=1) int *, int[ANY], - signed int *, signed int[ANY], - unsigned int *, unsigned int[ANY], - short *, short[ANY], - signed short *, signed short[ANY], - unsigned short *, unsigned short[ANY], - long *, long[ANY], - signed long *, signed long[ANY], - unsigned long *, unsigned long[ANY], - long long *, long long[ANY], - signed long long *, signed long long[ANY], - unsigned long long *, unsigned long long[ANY], - float *, float[ANY], - double *, double[ANY] -%{ - free($1); -%} - -%typemap(freearg, noblock=1) int *OUTPUT, -signed int *OUTPUT, -unsigned int *OUTPUT, -short *OUTPUT, -signed short *OUTPUT, -unsigned short *OUTPUT, -long *OUTPUT, -signed long *OUTPUT, -unsigned long *OUTPUT, -long long *OUTPUT, -signed long long *OUTPUT, -unsigned long long *OUTPUT, -float *OUTPUT, -double *OUTPUT, -char *OUTPUT, -signed char *OUTPUT, -unsigned char *OUTPUT -{} - - - -/* Should we recycle to make the length correct. - And warn if length() > the dimension. -*/ -%typemap(scheck) SWIGTYPE [ANY] %{ -# assert(length($input) >= $1_dim0) -%} - -/* Handling vector case to avoid warnings, - although we just use the first one. */ -%typemap(scheck) unsigned int %{ - assert(length($input) == 1 && $input >= 0, "All values must be non-negative"); -%} - - -%typemap(scheck) int, long %{ - if(length($input) > 1) { - warning("using only the first element of $input"); - }; -%} - -%include -%include -%include -%include -%include - -%typemap(in,noblock=1) enum SWIGTYPE[ANY] { - $1 = %reinterpret_cast(INTEGER($input), $1_ltype); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char * { - $1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype); -} - -%typemap(freearg,noblock=1) char * { - free($1); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char *[ANY] { - $1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype); -} - -%typemap(freearg,noblock=1) char *[ANY] { - free($1); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char[ANY] { - $1 = SWIG_strdup(CHAR(STRING_ELT($input, 0))); -} - -%typemap(freearg,noblock=1) char[ANY] { - free($1); -} - -%typemap(in,noblock=1,fragment="SWIG_strdup") char[] { - $1 = SWIG_strdup(CHAR(STRING_ELT($input, 0))); -} - -%typemap(freearg,noblock=1) char[] { - free($1); -} - -%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) -%{ temp = ($*1_ltype)INTEGER($input)[0]; - $1 = &temp; %} - -%typemap(out) const enum SWIGTYPE & %{ $result = Rf_ScalarInteger((int)*$1); %} - -%typemap(memberin) char[] %{ -if ($input) strcpy($1, $input); -else -strcpy($1, ""); -%} - -%typemap(globalin) char[] %{ -if ($input) strcpy($1, $input); -else -strcpy($1, ""); -%} - -%typemap(out,noblock=1) char * - { $result = $1 ? Rf_mkString(%reinterpret_cast($1,char *)) : R_NilValue; } - -%typemap(in,noblock=1) char { -$1 = %static_cast(CHAR(STRING_ELT($input, 0))[0],$1_ltype); -} - -%typemap(out) char - { - char tmp[2] = "x"; - tmp[0] = $1; - $result = Rf_mkString(tmp); - } - - -%typemap(in,noblock=1) int, long -{ - $1 = %static_cast(INTEGER($input)[0], $1_ltype); -} - -%typemap(out,noblock=1) int, long - "$result = Rf_ScalarInteger($1);"; - - -%typemap(in,noblock=1) bool - "$1 = LOGICAL($input)[0] ? true : false;"; - - -%typemap(out,noblock=1) bool - "$result = Rf_ScalarLogical($1);"; - -%typemap(in,noblock=1) - float, - double -{ - $1 = %static_cast(REAL($input)[0], $1_ltype); -} - -/* Why is this here ? */ -/* %typemap(out,noblock=1) unsigned int * - "$result = ScalarReal(*($1));"; */ - -%Rruntime %{ -setMethod('[', "ExternalReference", -function(x,i,j, ..., drop=TRUE) -if (!is.null(x$"__getitem__")) -sapply(i, function(n) x$"__getitem__"(i=as.integer(n-1)))) - -setMethod('[<-' , "ExternalReference", -function(x,i,j, ..., value) -if (!is.null(x$"__setitem__")) { -sapply(1:length(i), function(n) -x$"__setitem__"(i=as.integer(i[n]-1), x=value[n])) -x -}) - -setAs('ExternalReference', 'character', -function(from) {if (!is.null(from$"__str__")) from$"__str__"()}) - -suppressMessages(suppressWarnings(setMethod('print', 'ExternalReference', -function(x) {print(as(x, "character"))}))) -%} - - - diff --git a/win64/bin/swig/share/swig/4.1.0/r/rcontainer.swg b/win64/bin/swig/share/swig/4.1.0/r/rcontainer.swg deleted file mode 100755 index 81c4f912..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/rcontainer.swg +++ /dev/null @@ -1,198 +0,0 @@ - -// -// Common fragments -// - - -/**** The python container methods ****/ - - - -%fragment("StdSequenceTraits","header",fragment="") -{ -%#include -namespace swig { - inline size_t - check_index(ptrdiff_t i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - - throw std::out_of_range("index out of range"); - } - - inline size_t - slice_index(ptrdiff_t i, size_t size) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) { - return (size_t) (i + size); - } else { - throw std::out_of_range("index out of range"); - } - } else { - return ( (size_t) i < size ) ? ((size_t) i) : size; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (jj > ii) { - typename Sequence::const_iterator vb = self->begin(); - typename Sequence::const_iterator ve = self->begin(); - std::advance(vb,ii); - std::advance(ve,jj); - return new Sequence(vb, ve); - } else { - return new Sequence(); - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj < ii) jj = ii; - size_t ssize = jj - ii; - if (ssize <= v.size()) { - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); - std::advance(sb,ii); - std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); - } else { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj > ii) { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - } - } -} -} - -%define %swig_container_methods(Container...) - - %newobject __getslice__; - - %extend { - bool __nonzero__() const { - return !(self->empty()); - } - - size_type __len__() const { - return self->size(); - } - } -%enddef - -%define %swig_sequence_methods_common(Sequence...) -// %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - - %fragment("StdSequenceTraits"); - - %extend { - value_type pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty container"); - Sequence::value_type x = self->back(); - self->pop_back(); - return x; - } - - Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range) { - return swig::getslice(self, i, j); - } - - void __setslice__(difference_type i, difference_type j, const Sequence& v) - throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, v); - } - - void __delslice__(difference_type i, difference_type j) throw (std::out_of_range) { - swig::delslice(self, i, j); - } - - void __delitem__(difference_type i) throw (std::out_of_range) { - self->erase(swig::getpos(self,i)); - } - } -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - const value_type& __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, const value_type& x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - - void append(const value_type& x) { - self->push_back(x); - } - } -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) - %extend { - value_type __getitem__(difference_type i) throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - void __setitem__(difference_type i, value_type x) throw (std::out_of_range) { - *(swig::getpos(self,i)) = x; - } - - void append(value_type x) { - self->push_back(x); - } - } -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/r/rfragments.swg b/win64/bin/swig/share/swig/4.1.0/r/rfragments.swg deleted file mode 100755 index d6571790..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/rfragments.swg +++ /dev/null @@ -1,191 +0,0 @@ -/* for raw pointers */ -#define SWIG_ConvertPtr(oc, ptr, ty, flags) SWIG_R_ConvertPtr(oc, ptr, ty, flags) -#define SWIG_ConvertFunctionPtr(oc, ptr, ty) SWIG_R_ConvertPtr(oc, ptr, ty, 0) -#define SWIG_NewPointerObj(ptr, ty, flags) SWIG_R_NewPointerObj(ptr, ty, flags) -#define SWIG_NewFunctionPtrObj(ptr, ty) SWIG_R_NewPointerObj(ptr, ty, 0) - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_R_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, ty) SWIG_R_NewPackedObj(ptr, sz, ty) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, ty, flags) SWIG_ConvertPtr(obj, pptr, ty, flags) -#define SWIG_NewInstanceObj(ptr, ty, flags) SWIG_NewPointerObj(ptr, ty, flags) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_R_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, ty) SWIG_R_NewPackedObj(ptr, sz, ty) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_R_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_R_SetModule(pointer) - -%fragment(SWIG_From_frag(long),"header") { -SWIGINTERNINLINE SEXP -SWIG_From_dec(long)(long value) -{ - return Rf_ScalarInteger((int)value); -} -} - -%fragment(SWIG_AsVal_frag(long),"header") { -SWIGINTERNINLINE int -SWIG_AsVal_dec(long)(SEXP obj, long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -} - - -%fragment(SWIG_From_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SEXP -SWIG_From_dec(long long)(long long value) -{ - return Rf_ScalarInteger((int)value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE int -SWIG_AsVal_dec(long long)(SEXP obj, long long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -%#endif -} - -%fragment(SWIG_From_frag(unsigned long),"header") { -SWIGINTERNINLINE SEXP -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return Rf_ScalarInteger((int)value); -} -} - - -%fragment(SWIG_AsVal_frag(unsigned long),"header") { -SWIGINTERNINLINE int -SWIG_AsVal_dec(unsigned long)(SEXP obj, unsigned long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -} - - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE SEXP -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return Rf_ScalarInteger((int)value); -} -%#endif -} - - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE int -SWIG_AsVal_dec(unsigned long long)(SEXP obj, unsigned long long *val) -{ - if (val) *val = Rf_asInteger(obj); - return SWIG_OK; -} -%#endif -} - -%fragment(SWIG_From_frag(double),"header") { -SWIGINTERNINLINE SEXP -SWIG_From_dec(double)(double value) -{ - return Rf_ScalarReal(value); -} -} - - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERNINLINE int -SWIG_AsVal_dec(double)(SEXP obj, double *val) -{ - if (val) *val = Rf_asReal(obj); - return SWIG_OK; -} -} - -%fragment("SWIG_AsCharPtrAndSize", "header") -{ -SWIGINTERN int -SWIG_AsCharPtrAndSize(SEXP obj, char** cptr, size_t* psize, int *alloc) -{ - if (cptr && Rf_isString(obj)) { - char *cstr = %const_cast(CHAR(STRING_ELT(obj, 0)), char *); - int len = strlen(cstr); - - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - } - } else { - *cptr = %reinterpret_cast(malloc(len + 1), char *); - *cptr = strcpy(*cptr, cstr); - } - if (psize) *psize = len + 1; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_strdup","header") -{ -SWIGINTERN char * -SWIG_strdup(const char *str) -{ - char *newstr = %reinterpret_cast(malloc(strlen(str) + 1), char *); - return strcpy(newstr, str); -} -} - -//# This is modified from the R header files - -%fragment("SWIG_FromCharPtrAndSize","header") -{ -SWIGINTERN SEXP -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - SEXP t, c; - if (!carray) return R_NilValue; -/* See R internals document 1.10. - MkCharLen was introduced in 2.7.0. Use that instead of hand - creating vector. - - Starting in 2.8.0 creating strings via vectors was deprecated in - order to allow for use of CHARSXP caches. */ - - Rf_protect(t = Rf_allocVector(STRSXP, 1)); -%#if R_VERSION >= R_Version(2,7,0) - c = Rf_mkCharLen(carray, size); -%#else - c = Rf_allocVector(CHARSXP, size); - strncpy((char *)CHAR(c), carray, size); -%#endif - SET_STRING_ELT(t, 0, c); - Rf_unprotect(1); - return t; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/r/rkw.swg b/win64/bin/swig/share/swig/4.1.0/r/rkw.swg deleted file mode 100755 index ecaeca14..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/rkw.swg +++ /dev/null @@ -1,36 +0,0 @@ -/* - Warnings for R keywords, built-in names and bad names. -*/ - -#define RKW(x) %keywordwarn("'" `x` "' is a R keyword", rename="_%s") `x` -#define RSWIGKW(x) %keywordwarn("'" `x` "' is a SWIG R reserved parameter name", rename="_%s") `x` - -/* - Warnings for R reserved words taken from - http://cran.r-project.org/doc/manuals/R-lang.html#Reserved-words -*/ - -RKW(if); -RKW(else); -RKW(repeat); -RKW(while); -RKW(function); -RKW(for); -RKW(in); -RKW(next); -RKW(break); -RKW(TRUE); -RKW(FALSE); -RKW(NULL); -RKW(Inf); -RKW(NaN); -RKW(NA); -RKW(NA_integer_); -RKW(NA_real_); -RKW(NA_complex_); -RKW(NA_character_); - -RSWIGKW(self); - -#undef RKW -#undef RSWIGKW diff --git a/win64/bin/swig/share/swig/4.1.0/r/ropers.swg b/win64/bin/swig/share/swig/4.1.0/r/ropers.swg deleted file mode 100755 index 0ab9829d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/ropers.swg +++ /dev/null @@ -1,32 +0,0 @@ -#ifdef __cplusplus - -%rename(Equal) operator =; -%rename(PlusEqual) operator +=; -%rename(MinusEqual) operator -=; -%rename(MultiplyEqual) operator *=; -%rename(DivideEqual) operator /=; -%rename(PercentEqual) operator %=; -%rename(Plus) operator +; -%rename(Minus) operator -; -%rename(Multiply) operator *; -%rename(Divide) operator /; -%rename(Percent) operator %; -%rename(Not) operator !; -%rename(IndexIntoConst) operator[](unsigned idx) const; -%rename(IndexInto) operator[](unsigned idx); -%rename(Functor) operator (); -%rename(EqualEqual) operator ==; -%rename(NotEqual) operator !=; -%rename(LessThan) operator <; -%rename(LessThanEqual) operator <=; -%rename(GreaterThan) operator >; -%rename(GreaterThanEqual) operator >=; -%rename(And) operator &&; -%rename(Or) operator ||; -%rename(PlusPlusPrefix) operator++(); -%rename(PlusPlusPostfix) operator++(int); -%rename(MinusMinusPrefix) operator--(); -%rename(MinusMinusPostfix) operator--(int); - - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/r/rrun.swg b/win64/bin/swig/share/swig/4.1.0/r/rrun.swg deleted file mode 100755 index 7c86a802..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/rrun.swg +++ /dev/null @@ -1,420 +0,0 @@ -/* Remove global namespace pollution */ -#if !defined(SWIG_NO_R_NO_REMAP) -# define R_NO_REMAP -#endif -#if !defined(SWIG_NO_STRICT_R_HEADERS) -# define STRICT_R_HEADERS -#endif - -#include -#include - -#ifdef __cplusplus -#include -extern "C" { -#endif - -/* for raw pointer */ -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_R_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_R_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_R_NewPointerObj(ptr, type, flags) - -#include -#include -#include -#include - -#if R_VERSION >= R_Version(2,6,0) -#define VMAXTYPE void * -#else -#define VMAXTYPE char * -#endif - -/* Last error */ -static int SWIG_lasterror_code = 0; -static char SWIG_lasterror_msg[1024]; -SWIGRUNTIME void SWIG_Error(int code, const char *format, ...) { - va_list arg; - SWIG_lasterror_code = code; - va_start(arg, format); - vsnprintf(SWIG_lasterror_msg, sizeof(SWIG_lasterror_msg), format, arg); - va_end(arg); -} - -SWIGRUNTIME const char *SWIG_ErrorType(int code) { - switch (code) { - case SWIG_MemoryError: - return "SWIG:MemoryError"; - case SWIG_IOError: - return "SWIG:IOError"; - case SWIG_RuntimeError: - return "SWIG:RuntimeError"; - case SWIG_IndexError: - return "SWIG:IndexError"; - case SWIG_TypeError: - return "SWIG:TypeError"; - case SWIG_DivisionByZero: - return "SWIG:DivisionByZero"; - case SWIG_OverflowError: - return "SWIG:OverflowError"; - case SWIG_SyntaxError: - return "SWIG:SyntaxError"; - case SWIG_ValueError: - return "SWIG:ValueError"; - case SWIG_SystemError: - return "SWIG:SystemError"; - case SWIG_AttributeError: - return "SWIG:AttributeError"; - } - return "SWIG:UnknownError"; -} - -#define SWIG_fail goto fail - -/* - This is mainly a way to avoid having lots of local variables that may - conflict with those in the routine. - - Change name to R_SWIG_Callb.... -*/ -typedef struct RCallbackFunctionData { - - SEXP fun; - SEXP userData; - - - SEXP expr; - SEXP retValue; - int errorOccurred; - - SEXP el; /* Temporary pointer used in the construction of the expression to call the R function. */ - - struct RCallbackFunctionData *previous; /* Stack */ - -} RCallbackFunctionData; - -static RCallbackFunctionData *callbackFunctionDataStack; - - -SWIGRUNTIME SEXP -R_SWIG_debug_getCallbackFunctionData() -{ - int n, i; - SEXP ans; - RCallbackFunctionData *p = callbackFunctionDataStack; - - n = 0; - while(p) { - n++; - p = p->previous; - } - - Rf_protect(ans = Rf_allocVector(VECSXP, n)); - for(p = callbackFunctionDataStack, i = 0; i < n; p = p->previous, i++) - SET_VECTOR_ELT(ans, i, p->fun); - - Rf_unprotect(1); - - return(ans); -} - - - -SWIGRUNTIME RCallbackFunctionData * -R_SWIG_pushCallbackFunctionData(SEXP fun, SEXP userData) -{ - RCallbackFunctionData *el; - el = (RCallbackFunctionData *) calloc(1, sizeof(RCallbackFunctionData)); - el->fun = fun; - el->userData = userData; - el->previous = callbackFunctionDataStack; - - callbackFunctionDataStack = el; - - return(el); -} - - -SWIGRUNTIME SEXP -R_SWIG_R_pushCallbackFunctionData(SEXP fun, SEXP userData) -{ - R_SWIG_pushCallbackFunctionData(fun, userData); - return R_NilValue; -} - -SWIGRUNTIME RCallbackFunctionData * -R_SWIG_getCallbackFunctionData() -{ - if(!callbackFunctionDataStack) { - Rf_error("Supposedly impossible error occurred in the SWIG callback mechanism." - " No callback function data set."); - } - - return callbackFunctionDataStack; -} - -SWIGRUNTIME void -R_SWIG_popCallbackFunctionData(int doFree) -{ - RCallbackFunctionData *el = NULL; - if(!callbackFunctionDataStack) - return ; /* Error !!! */ - - el = callbackFunctionDataStack ; - callbackFunctionDataStack = callbackFunctionDataStack->previous; - - if(doFree) - free(el); -} - - -/* - Interface to S function - is(obj, type) - which is to be used to determine if an - external pointer inherits from the right class. - - Ideally, we would like to be able to do this without an explicit call to the is() function. - When the S4 class system uses its own SEXP types, then we will hopefully be able to do this - in the C code. - - Should we make the expression static and preserve it to avoid the overhead of - allocating each time. -*/ -SWIGRUNTIME int -R_SWIG_checkInherits(SEXP obj, SEXP tag, const char *type) -{ - SEXP e, val; - int check_err = 0; - - Rf_protect(e = Rf_allocVector(LANGSXP, 3)); - SETCAR(e, Rf_install("extends")); - - SETCAR(CDR(e), Rf_mkString(CHAR(PRINTNAME(tag)))); - SETCAR(CDR(CDR(e)), Rf_mkString(type)); - - val = R_tryEval(e, R_GlobalEnv, &check_err); - Rf_unprotect(1); - if(check_err) - return(0); - - - return(LOGICAL(val)[0]); -} - - -SWIGRUNTIME void * -R_SWIG_resolveExternalRef(SEXP arg, const char * const type, const char * const argName, Rboolean nullOk) -{ - void *ptr; - SEXP orig = arg; - - if(TYPEOF(arg) != EXTPTRSXP) - arg = GET_SLOT(arg, Rf_mkString("ref")); - - - if(TYPEOF(arg) != EXTPTRSXP) { - Rf_error("argument %s must be an external pointer (from an ExternalReference)", argName); - } - - - ptr = R_ExternalPtrAddr(arg); - - if(ptr == NULL && nullOk == (Rboolean) FALSE) { - Rf_error("the external pointer (of type %s) for argument %s has value NULL", argName, type); - } - - if(type[0] && R_ExternalPtrTag(arg) != Rf_install(type) && strcmp(type, "voidRef") - && !R_SWIG_checkInherits(orig, R_ExternalPtrTag(arg), type)) { - Rf_error("the external pointer for argument %s has tag %s, not the expected value %s", - argName, CHAR(PRINTNAME(R_ExternalPtrTag(arg))), type); - } - - - return(ptr); -} - -SWIGRUNTIME void -R_SWIG_ReferenceFinalizer(SEXP el) -{ - void *ptr = R_SWIG_resolveExternalRef(el, "", "", (Rboolean) 1); - fprintf(stderr, "In R_SWIG_ReferenceFinalizer for %p\n", ptr); - Rf_PrintValue(el); - - if(ptr) { - if(TYPEOF(el) != EXTPTRSXP) - el = GET_SLOT(el, Rf_mkString("ref")); - - if(TYPEOF(el) == EXTPTRSXP) - R_ClearExternalPtr(el); - - free(ptr); - } - - return; -} - -SWIGRUNTIME SEXP -SWIG_MakePtr(void *ptr, const char *typeName, int flags) -{ - SEXP external, r_obj; - - Rf_protect(external = R_MakeExternalPtr(ptr, Rf_install(typeName), R_NilValue)); - Rf_protect(r_obj = NEW_OBJECT(MAKE_CLASS((char *) typeName))); - - if (flags & SWIG_POINTER_OWN) - R_RegisterCFinalizer(external, R_SWIG_ReferenceFinalizer); - - r_obj = SET_SLOT(r_obj, Rf_mkString((char *) "ref"), external); - SET_S4_OBJECT(r_obj); - Rf_unprotect(2); - - return(r_obj); -} - - -SWIGRUNTIME SEXP -R_SWIG_create_SWIG_R_Array(const char *typeName, SEXP ref, int len) -{ - SEXP arr; - -/*XXX remove the char * cast when we can. MAKE_CLASS should be declared appropriately. */ - Rf_protect(arr = NEW_OBJECT(MAKE_CLASS((char *) typeName))); - Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("ref"), ref)); - Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("dims"), Rf_ScalarInteger(len))); - - Rf_unprotect(3); - SET_S4_OBJECT(arr); - return arr; -} - -#define ADD_OUTPUT_ARG(result, pos, value, name) r_ans = AddOutputArgToReturn(pos, value, name, OutputValues); - -SWIGRUNTIME SEXP -AddOutputArgToReturn(int pos, SEXP value, const char *name, SEXP output) -{ - SET_VECTOR_ELT(output, pos, value); - - return(output); -} - -/* Create a new pointer object */ -SWIGRUNTIMEINLINE SEXP -SWIG_R_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - SEXP rptr; - if (!ptr) { - return R_NilValue; - } - rptr = R_MakeExternalPtr(ptr, - R_MakeExternalPtr(type, R_NilValue, R_NilValue), R_NilValue); - SET_S4_OBJECT(rptr); - return rptr; -} - - -/* Convert a pointer value */ -SWIGRUNTIMEINLINE int -SWIG_R_ConvertPtr(SEXP obj, void **ptr, swig_type_info *ty, int flags) { - void *vptr; - if (!obj) return SWIG_ERROR; - if (obj == R_NilValue) { - if (ptr) *ptr = NULL; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - - vptr = R_ExternalPtrAddr(obj); - if (ty) { - swig_type_info *to = (swig_type_info*) - R_ExternalPtrAddr(R_ExternalPtrTag(obj)); - if (to == ty) { - if (ptr) *ptr = vptr; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - int newmemory = 0; - if (ptr) *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } - } else { - if (ptr) *ptr = vptr; - } - return SWIG_OK; -} - -SWIGRUNTIME swig_module_info * -SWIG_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - static void *type_pointer = (void *)0; - return (swig_module_info *) type_pointer; -} - -SWIGRUNTIME void -SWIG_SetModule(void *v, swig_module_info *swig_module) { -} - -typedef struct { - void *pack; - swig_type_info *ty; - size_t size; -} RSwigPacked; - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE SEXP RSwigPacked_New(void *ptr, size_t sz, - swig_type_info *ty) { - SEXP rptr; - RSwigPacked *sobj = - (RSwigPacked*) malloc(sizeof(RSwigPacked)); - if (sobj) { - void *pack = malloc(sz); - if (pack) { - memcpy(pack, ptr, sz); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = sz; - } else { - sobj = 0; - } - } - rptr = R_MakeExternalPtr(sobj, R_NilValue, R_NilValue); - return rptr; -} - -SWIGRUNTIME swig_type_info * -RSwigPacked_UnpackData(SEXP obj, void *ptr, size_t size) -{ - RSwigPacked *sobj = - (RSwigPacked *)R_ExternalPtrAddr(obj); - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; -} - -SWIGRUNTIMEINLINE SEXP -SWIG_R_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? RSwigPacked_New((void *) ptr, sz, type) : R_NilValue; -} - -/* Convert a packed pointer value */ - -SWIGRUNTIME int -SWIG_R_ConvertPacked(SEXP obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = RSwigPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -#ifdef __cplusplus -#define SWIG_exception_noreturn(code, msg) do { throw std::runtime_error(msg); } while(0) -#else -#define SWIG_exception_noreturn(code, msg) do { return result; } while(0) -#endif - -#ifdef __cplusplus -} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/r/rstdcommon.swg b/win64/bin/swig/share/swig/4.1.0/r/rstdcommon.swg deleted file mode 100755 index 054688b1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/rstdcommon.swg +++ /dev/null @@ -1,205 +0,0 @@ -%fragment("StdTraits","header",fragment="StdTraitsCommon") -{ -namespace swig { - /* - Traits that provides the from method - */ - - template struct traits_from_ptr { - static SWIG_Object from(Type *val, int owner = 0) { - return SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static SWIG_Object from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static SWIG_Object from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template - inline SWIG_Object from(const Type& val) { - return traits_from::from(val); - } - - template - inline SWIG_Object from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - /* - Traits that provides the asval/as/check method - */ - template - struct traits_asptr { - static int asptr(SWIG_Object obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(SWIG_Object obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(SWIG_Object obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(SWIG_Object obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(SWIG_Object obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(SWIG_Object obj) { - Type v; - int res = asval(obj, &v); - if (!obj || !SWIG_IsOK(res)) { - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(SWIG_Object obj) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(SWIG_Object obj, bool throw_error) { - Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); - if (SWIG_IsOK(res)) { - return v; - } else { - if (throw_error) - throw std::invalid_argument("bad type"); - return 0; - } - } - }; - - template - inline Type as(SWIG_Object obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(SWIG_Object obj) { - int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(SWIG_Object obj) { - int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(SWIG_Object obj) { - return traits_check::category>::check(obj); - } -} -} - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(SWIG_Object obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static SWIG_Object from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(SWIG_Object obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/r/rtype.swg b/win64/bin/swig/share/swig/4.1.0/r/rtype.swg deleted file mode 100755 index 021ce043..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/rtype.swg +++ /dev/null @@ -1,328 +0,0 @@ - -/* These map the primitive C types to the appropriate R type - for use in class representations. - */ - -%typemap("rtype") int, int *, int & "integer" -%typemap("rtype") long, long *, long & "integer" -%typemap("rtype") float, float*, float & "numeric" -%typemap("rtype") double, double*, double & "numeric" -%typemap("rtype") char *, char ** "character" -%typemap("rtype") char "character" -%typemap("rtype") string, string *, string & "character" -%typemap("rtype") std::string, std::string *, std::string & "character" -%typemap("rtype") bool, bool * "logical" -%typemap("rtype") enum SWIGTYPE "character" -%typemap("rtype") enum SWIGTYPE * "character" -%typemap("rtype") enum SWIGTYPE *const& "character" -%typemap("rtype") enum SWIGTYPE & "character" -%typemap("rtype") const enum SWIGTYPE & "character" -%typemap("rtype") enum SWIGTYPE && "character" -%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("rtypecheck") int, int &, long, long & - %{ (is.integer($arg) || is.numeric($arg)) && length($arg) == 1 %} -%typemap("rtypecheck") int *, long * - %{ is.integer($arg) || is.numeric($arg) %} - - -%typemap("rtypecheck") float, double - %{ is.numeric($arg) && length($arg) == 1 %} -%typemap("rtypecheck") float *, double * - %{ is.numeric($arg) %} - -%typemap("rtypecheck") bool, bool & - %{ is.logical($arg) && length($arg) == 1 %} -%typemap("rtypecheck") bool * - %{ is.logical($arg) %} - -/* - Set up type checks to insure overloading precedence. - We would like non pointer items to shadow pointer items, so that - they get called if length = 1 -*/ - -%typecheck(SWIG_TYPECHECK_BOOL) bool {} -%typecheck(SWIG_TYPECHECK_UINT32) unsigned int {} -%typecheck(SWIG_TYPECHECK_INTEGER) int {} -%typecheck(SWIG_TYPECHECK_FLOAT) float {} -%typecheck(SWIG_TYPECHECK_DOUBLE) double {} - -%typecheck(SWIG_TYPECHECK_BOOL_PTR) bool * {} -%typecheck(SWIG_TYPECHECK_INT32_PTR) int * {} -%typecheck(SWIG_TYPECHECK_FLOAT_PTR) float * {} -%typecheck(SWIG_TYPECHECK_DOUBLE_PTR) double * {} -%typecheck(SWIG_TYPECHECK_CHAR_PTR) char * {} - -%typecheck(SWIG_TYPECHECK_INT32_ARRAY) int[ANY] {} -%typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) float[ANY] {} -%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) double [ANY] {} - -/* Have to be careful that as(x, "numeric") is different from as.numeric(x). - The latter makes a REALSXP, whereas the former leaves an INTSXP as an - INTSXP. -*/ - -/* Force coercion of integer, since by default R sets all constants to - numeric, which means that you can't directly call a function with an - integer using an R numercal literal */ - -%typemap(scoercein) int, int *, int & - %{ $input = as.integer($input); %} -%typemap(scoercein) long, long *, long & - %{ $input = as.integer($input); %} -%typemap(scoercein) float, float*, float &, - double, double *, double & - %{ %} -%typemap(scoercein) char, char *, char & - %{ $input = as($input, "character"); %} -%typemap(scoercein) string, string *, string & - %{ $input = as($input, "character"); %} -%typemap(scoercein) std::string, std::string *, std::string & - %{ $input = as($input, "character"); %} -%typemap(scoercein) enum SWIGTYPE - %{ $input = enumToInteger($input, "$R_class"); %} -%typemap(scoercein) enum SWIGTYPE & - %{ $input = enumToInteger($input, "$*R_class"); %} -%typemap(scoercein) enum SWIGTYPE * - %{ $input = enumToInteger($input, "$R_class"); %} -%typemap(scoercein) enum SWIGTYPE *const - %{ $input = enumToInteger($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE, SWIGTYPE *, SWIGTYPE *const, SWIGTYPE *const&, SWIGTYPE &, SWIGTYPE && - %{ if (inherits($input, "ExternalReference")) $input = slot($input,"ref"); %} - -/* -%typemap(scoercein) SWIGTYPE *, SWIGTYPE *const - %{ $input = coerceIfNotSubclass($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE & - %{ $input = coerceIfNotSubclass($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE && - %{ $input = coerceIfNotSubclass($input, "$R_class"); %} - -%typemap(scoercein) SWIGTYPE - %{ $input = coerceIfNotSubclass($input, "$&R_class"); %} -*/ - -%typemap(scoercein) SWIGTYPE[ANY] - %{ - if(is.list($input)) - assert(all(sapply($input, class) == "$R_class")); - %} - - -/* **************************************************************** */ - -%typemap(scoercein) bool, bool *, bool & - "$input = as.logical($input);"; -%typemap(scoercein) int, - int *, - int &, - long, - long *, - long & - "$input = as.integer($input);"; - -%typemap(scoercein) char *, string, std::string, -string &, std::string & -%{ $input = as($input, "character"); %} - -%typemap(scoerceout) enum SWIGTYPE - %{ $result = enumFromInteger($result, "$R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE & - %{ $result = enumFromInteger($result, "$*R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE && - %{ $result = enumFromInteger($result, "$R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE * - %{ $result = enumToInteger($result, "$R_class"); %} - -%typemap(scoerceout) enum SWIGTYPE *const - %{ $result = enumToInteger($result, "$R_class"); %} - -%typemap(scoerceout) SEXP %{ %} - -%typemap(scoerceout) SWIGTYPE - %{ $result <- if (is.null($result)) $result - else new("$&R_class", ref=$result); %} - -%typemap(scoerceout) SWIGTYPE & - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - - -%typemap(scoerceout) SWIGTYPE && - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - -%typemap(scoerceout) SWIGTYPE * - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - - -%typemap(scoerceout) SWIGTYPE *const - %{ $result <- if (is.null($result)) $result - else new("$R_class", ref=$result); %} - -%typemap(scoerceout) SWIGTYPE *const& - %{ $result <- if (is.null($result)) $result - else new("$*R_class", ref=$result); %} - - -/* Override the SWIGTYPE * above. */ -%typemap(scoerceout) char, - char *, - char &, - float, - double, - float*, - double*, - float &, - double &, - int, - int &, - long, - long &, - bool, - bool &, - string, - std::string, - string &, - std::string &, - void, - signed int, - signed int &, - unsigned int, - unsigned int &, - short, - short &, - unsigned short, - unsigned short &, - long long, - signed long long, - signed long long &, - unsigned long long, - unsigned long long &, - signed long, - signed long &, - unsigned long, - unsigned long &, - signed char, - signed char &, - unsigned char, - unsigned char & - %{ %} - -%apply int {size_t, -std::size_t, -ptrdiff_t, -std::ptrdiff_t, -signed int, -unsigned int, -short, -unsigned short, -signed char, -unsigned char} - -%apply int* {size_t[], -std::size_t[], -ptrdiff_t[], -std::ptrdiff_t[], -signed int[], -unsigned int[], -short[], -unsigned short[], -signed char[], -unsigned char[]} - -%apply int* {size_t[ANY], -std::size_t[ANY], -ptrdiff_t[ANY], -std::ptrdiff_t[ANY], -signed int[ANY], -unsigned int[ANY], -short[ANY], -unsigned short[ANY], -signed char[ANY], -unsigned char[ANY]} - -%apply int* {size_t*, -std::size_t*, -ptrdiff_t*, -std::ptrdiff_t*, -signed int*, -unsigned int*, -short*, -unsigned short*, -signed char*, -unsigned char*} - -%apply long { - long long, - signed long long, - unsigned long long, - signed long, - unsigned long} - -%apply long* { - long long*, - signed long long*, - unsigned long long*, - signed long*, - unsigned long*, - long long[], - signed long long[], - unsigned long long[], - signed long[], - unsigned long[], - long long[ANY], - signed long long[ANY], - unsigned long long[ANY], - signed long[ANY], - unsigned long[ANY]} - -%apply float* { - float[], - float[ANY] -} -%apply double * { - double[], - double[ANY] -} - -%apply bool* { - bool[], - bool[ANY] -} - -#if 0 - Just examining the values for a SWIGTYPE. - -%typemap(scoerceout) SWIGTYPE %{ - - name = $1_name - type = $1_type - ltype = $1_ltype - - mangle = $1_mangle - descriptor = $1_descriptor - - pointer type = $*1_type - pointer ltype = $*1_ltype - - pointer descriptor = $*1_descriptor - basetype = $*_basetype - -%} -#endif - - diff --git a/win64/bin/swig/share/swig/4.1.0/r/srun.swg b/win64/bin/swig/share/swig/4.1.0/r/srun.swg deleted file mode 100755 index a26f0447..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/srun.swg +++ /dev/null @@ -1,150 +0,0 @@ -# srun.swg # -# -# This is the basic code that is needed at run time within R to -# provide and define the relevant classes. It is included -# automatically in the generated code by copying the contents of -# srun.swg into the newly created binding code. - - -# This could be provided as a separate run-time library but this -# approach allows the code to be included directly into the -# generated bindings and so removes the need to have and install an -# additional library. We may however end up with multiple copies of -# this and some confusion at run-time as to which class to use. This -# is an issue when we use NAMESPACES as we may need to export certain -# classes. - -###################################################################### - -if(length(getClassDef("RSWIGStruct")) == 0) - setClass("RSWIGStruct", representation("VIRTUAL")) - - - -if(length(getClassDef("ExternalReference")) == 0) -# Should be virtual but this means it loses its slots currently -#representation("VIRTUAL") - setClass("ExternalReference", representation( ref = "externalptr")) - - - -if(length(getClassDef("NativeRoutinePointer")) == 0) - setClass("NativeRoutinePointer", - representation(parameterTypes = "character", - returnType = "character", - "VIRTUAL"), - contains = "ExternalReference") - -if(length(getClassDef("CRoutinePointer")) == 0) - setClass("CRoutinePointer", contains = "NativeRoutinePointer") - - -if(length(getClassDef("EnumerationValue")) == 0) - setClass("EnumerationValue", contains = "integer") - - -if(!isGeneric("copyToR")) - setGeneric("copyToR", - function(value, obj = new(gsub("Ref$", "", class(value)))) - standardGeneric("copyToR" - )) - -setGeneric("delete", function(obj) standardGeneric("delete")) - - -SWIG_createNewRef = -function(className, ..., append = TRUE) -{ - f = get(paste("new", className, sep = "_"), mode = "function") - - f(...) -} - -if(!isGeneric("copyToC")) - setGeneric("copyToC", - function(value, obj = SWIG_createNewRef(class(value))) - standardGeneric("copyToC" - )) - - -# -defineEnumeration = -function(name, .values, where = topenv(parent.frame()), suffix = "Value") -{ - # Mirror the class definitions via the E analogous to .__C__ - defName = paste(".__E__", name, sep = "") - delayedAssign(defName, .values, assign.env = where) - - if(nchar(suffix)) - name = paste(name, suffix, sep = "") - - setClass(name, contains = "EnumerationValue", where = where) -} - -enumToInteger <- function(name,type) -{ - if (is.character(name)) { - ans <- as.integer(get(paste(".__E__", type, sep = ""))[name]) - if (is.na(ans)) {warning("enum not found ", name, " ", type)} - ans - } -} - -enumFromInteger = -function(i,type) -{ - itemlist <- get(paste(".__E__", type, sep="")) - names(itemlist)[match(i, itemlist)] -} - -coerceIfNotSubclass = -function(obj, type) -{ - if(!is(obj, type)) {as(obj, type)} else obj -} - - -setClass("SWIGArray", representation(dims = "integer"), contains = "ExternalReference") - -setMethod("length", "SWIGArray", function(x) x@dims[1]) - - -defineEnumeration("SCopyReferences", - .values = c( "FALSE" = 0, "TRUE" = 1, "DEEP" = 2)) - -assert = -function(condition, message = "") -{ - if(!condition) - stop(message) - - TRUE -} - - -if(FALSE) { -print.SWIGFunction = -function(x, ...) - { - } -} - - -####################################################################### - -R_SWIG_getCallbackFunctionStack = -function() -{ - # No PACKAGE argument as we don't know what the DLL is. - .Call("R_SWIG_debug_getCallbackFunctionData") -} - -R_SWIG_addCallbackFunctionStack = -function(fun, userData = NULL) -{ - # No PACKAGE argument as we don't know what the DLL is. - .Call("R_SWIG_R_pushCallbackFunctionData", fun, userData) -} - - -####################################################################### diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_alloc.i b/win64/bin/swig/share/swig/4.1.0/r/std_alloc.i deleted file mode 100755 index 87fa8d4a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include \ No newline at end of file diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_common.i b/win64/bin/swig/share/swig/4.1.0/r/std_common.i deleted file mode 100755 index 2ba43e6e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_common.i +++ /dev/null @@ -1,73 +0,0 @@ -%include - - -/* - Generate the traits for a 'primitive' type, such as 'double', - for which the SWIG_AsVal and SWIG_From methods are already defined. -*/ - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SEXP obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SEXP from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SEXP obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SEXP from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_container.i b/win64/bin/swig/share/swig/4.1.0/r/std_container.i deleted file mode 100755 index 7d1dc10c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_deque.i b/win64/bin/swig/share/swig/4.1.0/r/std_deque.i deleted file mode 100755 index 0c757ab0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include \ No newline at end of file diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_except.i b/win64/bin/swig/share/swig/4.1.0/r/std_except.i deleted file mode 100755 index 3e056e7d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_list.i b/win64/bin/swig/share/swig/4.1.0/r/std_list.i deleted file mode 100755 index e6928eae..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_list.i +++ /dev/null @@ -1,5 +0,0 @@ -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_map.i b/win64/bin/swig/share/swig/4.1.0/r/std_map.i deleted file mode 100755 index aa889d86..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_map.i +++ /dev/null @@ -1,5 +0,0 @@ -%fragment("StdMapTraits","header") -%{ -%} - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_pair.i b/win64/bin/swig/share/swig/4.1.0/r/std_pair.i deleted file mode 100755 index fa218700..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_pair.i +++ /dev/null @@ -1,5 +0,0 @@ -%fragment("StdPairTraits","header") -%{ -%} - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/r/std_shared_ptr.i deleted file mode 100755 index 01a0e9dd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_string.i b/win64/bin/swig/share/swig/4.1.0/r/std_string.i deleted file mode 100755 index 0afc2468..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_string.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/r/std_vector.i b/win64/bin/swig/share/swig/4.1.0/r/std_vector.i deleted file mode 100755 index 8c11af18..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/std_vector.i +++ /dev/null @@ -1,1105 +0,0 @@ -// R specific swig components -/* - Vectors -*/ - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - // vectors of doubles - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(REALSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - NUMERIC_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of floats - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(REALSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - NUMERIC_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of unsigned 8bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 8bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of unsigned 16bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 16bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of 32 bit unsigned int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of 32bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of 64 bit unsigned int -#if defined(SWIGWORDSIZE64) - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 64 bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; -#else - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - // vectors of 64 bit int - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(INTSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - INTEGER_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; -#endif - // vectors of bool - template <> - struct traits_from_ptr > { - static SEXP from (std::vector *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(LGLSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - LOGICAL_POINTER(result)[pos] = ((*val)[pos]); - } - UNPROTECT(1); - return(result); - } - }; - - // vectors of strings - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector > *val, int owner = 0) { - SEXP result; - PROTECT(result = Rf_allocVector(STRSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - CHARACTER_POINTER(result)[pos] = Rf_mkChar(((*val)[pos]).c_str()); - } - UNPROTECT(1); - return(result); - } - }; - - // catch all that does everything with vectors - template - struct traits_from_ptr< std::vector< T > > { - static SEXP from (std::vector< T > *val, int owner = 0) { - return SWIG_R_NewPointerObj(val, type_info< std::vector< T > >(), owner); - } - }; - ///////////////////////////////////////////////// - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - double *S = NUMERIC_POINTER(obj); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - double *S = NUMERIC_POINTER(obj); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - // 8 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - // 16 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - // 32 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - -#if defined(SWIGWORDSIZE64) - // 64 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - -#else - // 64 bit integer types - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - unsigned int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, INTSXP)); - int *S = INTEGER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - -#endif - - template <> - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - // not sure how to check the size of the SEXP obj is correct - int sexpsz = Rf_length(obj); - p = new std::vector(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, LGLSXP)); - int *S = LOGICAL_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - (*p)[pos] = static_cast(S[pos]); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - template <> - struct traits_asptr < std::vector > > { - static int asptr(SEXP obj, std::vector > **val) { - std::vector > *p; - // R character vectors are STRSXP containing CHARSXP - // access a CHARSXP using STRING_ELT - int sexpsz = Rf_length(obj); - p = new std::vector >(sexpsz); - SEXP coerced; - PROTECT(coerced = Rf_coerceVector(obj, STRSXP)); - //SEXP *S = CHARACTER_POINTER(coerced); - for (unsigned pos = 0; pos < p->size(); pos++) - { - const char * thecstring = CHAR(STRING_ELT(coerced, pos)); - (*p)[pos] = std::basic_string(thecstring); - } - int res = SWIG_OK; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - UNPROTECT(1); - return res; - } - }; - - // catchall for R to vector conversion - template - struct traits_asptr < std::vector > { - static int asptr(SEXP obj, std::vector **val) { - std::vector *p; - int res = SWIG_R_ConvertPtr(obj, (void**)&p, type_info< std::vector >(), 0); - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - // now for vectors of vectors. These will be represented as lists of vectors on the - // catch all that does everything with vectors - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(INTSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - INTEGER_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(INTSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - INTEGER_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(REALSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - NUMERIC_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(REALSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - NUMERIC_POINTER(VECTOR_ELT(result, pos))[vpos] = static_cast(val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > { - static SEXP from (std::vector< std::vector > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(LGLSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - LOGICAL_POINTER(VECTOR_ELT(result, pos))[vpos] = (val->at(pos).at(vpos)); - } - } - UNPROTECT(1); - return(result); - } - }; - - template <> - struct traits_from_ptr > > > { - static SEXP from (std::vector< std::vector > > *val, int owner = 0) { - SEXP result; - // allocate the R list - PROTECT(result = Rf_allocVector(VECSXP, val->size())); - for (unsigned pos = 0; pos < val->size(); pos++) - { - // allocate the R vector - SET_VECTOR_ELT(result, pos, Rf_allocVector(STRSXP, val->at(pos).size())); - // Fill the R vector - for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos) - { - CHARACTER_POINTER(VECTOR_ELT(result, pos))[vpos] = Rf_mkChar(val->at(pos).at(vpos).c_str()); - } - } - UNPROTECT(1); - return(result); - } - }; - - template - struct traits_from_ptr< std::vector < std::vector< T > > > { - static SEXP from (std::vector < std::vector< T > > *val, int owner = 0) { - return SWIG_R_NewPointerObj(val, type_info< std::vector < std::vector< T > > >(), owner); - } - }; - - ///////////////////////////////////////////////////////////////// - - // R side - template <> - struct traits_asptr < std::vector< std::vector > > { - static int asptr(SEXP obj, std::vector< std::vector > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(INTEGER_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< int> > > { - static int asptr(SEXP obj, std::vector< std::vector< int> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< int> > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(INTEGER_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< float> > > { - static int asptr(SEXP obj, std::vector< std::vector< float> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< float> > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(NUMERIC_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< double> > > { - static int asptr(SEXP obj, std::vector< std::vector< double> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< double> > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(NUMERIC_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template <> - struct traits_asptr < std::vector< std::vector< bool > > > { - static int asptr(SEXP obj, std::vector< std::vector< bool> > **val) { - std::vector > *p; - // this is the length of the list - unsigned int sexpsz = Rf_length(obj); - p = new std::vector< std::vector< bool > > (sexpsz); - - for (unsigned listpos = 0; listpos < sexpsz; ++listpos) - { - unsigned vecsize = Rf_length(VECTOR_ELT(obj, listpos)); - for (unsigned vpos = 0; vpos < vecsize; ++vpos) - { - (*p)[listpos].push_back(static_cast(LOGICAL_POINTER(VECTOR_ELT(obj, listpos))[vpos])); - } - } - - int res = SWIG_OK; - - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - // catchall - template - struct traits_asptr < std::vector< std::vector > > { - static int asptr(SEXP obj, std::vector< std::vector > **val) { - std::vector< std::vector > *p; - Rprintf("vector of vectors - unsupported content\n"); - int res = SWIG_R_ConvertPtr(obj, (void**)&p, type_info< std::vector< std::vector > > (), 0); - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - } -%} - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%define %traits_type_name(Type...) -%fragment(SWIG_Traits_frag(Type), "header", - fragment="StdTraits",fragment="StdVectorTraits") { - namespace swig { - template <> struct traits< Type > { - typedef pointer_category category; - static const char* type_name() { - return #Type; - } - }; - } - } -%enddef - -%include - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector) -%traits_type_name(std::vector) -%typemap("rtypecheck") std::vector, std::vector *, std::vector & - %{ is.numeric($arg) %} -%typemap("rtype") std::vector "numeric" -%typemap("scoercein") std::vector, std::vector *, std::vector & "$input = as.numeric($input);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector) -%traits_type_name(std::vector) - -// reuse these for float -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; - - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -%typemap("rtypecheck") std::vector, std::vector *, std::vector & - %{ is.logical($arg) %} -%typemap("rtype") std::vector "logical" -%typemap("scoercein") std::vector , std::vector & "$input = as.logical($input);" - - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -%typemap("rtypecheck") std::vector, std::vector *, std::vector & - %{ is.integer($arg) || is.numeric($arg) %} - -%typemap("rtype") std::vector "integer" -%typemap("scoercein") std::vector , std::vector *, std::vector & "$input = as.integer($input);" - -// strings -%typemap("rtype") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & "character" - -%typemap("rtypecheck") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & - %{ is.character($arg) %} - -%typemap("scoercein") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & "$input = as.character($input);"; - -%typemap("scoerceout") std::vector< std::basic_string >, -std::vector< std::basic_string > *, - std::vector< std::basic_string > & -%{ %} - -// all the related integer vectors -// signed -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -#if defined(SWIGWORDSIZE64) -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#else -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#endif - -// unsigned -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); - -#if defined(SWIGWORDSIZE64) -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#else -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector); -%traits_type_name(std::vector); -#endif - -// These R side typemaps are common for integer types -// but we can't use %apply as it will copy the C side ones too -// Also note that we don't seem to be able to use types like -// int_least8_t here. -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; - -#if defined(SWIGWORDSIZE64) -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -#else -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtype") std::vector, std::vector *, std::vector & = std::vector; -#endif - - -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; - -#if defined(SWIGWORDSIZE64) -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -#else -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -%typemap("scoercein") std::vector, std::vector *, std::vector & = std::vector; -#endif - -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; - -#if defined(SWIGWORDSIZE64) -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -#else -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -%typemap("rtypecheck") std::vector, std::vector *, std::vector & = std::vector; -#endif - -/////////////////////////////////////////////////////////////// - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.integer);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.integer);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.numeric);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & - "$input = lapply($input, as.numeric);"; - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector >); -%traits_type_name(std::vector< std::vector >); -%typemap("rtypecheck") std::vector >, std::vector > *, std::vector > & - %{ is.list($arg) && all(sapply($arg , is.integer) || sapply($arg, is.numeric)) %} -%typemap("rtype") std::vector >, std::vector > *, std::vector > & "list" -%typemap("scoercein") std::vector< std::vector >, std::vector > *, std::vector > & "$input = lapply($input, as.logical);" - -%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector > >); -%traits_type_name(std::vector< std::vector > >); -%typemap("rtypecheck") std::vector > >, std::vector > > *, std::vector > > & - %{ is.list($arg) && all(sapply($arg , is.character)) %} -%typemap("rtype") std::vector > >, std::vector > > *, std::vector > > & "list" -%typemap("scoercein") std::vector< std::vector > >, std::vector > > *, std::vector > > & "$input = lapply($input, as.character);" - -// we don't want these to be given R classes as they -// have already been turned into R vectors. -%typemap(scoerceout) std::vector, - std::vector*, - std::vector&, - std::vector , - std::vector*, - std::vector , - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector&, - // vectors of vectors - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector >, - std::vector< std::vector >*, - std::vector< std::vector >&, - std::vector< std::vector > >, - std::vector< std::vector > >*, - std::vector< std::vector > >& - %{ %} - -#if defined(SWIGWORDSIZE64) -%typemap(scoerceout) std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector& - %{ %} -#else - -%typemap(scoerceout) std::vector, - std::vector*, - std::vector&, - std::vector, - std::vector*, - std::vector& - %{ %} - -#endif - -%apply std::vector< std::basic_string > { std::vector }; -%apply std::vector< std::vector< std::basic_string > > { std::vector< std::vector > }; diff --git a/win64/bin/swig/share/swig/4.1.0/r/stl.i b/win64/bin/swig/share/swig/4.1.0/r/stl.i deleted file mode 100755 index c7eb8368..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/stl.i +++ /dev/null @@ -1,9 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/r/swigmove.i b/win64/bin/swig/share/swig/4.1.0/r/swigmove.i deleted file mode 100755 index 03e87fa2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/r/typemaps.i b/win64/bin/swig/share/swig/4.1.0/r/typemaps.i deleted file mode 100755 index da64f2d0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/r/typemaps.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/Makefile.swig b/win64/bin/swig/share/swig/4.1.0/ruby/Makefile.swig deleted file mode 100755 index 4bd08a1d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/Makefile.swig +++ /dev/null @@ -1,42 +0,0 @@ -# File : Makefile.swig -# Makefile for a SWIG module. Use this file if you are -# producing a Ruby extension for general use or distribution. -# -# 1. Prepare extconf.rb. -# 2. Modify this file as appropriate. -# 3. Type 'make -f Makefile.swig' to generate wrapper code and Makefile. -# 4. Type 'make' to build your extension. -# 5. Type 'make install' to install your extension. -# - -MODULE = yourmodule -FEATURE = $(MODULE) -INTERFACE = $(MODULE).i -RUBY = ruby -SWIG = swig - -# for C extension -SWIGOPT = -ruby -WRAPPER = $(MODULE)_wrap.c - -## for C++ extension -#SWIGOPT = -ruby -c++ -#WRAPPER = $(MODULE)_wrap.cc - - -swigall: $(WRAPPER) Makefile - -$(WRAPPER): $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $@ $(INTERFACE) - -Makefile: extconf.rb - $(RUBY) extconf.rb - @if [ -f Makefile ] ; then\ - echo "include Makefile.swig" >> Makefile;\ - fi - -swigclean: - @if [ -f Makefile ] ; then\ - make -f Makefile clean;\ - fi - rm -f Makefile $(WRAPPER) diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/argcargv.i b/win64/bin/swig/share/swig/4.1.0/ruby/argcargv.i deleted file mode 100755 index 32b7f600..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/argcargv.i +++ /dev/null @@ -1,44 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - - Use it as follows: - - %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) } - - %inline %{ - - int mainApp(size_t argc, const char **argv) { - return argc; - } - - then from ruby: - - $args = ["asdf", "asdf2"] - mainApp(args) - - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - if (rb_obj_is_kind_of($input,rb_cArray)) { - int i; - int size = RARRAY_LEN($input); - $1 = ($1_ltype) size; - $2 = (char **) malloc((size+1)*sizeof(char *)); - VALUE *ptr = RARRAY_PTR($input); - for (i=0; i < size; i++, ptr++) { - $2[i]= StringValuePtr(*ptr); - } - $2[i]=NULL; - } else { - $1 = 0; $2 = 0; - %argument_fail(SWIG_TypeError, "int ARGC, char **ARGV", $symname, $argnum); - } -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - $1 = rb_obj_is_kind_of($input,rb_cArray); -} - -%typemap(freearg) (int ARGC, char **ARGV) { - free((char *) $2); -} diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/attribute.i b/win64/bin/swig/share/swig/4.1.0/ruby/attribute.i deleted file mode 100755 index b18f9ae8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/boost_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/ruby/boost_shared_ptr.i deleted file mode 100755 index 971a52d4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/boost_shared_ptr.i +++ /dev/null @@ -1,401 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE - %{(void)arg1; - delete reinterpret_cast< SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > * >(self);%} - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - swig_ruby_owntype newmem = {0, 0}; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - swig_ruby_owntype newmem = {0, 0}; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - swig_ruby_owntype newmem = {0, 0}; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - swig_ruby_owntype newmem = {0, 0}; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - swig_ruby_owntype newmem = {0, 0}; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - swig_ruby_owntype newmem = {0, 0}; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - swig_ruby_owntype newmem = {0, 0}; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem.own & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/carrays.i b/win64/bin/swig/share/swig/4.1.0/ruby/carrays.i deleted file mode 100755 index ae694205..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/carrays.i +++ /dev/null @@ -1,6 +0,0 @@ -%define %array_class(TYPE,NAME) - %array_class_wrap(TYPE,NAME,__getitem__,__setitem__) -%enddef - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/cdata.i b/win64/bin/swig/share/swig/4.1.0/ruby/cdata.i deleted file mode 100755 index 1c6de446..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/cmalloc.i b/win64/bin/swig/share/swig/4.1.0/ruby/cmalloc.i deleted file mode 100755 index d3a1222e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/cpointer.i b/win64/bin/swig/share/swig/4.1.0/ruby/cpointer.i deleted file mode 100755 index 0e75cbcd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/cstring.i b/win64/bin/swig/share/swig/4.1.0/ruby/cstring.i deleted file mode 100755 index 033677b3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/director.swg b/win64/bin/swig/share/swig/4.1.0/ruby/director.swg deleted file mode 100755 index 44dd1aec..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/director.swg +++ /dev/null @@ -1,311 +0,0 @@ -/* ----------------------------------------------------------------------------- - * director.swg - * - * This file contains support for director classes so that Ruby proxy - * methods can be called from C++. - * ----------------------------------------------------------------------------- */ - -/* - Use -DSWIG_DIRECTOR_NOUEH if you prefer to avoid the use of the - Undefined Exception Handler provided by swig. -*/ -#ifndef SWIG_DIRECTOR_NOUEH -#ifndef SWIG_DIRECTOR_UEH -#define SWIG_DIRECTOR_UEH -#endif -#endif - -#include -#include -#include -#include - -# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) - -namespace Swig { - - /* memory handler */ - struct GCItem { - virtual ~GCItem() { - } - - virtual swig_ruby_owntype get_own() const { - swig_ruby_owntype own = {0, 0}; - return own; - } - }; - - struct GCItem_var { - GCItem_var(GCItem *item = 0) : _item(item) { - } - - GCItem_var& operator=(GCItem *item) { - GCItem *tmp = _item; - _item = item; - delete tmp; - return *this; - } - - ~GCItem_var() { - delete _item; - } - - GCItem *operator->() const { - return _item; - } - - private: - GCItem *_item; - }; - - - template - struct GCItem_T : GCItem { - GCItem_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCItem_T() { - delete _ptr; - } - - private: - Type *_ptr; - }; - - struct GCItem_Object : GCItem { - GCItem_Object(swig_ruby_owntype own) : _own(own) { - } - - virtual ~GCItem_Object() { - } - - swig_ruby_owntype get_own() const { - return _own; - } - - private: - swig_ruby_owntype _own; - }; - - template - struct GCArray_T : GCItem { - GCArray_T(Type *ptr) : _ptr(ptr) { - } - - virtual ~GCArray_T() { - delete[] _ptr; - } - - private: - Type *_ptr; - }; - - - /* body args */ - struct body_args { - VALUE recv; - ID id; - int argc; - VALUE *argv; - }; - - /* Base class for director exceptions */ - class DirectorException : public std::exception { - protected: - VALUE swig_error; - std::string swig_msg; - protected: - DirectorException(VALUE error) : swig_error(error) { - } - - DirectorException(VALUE error, const char *hdr, const char *msg ="") : swig_error(error), swig_msg(hdr) { - if (msg[0]) { - swig_msg += " "; - swig_msg += msg; - } - if (swig_msg.size()) { - VALUE str = rb_str_new(swig_msg.data(), swig_msg.size()); - swig_error = rb_exc_new3(error, str); - } else { - swig_error = error; - } - } - - public: - virtual ~DirectorException() throw() { - } - - VALUE getType() const { - return CLASS_OF(swig_error); - } - - VALUE getError() const { - return swig_error; - } - - /* Deprecated, use what() instead */ - const std::string& getMessage() const { - return swig_msg; - } - - const char *what() const throw() { - return swig_msg.c_str(); - } - }; - - /* Type mismatch in the return value from a Ruby method call */ - class DirectorTypeMismatchException : public DirectorException { - public: - DirectorTypeMismatchException(VALUE error, const char *msg="") - : DirectorException(error, "SWIG director type mismatch", msg) { - } - - DirectorTypeMismatchException(const char *msg="") - : DirectorException(rb_eTypeError, "SWIG director type mismatch", msg) { - } - - static void raise(VALUE error, const char *msg) { - throw DirectorTypeMismatchException(error, msg); - } - - static void raise(const char *msg) { - throw DirectorTypeMismatchException(msg); - } - }; - - /* Any Ruby exception that occurs during a director method call */ - class DirectorMethodException : public DirectorException { - public: - DirectorMethodException(VALUE error) - : DirectorException(error) { - } - - DirectorMethodException(const char *msg = "") - : DirectorException(rb_eRuntimeError, "SWIG director method error.", msg) { - } - - static void raise(VALUE error) { - throw DirectorMethodException(error); - } - }; - - /* Attempted to call a pure virtual method via a director method */ - class DirectorPureVirtualException : public DirectorException - { - public: - DirectorPureVirtualException(const char *msg = "") - : DirectorException(rb_eRuntimeError, "SWIG director pure virtual method called", msg) { - } - - static void raise(const char *msg) { - throw DirectorPureVirtualException(msg); - } - }; - - /* Simple thread abstraction for pthreads on win32 */ -#ifdef __THREAD__ -# define __PTHREAD__ -# if defined(_WIN32) || defined(__WIN32__) -# define pthread_mutex_lock EnterCriticalSection -# define pthread_mutex_unlock LeaveCriticalSection -# define pthread_mutex_t CRITICAL_SECTION -# define SWIG_MUTEX_INIT(var) var -# else -# include -# define SWIG_MUTEX_INIT(var) var = PTHREAD_MUTEX_INITIALIZER -# endif -#endif - -#ifdef __PTHREAD__ - struct Guard { - pthread_mutex_t *_mutex; - - Guard(pthread_mutex_t &mutex) : _mutex(&mutex) { - pthread_mutex_lock(_mutex); - } - - ~Guard() { - pthread_mutex_unlock(_mutex); - } - }; -# define SWIG_GUARD(mutex) Guard _guard(mutex) -#else -# define SWIG_GUARD(mutex) -#endif - - /* director base class */ - class Director { - private: - /* pointer to the wrapped Ruby object */ - VALUE swig_self; - /* flag indicating whether the object is owned by Ruby or c++ */ - mutable bool swig_disown_flag; - - public: - /* wrap a Ruby object. */ - Director(VALUE self) : swig_self(self), swig_disown_flag(false) { - } - - /* discard our reference at destruction */ - virtual ~Director() { - } - - /* return a pointer to the wrapped Ruby object */ - VALUE swig_get_self() const { - return swig_self; - } - - /* acquire ownership of the wrapped Ruby object (the sense of "disown" is from Ruby) */ - void swig_disown() const { - if (!swig_disown_flag) { - swig_disown_flag = true; - } - } - - /* ownership management */ - private: - typedef std::map swig_ownership_map; - mutable swig_ownership_map swig_owner; -#ifdef __PTHREAD__ - static pthread_mutex_t swig_mutex_own; -#endif - - public: - template - void swig_acquire_ownership_array(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCArray_T(vptr); - } - } - - template - void swig_acquire_ownership(Type *vptr) const { - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_T(vptr); - } - } - - void swig_acquire_ownership_obj(void *vptr, swig_ruby_owntype own) const { - if (vptr && own.datafree) { - SWIG_GUARD(swig_mutex_own); - swig_owner[vptr] = new GCItem_Object(own); - } - } - - swig_ruby_owntype swig_release_ownership(void *vptr) const { - swig_ruby_owntype own = {0, 0}; - if (vptr) { - SWIG_GUARD(swig_mutex_own); - swig_ownership_map::iterator iter = swig_owner.find(vptr); - if (iter != swig_owner.end()) { - own.datafree = iter->second->get_own().datafree; - swig_owner.erase(iter); - } - } - return own; - } - }; -} - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/embed.i b/win64/bin/swig/share/swig/4.1.0/ruby/embed.i deleted file mode 100755 index 3c599aa6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/embed.i +++ /dev/null @@ -1,16 +0,0 @@ -%wrapper %{ - -#include - -int -main(argc, argv) - int argc; - char **argv; -{ - ruby_init(); - ruby_options(argc, argv); - ruby_run(); - return 0; -} - -%} diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/exception.i b/win64/bin/swig/share/swig/4.1.0/ruby/exception.i deleted file mode 100755 index 6b07bb10..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/exception.i +++ /dev/null @@ -1,5 +0,0 @@ -%include - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg);)) -} diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/extconf.rb b/win64/bin/swig/share/swig/4.1.0/ruby/extconf.rb deleted file mode 100755 index b51d2f34..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/extconf.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'mkmf' - -dir_config('yourlib') - -if have_header('yourlib.h') and have_library('yourlib', 'yourlib_init') - # If you use swig -c option, you may have to link libswigrb. - # have_library('swigrb') - create_makefile('yourlib') -end diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/extra-install.list b/win64/bin/swig/share/swig/4.1.0/ruby/extra-install.list deleted file mode 100755 index 24a1995f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/extra-install.list +++ /dev/null @@ -1,3 +0,0 @@ -# see top-level Makefile.in -Makefile.swig -extconf.rb diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/factory.i b/win64/bin/swig/share/swig/4.1.0/ruby/factory.i deleted file mode 100755 index 377f0080..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/file.i b/win64/bin/swig/share/swig/4.1.0/ruby/file.i deleted file mode 100755 index 0cd20728..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/file.i +++ /dev/null @@ -1,39 +0,0 @@ -// FILE * -%{ -#ifdef __cplusplus -extern "C" { -#endif - -/* Ruby 1.9 changed the file name of this header */ -#ifdef HAVE_RUBY_IO_H -#include "ruby/io.h" -#else -#include "rubyio.h" -#endif - -#ifdef __cplusplus -} -#endif -%} - -%typemap(in) FILE *READ { - OpenFile *of; - GetOpenFile($input, of); - rb_io_check_readable(of); - $1 = GetReadFile(of); - rb_read_check($1); -} - -%typemap(in) FILE *READ_NOCHECK { - OpenFile *of; - GetOpenFile($input, of); - rb_io_check_readable(of); - $1 = GetReadFile(of); -} - -%typemap(in) FILE *WRITE { - OpenFile *of; - GetOpenFile($input, of); - rb_io_check_writable(of); - $1 = GetWriteFile(of); -} diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/progargcargv.i b/win64/bin/swig/share/swig/4.1.0/ruby/progargcargv.i deleted file mode 100755 index 119853f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/progargcargv.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -int PROG_ARGC -char **PROG_ARGV - - Some C function receive argc and argv from C main function. - This typemap provides ignore typemap which pass Ruby ARGV contents - as argc and argv to C function. -*/ - - - -// argc and argv -%typemap(in,numinputs=0) int PROG_ARGC { - $1 = RARRAY_LEN(rb_argv) + 1; -} - -%typemap(in,numinputs=0) char **PROG_ARGV { - int i, n; - VALUE ary = rb_eval_string("[$0] + ARGV"); - n = RARRAY_LEN(ary); - $1 = (char **)malloc(n + 1); - for (i = 0; i < n; i++) { - VALUE v = rb_obj_as_string(RARRAY_PTR(ary)[i]); - $1[i] = (char *)malloc(RSTRING_LEN(v) + 1); - strcpy($1[i], RSTRING_PTR(v)); - } -} - -%typemap(freearg) char **PROG_ARGV { - int i, n = RARRAY_LEN(rb_argv) + 1; - for (i = 0; i < n; i++) free($1[i]); - free($1); -} - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/ruby.swg b/win64/bin/swig/share/swig/4.1.0/ruby/ruby.swg deleted file mode 100755 index 36b40850..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/ruby.swg +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------------------------ - * ruby.swg - * - * Ruby configuration module. - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * The Ruby auto rename rules - * ------------------------------------------------------------ */ -#if defined(SWIG_RUBY_AUTORENAME) -/* Class names are CamelCase */ -%rename("%(camelcase)s", %$isclass) ""; - -/* Constants created by %constant or #define are UPPER_CASE */ -%rename("%(uppercase)s", %$isconstant) ""; - -/* SWIG only considers static class members with inline initializers - to be constants. For examples of what is and isn't considered - a constant by SWIG see naming.i in the Ruby test suite. */ -%rename("%(uppercase)s", %$ismember, %$isvariable,%$isimmutable,%$isstatic,%$hasvalue,%$hasconsttype) ""; - -/* Enums are mapped to constants but all we do is make sure the - first letter is uppercase */ -%rename("%(firstuppercase)s", %$isenumitem) ""; - -/* Method names should be lower_case_with_underscores */ -%rename("%(undercase)s", %$isfunction, %$not %$ismemberget, %$not %$ismemberset) ""; -#endif - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Ruby keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Documentation for common Ruby methods - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Ruby initialization function - * ------------------------------------------------------------ */ -%include - - - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyapi.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyapi.swg deleted file mode 100755 index d5b5bb0c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyapi.swg +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Ruby API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -SWIGINTERN VALUE -SWIG_Ruby_AppendOutput(VALUE target, VALUE o) { - if (NIL_P(target)) { - target = o; - } else { - if (TYPE(target) != T_ARRAY) { - VALUE o2 = target; - target = rb_ary_new(); - rb_ary_push(target, o2); - } - rb_ary_push(target, o); - } - return target; -} - -/* For ruby1.8.4 and earlier. */ -#ifndef RUBY_INIT_STACK - RUBY_EXTERN void Init_stack(VALUE* addr); -# define RUBY_INIT_STACK \ - VALUE variable_in_this_stack_frame; \ - Init_stack(&variable_in_this_stack_frame); -#endif - - -#ifdef __cplusplus -} -#endif - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyautodoc.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyautodoc.swg deleted file mode 100755 index 0c0ff6a1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyautodoc.swg +++ /dev/null @@ -1,105 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyautodoc.swg - * - * This file implements autodoc typemaps for some common ruby methods. - * ----------------------------------------------------------------------------- */ - -%define AUTODOC(func, str) - %feature("autodoc", str) func; -%enddef - - -AUTODOC(to_i, "Convert $class to an Integer"); -AUTODOC(to_f, "Convert $class to a Float"); -AUTODOC(coerce, "Coerce class to a number"); -AUTODOC(to_a, "Convert $class to an Array"); -AUTODOC(to_s, "Convert class to a String representation"); -AUTODOC(inspect, "Inspect class and its contents"); - -AUTODOC(at, "Return element at a certain index"); -AUTODOC(__getitem__, "Element accessor/slicing"); -AUTODOC(__setitem__, "Element setter/slicing"); -AUTODOC(slice, "Return a slice (portion of) the $class"); - -AUTODOC(push, "Add an element at the end of the $class"); -AUTODOC(pop, "Remove and return element at the end of the $class"); -AUTODOC(shift, "Remove and return element at the beginning of the $class"); -AUTODOC(unshift, "Add one or more elements at the beginning of the $class"); -AUTODOC(first, "Return the first element in $class"); -AUTODOC(last, "Return the last element in $class"); - - -// -// Common Object methods -// -AUTODOC(hash, "Hashing function for class"); -AUTODOC(dup, "Create a duplicate of the class and unfreeze it if needed"); -AUTODOC(clone, "Create a duplicate of the class"); - -// -// Container methods -// -AUTODOC(empty, "Check if $class is empty"); -AUTODOC(size, "Size or Length of the $class"); -AUTODOC(insert, "Insert one or more new elements in the $class"); - -// -// Iterator methods (block) -// -AUTODOC(each, "Iterate thru each element in the $class. A block must be provided"); -AUTODOC(find, "Find an element in the class"); -AUTODOC(each_key, "Iterate thru each key element in the $class. A block must be provided"); -AUTODOC(each_value, "Iterate thru each key element in the $class. A block must be provided"); -AUTODOC(reject, "Iterate thru each element in the $class and reject those that fail a condition returning a new $class. A block must be provided"); -AUTODOC(reject_bang, "Iterate thru each element in the $class and reject those that fail a condition. A block must be provided. $class is modified in place"); -AUTODOC(select, "Iterate thru each element in the $class and select those that match a condition. A block must be provided"); -AUTODOC(delete_at, "Delete an element at a certain index"); -AUTODOC(__delete__, "Delete a matching element"); - - -// -// Hash methods -// -AUTODOC(keys, "Return an Array of key elements"); -AUTODOC(values, "Return an Array of value elements"); -AUTODOC(values_at, "Return an Array of value elements matching the conditions"); - - -// -// Operators -// -#ifdef __cplusplus -AUTODOC(operator==, "Equality comparison operator"); -AUTODOC(operator<=, "Lower or equal comparison operator"); -AUTODOC(operator>=, "Higher or equal comparison operator"); -AUTODOC(operator<, "Lower than comparison operator"); -AUTODOC(operator>, "Higher than comparison operator"); -AUTODOC(operator<<, "Left shifting or appending operator"); -AUTODOC(operator>>, "Right shifting operator or extracting operator"); -AUTODOC(operator+, "Add operator"); -AUTODOC(operator-, "Subtraction operator"); -AUTODOC(operator+(), "Positive operator"); -AUTODOC(operator-(), "Negation operator"); -AUTODOC(operator&, "AND operator"); -AUTODOC(operator|, "OR operator"); -AUTODOC(operator^, "XOR operator"); -AUTODOC(operator~, "Invert operator"); -#endif -AUTODOC(__eq__, "Equality comparison operator"); -AUTODOC(__le__, "Lower or equal comparison operator"); -AUTODOC(__ge__, "Higher or equal comparison operator"); -AUTODOC(__lt__, "Lower than comparison operator"); -AUTODOC(__gt__, "Higher than comparison operator"); -AUTODOC(__lshift__, "Left shifting or appending operator"); -AUTODOC(__rshift__, "Right shifting operator or extracting operator"); -AUTODOC(__add___, "Add operator"); -AUTODOC(__sub__, "Subtraction operator"); -AUTODOC(__pos__, "Positive operator"); -AUTODOC(__neg__, "Negation operator"); -AUTODOC(__and__, "AND operator"); -AUTODOC(__or__, "OR operator"); -AUTODOC(__xor__, "XOR operator"); -AUTODOC(__negate__, "Invert operator"); -AUTODOC(__pow__, "Exponential operator"); -AUTODOC(__divmod__, "Modulo of division"); -AUTODOC(__cmp__, "Comparison operator. Returns < 0 for less than, 0 for equal or > 1 for higher than."); diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyclasses.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyclasses.swg deleted file mode 100755 index 493d9bbc..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyclasses.swg +++ /dev/null @@ -1,404 +0,0 @@ -#ifdef __cplusplus - -/* - GC_VALUE is used as a replacement of Ruby's VALUE. - GC_VALUE automatically handles registering and unregistering - of the underlying Ruby object with the GC. - - It can be used if you want to create STL containers of VALUEs, such as: - - std::vector< GC_VALUE >; - - or as a member variable: - - struct A { - GC_VALUE _obj; - A(VALUE o) : _obj(o) { - } - }; - - or as a input/output value (not much use for this, as VALUE works just as - well here, thou): - - GC_VALUE func(GC_VALUE obj) { - GC_VALUE out = rb_obj_classname(obj); - return out; - } - - - GC_VALUE is 'visible' at the wrapped side, so you can do: - - %template(RubyVector) std::vector; - - and all the proper typemaps will be used. - -*/ - -%fragment("GC_VALUE_definition","header") { -namespace swig { - class SwigGCReferences { - VALUE _hash; - - SwigGCReferences() : _hash(Qnil) { - } - ~SwigGCReferences() { - if (_hash != Qnil) - rb_gc_unregister_address(&_hash); - } - static void EndProcHandler(VALUE) { - // Ruby interpreter ending - _hash can no longer be accessed. - SwigGCReferences &s_references = instance(); - s_references._hash = Qnil; - } - public: - static SwigGCReferences& instance() { - // Hash of all GC_VALUE's currently in use - static SwigGCReferences s_references; - - return s_references; - } - static void initialize() { - SwigGCReferences &s_references = instance(); - if (s_references._hash == Qnil) { - rb_set_end_proc(&EndProcHandler, Qnil); - s_references._hash = rb_hash_new(); - rb_gc_register_address(&s_references._hash); - } - } - void GC_register(VALUE& obj) { - if (FIXNUM_P(obj) || SPECIAL_CONST_P(obj) || SYMBOL_P(obj)) - return; - if (_hash != Qnil) { - VALUE val = rb_hash_aref(_hash, obj); - unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 0; - ++n; - rb_hash_aset(_hash, obj, INT2NUM(n)); - } - } - void GC_unregister(const VALUE& obj) { - if (FIXNUM_P(obj) || SPECIAL_CONST_P(obj) || SYMBOL_P(obj)) - return; - // this test should not be needed but I've noticed some very erratic - // behavior of none being unregistered in some very rare situations. - if (BUILTIN_TYPE(obj) == T_NONE) - return; - if (_hash != Qnil) { - VALUE val = rb_hash_aref(_hash, obj); - unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 1; - --n; - if (n) - rb_hash_aset(_hash, obj, INT2NUM(n)); - else - rb_hash_delete(_hash, obj); - } - } - }; - - class GC_VALUE { - protected: - VALUE _obj; - - static ID hash_id; - static ID lt_id; - static ID gt_id; - static ID eq_id; - static ID le_id; - static ID ge_id; - - static ID pos_id; - static ID neg_id; - static ID inv_id; - - static ID add_id; - static ID sub_id; - static ID mul_id; - static ID div_id; - static ID mod_id; - - static ID and_id; - static ID or_id; - static ID xor_id; - - static ID lshift_id; - static ID rshift_id; - - struct OpArgs - { - VALUE src; - ID id; - int nargs; - VALUE target; - }; - - - public: - GC_VALUE() : _obj(Qnil) - { - } - - GC_VALUE(const GC_VALUE& item) : _obj(item._obj) - { - SwigGCReferences::instance().GC_register(_obj); - } - - GC_VALUE(VALUE obj) :_obj(obj) - { - SwigGCReferences::instance().GC_register(_obj); - } - - ~GC_VALUE() - { - SwigGCReferences::instance().GC_unregister(_obj); - } - - GC_VALUE & operator=(const GC_VALUE& item) - { - SwigGCReferences::instance().GC_unregister(_obj); - _obj = item._obj; - SwigGCReferences::instance().GC_register(_obj); - return *this; - } - - operator VALUE() const - { - return _obj; - } - - VALUE inspect() const - { - return rb_inspect(_obj); - } - - VALUE to_s() const - { - return rb_inspect(_obj); - } - - static VALUE swig_rescue_swallow(VALUE, VALUE) - { - /* - VALUE errstr = rb_obj_as_string(rb_errinfo()); - printf("Swallowing error: '%s'\n", RSTRING_PTR(StringValue(errstr))); - */ - return Qnil; /* Swallow Ruby exception */ - } - - static VALUE swig_rescue_funcall(VALUE p) - { - OpArgs* args = (OpArgs*) p; - return rb_funcall(args->src, args->id, args->nargs, args->target); - } - - bool relational_equal_op(const GC_VALUE& other, const ID& op_id, bool (*op_func)(const VALUE& a, const VALUE& b)) const - { - if (FIXNUM_P(_obj) && FIXNUM_P(other._obj)) { - return op_func(_obj, other._obj); - } - bool res = false; - VALUE ret = Qnil; - SWIG_RUBY_THREAD_BEGIN_BLOCK; - if (rb_respond_to(_obj, op_id)) { - OpArgs args; - args.src = _obj; - args.id = op_id; - args.nargs = 1; - args.target = VALUE(other); - ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args), - (VALUEFUNC(swig_rescue_swallow)), Qnil); - } - if (ret == Qnil) { - VALUE a = rb_funcall2( _obj, hash_id, 0, 0 ); - VALUE b = rb_funcall2( VALUE(other), hash_id, 0, 0 ); - res = op_func(a, b); - } else { - res = RTEST(ret); - } - SWIG_RUBY_THREAD_END_BLOCK; - return res; - } - - static bool operator_eq(const VALUE& a, const VALUE& b) { return a == b; } - static bool operator_lt(const VALUE& a, const VALUE& b) { return a < b; } - static bool operator_le(const VALUE& a, const VALUE& b) { return a <= b; } - static bool operator_gt(const VALUE& a, const VALUE& b) { return a > b; } - static bool operator_ge(const VALUE& a, const VALUE& b) { return a >= b; } - - bool operator==(const GC_VALUE& other) const { return relational_equal_op(other, eq_id, operator_eq); } - bool operator<(const GC_VALUE& other) const { return relational_equal_op(other, lt_id, operator_lt); } - bool operator<=(const GC_VALUE& other) const { return relational_equal_op(other, le_id, operator_le); } - bool operator>(const GC_VALUE& other) const { return relational_equal_op(other, gt_id, operator_gt); } - bool operator>=(const GC_VALUE& other) const { return relational_equal_op(other, ge_id, operator_ge); } - - bool operator!=(const GC_VALUE& other) const - { - return !(this->operator==(other)); - } - - GC_VALUE unary_op(const ID& op_id) const - { - VALUE ret = Qnil; - SWIG_RUBY_THREAD_BEGIN_BLOCK; - OpArgs args; - args.src = _obj; - args.id = op_id; - args.nargs = 0; - args.target = Qnil; - ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args), - (VALUEFUNC(swig_rescue_swallow)), Qnil); - SWIG_RUBY_THREAD_END_BLOCK; - return ret; - } - - GC_VALUE operator+() const { return unary_op(pos_id); } - GC_VALUE operator-() const { return unary_op(neg_id); } - GC_VALUE operator~() const { return unary_op(inv_id); } - - GC_VALUE binary_op(const GC_VALUE& other, const ID& op_id) const - { - VALUE ret = Qnil; - SWIG_RUBY_THREAD_BEGIN_BLOCK; - OpArgs args; - args.src = _obj; - args.id = op_id; - args.nargs = 1; - args.target = VALUE(other); - ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args), - (VALUEFUNC(swig_rescue_swallow)), Qnil); - SWIG_RUBY_THREAD_END_BLOCK; - return GC_VALUE(ret); - } - - GC_VALUE operator+(const GC_VALUE& other) const { return binary_op(other, add_id); } - GC_VALUE operator-(const GC_VALUE& other) const { return binary_op(other, sub_id); } - GC_VALUE operator*(const GC_VALUE& other) const { return binary_op(other, mul_id); } - GC_VALUE operator/(const GC_VALUE& other) const { return binary_op(other, div_id); } - GC_VALUE operator%(const GC_VALUE& other) const { return binary_op(other, mod_id); } - GC_VALUE operator&(const GC_VALUE& other) const { return binary_op(other, and_id); } - GC_VALUE operator^(const GC_VALUE& other) const { return binary_op(other, xor_id); } - GC_VALUE operator|(const GC_VALUE& other) const { return binary_op(other, or_id); } - GC_VALUE operator<<(const GC_VALUE& other) const { return binary_op(other, lshift_id); } - GC_VALUE operator>>(const GC_VALUE& other) const { return binary_op(other, rshift_id); } - }; - - ID GC_VALUE::hash_id = rb_intern("hash"); - ID GC_VALUE::lt_id = rb_intern("<"); - ID GC_VALUE::gt_id = rb_intern(">"); - ID GC_VALUE::eq_id = rb_intern("=="); - ID GC_VALUE::le_id = rb_intern("<="); - ID GC_VALUE::ge_id = rb_intern(">="); - - ID GC_VALUE::pos_id = rb_intern("+@"); - ID GC_VALUE::neg_id = rb_intern("-@"); - ID GC_VALUE::inv_id = rb_intern("~"); - - ID GC_VALUE::add_id = rb_intern("+"); - ID GC_VALUE::sub_id = rb_intern("-"); - ID GC_VALUE::mul_id = rb_intern("*"); - ID GC_VALUE::div_id = rb_intern("/"); - ID GC_VALUE::mod_id = rb_intern("%"); - - ID GC_VALUE::and_id = rb_intern("&"); - ID GC_VALUE::or_id = rb_intern("|"); - ID GC_VALUE::xor_id = rb_intern("^"); - - ID GC_VALUE::lshift_id = rb_intern("<<"); - ID GC_VALUE::rshift_id = rb_intern(">>"); - - typedef GC_VALUE LANGUAGE_OBJ; - -} // namespace swig - -} // %fragment(GC_VALUE_definition) - - - -namespace swig { - - %apply VALUE {GC_VALUE}; - - // Make sure this is the last typecheck done - %typecheck(999999,fragment="GC_VALUE_definition",noblock=1) GC_VALUE, GC_VALUE&, - const GC_VALUE& { $1 = 1; }; - - /* For input */ - %typemap(in,fragment="GC_VALUE_definition",noblock=1) GC_VALUE* (GC_VALUE r), GC_VALUE& (GC_VALUE r) { - r = $input; $1 = &r; - } - - /* For output */ - %typemap(out,fragment="GC_VALUE_definition",noblock=1) GC_VALUE { - $result = (VALUE)$1; - } - - %typemap(out,fragment="GC_VALUE_definition",noblock=1) GC_VALUE*, GC_VALUE const & { - $result = (VALUE)*$1; - } - - %nodirector GC_VALUE; - - // We ignore the constructor so that user can never create a GC_VALUE - // manually - %ignore GC_VALUE::GC_VALUE; - - struct GC_VALUE { - VALUE inspect() const; - VALUE to_s() const; - GC_VALUE(); - protected: - GC_VALUE(const GC_VALUE&); - ~GC_VALUE(); - }; - - %exception GC_VALUE {}; - - - %ignore LANGUAGE_OBJ; - typedef GC_VALUE LANGUAGE_OBJ; -} - - -%init { - swig::SwigGCReferences::initialize(); -} - - - -// -// Fragment that contains traits to properly deal with GC_VALUE. -// These functions may be invoked as a need of the from(), asval(), -// asptr() and as() template functors, usually used in %typemaps. -// -%fragment(SWIG_Traits_frag(swig::GC_VALUE),"header",fragment="StdTraits",fragment="GC_VALUE_definition") { -namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "GC_VALUE"; } - }; - - template <> struct traits_from { - typedef GC_VALUE value_type; - static VALUE from(const value_type& val) { - return static_cast(val); - } - }; - - template <> - struct traits_check { - static bool check(GC_VALUE) { - return true; - } - }; - - template <> struct traits_asval { - typedef GC_VALUE value_type; - static int asval(VALUE obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; - } - }; -} // swig -} // %fragment(traits for swig::GC_VALUE) - - -#endif // __cplusplus - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubycomplex.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubycomplex.swg deleted file mode 100755 index b79504cc..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubycomplex.swg +++ /dev/null @@ -1,148 +0,0 @@ -/* - Defines the As/From conversors for double/float complex, you need to - provide complex Type, the Name you want to use in the converters, - the complex Constructor method, and the Real and Imag complex - accessor methods. - - See the std_complex.i and ccomplex.i for concrete examples. -*/ - -%fragment("rb_complex_new","header") -{ -%#if !defined(T_COMPLEX) -/* Ruby versions prior to 1.9 did not have native complex numbers. They were an extension in the STD library. */ -SWIGINTERN VALUE rb_complex_new(VALUE x, VALUE y) { - static ID new_id = rb_intern("new"); - static VALUE cComplex = rb_const_get(rb_cObject, rb_intern("Complex")); - return rb_funcall(cComplex, new_id, 2, x, y); -} -%#endif -} - -%fragment("SWIG_Complex_Numbers","header") -{ -%#if !defined(T_COMPLEX) -SWIGINTERN int SWIG_Is_Complex( VALUE obj ) { - static ID real_id = rb_intern("real"); - static ID imag_id = rb_intern("imag"); - return ( (rb_respond_to( obj, real_id ) ) && - (rb_respond_to( obj, imag_id ) ) ); -} -%#else -SWIGINTERN int SWIG_Is_Complex( VALUE obj ) { - return TYPE(obj) == T_COMPLEX; -} -%#endif - -SWIGINTERN VALUE SWIG_Complex_Real(VALUE obj) { - static ID real_id = rb_intern("real"); - return rb_funcall2(obj, real_id, 0, 0); -} - -SWIGINTERN VALUE SWIG_Complex_Imaginary(VALUE obj) { - static ID imag_id = rb_intern("imag"); - return rb_funcall2(obj, imag_id, 0, 0); -} -} - -%init { -%#if !defined(T_COMPLEX) - rb_require("complex"); -%#endif -} - -/* the common from converter */ -%define %swig_fromcplx_conv(Type, Real, Imag) -%fragment(SWIG_From_frag(Type),"header",fragment="rb_complex_new") -{ -SWIGINTERNINLINE VALUE -SWIG_From(Type)(%ifcplusplus(const Type&, Type) c) -{ - VALUE re = rb_float_new(Real(c)); - VALUE im = rb_float_new(Imag(c)); - return rb_complex_new(re, im); -} -} -%enddef - -/* the double case */ -%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(double), - fragment="SWIG_Complex_Numbers") -{ -SWIGINTERN int -SWIG_AsVal(Type) (VALUE o, Type* val) -{ - if ( SWIG_Is_Complex( o ) ) { - if (val) { - VALUE real = SWIG_Complex_Real(o); - VALUE imag = SWIG_Complex_Imaginary(o); - double re = 0; - SWIG_AsVal_double( real, &re ); - double im = 0; - SWIG_AsVal_double( imag, &im ); - *val = Constructor(re, im); - } - return SWIG_OK; - } else { - double d; - int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(d, 0.0); - return res; - } - } - return SWIG_TypeError; -} -} -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -/* the float case */ -%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) -%fragment(SWIG_AsVal_frag(Type),"header", - fragment=SWIG_AsVal_frag(float), - fragment=SWIG_AsVal_frag(double), - fragment="SWIG_Complex_Numbers") { -SWIGINTERN int -SWIG_AsVal(Type)(VALUE o, Type *val) -{ - if ( SWIG_Is_Complex( o ) ) { - VALUE real = SWIG_Complex_Real(o); - VALUE imag = SWIG_Complex_Imaginary(o); - double re = 0; - SWIG_AsVal_double( real, &re ); - double im = 0; - SWIG_AsVal_double( imag, &im ); - if ((-FLT_MAX <= re && re <= FLT_MAX) && - (-FLT_MAX <= im && im <= FLT_MAX)) { - if (val) *val = Constructor(%numeric_cast(re, float), - %numeric_cast(im, float)); - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - float re; - int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); - if (SWIG_IsOK(res)) { - if (val) *val = Constructor(re, 0.0f); - return res; - } - } - return SWIG_TypeError; -} -} - -%swig_fromcplx_conv(Type, Real, Imag); -%enddef - -#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ -%swig_cplxflt_conv(Type, Constructor, Real, Imag) - - -#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ -%swig_cplxdbl_conv(Type, Constructor, Real, Imag) - - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubycontainer.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubycontainer.swg deleted file mode 100755 index f75b059e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubycontainer.swg +++ /dev/null @@ -1,1114 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubycontainer.swg - * - * Ruby sequence <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Ruby, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - -%include - -/**** The RubySequence C++ Wrap ***/ - -%fragment(""); - -%include - - -%fragment("RubySequence_Base","header") -{ -%#include - - -namespace swig { - template < class T > - struct yield - { - bool - operator()( const T& v ) const - { - return RTEST( rb_yield( swig::from< T >(v) ) ); - } - }; - - - inline size_t - check_index(ptrdiff_t i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; - } - - throw std::out_of_range("index out of range"); - } - - inline size_t - slice_index(ptrdiff_t i, size_t size) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) { - return (size_t) (i + size); - } else { - throw std::out_of_range("index out of range"); - } - } else { - return ( (size_t) i < size ) ? ((size_t) i) : size; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline void - resize(Sequence *seq, typename Sequence::size_type n, typename Sequence::value_type x) { - seq->resize(n, x); - } - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, (i == size && j == size)); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (jj > ii) { - typename Sequence::const_iterator vb = self->begin(); - typename Sequence::const_iterator ve = self->begin(); - std::advance(vb,ii); - std::advance(ve,jj); - return new Sequence(vb, ve); - } else { - return new Sequence(); - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj < ii) jj = ii; - size_t ssize = jj - ii; - if (ssize <= v.size()) { - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); - std::advance(sb,ii); - std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); - } else { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j) { - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - if (jj > ii) { - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - } - } -} -} - -%fragment("RubySequence_Cont","header", - fragment="", - fragment="StdTraits", - fragment="RubySequence_Base", - fragment="ConstIterator_T") -{ -namespace swig -{ - - /** - * This class is a proxy class for references, used to return and set values - * of an element of a Ruby Array of stuff. - * It can be used by RubySequence_InputIterator to make it work with STL - * algorithms. - */ - template - struct RubySequence_Ref - { - RubySequence_Ref(VALUE seq, int index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - VALUE item = rb_ary_entry(_seq, _index ); - try { - return swig::as(item); - } catch (const std::invalid_argument& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", _index); - VALUE lastErr = rb_gv_get("$!"); - if ( lastErr == Qnil ) { - %type_error(swig::type_name()); - } - VALUE str = rb_str_new2(msg); - str = rb_str_cat2( str, e.what() ); - SWIG_Ruby_ExceptionType( NULL, str ); - throw; - } - } - - RubySequence_Ref& operator=(const T& v) - { - rb_ary_set(_seq, _index, swig::from< T >(v)); - return *this; - } - - private: - VALUE _seq; - int _index; - }; - - - /** - * This class is a proxy to return a pointer to a class, usually - * RubySequence_Ref. - * It can be used by RubySequence_InputIterator to make it work with STL - * algorithms. - */ - template - struct RubySequence_ArrowProxy - { - RubySequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - - /** - * Input Iterator. This adapator class is a random access iterator that - * allows you to use STL algorithms with a Ruby class (a Ruby Array by default). - */ - template > - struct RubySequence_InputIterator - { - typedef RubySequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef ptrdiff_t difference_type; - - RubySequence_InputIterator() - { - } - - RubySequence_InputIterator(VALUE seq, int index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - RubySequence_ArrowProxy - operator->() const { - return RubySequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index) && (_seq == ri._seq); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - VALUE _seq; - difference_type _index; - }; - - - /** - * This adaptor class allows you to use a Ruby Array as if it was an STL - * container, giving it begin(), end(), and iterators. - */ - template - struct RubySequence_Cont - { - typedef RubySequence_Ref reference; - typedef const RubySequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - typedef int size_type; - typedef const pointer const_pointer; - typedef RubySequence_InputIterator iterator; - typedef RubySequence_InputIterator const_iterator; - - RubySequence_Cont(VALUE seq) : _seq(0) - { - if (!rb_obj_is_kind_of(seq, rb_cArray)) { - throw std::invalid_argument("an Array is expected"); - } - _seq = seq; - } - - ~RubySequence_Cont() - { - } - - size_type size() const - { - return RARRAY_LEN(_seq); - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - int s = (int) size(); - for (int i = 0; i < s; ++i) { - VALUE item = rb_ary_entry(_seq, i ); - if (!swig::check(item)) - return false; - } - return true; - } - - private: - VALUE _seq; - }; - -} -} - -/** - * Macros used to typemap an STL iterator -> SWIGIterator conversion. - */ -%define %swig_sequence_iterator(Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - - %typemap(out,noblock=1,fragment="RubySequence_Cont") - const_iterator, const_reverse_iterator { - $result = SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &), - self), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN); - } - - %typemap(out,noblock=1,fragment="RubySequence_Cont") - iterator, reverse_iterator { - $result = SWIG_NewPointerObj(swig::make_nonconst_iterator(%static_cast($1,const $type &), - self), - swig::Iterator::descriptor(),SWIG_POINTER_OWN); - } - - %typemap(out,noblock=1,fragment="RubySequence_Cont") - std::pair { - $result = rb_ary_new2(2); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).first), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).second), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - } - - // std::map/multimap/set allow returning std::pair< iterator, iterator > from - // equal_range, but we cannot still modify the key, so the iterator is - // const. - %typemap(out,noblock=1,fragment="RubySequence_Cont") - std::pair { - $result = rb_ary_new2(2); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).first), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - rb_ary_push($result, SWIG_NewPointerObj(swig::make_const_iterator(%static_cast($1,const $type &).second), - swig::ConstIterator::descriptor(),SWIG_POINTER_OWN)); - } - - - %typemap(in,noblock=1,fragment="RubySequence_Cont") - const_iterator(swig::ConstIterator *iter = 0, int res), - const_reverse_iterator(swig::ConstIterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::ConstIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::ConstIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typemap(in,noblock=1,fragment="RubySequence_Cont") - iterator(swig::Iterator *iter = 0, int res), - reverse_iterator(swig::Iterator *iter = 0, int res) { - res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::Iterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::Iterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="RubySequence_Cont") - const_iterator, const_reverse_iterator { - swig::ConstIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::ConstIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="RubySequence_Cont") - iterator, reverse_iterator { - swig::ConstIterator *iter = 0; - int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::Iterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("RubySequence_Cont"); - -// %newobject iterator; -// %newobject const_iterator; -// %extend { -// swig::Iterator* iterator(VALUE* RUBY_SELF) { -// return swig::make_nonconst_iterator($self->begin(), $self->begin(), -// $self->end(), *RUBY_SELF); -// } - -// swig::ConstIterator* const_iterator(VALUE* RUBY_SELF) { -// return swig::make_const_iterator($self->begin(), $self->begin(), -// $self->end(), *RUBY_SELF); -// } -// } -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - - -/**** The Ruby container methods ****/ - - - -%define %swig_container_methods(Container...) - - %extend { - - %newobject dup; - Container* dup() - { - return new Container(*$self); - } - - } - -%enddef - - -/** - * Macro used to define common Ruby printing methods for STL container - */ -%define %swig_sequence_printing_methods(Sequence...) - - %extend { - - VALUE inspect() - { - Sequence::const_iterator i = $self->begin(); - Sequence::const_iterator e = $self->end(); - const char *type_name = swig::type_name< Sequence >(); - VALUE str = rb_str_new2(type_name); - str = rb_str_cat2( str, " [" ); - bool comma = false; - VALUE tmp; - for ( ; i != e; ++i, comma = true ) - { - if (comma) str = rb_str_cat2( str, "," ); - tmp = swig::from< Sequence::value_type >( *i ); - tmp = rb_inspect( tmp ); - str = rb_str_buf_append( str, tmp ); - } - str = rb_str_cat2( str, "]" ); - return str; - } - - VALUE to_a() - { - Sequence::const_iterator i = $self->begin(); - Sequence::const_iterator e = $self->end(); - VALUE ary = rb_ary_new2( std::distance( i, e ) ); - VALUE tmp; - for ( ; i != e; ++i ) - { - tmp = swig::from< Sequence::value_type >( *i ); - rb_ary_push( ary, tmp ); - } - return ary; - } - - VALUE to_s() - { - Sequence::iterator i = $self->begin(); - Sequence::iterator e = $self->end(); - VALUE str = rb_str_new2( "" ); - VALUE tmp; - for ( ; i != e; ++i ) - { - tmp = swig::from< Sequence::value_type >( *i ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - } - return str; - } -} -%enddef - - -/** - * Macro used to add common methods to all STL sequence-type containers - */ -%define %swig_sequence_methods_non_resizable_common(Sequence...) - %swig_container_methods(%arg(Sequence)) - %swig_sequence_iterator(%arg(Sequence)) - %swig_sequence_printing_methods(%arg(Sequence)) - - %fragment("RubySequence_Base"); - - %extend { - - VALUE slice( difference_type i, difference_type length ) throw (std::invalid_argument) { - if ( length < 0 ) - return Qnil; - std::size_t len = $self->size(); - if ( i < 0 ) { - if ( i + static_cast(len) < 0 ) - return Qnil; - else - i = len + i; - } - Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) - j = len; - - VALUE r = Qnil; - try { - r = swig::from< const Sequence* >( swig::getslice(self, i, j) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - - Sequence* each() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE r; - Sequence::const_iterator i = self->begin(); - Sequence::const_iterator e = self->end(); - for ( ; i != e; ++i ) - { - r = swig::from< Sequence::value_type >(*i); - rb_yield(r); - } - - return self; - } - - VALUE __delete2__(const value_type& i) { - VALUE r = Qnil; - return r; - } - - } -%enddef - -%define %swig_sequence_methods_resizable_common(Sequence...) - %extend { - - %newobject select; - Sequence* select() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - Sequence* r = new Sequence(); - Sequence::const_iterator i = $self->begin(); - Sequence::const_iterator e = $self->end(); - for ( ; i != e; ++i ) - { - VALUE v = swig::from< Sequence::value_type >(*i); - if ( RTEST( rb_yield(v) ) ) - $self->insert( r->end(), *i); - } - - return r; - } - - VALUE delete_at(difference_type i) { - VALUE r = Qnil; - try { - Sequence::iterator at = swig::getpos(self, i); - r = swig::from< Sequence::value_type >( *(at) ); - $self->erase(at); - } - catch (const std::out_of_range&) { - } - return r; - } - } -%enddef - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_methods_non_resizable_common(%arg(Sequence)) - %swig_sequence_methods_resizable_common(%arg(Sequence)) -%enddef - -/** - * Macro used to add functions for back insertion of values in - * STL sequence containers - */ -%define %swig_sequence_back_inserters( Sequence... ) - %extend { - - VALUE pop() { - if ($self->empty()) return Qnil; - Sequence::value_type x = self->back(); - $self->pop_back(); - return swig::from< Sequence::value_type >( x ); - } - - %alias push "<<"; - const value_type push( const value_type& e ) { - $self->push_back( e ); - return e; - } - - %newobject reject; - Sequence* reject() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - Sequence* r = new Sequence(); - std::remove_copy_if( $self->begin(), $self->end(), - std::back_inserter(*r), - swig::yield< Sequence::value_type >() ); - return r; - } - - } -%enddef - -%define %swig_sequence_methods_extra(Sequence...) - %extend { - %alias reject_bang "delete_if"; - Sequence* reject_bang() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - $self->erase( std::remove_if( $self->begin(), $self->end(), - swig::yield< Sequence::value_type >() ), $self->end() ); - return $self; - } - } -%enddef - -%define %swig_sequence_methods_non_resizable_accessors(Sequence...) - %extend { - - VALUE at(difference_type i) const { - VALUE r = Qnil; - try { - r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - VALUE __getitem__(difference_type i, difference_type length) const throw (std::invalid_argument) { - if ( length < 0 ) - return Qnil; - std::size_t len = $self->size(); - if ( i < 0 ) { - if ( i + static_cast(len) < 0 ) - return Qnil; - else - i = len + i; - } - Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) - j = len; - - VALUE r = Qnil; - try { - r = swig::from< const Sequence* >( swig::getslice(self, i, j) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - VALUE __getitem__(difference_type i) const { - VALUE r = Qnil; - try { - r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) ); - } - catch( const std::out_of_range& ) { - } - return r; - } - - VALUE __getitem__(VALUE i) const throw (std::invalid_argument) { - if ( rb_obj_is_kind_of( i, rb_cRange ) == Qfalse ) { - rb_raise( rb_eTypeError, "not a valid index or range" ); - } - - static ID id_end = rb_intern("end"); - static ID id_start = rb_intern("begin"); - static ID id_noend = rb_intern("exclude_end?"); - - VALUE start = rb_funcall2( i, id_start, 0, 0 ); - VALUE end = rb_funcall2( i, id_end, 0, 0 ); - bool noend = ( rb_funcall2( i, id_noend, 0, 0 ) == Qtrue ); - - int len = $self->size(); - - int s = NUM2INT( start ); - if ( s < 0 ) { - s = len + s; - if ( s < 0 ) - return Qnil; - } else if ( s > len ) - return Qnil; - - int e = NUM2INT( end ); - if ( e < 0 ) e = len + e; - if ( noend ) e -= 1; - if ( e < 0 ) e = -1; - if ( e >= len ) e = len - 1; - if ( s == len ) e = len - 1; - - return swig::from< Sequence* >( swig::getslice(self, s, e+1) ); - } - - VALUE __setitem__(difference_type i, const value_type& x) throw (std::invalid_argument, std::out_of_range) - { - if ( i >= static_cast( $self->size()) ) - swig::resize( $self, i+1, x ); - else - *(swig::getpos($self, i)) = x; - - return swig::from< Sequence::value_type >( x ); - } - - VALUE __setitem__(difference_type i, difference_type length, const Sequence& v) throw (std::invalid_argument) { - - if ( length < 0 ) - return Qnil; - std::size_t len = $self->size(); - if ( i < 0 ) { - if ( i + static_cast(len) < 0 ) - return Qnil; - else - i = len + i; - } - Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) { - swig::resize( $self, j, *(v.begin()) ); - } - - VALUE r = Qnil; - swig::setslice($self, i, j, v); - r = swig::from< const Sequence* >( &v ); - return r; - } - } -%enddef - -/** - * Macro used to add functions for non resizable sequences - */ -%define %swig_sequence_methods_non_resizable(Sequence...) - %swig_sequence_methods_non_resizable_common(%arg(Sequence)) - %swig_sequence_methods_non_resizable_accessors(%arg(Sequence)) -%enddef - - -/** - * Macro used to add functions for sequences - */ -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_non_resizable_common(%arg(Sequence)) - %swig_sequence_methods_resizable_common(%arg(Sequence)) - %swig_sequence_methods_non_resizable_accessors(%arg(Sequence)) - %swig_sequence_methods_extra(%arg(Sequence)); - %swig_sequence_back_inserters(%arg(Sequence)); -%enddef - -%define %swig_sequence_methods_non_resizable_val(Sequence...) - %swig_sequence_methods_non_resizable(%arg(Sequence)) -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods(%arg(Sequence)) -%enddef - - -/** - * Macro used to add functions for front insertion of - * elements in STL sequence containers that support it. - */ -%define %swig_sequence_front_inserters( Sequence... ) -%extend { - - VALUE shift() - { - if ($self->empty()) return Qnil; - Sequence::value_type x = self->front(); - $self->erase( $self->begin() ); - return swig::from< Sequence::value_type >( x ); - } - - %typemap(in) (int argc, VALUE* argv) { - $1 = argc - 1; - $2 = argv + 1; - } - - Sequence* insert( difference_type pos, int argc, VALUE* argv, ... ) - { - std::size_t len = $self->size(); - std::size_t i = swig::check_index( pos, len, true ); - Sequence::iterator start; - - VALUE elem = argv[0]; - int idx = 0; - try { - Sequence::value_type val = swig::as( elem ); - if ( i >= len ) { - $self->resize(i-1, val); - return $self; - } - start = $self->begin(); - std::advance( start, i ); - $self->insert( start++, val ); - - for ( ++idx; idx < argc; ++idx ) - { - elem = argv[idx]; - val = swig::as( elem ); - $self->insert( start++, val ); - } - - } - catch(const std::invalid_argument &) - { - rb_raise( rb_eArgError, "%s", - Ruby_Format_TypeError( "", - swig::type_name(), - __FUNCTION__, idx+2, elem )); - } - - - return $self; - } - - %typemap(in) (int argc, VALUE* argv) { - $1 = argc; - $2 = argv; - } - - Sequence* unshift( int argc, VALUE* argv, ... ) - { - for ( int idx = argc-1; idx >= 0; --idx ) - { - Sequence::iterator start = $self->begin(); - VALUE elem = argv[idx]; - try { - Sequence::value_type val = swig::as( elem ); - $self->insert( start, val ); - } - catch(const std::invalid_argument &) - { - rb_raise( rb_eArgError, "%s", - Ruby_Format_TypeError( "", - swig::type_name(), - __FUNCTION__, idx+2, elem )); - } - } - - return $self; - } -} -%enddef - - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="RubySequence_Cont", - fragment="GC_VALUE_definition") -{ -namespace swig { - template - inline void - assign(const RubySeq& rubyseq, Seq* seq) { - // seq->assign(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(VALUE obj, sequence **seq) { - if (rb_obj_is_kind_of(obj, rb_cArray) == Qtrue) { - try { - RubySequence_Cont rubyseq(obj); - if (seq) { - sequence *pseq = new sequence(); - assign(rubyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return rubyseq.check() ? SWIG_OK : SWIG_ERROR; - } - } catch (const std::exception& e) { - if (seq) { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - rb_raise(rb_eTypeError, "%s", e.what()); - } - } - return SWIG_ERROR; - } - } else { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } - }; - - // Partial specialization for GC_VALUE's. No need to typecheck each - // element. - template< class Seq > - struct traits_asptr_stdseq< Seq, swig::GC_VALUE > { - typedef Seq sequence; - typedef swig::GC_VALUE value_type; - - static int asptr(VALUE obj, sequence **seq) { - if (rb_obj_is_kind_of(obj, rb_cArray) == Qtrue) { - try { - if (seq) { - RubySequence_Cont rubyseq(obj); - sequence *pseq = new sequence(); - assign(rubyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; - } else { - return true; - } - } catch (const std::exception& e) { - if (seq) { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - rb_raise(rb_eTypeError, "%s", e.what()); - } - } - return SWIG_ERROR; - } - } else { - sequence *p; - swig_type_info *descriptor = swig::type_info(); - if (descriptor && SWIG_IsOK(SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { - if (seq) *seq = p; - return SWIG_OLDOBJ; - } - } - return SWIG_ERROR; - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static VALUE from(const sequence& seq) { -#ifdef SWIG_RUBY_EXTRA_NATIVE_CONTAINERS - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); - } -#endif - size_type size = seq.size(); - if (size <= (size_type)INT_MAX) { - VALUE obj = rb_ary_new2((int)size); - int i = 0; - for (const_iterator it = seq.begin(); - it != seq.end(); ++it, ++i) { - rb_ary_push(obj, swig::from< value_type >(*it)); - } - rb_obj_freeze(obj); // treat as immutable result - return obj; - } else { - rb_raise(rb_eRangeError,"sequence size not valid in ruby"); - return Qnil; - } - } - }; -} -} - - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubycontainer_extended.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubycontainer_extended.swg deleted file mode 100755 index 31040a2d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubycontainer_extended.swg +++ /dev/null @@ -1,134 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubycontainer_extended.swg - * - * This file contains additional functions that make containers - * behave closer to ruby primitive types. - * However, some of these functions place some restrictions on - * the underlying object inside of the container and the iterator - * (that it has to have an == comparison function, that it has to have - * an = assignment operator, etc). - * ----------------------------------------------------------------------------- */ - -/** - * Macro used to add extend functions that require operator== in object. - * - * @param Container STL container - * @param Type class inside container - * - */ -%define %swig_container_with_equal_operator( Container, Type ) - - VALUE __delete__( const Type& val ) { - VALUE r = Qnil; - Container::iterator e = $self->end(); - Container::iterator i = std::remove( $self->begin(), e, val ); - // remove dangling elements now - $self->erase( i, e ); - - if ( i != e ) - r = swig::from< Type >( val ); - else if ( rb_block_given_p() ) - r = rb_yield(Qnil); - return r; - } - -%enddef // end of %swig_container_with_equal_operator - - - - -/** - * Macro used to add extend functions that require the assignment - * operator (ie. = ) of contained class - * - * @param Container STL container - * @param Type class inside container - * - */ - -%define %swig_container_with_assignment( Container, Type ) - - - // - // map! -- the equivalent of std::transform - // - Container< Type >* map_bang() { - - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "No block given" ); - - VALUE r = Qnil; - Container< Type >::iterator i = $self->begin(); - Container< Type >::iterator e = $self->end(); - - try { - for ( ; i != e; ++i ) - { - r = swig::from< Type >( *i ); - r = rb_yield( r ); - *i = swig::as< Type >( r ); - } - } - catch (const std::invalid_argument&) - { - rb_raise(rb_eTypeError, - "Yield block did not return a valid element for " "Container"); - } - - return $self; - } - - -%enddef // end of %swig_container_with_assignment - - - - - -/** - * Macro used to add all extended functions to a container - * - * @param Container STL container - * @param Type class inside container - * - */ -%define %swig_container_extend( Container, Type ) - -%extend Container< Type > { - - %swig_container_with_assignment( %arg(Container), Type ); - %swig_container_with_equal_operator( %arg(Container), Type ); - -} - -%enddef - - -/** - * Private macro used to add all extended functions to C/C++ - * primitive types - * - * @param Container an STL container, like std::vector (with no class template) - * - */ -%define %__swig_container_extend_primtypes( Container ) - -%swig_container_extend( %arg( Container ), bool ); -%swig_container_extend( %arg( Container ), char ); -%swig_container_extend( %arg( Container ), short ); -%swig_container_extend( %arg( Container ), int ); -%swig_container_extend( %arg( Container ), unsigned short ); -%swig_container_extend( %arg( Container ), unsigned int ); -%swig_container_extend( %arg( Container ), float ); -%swig_container_extend( %arg( Container ), double ); -%swig_container_extend( %arg( Container ), std::complex ); -%swig_container_extend( %arg( Container ), std::string ); -%swig_container_extend( %arg( Container ), swig::GC_VALUE ); - -%enddef - - -%__swig_container_extend_primtypes( std::vector ); -%__swig_container_extend_primtypes( std::deque ); -%__swig_container_extend_primtypes( std::list ); - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubydef.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubydef.swg deleted file mode 100755 index b173494c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubydef.swg +++ /dev/null @@ -1 +0,0 @@ -/* empty file added for backward comp. */ diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyerrors.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyerrors.swg deleted file mode 100755 index cf321246..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyerrors.swg +++ /dev/null @@ -1,154 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - - -/* Define some additional error types */ -#define SWIG_ObjectPreviouslyDeletedError -100 - - -/* Define custom exceptions for errors that do not map to existing Ruby - exceptions. Note this only works for C++ since a global cannot be - initialized by a function in C. For C, fallback to rb_eRuntimeError.*/ - -SWIGINTERN VALUE -getNullReferenceError(void) { - static int init = 0; - static VALUE rb_eNullReferenceError ; - if (!init) { - init = 1; - rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError); - } - return rb_eNullReferenceError; -} - -SWIGINTERN VALUE -getObjectPreviouslyDeletedError(void) { - static int init = 0; - static VALUE rb_eObjectPreviouslyDeleted ; - if (!init) { - init = 1; - rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError); - } - return rb_eObjectPreviouslyDeleted; -} - - -SWIGINTERN VALUE -SWIG_Ruby_ErrorType(int SWIG_code) { - VALUE type; - switch (SWIG_code) { - case SWIG_MemoryError: - type = rb_eNoMemError; - break; - case SWIG_IOError: - type = rb_eIOError; - break; - case SWIG_RuntimeError: - type = rb_eRuntimeError; - break; - case SWIG_IndexError: - type = rb_eIndexError; - break; - case SWIG_TypeError: - type = rb_eTypeError; - break; - case SWIG_DivisionByZero: - type = rb_eZeroDivError; - break; - case SWIG_OverflowError: - type = rb_eRangeError; - break; - case SWIG_SyntaxError: - type = rb_eSyntaxError; - break; - case SWIG_ValueError: - type = rb_eArgError; - break; - case SWIG_SystemError: - type = rb_eFatal; - break; - case SWIG_AttributeError: - type = rb_eRuntimeError; - break; - case SWIG_NullReferenceError: - type = getNullReferenceError(); - break; - case SWIG_ObjectPreviouslyDeletedError: - type = getObjectPreviouslyDeletedError(); - break; - case SWIG_UnknownError: - type = rb_eRuntimeError; - break; - default: - type = rb_eRuntimeError; - } - return type; -} - - -/* This function is called when a user inputs a wrong argument to - a method. - */ -SWIGINTERN -const char* Ruby_Format_TypeError( const char* msg, - const char* type, - const char* name, - const int argn, - VALUE input ) -{ - char buf[128]; - VALUE str; - VALUE asStr; - if ( msg && *msg ) - { - str = rb_str_new2(msg); - } - else - { - str = rb_str_new(NULL, 0); - } - - str = rb_str_cat2( str, "Expected argument " ); - sprintf( buf, "%d of type ", argn-1 ); - str = rb_str_cat2( str, buf ); - str = rb_str_cat2( str, type ); - str = rb_str_cat2( str, ", but got " ); - str = rb_str_cat2( str, rb_obj_classname(input) ); - str = rb_str_cat2( str, " " ); - asStr = rb_inspect(input); - if ( RSTRING_LEN(asStr) > 30 ) - { - str = rb_str_cat( str, StringValuePtr(asStr), 30 ); - str = rb_str_cat2( str, "..." ); - } - else - { - str = rb_str_append( str, asStr ); - } - - if ( name ) - { - str = rb_str_cat2( str, "\n\tin SWIG method '" ); - str = rb_str_cat2( str, name ); - str = rb_str_cat2( str, "'" ); - } - - return StringValuePtr( str ); -} - -/* This function is called when an overloaded method fails */ -SWIGINTERN -void Ruby_Format_OverloadedError( - const int argc, - const int maxargs, - const char* method, - const char* prototypes - ) -{ - const char* msg = "Wrong # of arguments"; - if ( argc <= maxargs ) msg = "Wrong arguments"; - rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n" - "Possible C/C++ prototypes are:\n%s", - msg, method, prototypes); -} diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyfragments.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyfragments.swg deleted file mode 100755 index f8d9751e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyfragments.swg +++ /dev/null @@ -1,23 +0,0 @@ -/* - - Create a file with this name, 'rubyfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the ones defined by default by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal(int)(VALUE obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - - -*/ diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyhead.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyhead.swg deleted file mode 100755 index d75d4f41..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyhead.swg +++ /dev/null @@ -1,185 +0,0 @@ -#if __GNUC__ >= 7 -#pragma GCC diagnostic push -#if defined(__cplusplus) -#pragma GCC diagnostic ignored "-Wregister" -#if __GNUC__ >= 10 -#pragma GCC diagnostic ignored "-Wvolatile" -#if __GNUC__ >= 11 -#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" -#endif -#endif -#endif -#endif - -#include - -#if __GNUC__ >= 7 -#pragma GCC diagnostic pop -#endif - -/* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which - * breaks using rb_intern as an lvalue, as SWIG does. We work around this - * issue for now by disabling this. - * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645 - */ -#ifdef rb_intern -# undef rb_intern -#endif - -/* Remove global macros defined in Ruby's win32.h */ -#ifdef write -# undef write -#endif -#ifdef read -# undef read -#endif -#ifdef bind -# undef bind -#endif -#ifdef close -# undef close -#endif -#ifdef connect -# undef connect -#endif - - -/* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */ -#ifndef NUM2LL -#define NUM2LL(x) NUM2LONG((x)) -#endif -#ifndef LL2NUM -#define LL2NUM(x) INT2NUM((long) (x)) -#endif -#ifndef ULL2NUM -#define ULL2NUM(x) UINT2NUM((unsigned long) (x)) -#endif - -/* Ruby 1.7 doesn't (yet) define NUM2ULL() */ -#ifndef NUM2ULL -#ifdef HAVE_LONG_LONG -#define NUM2ULL(x) rb_num2ull((x)) -#else -#define NUM2ULL(x) NUM2ULONG(x) -#endif -#endif - -/* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */ -/* Define these for older versions so we can just write code the new way */ -#ifndef RSTRING_LEN -# define RSTRING_LEN(x) RSTRING(x)->len -#endif -#ifndef RSTRING_PTR -# define RSTRING_PTR(x) RSTRING(x)->ptr -#endif -#ifndef RSTRING_END -# define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x)) -#endif -#ifndef RARRAY_LEN -# define RARRAY_LEN(x) RARRAY(x)->len -#endif -#ifndef RARRAY_PTR -# define RARRAY_PTR(x) RARRAY(x)->ptr -#endif -#ifndef RFLOAT_VALUE -# define RFLOAT_VALUE(x) RFLOAT(x)->value -#endif -#ifndef DOUBLE2NUM -# define DOUBLE2NUM(x) rb_float_new(x) -#endif -#ifndef RHASH_TBL -# define RHASH_TBL(x) (RHASH(x)->tbl) -#endif -#ifndef RHASH_ITER_LEV -# define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev) -#endif -#ifndef RHASH_IFNONE -# define RHASH_IFNONE(x) (RHASH(x)->ifnone) -#endif -#ifndef RHASH_SIZE -# define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries) -#endif -#ifndef RHASH_EMPTY_P -# define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0) -#endif -#ifndef RSTRUCT_LEN -# define RSTRUCT_LEN(x) RSTRUCT(x)->len -#endif -#ifndef RSTRUCT_PTR -# define RSTRUCT_PTR(x) RSTRUCT(x)->ptr -#endif -#ifndef RTYPEDDATA_P -# define RTYPEDDATA_P(x) (TYPE(x) != T_DATA) -#endif - - - -/* - * The following macros are used for providing the correct type of a - * function pointer to the Ruby C API. - * Starting with Ruby 2.7 (corresponding to RB_METHOD_DEFINITION_DECL being - * defined) these macros act transparently due to Ruby's moving away from - * ANYARGS and instead employing strict function signatures. - * - * Note: In case of C (not C++) the macros are transparent even before - * Ruby 2.7 due to the fact that the Ruby C API used function declarators - * with empty parentheses, which allows for an unspecified number of - * arguments. - * - * PROTECTFUNC(f) is used for the function pointer argument of the Ruby - * C API function rb_protect(). - * - * VALUEFUNC(f) is used for the function pointer argument(s) of Ruby C API - * functions like rb_define_method() and rb_define_singleton_method(). - * - * VOIDFUNC(f) is used to typecast a C function that implements either - * the "mark" or "free" stuff for a Ruby Data object, so that it can be - * passed as an argument to Ruby C API functions like Data_Wrap_Struct() - * and Data_Make_Struct(). - * - * SWIG_RUBY_VOID_ANYARGS_FUNC(f) is used for the function pointer - * argument(s) of Ruby C API functions like rb_define_virtual_variable(). - * - * SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer - * argument(s) of Ruby C API functions like st_foreach(). - */ -#if defined(__cplusplus) && !defined(RB_METHOD_DEFINITION_DECL) -# define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f) -# define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f) -# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f) -# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) ((void (*)(ANYARGS))(f)) -# define SWIG_RUBY_INT_ANYARGS_FUNC(f) ((int (*)(ANYARGS))(f)) -#else -# define PROTECTFUNC(f) (f) -# define VALUEFUNC(f) (f) -# define VOIDFUNC(f) (f) -# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f) -# define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f) -#endif - -/* Don't use for expressions have side effect */ -#ifndef RB_STRING_VALUE -#define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s))) -#endif -#ifndef StringValue -#define StringValue(s) RB_STRING_VALUE(s) -#endif -#ifndef StringValuePtr -#define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s)) -#endif -#ifndef StringValueLen -#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s)) -#endif -#ifndef SafeStringValue -#define SafeStringValue(v) do {\ - StringValue(v);\ - rb_check_safe_str(v);\ -} while (0) -#endif - -#ifndef HAVE_RB_DEFINE_ALLOC_FUNC -#define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1) -#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new") -#endif - -static VALUE _mSWIG = Qnil; diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyinit.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyinit.swg deleted file mode 100755 index 00b72042..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyinit.swg +++ /dev/null @@ -1 +0,0 @@ -%insert(initbeforefunc) "swiginit.swg" diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyiterators.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyiterators.swg deleted file mode 100755 index 38fd8a44..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyiterators.swg +++ /dev/null @@ -1,932 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyiterators.swg - * - * Implement a C++ 'output' iterator for Ruby. - * - * Users can derive form the Iterator to implement their - * own iterators. As an example (real one since we use it for STL/STD - * containers), the template Iterator_T does the - * implementation for generic C++ iterators. - * ----------------------------------------------------------------------------- */ - -%include - - -%fragment("ConstIterator","header",fragment="",fragment="GC_VALUE_definition") { -namespace swig { - struct stop_iteration { - }; - - /** - * Abstract base class used to represent all iterators of STL containers. - */ - struct ConstIterator { - public: - typedef ConstIterator self_type; - - protected: - GC_VALUE _seq; - - protected: - ConstIterator(VALUE seq) : _seq(seq) - { - } - - // Random access iterator methods, but not required in Ruby - virtual ptrdiff_t distance(const ConstIterator &x) const - { - throw std::invalid_argument("distance not supported"); - } - - virtual bool equal (const ConstIterator &x) const - { - throw std::invalid_argument("equal not supported"); - } - - virtual self_type* advance(ptrdiff_t n) - { - throw std::invalid_argument("advance not supported"); - } - - public: - virtual ~ConstIterator() {} - - // Access iterator method, required by Ruby - virtual VALUE value() const { - throw std::invalid_argument("value not supported"); - return Qnil; - }; - - virtual VALUE setValue( const VALUE& v ) { - throw std::invalid_argument("value= not supported"); - return Qnil; - } - - virtual self_type* next( size_t n = 1 ) - { - return this->advance( n ); - } - - virtual self_type* previous( size_t n = 1 ) - { - ptrdiff_t nn = n; - return this->advance( -nn ); - } - - virtual VALUE to_s() const { - throw std::invalid_argument("to_s not supported"); - return Qnil; - } - - virtual VALUE inspect() const { - throw std::invalid_argument("inspect not supported"); - return Qnil; - } - - virtual ConstIterator *dup() const - { - throw std::invalid_argument("dup not supported"); - return NULL; - } - - // - // C++ common/needed methods. We emulate a bidirectional - // operator, to be compatible with all the STL. - // The iterator traits will then tell the STL what type of - // iterator we really are. - // - ConstIterator() : _seq( Qnil ) - { - } - - ConstIterator( const self_type& b ) : _seq( b._seq ) - { - } - - self_type& operator=( const self_type& b ) - { - _seq = b._seq; - return *this; - } - - bool operator == (const ConstIterator& x) const - { - return equal(x); - } - - bool operator != (const ConstIterator& x) const - { - return ! operator==(x); - } - - // Pre-decrement operator - self_type& operator--() - { - return *previous(); - } - - // Pre-increment operator - self_type& operator++() - { - return *next(); - } - - // Post-decrement operator - self_type operator--(int) - { - self_type r = *this; - previous(); - return r; - } - - // Post-increment operator - self_type operator++(int) - { - self_type r = *this; - next(); - return r; - } - - ConstIterator& operator += (ptrdiff_t n) - { - return *advance(n); - } - - ConstIterator& operator -= (ptrdiff_t n) - { - return *advance(-n); - } - - ConstIterator* operator + (ptrdiff_t n) const - { - return dup()->advance(n); - } - - ConstIterator* operator - (ptrdiff_t n) const - { - return dup()->advance(-n); - } - - ptrdiff_t operator - (const ConstIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::ConstIterator *"); - init = 1; - } - return desc; - } - }; - - - /** - * Abstract base class used to represent all non-const iterators of STL containers. - * - */ - struct Iterator : public ConstIterator { - public: - typedef Iterator self_type; - - protected: - Iterator(VALUE seq) : ConstIterator(seq) - { - } - - virtual self_type* advance(ptrdiff_t n) - { - throw std::invalid_argument("operation not supported"); - } - - public: - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::Iterator *"); - init = 1; - } - return desc; - } - - virtual Iterator *dup() const - { - throw std::invalid_argument("dup not supported"); - return NULL; - } - - virtual self_type* next( size_t n = 1 ) - { - return this->advance( n ); - } - - virtual self_type* previous( size_t n = 1 ) - { - ptrdiff_t nn = n; - return this->advance( -nn ); - } - - bool operator == (const ConstIterator& x) const - { - return equal(x); - } - - bool operator != (const Iterator& x) const - { - return ! operator==(x); - } - - Iterator& operator += (ptrdiff_t n) - { - return *advance(n); - } - - Iterator& operator -= (ptrdiff_t n) - { - return *advance(-n); - } - - Iterator* operator + (ptrdiff_t n) const - { - return dup()->advance(n); - } - - Iterator* operator - (ptrdiff_t n) const - { - return dup()->advance(-n); - } - - ptrdiff_t operator - (const Iterator& x) const - { - return x.distance(*this); - } - }; - -} -} - - -%fragment("ConstIterator_T","header",fragment="",fragment="ConstIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - - /** - * Templated base classes for all custom const_iterators. - * - */ - template - class ConstIterator_T : public ConstIterator - { - public: - typedef OutConstIterator const_iter; - typedef typename std::iterator_traits::value_type value_type; - typedef ConstIterator_T self_type; - - protected: - - - virtual bool equal (const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual ptrdiff_t distance(const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual ConstIterator* advance(ptrdiff_t n) - { - std::advance( current, n ); - return this; - } - - public: - ConstIterator_T() : ConstIterator(Qnil) - { - } - - ConstIterator_T(const_iter curr, VALUE seq = Qnil) - : ConstIterator(seq), current(curr) - { - } - - const const_iter& get_current() const - { - return current; - } - - const value_type& operator*() const - { - return *current; - } - - virtual VALUE inspect() const - { - VALUE ret = rb_str_new2("#<"); - ret = rb_str_cat2( ret, rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::const_iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_inspect(cur) ); - ret = rb_str_cat2( ret, ">" ); - return ret; - } - - virtual VALUE to_s() const - { - VALUE ret = rb_str_new2( rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::const_iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_obj_as_string(cur) ); - return ret; - } - - protected: - const_iter current; - }; - - - /** - * Templated base classes for all custom non-const iterators. - * - */ - template - class Iterator_T : public Iterator - { - public: - typedef InOutIterator nonconst_iter; - - // Make this class iterator STL compatible, by using iterator_traits - typedef typename std::iterator_traits::iterator_category iterator_category; - typedef typename std::iterator_traits::value_type value_type; - typedef typename std::iterator_traits::difference_type difference_type; - typedef typename std::iterator_traits::pointer pointer; - typedef typename std::iterator_traits::reference reference; - - typedef Iterator base; - typedef Iterator_T< nonconst_iter > self_type; - - protected: - - virtual bool equal (const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual ptrdiff_t distance(const ConstIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( current, n ); - return this; - } - - public: - - Iterator_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator(seq), current(curr) - { - } - - const nonconst_iter& get_current() const - { - return current; - } - - self_type& operator=( const self_type& b ) - { - base::operator=( b ); - return *this; - } - - self_type& operator=( const value_type& b ) - { - *current = b; - return *this; - } - - const value_type& operator*() const - { - return *current; - } - - value_type& operator*() - { - return *current; - } - - virtual VALUE inspect() const - { - VALUE ret = rb_str_new2("#<"); - ret = rb_str_cat2( ret, rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_inspect(cur) ); - ret = rb_str_cat2( ret, ">" ); - return ret; - } - - virtual VALUE to_s() const - { - VALUE ret = rb_str_new2( rb_obj_classname(_seq) ); - ret = rb_str_cat2( ret, "::iterator " ); - VALUE cur = value(); - ret = rb_str_concat( ret, rb_obj_as_string(cur) ); - return ret; - } - - protected: - nonconst_iter current; - }; - - - /** - * Auxiliary functor to store the value of a ruby object inside - * a reference of a compatible C++ type. ie: Ruby -> C++ - * - */ - template - struct asval_oper - { - typedef ValueType value_type; - typedef bool result_type; - bool operator()(VALUE obj, value_type& v) const - { - return ( swig::asval< value_type >(obj, &v) == SWIG_OK ); - } - }; - - /** - * Auxiliary functor to return a ruby object from a C++ type. - * ie: C++ -> Ruby - * - */ - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef VALUE result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - - /** - * ConstIterator class for a const_iterator with no end() boundaries. - * - */ - template::value_type, - typename FromOper = from_oper > - class ConstIteratorOpen_T : public ConstIterator_T - { - public: - FromOper from; - typedef OutConstIterator const_iter; - typedef ValueType value_type; - typedef ConstIterator_T base; - typedef ConstIteratorOpen_T self_type; - - ConstIteratorOpen_T(const_iter curr, VALUE seq = Qnil) - : ConstIterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - ConstIterator *dup() const - { - return new self_type(*this); - } - }; - - /** - * Iterator class for an iterator with no end() boundaries. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class IteratorOpen_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef IteratorOpen_T self_type; - - public: - IteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - virtual VALUE setValue( const VALUE& v ) - { - value_type& dst = *base::current; - if ( asval(v, dst) ) return v; - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - }; - - /** - * ConstIterator class for a const_iterator where begin() and end() boundaries are known. - * - */ - template::value_type, - typename FromOper = from_oper > - class ConstIteratorClosed_T : public ConstIterator_T - { - public: - FromOper from; - typedef OutConstIterator const_iter; - typedef ValueType value_type; - typedef ConstIterator_T base; - typedef ConstIteratorClosed_T self_type; - - protected: - virtual ConstIterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - ConstIteratorClosed_T(const_iter curr, const_iter first, - const_iter last, VALUE seq = Qnil) - : ConstIterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - ConstIterator *dup() const - { - return new self_type(*this); - } - - - private: - const_iter begin; - const_iter end; - }; - - /** - * Iterator class for a iterator where begin() and end() boundaries are known. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class IteratorClosed_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef IteratorClosed_T self_type; - - protected: - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - IteratorClosed_T(nonconst_iter curr, nonconst_iter first, - nonconst_iter last, VALUE seq = Qnil) - : Iterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - // Iterator setter method, required by Ruby - virtual VALUE setValue( const VALUE& v ) - { - if (base::current == end) - throw stop_iteration(); - - value_type& dst = *base::current; - if ( asval( v, dst ) ) return v; - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - - private: - nonconst_iter begin; - nonconst_iter end; - }; - - /* Partial specialization for bools which don't allow de-referencing */ - template< typename InOutIterator, typename FromOper, typename AsvalOper > - class IteratorOpen_T< InOutIterator, bool, FromOper, AsvalOper > : - public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef bool value_type; - typedef Iterator_T base; - typedef IteratorOpen_T self_type; - - IteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - virtual VALUE setValue( const VALUE& v ) - { - bool tmp = *base::current; - if ( asval( v, tmp ) ) - { - *base::current = tmp; - return v; - } - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - - }; - - /* Partial specialization for bools which don't allow de-referencing */ - template< typename InOutIterator, typename FromOper, typename AsvalOper > - class IteratorClosed_T< InOutIterator, bool, FromOper, AsvalOper > : - public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef bool value_type; - typedef Iterator_T base; - typedef IteratorClosed_T self_type; - - protected: - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - IteratorClosed_T(nonconst_iter curr, nonconst_iter first, - nonconst_iter last, VALUE seq = Qnil) - : Iterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - virtual VALUE setValue( const VALUE& v ) - { - if (base::current == end) - throw stop_iteration(); - - bool tmp = *base::current; - if ( asval( v, tmp ) ) - { - *base::current = tmp; - return v; - } - return Qnil; - } - - Iterator *dup() const - { - return new self_type(*this); - } - - private: - nonconst_iter begin; - nonconst_iter end; - }; - - - /** - * Helper function used to wrap a bounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline Iterator* - make_nonconst_iterator(const InOutIter& current, const InOutIter& begin, - const InOutIter& end, VALUE seq = Qnil) - { - return new IteratorClosed_T(current, begin, end, seq); - } - - /** - * Helper function used to wrap an unbounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline Iterator* - make_nonconst_iterator(const InOutIter& current, VALUE seq = Qnil) - { - return new IteratorOpen_T(current, seq); - } - - /** - * Helper function used to wrap a bounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline ConstIterator* - make_const_iterator(const OutIter& current, const OutIter& begin, - const OutIter& end, VALUE seq = Qnil) - { - return new ConstIteratorClosed_T(current, begin, end, seq); - } - - /** - * Helper function used to wrap an unbounded const_iterator. This is to be used in - * a %typemap(out), for example. - * - */ - template - inline ConstIterator* - make_const_iterator(const OutIter& current, VALUE seq = Qnil) - { - return new ConstIteratorOpen_T(current, seq); - } -} -} - - -%fragment("ConstIterator"); - - -// -// This part is just so SWIG is aware of the base abstract iterator class. -// -namespace swig -{ - /* - Throw a StopIteration exception - */ - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws) stop_iteration { - (void)$1; - SWIG_Ruby_ExceptionType(NULL, Qnil); - SWIG_fail; - } - - /* - Mark methods that return new objects - */ - %newobject ConstIterator::dup; - %newobject ConstIterator::operator + (ptrdiff_t n) const; - %newobject ConstIterator::operator - (ptrdiff_t n) const; - - %nodirector ConstIterator; - - %catches(swig::stop_iteration) ConstIterator::value() const; - %catches(swig::stop_iteration) ConstIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) ConstIterator::decr(size_t n = 1); - %catches(std::invalid_argument) ConstIterator::distance(const ConstIterator &x) const; - %catches(std::invalid_argument) ConstIterator::equal (const ConstIterator &x) const; - %catches(swig::stop_iteration) ConstIterator::next(); - %catches(swig::stop_iteration) ConstIterator::previous(); - %catches(swig::stop_iteration) ConstIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) ConstIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) ConstIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) ConstIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) ConstIterator::operator - (ptrdiff_t n) const; - - - struct ConstIterator - { - protected: - ConstIterator(VALUE seq); - - public: - virtual ~ConstIterator(); - - // Access iterator method, required by Ruby - virtual VALUE value() const; - - // C++ common/needed methods - virtual ConstIterator *dup() const; - - virtual VALUE inspect() const; - virtual VALUE to_s() const; - - virtual ConstIterator* next(size_t n = 1); - virtual ConstIterator* previous(size_t n = 1); - - bool operator == (const ConstIterator& x) const; - ConstIterator* operator + (ptrdiff_t n) const; - ConstIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const ConstIterator& x) const; - }; - - struct Iterator : public ConstIterator - { - %rename("value=") setValue( const VALUE& v ); - virtual VALUE setValue( const VALUE& v ); - - virtual Iterator *dup() const; - - virtual Iterator* next(size_t n = 1); - virtual Iterator* previous(size_t n = 1); - - virtual VALUE inspect() const; - virtual VALUE to_s() const; - - bool operator == (const Iterator& x) const; - Iterator* operator + (ptrdiff_t n) const; - Iterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const Iterator& x) const; - }; - -} - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubykw.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubykw.swg deleted file mode 100755 index 61f94a0c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubykw.swg +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef RUBY_RUBYKW_SWG_ -#define RUBY_RUBYKW_SWG_ - -/* Warnings for Ruby keywords */ -#define RUBYKW(x) %keywordwarn("'" `x` "' is a ruby keyword",rename="C_%s",fullname=1) `x` - -/* - - from http://www.rubycentral.com/book/language.html - -*/ - -RUBYKW(BEGIN); -RUBYKW(END); -RUBYKW(alias); -RUBYKW(and); -RUBYKW(begin); -RUBYKW(break); -RUBYKW(case); -RUBYKW(class); -RUBYKW(def); -RUBYKW("defined"); -RUBYKW(do); -RUBYKW(else); -RUBYKW(elsif); -RUBYKW(end); -RUBYKW(ensure); -RUBYKW(false); -RUBYKW(fatal); -RUBYKW(for); -RUBYKW(if); -RUBYKW(in); -RUBYKW(module); -RUBYKW(next); -RUBYKW(nil); -RUBYKW(not); -RUBYKW(or); -RUBYKW(redo); -RUBYKW(rescue); -RUBYKW(retry); -RUBYKW(return); -RUBYKW(self); -RUBYKW(super); -RUBYKW(then); -RUBYKW(true); -RUBYKW(undef); -RUBYKW(unless); -RUBYKW(until); -RUBYKW(when); -RUBYKW(while); -RUBYKW(yield); - -// RUBYKW(FalseClass); -// RUBYKW(TrueClass); -// RUBYKW(Numeric); -// RUBYKW(Integer); -// RUBYKW(Fixnum); -// RUBYKW(Float); -// RUBYKW(Range); -// RUBYKW(Array); -// RUBYKW(String); -// RUBYKW(IO); -// RUBYKW(File); -// RUBYKW(FileUtils); -// RUBYKW(Find); -// RUBYKW(Struct); -// RUBYKW(OpenStruct); -// RUBYKW(Regexp); - -#undef RUBYKW - -#endif //RUBY_RUBYKW_SWG_ diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubymacros.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubymacros.swg deleted file mode 100755 index e7af6b6a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubymacros.swg +++ /dev/null @@ -1,13 +0,0 @@ - -// Redefine these macros so argument index for ruby is done properly, -// ignoring self and we get some more info about the input. -#define %argfail_fmt(_type,_name,_argn) Ruby_Format_TypeError( "", _type, #_name, _argn, $input ) - -#define %argnullref_fmt(_type,_name,_argn) Ruby_Format_TypeError(%nullref_fmt(), _type, #_name, _argn, $input) - -%{ -#define SWIG_RUBY_THREAD_BEGIN_BLOCK -#define SWIG_RUBY_THREAD_END_BLOCK -%} - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyopers.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyopers.swg deleted file mode 100755 index 080af14d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyopers.swg +++ /dev/null @@ -1,55 +0,0 @@ -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus - -%rename(__add__) *::operator+; -%rename(__pos__) *::operator+(); -%rename(__pos__) *::operator+() const; -%rename(__sub__) *::operator-; -%rename(__neg__) *::operator-(); -%rename(__neg__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__mod__) *::operator%; -%rename(__lshift__) *::operator<<; -%rename(__rshift__) *::operator>>; -%rename(__and__) *::operator&; -%rename(__or__) *::operator|; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__lt__) *::operator<; -%rename(__le__) *::operator<=; -%rename(__gt__) *::operator>; -%rename(__ge__) *::operator>=; -%rename(__eq__) *::operator==; - -/* Special cases */ -%rename(__call__) *::operator(); - -/* Ignored inplace operators */ -%ignoreoperator(NOTEQUAL) operator!=; -%ignoreoperator(PLUSEQ) operator+=; -%ignoreoperator(MINUSEQ) operator-=; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; - -/* Ignored operators */ -%ignoreoperator(LNOT) operator!; -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; -%ignoreoperator(EQ) operator=; -%ignoreoperator(PLUSPLUS) operator++; -%ignoreoperator(MINUSMINUS) operator--; -%ignoreoperator(ARROWSTAR) operator->*; -%ignoreoperator(INDEX) operator[]; - - -#endif /* __cplusplus */ diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyprimtypes.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyprimtypes.swg deleted file mode 100755 index 4931656e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyprimtypes.swg +++ /dev/null @@ -1,228 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyprimtypes.swg - * ----------------------------------------------------------------------------- */ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* auxiliary ruby fail method */ - -%fragment("SWIG_ruby_failed","header") -{ -SWIGINTERN VALUE -SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2)) -{ - return Qnil; -} -} - -%define %ruby_aux_method(Type, Method, Action) -SWIGINTERN VALUE SWIG_AUX_##Method##(VALUE arg) -{ - VALUE *args = (VALUE *)arg; - VALUE obj = args[0]; - VALUE type = TYPE(obj); - Type *res = (Type *)(args[1]); - *res = Action; - return obj; -} -%enddef - - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { -SWIGINTERNINLINE VALUE -SWIG_From_dec(bool)(bool value) -{ - return value ? Qtrue : Qfalse; -} -} - -%fragment(SWIG_AsVal_frag(bool),"header", - fragment=SWIG_AsVal_frag(int)) { -SWIGINTERN int -SWIG_AsVal_dec(bool)(VALUE obj, bool *val) -{ - if (obj == Qtrue) { - if (val) *val = true; - return SWIG_OK; - } else if (obj == Qfalse) { - if (val) *val = false; - return SWIG_OK; - } else { - int res = 0; - if (SWIG_AsVal(int)(obj, &res) == SWIG_OK) { - if (val) *val = res ? true : false; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header", - fragment="") { - %define_as(SWIG_From_dec(long), LONG2NUM) -} - -%fragment(SWIG_AsVal_frag(long),"header",fragment="SWIG_ruby_failed") { -%ruby_aux_method(long, NUM2LONG, type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(long)(VALUE obj, long* val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long)) { -SWIGINTERNINLINE VALUE -SWIG_From_dec(unsigned long)(unsigned long value) -{ - return ULONG2NUM(value); -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header",fragment="SWIG_ruby_failed") { -%ruby_aux_method(unsigned long, NUM2ULONG, type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(VALUE obj, unsigned long *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - unsigned long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE VALUE -SWIG_From_dec(long long)(long long value) -{ - return LL2NUM(value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_ruby_failed", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -%ruby_aux_method(long long, NUM2LL, type == T_FIXNUM ? NUM2LL(obj) : rb_big2ll(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(long long)(VALUE obj, long long *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - long long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE VALUE -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - return ULL2NUM(value); -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment="SWIG_ruby_failed", - fragment="SWIG_LongLongAvailable") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -%ruby_aux_method(long long, NUM2ULL, type == T_FIXNUM ? NUM2ULL(obj) : rb_big2ull(obj)) - -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(VALUE obj, unsigned long long *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FIXNUM) || (type == T_BIGNUM)) { - unsigned long long v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { - %define_as(SWIG_From_dec(double), rb_float_new) -} - -%fragment(SWIG_AsVal_frag(double),"header",fragment="SWIG_ruby_failed") { -%ruby_aux_method(double, NUM2DBL, NUM2DBL(obj); (void)type) - -SWIGINTERN int -SWIG_AsVal_dec(double)(VALUE obj, double *val) -{ - VALUE type = TYPE(obj); - if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) { - double v; - VALUE a[2]; - a[0] = obj; - a[1] = (VALUE)(&v); - if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2DBL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { - if (val) *val = v; - return SWIG_OK; - } - } - return SWIG_TypeError; -} -} - - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyrun.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyrun.swg deleted file mode 100755 index 982b2551..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyrun.swg +++ /dev/null @@ -1,468 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubyrun.swg - * - * This file contains the runtime support for Ruby modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 - -/* for raw pointers */ -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags) -#define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own) -#define swig_owntype swig_ruby_owntype - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code) -#define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg) -#define SWIG_fail goto fail - - -/* Ruby-specific SWIG API */ - -#define SWIG_InitRuntime() SWIG_Ruby_InitRuntime() -#define SWIG_define_class(ty) SWIG_Ruby_define_class(ty) -#define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty) -#define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value) -#define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty) - -#include "assert.h" - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - VALUE klass; - VALUE mImpl; - void (*mark)(void *); - void (*destroy)(void *); - int trackObjects; -} swig_class; - - -/* Global pointer used to keep some internal SWIG stuff */ -static VALUE _cSWIG_Pointer = Qnil; -static VALUE swig_runtime_data_type_pointer = Qnil; - -/* Global IDs used to keep some internal SWIG stuff */ -static ID swig_arity_id = 0; -static ID swig_call_id = 0; - -/* - If your swig extension is to be run within an embedded ruby and has - director callbacks, you should set -DRUBY_EMBEDDED during compilation. - This will reset ruby's stack frame on each entry point from the main - program the first time a virtual director function is invoked (in a - non-recursive way). - If this is not done, you run the risk of Ruby trashing the stack. -*/ - -#ifdef RUBY_EMBEDDED - -# define SWIG_INIT_STACK \ - if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \ - ++swig_virtual_calls; -# define SWIG_RELEASE_STACK --swig_virtual_calls; -# define Ruby_DirectorTypeMismatchException(x) \ - rb_raise( rb_eTypeError, "%s", x ); return c_result; - - static unsigned int swig_virtual_calls = 0; - -#else /* normal non-embedded extension */ - -# define SWIG_INIT_STACK -# define SWIG_RELEASE_STACK -# define Ruby_DirectorTypeMismatchException(x) \ - throw Swig::DirectorTypeMismatchException( x ); - -#endif /* RUBY_EMBEDDED */ - - -SWIGRUNTIME VALUE -getExceptionClass(void) { - static int init = 0; - static VALUE rubyExceptionClass ; - if (!init) { - init = 1; - rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception")); - } - return rubyExceptionClass; -} - -/* This code checks to see if the Ruby object being raised as part - of an exception inherits from the Ruby class Exception. If so, - the object is simply returned. If not, then a new Ruby exception - object is created and that will be returned to Ruby.*/ -SWIGRUNTIME VALUE -SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) { - VALUE exceptionClass = getExceptionClass(); - if (rb_obj_is_kind_of(obj, exceptionClass)) { - return obj; - } else { - return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj)); - } -} - -/* Initialize Ruby runtime support */ -SWIGRUNTIME void -SWIG_Ruby_InitRuntime(void) -{ - if (_mSWIG == Qnil) { - _mSWIG = rb_define_module("SWIG"); - swig_call_id = rb_intern("call"); - swig_arity_id = rb_intern("arity"); - } -} - -/* Define Ruby class for C type */ -SWIGRUNTIME void -SWIG_Ruby_define_class(swig_type_info *type) -{ - char *klass_name = (char *) malloc(4 + strlen(type->name) + 1); - sprintf(klass_name, "TYPE%s", type->name); - if (NIL_P(_cSWIG_Pointer)) { - _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject); - rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new"); - } - rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer); - free((void *) klass_name); -} - -/* Create a new pointer object */ -SWIGRUNTIME VALUE -SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags) -{ - int own = flags & SWIG_POINTER_OWN; - int track; - char *klass_name; - swig_class *sklass; - VALUE klass; - VALUE obj; - - if (!ptr) - return Qnil; - - assert(type); - if (type->clientdata) { - sklass = (swig_class *) type->clientdata; - - /* Are we tracking this class and have we already returned this Ruby object? */ - track = sklass->trackObjects; - if (track) { - obj = SWIG_RubyInstanceFor(ptr); - - /* Check the object's type and make sure it has the correct type. - It might not in cases where methods do things like - downcast methods. */ - if (obj != Qnil) { - VALUE value = rb_iv_get(obj, "@__swigtype__"); - const char* type_name = RSTRING_PTR(value); - - if (strcmp(type->name, type_name) == 0) { - return obj; - } - } - } - - /* Create a new Ruby object */ - obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), - ( own ? VOIDFUNC(sklass->destroy) : - (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 ) - ), ptr); - - /* If tracking is on for this class then track this object. */ - if (track) { - SWIG_RubyAddTracking(ptr, obj); - } - } else { - klass_name = (char *) malloc(4 + strlen(type->name) + 1); - sprintf(klass_name, "TYPE%s", type->name); - klass = rb_const_get(_mSWIG, rb_intern(klass_name)); - free((void *) klass_name); - obj = Data_Wrap_Struct(klass, 0, 0, ptr); - } - rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); - - return obj; -} - -/* Create a new class instance (always owned) */ -SWIGRUNTIME VALUE -SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type) -{ - VALUE obj; - swig_class *sklass = (swig_class *) type->clientdata; - obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0); - rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); - return obj; -} - -/* Get type mangle from class name */ -SWIGRUNTIMEINLINE char * -SWIG_Ruby_MangleStr(VALUE obj) -{ - VALUE stype = rb_iv_get(obj, "@__swigtype__"); - if (NIL_P(stype)) - return NULL; - return StringValuePtr(stype); -} - -/* Acquire a pointer value */ -typedef struct { - void (*datafree)(void *); - int own; -} swig_ruby_owntype; - -SWIGRUNTIME swig_ruby_owntype -SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) { - swig_ruby_owntype oldown = {0, 0}; - if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) { - oldown.datafree = RDATA(obj)->dfree; - RDATA(obj)->dfree = own.datafree; - } - return oldown; -} - -/* Convert a pointer value */ -SWIGRUNTIME int -SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, swig_ruby_owntype *own) -{ - char *c; - swig_cast_info *tc; - void *vptr = 0; - - /* Grab the pointer */ - if (NIL_P(obj)) { - if (ptr) - *ptr = 0; - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } else { - if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) { - return SWIG_ERROR; - } - Data_Get_Struct(obj, void, vptr); - } - - if (own) { - own->datafree = RDATA(obj)->dfree; - own->own = 0; - } - - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE)) { - if (!RDATA(obj)->dfree) - return SWIG_ERROR_RELEASE_NOT_OWNED; - } - - /* Check to see if the input object is giving up ownership - of the underlying C struct or C++ object. If so then we - need to reset the destructor since the Ruby object no - longer owns the underlying C++ object.*/ - if (flags & SWIG_POINTER_DISOWN) { - /* Is tracking on for this class? */ - int track = 0; - if (ty && ty->clientdata) { - swig_class *sklass = (swig_class *) ty->clientdata; - track = sklass->trackObjects; - } - - if (track) { - /* We are tracking objects for this class. Thus we change the destructor - * to SWIG_RubyRemoveTracking. This allows us to - * remove the mapping from the C++ to Ruby object - * when the Ruby object is garbage collected. If we don't - * do this, then it is possible we will return a reference - * to a Ruby object that no longer exists thereby crashing Ruby. */ - RDATA(obj)->dfree = SWIG_RubyRemoveTracking; - } else { - RDATA(obj)->dfree = 0; - } - } - - if (flags & SWIG_POINTER_CLEAR) { - DATA_PTR(obj) = 0; - } - - /* Do type-checking if type info was provided */ - if (ty) { - if (ty->clientdata) { - if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) { - if (vptr == 0) { - /* The object has already been deleted */ - return SWIG_ObjectPreviouslyDeletedError; - } - } - } - if ((c = SWIG_MangleStr(obj)) == NULL) { - return SWIG_ERROR; - } - tc = SWIG_TypeCheck(c, ty); - if (!tc) { - return SWIG_ERROR; - } else { - if (ptr) { - if (tc->type == ty) { - *ptr = vptr; - } else { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, vptr, &newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - own->own = own->own | SWIG_CAST_NEW_MEMORY; - } - } - } - } - } else { - if (ptr) - *ptr = vptr; - } - - return SWIG_OK; -} - -/* Check convert */ -SWIGRUNTIMEINLINE int -SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty) -{ - char *c = SWIG_MangleStr(obj); - if (!c) return 0; - return SWIG_TypeCheck(c,ty) != 0; -} - -SWIGRUNTIME VALUE -SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; - *(r++) = '_'; - r = SWIG_PackData(r, ptr, sz); - strcpy(r, type->name); - return rb_str_new2(result); -} - -/* Convert a packed pointer value */ -SWIGRUNTIME int -SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c; - - if (TYPE(obj) != T_STRING) goto type_error; - c = StringValuePtr(obj); - /* Pointer values must start with leading underscore */ - if (*c != '_') goto type_error; - c++; - c = SWIG_UnpackData(c, ptr, sz); - if (ty) { - tc = SWIG_TypeCheck(c, ty); - if (!tc) goto type_error; - } - return SWIG_OK; - - type_error: - return SWIG_ERROR; -} - -SWIGRUNTIME swig_module_info * -SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata)) -{ - VALUE pointer; - swig_module_info *ret = 0; - VALUE verbose = rb_gv_get("VERBOSE"); - - /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */ - rb_gv_set("VERBOSE", Qfalse); - - /* first check if pointer already created */ - pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - if (pointer != Qnil) { - Data_Get_Struct(pointer, swig_module_info, ret); - } - - /* reinstate warnings */ - rb_gv_set("VERBOSE", verbose); - return ret; -} - -SWIGRUNTIME void -SWIG_Ruby_SetModule(swig_module_info *pointer) -{ - /* register a new class */ - VALUE cl = rb_define_class("swig_runtime_data", rb_cObject); - rb_undef_alloc_func(cl); - /* create and store the structure pointer to a global variable */ - swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer); - rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer); -} - -/* This function can be used to check whether a proc or method or similarly - callable function has been passed. Usually used in a %typecheck, like: - - %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) { - $result = SWIG_Ruby_isCallable( $input ); - } - */ -SWIGINTERN -int SWIG_Ruby_isCallable( VALUE proc ) -{ - if ( rb_respond_to( proc, swig_call_id ) ) - return 1; - return 0; -} - -/* This function can be used to check the arity (number of arguments) - a proc or method can take. Usually used in a %typecheck. - Valid arities will be that equal to minimal or those < 0 - which indicate a variable number of parameters at the end. - */ -SWIGINTERN -int SWIG_Ruby_arity( VALUE proc, int minimal ) -{ - if ( rb_respond_to( proc, swig_arity_id ) ) - { - VALUE num = rb_funcall2( proc, swig_arity_id, 0, 0 ); - int arity = NUM2INT(num); - if ( arity < 0 && (arity+1) < -minimal ) return 1; - if ( arity == minimal ) return 1; - return 1; - } - return 0; -} - - -#ifdef __cplusplus -} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyruntime.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyruntime.swg deleted file mode 100755 index 94cc1cdb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyruntime.swg +++ /dev/null @@ -1,9 +0,0 @@ - -%runtime "swiglabels.swg" /* Common C API type-checking code */ -%runtime "swigrun.swg" /* Common C API type-checking code */ -%runtime "swigerrors.swg" /* SWIG errors */ -%runtime "rubyhead.swg" /* Ruby includes and fixes */ -%runtime "rubyerrors.swg" /* Ruby errors */ -%runtime "rubytracking.swg" /* API for tracking C++ classes to Ruby objects */ -%runtime "rubyapi.swg" -%runtime "rubyrun.swg" diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubystdautodoc.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubystdautodoc.swg deleted file mode 100755 index be7e3750..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubystdautodoc.swg +++ /dev/null @@ -1,33 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubystdautodoc.swg - * - * This file contains autodocs for standard STL functions. - * ----------------------------------------------------------------------------- */ - -// -// For STL autodocumentation -// -AUTODOC(c_str, "Convert class to a String representation"); -AUTODOC(begin, "Return an iterator to the beginning of the $class"); -AUTODOC(end, "Return an iterator to past the end of the $class"); -AUTODOC(rbegin, "Return a reverse iterator to the beginning (the end) of the $class"); -AUTODOC(rend, "Return a reverse iterator to past the end (past the beginning) of the $class"); -AUTODOC(length, "Size or Length of the $class"); -AUTODOC(replace, "Replace all or a portion of the $class"); -AUTODOC(resize, "Resize the size of the $class"); -AUTODOC(capacity, "Reserved capacity of the $class"); -AUTODOC(reserve, "Reserve memory in the $class for a number of elements"); -AUTODOC(erase, "Delete a portion of the $class"); -AUTODOC(max_size, "Maximum size of elements allowed in the $class"); -AUTODOC(iterator, "Return an iterator to the $class"); -AUTODOC(empty, "Check if the $class is empty or not"); -AUTODOC(rfind, "Find an element in reverse usually starting from the end of the $class"); -AUTODOC(assign, "Assign a new $class or portion of it"); -AUTODOC(front, "Return the first element in $class"); -AUTODOC(back, "Return the last element in $class"); -AUTODOC(second, "Return the second element in $class"); -AUTODOC(push_front, "Add an element at the beginning of the $class"); -AUTODOC(push_back, "Add an element at the end of the $class"); -AUTODOC(pop_front, "Remove and return element at the beginning of the $class"); -AUTODOC(pop_back, "Remove and return an element at the end of the $class"); -AUTODOC(clear, "Clear $class contents"); diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubystdcommon.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubystdcommon.swg deleted file mode 100755 index 4514ddfe..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubystdcommon.swg +++ /dev/null @@ -1,199 +0,0 @@ - -/* ------------------------------------------------------------ - * The Ruby classes, for C++ - * ------------------------------------------------------------ */ -%include -%include - -%fragment("StdTraits","header",fragment="StdTraitsCommon",fragment="StdTraitsForwardDeclaration") -{ - -namespace swig { - /* - Traits that provides the from method - */ - template struct traits_from_ptr { - static VALUE from(Type *val, int owner = 0) { - return SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static VALUE from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static VALUE from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static VALUE from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline VALUE from(const Type& val) { - return traits_from::from(val); - } - - template - inline VALUE from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - /* - Traits that provides the asval/as/check method - */ - template - struct traits_asptr { - static int asptr(VALUE obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(VALUE obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(VALUE obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(VALUE obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(VALUE obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(VALUE obj) { - Type v; - int res = asval(obj, &v); - if (!SWIG_IsOK(res)) { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - return v; - } - }; - - template - struct traits_as { - static Type as(VALUE obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(VALUE obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) { - %type_error(swig::type_name()); - } - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(VALUE obj) { - return traits_as< Type, typename traits< Type >::category >::as(obj); - } - - template - struct traits_check { - static bool check(VALUE obj) { - int res = asval(obj, (Type *)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(VALUE obj) { - int res = asptr(obj, (Type **)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(VALUE obj) { - return traits_check::category>::check(obj); - } -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubystdcommon_forward.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubystdcommon_forward.swg deleted file mode 100755 index 79393a2e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubystdcommon_forward.swg +++ /dev/null @@ -1,15 +0,0 @@ -%fragment("StdTraitsForwardDeclaration","header") -{ -namespace swig { - template struct traits_asptr; - template struct traits_asval; - struct pointer_category; - template struct traits_as; - template struct traits_from; - template struct traits_from_ptr; - template struct noconst_traits; - template swig_type_info* type_info(); - template const char* type_name(); - template VALUE from(const Type& val); -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubystdfunctors.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubystdfunctors.swg deleted file mode 100755 index 96ef11f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubystdfunctors.swg +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @file rubystdfunctors.swg - * @date Sun May 6 00:44:33 2007 - * - * @brief This file provides unary and binary functors for STL - * containers, that will invoke a Ruby proc or method to do - * their operation. - * - * You can use them in a swig file like: - * - * %include - * %include - * - * %template< IntSet > std::set< int, swig::BinaryPredicate<> >; - * - * - * which will then allow calling them from Ruby either like: - * - * # order of set is defined by C++ default - * a = IntSet.new - * - * # sort order defined by Ruby proc - * b = IntSet.new( proc { |a,b| a > b } ) - * - */ - -%include rubyclasses.swg - - -namespace swig { - - %apply GC_VALUE { UnaryPredicate, BinaryPredicate, UnaryFunction, - BinaryFunction }; - - %typecheck(SWIG_TYPECHECK_POINTER,noblock=1) - UnaryPredicate, UnaryPredicate&, UnaryFunction, UnaryFunction& - { - $1 = SWIG_Ruby_isCallable($input) && SWIG_Ruby_arity($input, 1); - } - - %typecheck(SWIG_TYPECHECK_POINTER,noblock=1) - BinaryPredicate, BinaryPredicate&, BinaryFunction, BinaryFunction& { - $1 = SWIG_Ruby_isCallable($input) && SWIG_Ruby_arity($input, 2); - } - - %typemap(in,noblock=1) BinaryFunction&, BinaryFunction { - $1 = new swig::BinaryFunction< >($input); - } - %typemap(in,noblock=1) UnaryFunction&, UnaryFunction { - $1 = new swig::UnaryFunction< >($input); - } - - %typemap(in,noblock=1) BinaryPredicate&, BinaryPredicate { - $1 = new swig::BinaryPredicate<>($input); - } - - %typemap(in,noblock=1) UnaryPredicate&, UnaryPredicate { - $1 = new swig::UnaryPredicate< >($input); - } - - - %ignore BinaryFunction; - template< class _T = GC_VALUE > - struct BinaryFunction { - }; - - %ignore UnaryFunction; - template< class _T = GC_VALUE > - struct UnaryFunction { - }; - - %ignore BinaryPredicate; - template< class _T = GC_VALUE > - struct BinaryPredicate { - }; - - %ignore UnaryPredicate; - template< class _T = GC_VALUE > - struct UnaryPredicate { - - }; - -} - - -%fragment("StdFunctors","header",fragment="StdTraits",fragment="GC_VALUE_definition") -{ -namespace swig { - - static ID call_id = rb_intern("call"); - - template > - struct BinaryPredicate : GC_VALUE - { - BinaryPredicate(VALUE obj = Qnil) : GC_VALUE(obj) { } - bool operator()(_T a, _T b) const - { - if (_obj != Qnil) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from(a); - VALUE arg2 = swig::from(b); - VALUE res = rb_funcall( _obj, swig::call_id, 2, arg1, arg2); - SWIG_RUBY_THREAD_END_BLOCK; - return RTEST(res); - } else { - return _DefaultFunc()(a, b); - } - } - }; - - template > - struct BinaryFunction : GC_VALUE - { - BinaryFunction(VALUE obj = Qnil) : GC_VALUE(obj) { } - _T operator()(_T a, _T b) const - { - if (_obj != Qnil) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from(a); - VALUE arg2 = swig::from(b); - VALUE res = rb_funcall( _obj, swig::call_id, 2, arg1, arg2); - SWIG_RUBY_THREAD_END_BLOCK; - return swig::as<_T >(res); - } else { - return _DefaultFunc()(a, b); - } - } - }; - - template< class _T = GC_VALUE > - struct UnaryPredicate : GC_VALUE - { - UnaryPredicate(VALUE obj = Qnil) : GC_VALUE(obj) { } - bool operator()(_T a) const - { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from<_T >(a); - VALUE res = rb_funcall( _obj, swig::call_id, 1, arg1); - SWIG_RUBY_THREAD_END_BLOCK; - return RTEST(res); - } - }; - - template< class _T = GC_VALUE > - struct UnaryFunction : GC_VALUE - { - UnaryFunction(VALUE obj = Qnil) : GC_VALUE(obj) { } - _T operator()(_T a) const - { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - VALUE arg1 = swig::from(a); - VALUE res = rb_funcall( _obj, swig::call_id, 1, VALUE(arg1)); - SWIG_RUBY_THREAD_END_BLOCK; - return swig::as< _T >(res); - } - }; - -} // namespace swig - -} - - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubystrings.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubystrings.swg deleted file mode 100755 index 0ac8f3c7..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubystrings.swg +++ /dev/null @@ -1,57 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc) -{ - if (TYPE(obj) == T_STRING) { - char *cstr = StringValuePtr(obj); - size_t size = RSTRING_LEN(obj) + 1; - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, size, char); - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } - } - if (psize) *psize = size; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *)vptr; - if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { -SWIGINTERNINLINE VALUE -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > LONG_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_NewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : Qnil; - } else { - return rb_str_new(carray, %numeric_cast(size,long)); - } - } else { - return Qnil; - } -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubytracking.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubytracking.swg deleted file mode 100755 index 7c95afc7..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubytracking.swg +++ /dev/null @@ -1,136 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubytracking.swg - * - * This file contains support for tracking mappings from - * Ruby objects to C++ objects. This functionality is needed - * to implement mark functions for Ruby's mark and sweep - * garbage collector. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(ST_DATA_T_DEFINED) -/* Needs to be explicitly included for Ruby 1.8 and earlier */ -#include -#endif - -/* Ruby 1.8 actually assumes the first case. */ -#if SIZEOF_VOIDP == SIZEOF_LONG -# define SWIG2NUM(v) LONG2NUM((unsigned long)v) -# define NUM2SWIG(x) (unsigned long)NUM2LONG(x) -#elif SIZEOF_VOIDP == SIZEOF_LONG_LONG -# define SWIG2NUM(v) LL2NUM((unsigned long long)v) -# define NUM2SWIG(x) (unsigned long long)NUM2LL(x) -#else -# error sizeof(void*) is not the same as long or long long -#endif - -/* Global hash table to store Trackings from C/C++ - structs to Ruby Objects. -*/ -static st_table* swig_ruby_trackings = NULL; - -static VALUE swig_ruby_trackings_count(ID id, VALUE *var) { - return SWIG2NUM(swig_ruby_trackings->num_entries); -} - - -/* Setup a hash table to store Trackings */ -SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) { - /* Create a hash table to store Trackings from C++ - objects to Ruby objects. */ - - /* Try to see if some other .so has already created a - tracking hash table, which we keep hidden in an instance var - in the SWIG module. - This is done to allow multiple DSOs to share the same - tracking table. - */ - VALUE trackings_value = Qnil; - /* change the variable name so that we can mix modules - compiled with older SWIG's - this used to be called "@__trackings__" */ - ID trackings_id = rb_intern( "@__safetrackings__" ); - VALUE verbose = rb_gv_get("VERBOSE"); - rb_gv_set("VERBOSE", Qfalse); - trackings_value = rb_ivar_get( _mSWIG, trackings_id ); - rb_gv_set("VERBOSE", verbose); - - /* The trick here is that we have to store the hash table - pointer in a Ruby variable. We do not want Ruby's GC to - treat this pointer as a Ruby object, so we convert it to - a Ruby numeric value. */ - if (trackings_value == Qnil) { - /* No, it hasn't. Create one ourselves */ - swig_ruby_trackings = st_init_numtable(); - rb_ivar_set( _mSWIG, trackings_id, SWIG2NUM(swig_ruby_trackings) ); - } else { - swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value); - } - - rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", - VALUEFUNC(swig_ruby_trackings_count), - SWIG_RUBY_VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL)); -} - -/* Add a Tracking from a C/C++ struct to a Ruby object */ -SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) { - /* Store the mapping to the global hash table. */ - st_insert(swig_ruby_trackings, (st_data_t)ptr, object); -} - -/* Get the Ruby object that owns the specified C/C++ struct */ -SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) { - /* Now lookup the value stored in the global hash table */ - VALUE value; - - if (st_lookup(swig_ruby_trackings, (st_data_t)ptr, &value)) { - return value; - } else { - return Qnil; - } -} - -/* Remove a Tracking from a C/C++ struct to a Ruby object. It - is very important to remove objects once they are destroyed - since the same memory address may be reused later to create - a new object. */ -SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) { - /* Delete the object from the hash table */ - st_delete(swig_ruby_trackings, (st_data_t *)&ptr, NULL); -} - -/* This is a helper method that unlinks a Ruby object from its - underlying C++ object. This is needed if the lifetime of the - Ruby object is longer than the C++ object. */ -SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) { - VALUE object = SWIG_RubyInstanceFor(ptr); - - if (object != Qnil) { - // object might have the T_ZOMBIE type, but that's just - // because the GC has flagged it as such for a deferred - // destruction. Until then, it's still a T_DATA object. - DATA_PTR(object) = 0; - } -} - -/* This is a helper method that iterates over all the trackings - passing the C++ object pointer and its related Ruby object - to the passed callback function. */ - -/* Proxy method to abstract the internal trackings datatype */ -static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) { - ((void (*) (void *, VALUE))meth)((void *)ptr, (VALUE)obj); - return ST_CONTINUE; -} - -SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) { - st_foreach(swig_ruby_trackings, - SWIG_RUBY_INT_ANYARGS_FUNC(swig_ruby_internal_iterate_callback), - (st_data_t)meth); -} - -#ifdef __cplusplus -} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubytypemaps.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubytypemaps.swg deleted file mode 100755 index 585495a8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubytypemaps.swg +++ /dev/null @@ -1,62 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Ruby - * ------------------------------------------------------------ */ -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ -/* bool is dangerous in Ruby, change precedence */ -#undef SWIG_TYPECHECK_BOOL -%define SWIG_TYPECHECK_BOOL 10000 %enddef - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Ruby fragments for primitive types */ -%include - -/* Ruby fragments for char* strings */ -%include - -/* Backward compatibility output helper */ -%fragment("output_helper","header") %{ -#define output_helper SWIG_Ruby_AppendOutput -%} - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* Directors are supported in Ruby */ -#ifndef SWIG_DIRECTOR_TYPEMAPS -#define SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Ruby types */ -#define SWIG_Object VALUE -#define VOID_Object Qnil - -/* Overload of the output/constant/exception handling */ - -/* append output */ -#define SWIG_AppendOutput(result,obj) SWIG_Ruby_AppendOutput(result, obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) rb_define_const($module, name, obj) - -/* raise */ -#define SWIG_Raise(obj, type, desc) rb_exc_raise(SWIG_Ruby_ExceptionType(desc, obj)) - -/* Get the address of the 'Ruby self' object */ - -%typemap(in,numinputs=0,noblock=1) VALUE* RUBY_SELF { - $1 = &self; -} - -/* Include the unified typemap library */ -%include - - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubyuserdir.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubyuserdir.swg deleted file mode 100755 index a9cf6be3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubyuserdir.swg +++ /dev/null @@ -1,20 +0,0 @@ -#define %alias %feature("alias") -#define %freefunc %feature("freefunc") -#define %markfunc %feature("markfunc") -#define %mixin %feature("mixin") -#define %predicate %feature("predicate", "1") -#define %bang %feature("bang", "1") -#define %trackobjects %feature("trackobjects") -#define %nooutput %feature("outputs","0") -#define %initstack %feature("initstack", "1") -#define %ignorestack %feature("initstack", "0") - -/* ------------------------------------------------------------------------- */ -/* - Enable keywords parameters -*/ - -#define %kwargs %feature("kwargs") -#define %nokwargs %feature("kwargs", "0") -#define %clearkwargs %feature("kwargs", "") - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/rubywstrings.swg b/win64/bin/swig/share/swig/4.1.0/ruby/rubywstrings.swg deleted file mode 100755 index 93149449..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/rubywstrings.swg +++ /dev/null @@ -1,58 +0,0 @@ -/* ----------------------------------------------------------------------------- - * rubywstrings.swg - * - * utility methods for wchar_t strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_AsCharPtrAndSize",fragment="SWIG_ruby_wstring_encoding_init") { -SWIGINTERN int -SWIG_AsWCharPtrAndSize(VALUE obj, wchar_t **cptr, size_t *psize, int *alloc) -{ - rb_encoding* wstr_enc = swig_ruby_wstring_encoding; - - if (TYPE(obj) == T_STRING) { - VALUE rstr = rb_str_conv_enc(obj, rb_enc_get(obj), wstr_enc); - wchar_t* cstr = (wchar_t*) StringValuePtr(rstr); - size_t size = RSTRING_LEN(rstr) / sizeof(wchar_t) + 1; - - if ( RSTRING_LEN(rstr) % sizeof(wchar_t) != 0 ) { - rb_raise(rb_eRuntimeError, - "The length of the byte sequence of converted string is not a multiplier of sizeof(wchar_t). Invalid byte sequence is given. Or invalid SWIG_RUBY_WSTRING_ENCODING is given when compiling this binding."); - } - if (cptr && alloc) { - *alloc = SWIG_NEWOBJ; - *cptr = %new_array(size, wchar_t); - memmove(*cptr, cstr, RSTRING_LEN(rstr)); - } - if (psize) *psize = size; - - return SWIG_OK; - } else { - return SWIG_TypeError; - } -} -} - -%fragment("SWIG_FromWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_FromCharPtrAndSize",fragment="SWIG_ruby_wstring_encoding_init") { -SWIGINTERNINLINE VALUE -SWIG_FromWCharPtrAndSize(const wchar_t * carray, size_t size) -{ - rb_encoding* wstr_enc = swig_ruby_wstring_encoding; - rb_encoding* rb_enc = swig_ruby_internal_encoding; - - if (carray && size <= LONG_MAX/sizeof(wchar_t)) { - VALUE rstr = rb_str_new( (const char*)carray, %numeric_cast(size*sizeof(wchar_t),long) ); - rb_encoding* new_enc = rb_default_internal_encoding(); - - rb_enc_associate(rstr, wstr_enc); - if ( !new_enc ) { - new_enc = rb_enc; - } - return rb_str_conv_enc(rstr, wstr_enc, new_enc); - } else { - return Qnil; - } -} -} - - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_alloc.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_alloc.i deleted file mode 100755 index 2b9342fb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_alloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_array.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_array.i deleted file mode 100755 index 5ed761b1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_array.i +++ /dev/null @@ -1,102 +0,0 @@ -/* - std::array -*/ - -%fragment("StdArrayTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::array **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::array& vec) { - return traits_from_stdseq >::from(vec); - } - }; - - template - inline void - assign(const RubySeq& rubyseq, std::array* seq) { - if (rubyseq.size() < seq->size()) - throw std::invalid_argument("std::array cannot be expanded in size"); - else if (rubyseq.size() > seq->size()) - throw std::invalid_argument("std::array cannot be reduced in size"); - std::copy(rubyseq.begin(), rubyseq.end(), seq->begin()); - } - - template - inline void - resize(std::array *seq, typename std::array::size_type n, typename std::array::value_type x) { - throw std::invalid_argument("std::array is a fixed size container and does not support resizing"); - } - - // Only limited slicing is supported as std::array is fixed in size - template - inline std::array* - getslice(const std::array* self, Difference i, Difference j) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, (i == size && j == size)); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (ii == 0 && jj == size) { - Sequence *sequence = new Sequence(); - std::copy(self->begin(), self->end(), sequence->begin()); - return sequence; - } else { - throw std::invalid_argument("std::array object only supports getting a slice that is the size of the array"); - } - } - - template - inline void - setslice(std::array* self, Difference i, Difference j, const InputSeq& v) { - typedef std::array Sequence; - typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, true); - typename Sequence::size_type jj = swig::slice_index(j, size); - - if (ii == 0 && jj == size) { - std::copy(v.begin(), v.end(), self->begin()); - } else { - throw std::invalid_argument("std::array object only supports setting a slice that is the size of the array"); - } - } - - template - inline void - delslice(std::array* self, Difference i, Difference j) { - throw std::invalid_argument("std::array object does not support item deletion"); - } - } -%} - - -%define %swig_array_methods(Type...) - %swig_sequence_methods_non_resizable(Type) -%enddef - -%define %swig_array_methods_val(Type...) - %swig_sequence_methods_non_resizable_val(Type); -%enddef - - -%mixin std::array "Enumerable"; -%ignore std::array::push_back; -%ignore std::array::pop_back; - - -%rename("delete") std::array::__delete__; -%rename("reject!") std::array::reject_bang; -%rename("map!") std::array::map_bang; -%rename("empty?") std::array::empty; -%rename("include?" ) std::array::__contains__ const; -%rename("has_key?" ) std::array::has_key const; - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_auto_ptr.i deleted file mode 100755 index 304f1fc9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_basic_string.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_basic_string.i deleted file mode 100755 index bcd9c026..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_basic_string.i +++ /dev/null @@ -1,92 +0,0 @@ -#if !defined(SWIG_STD_STRING) -#define SWIG_STD_BASIC_STRING - -%include - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - - -%traits_swigtype(std::basic_string); -%fragment(SWIG_Traits_frag(std::basic_string)); - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(VALUE obj, std::string **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::string *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - char* buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::string(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromCharPtrAndSize") { -SWIGINTERNINLINE VALUE - SWIG_From(std::basic_string)(const std::string& s) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } -} - -%ignore std::basic_string::operator!=; -%ignore std::basic_string::operator+=; - -%include -%typemaps_asptrfromn(%checkcode(STRING), std::basic_string); - -#endif - - -#if !defined(SWIG_STD_WSTRING) - -%traits_swigtype(std::basic_string); -%fragment(SWIG_Traits_frag(std::basic_string)); - - -%fragment(SWIG_AsPtr_frag(std::basic_string),"header", - fragment="SWIG_AsWCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr(std::basic_string)(VALUE obj, std::wstring **val) { - static swig_type_info* string_info = SWIG_TypeQuery("std::basic_string *"); - std::wstring *vptr; - if (SWIG_IsOK(SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0))) { - if (val) *val = vptr; - return SWIG_OLDOBJ; - } else { - wchar_t *buf = 0 ; size_t size = 0; int alloc = 0; - if (SWIG_IsOK(SWIG_AsWCharPtrAndSize(obj, &buf, &size, &alloc))) { - if (buf) { - if (val) *val = new std::wstring(buf, size - 1); - if (alloc == SWIG_NEWOBJ) %delete_array(buf); - return SWIG_NEWOBJ; - } - } - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string),"header", - fragment="SWIG_FromWCharPtrAndSize") { -SWIGINTERNINLINE VALUE - SWIG_From(std::basic_string)(const std::wstring& s) { - return SWIG_FromWCharPtrAndSize(s.data(), s.size()); - } -} - -%typemaps_asptrfromn(%checkcode(UNISTRING), std::basic_string); - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_char_traits.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_char_traits.i deleted file mode 100755 index e60261f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_common.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_common.i deleted file mode 100755 index fc3bb143..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_common.i +++ /dev/null @@ -1,74 +0,0 @@ -%include -%include -%include - - -/* - Generate the traits for a 'primitive' type, such as 'double', - for which the SWIG_AsVal and SWIG_From methods are already defined. -*/ - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(VALUE obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static VALUE from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(VALUE obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static VALUE from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_complex.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_complex.i deleted file mode 100755 index f330b5c7..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_complex.i +++ /dev/null @@ -1,29 +0,0 @@ -/* - * STD C++ complex typemaps - */ - -%include - -%{ -#include -%} - -namespace std { - %naturalvar complex; - template class complex; - %template() complex; - %template() complex; -} - -/* defining the complex as/from converters */ - -%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) -%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) - -/* defining the typemaps */ - -%typemaps_primitive(%checkcode(CPLXDBL), std::complex); -%typemaps_primitive(%checkcode(CPLXFLT), std::complex); - - - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_container.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_container.i deleted file mode 100755 index 01f1890a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_container.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_deque.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_deque.i deleted file mode 100755 index c04de7f0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_deque.i +++ /dev/null @@ -1,30 +0,0 @@ -/* - Deques -*/ - -%fragment("StdDequeTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::deque **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::deque& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%ignore std::deque::push_back; -%ignore std::deque::pop_back; - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_except.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_except.i deleted file mode 100755 index 3e056e7d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_functors.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_functors.i deleted file mode 100755 index 0f85e401..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_functors.i +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file std_functors.i - * @date Sun May 6 00:44:33 2007 - * - * @brief This file provides unary and binary functors for STL - * containers, that will invoke a Ruby proc or method to do - * their operation. - * - * You can use them in a swig file like: - * - * %include - * %include - * - * %template< IntSet > std::set< int, swig::BinaryPredicate >; - * - * - * which will then allow calling them from Ruby either like: - * - * # order of set is defined by C++ default - * a = IntSet.new - * - * # sort order defined by Ruby proc - * b = IntSet.new( proc { |a,b| a > b } ) - * - */ - -%include - -%fragment("StdFunctors"); diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_ios.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_ios.i deleted file mode 100755 index a347a9a0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_ios.i +++ /dev/null @@ -1,14 +0,0 @@ - -#pragma SWIG nowarn=801 - -%rename(ios_base_in) std::ios_base::in; - -AUTODOC(cerr, "Standard C++ error stream"); -AUTODOC(cout, "Standard C++ output stream"); -AUTODOC(cin, "Standard C++ input stream"); -AUTODOC(clog, "Standard C++ logging stream"); -AUTODOC(endl, "Add an end line to stream"); -AUTODOC(ends, "Ends stream"); -AUTODOC(flush, "Flush stream"); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_iostream.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_iostream.i deleted file mode 100755 index 19569d43..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_iostream.i +++ /dev/null @@ -1,12 +0,0 @@ -namespace std -{ -%callback("%s") endl; -%callback("%s") ends; -%callback("%s") flush; -} - -%warnfilter(365) operator+=; -%warnfilter(802) std::basic_iostream; // turn off multiple inheritance warning - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_list.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_list.i deleted file mode 100755 index 2b0bc258..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_list.i +++ /dev/null @@ -1,42 +0,0 @@ -/* - Lists -*/ - -%fragment("StdListTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static VALUE from(const std::list& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%ignore std::list::push_back; -%ignore std::list::pop_back; - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%mixin std::list "Enumerable"; - -%rename("delete") std::list::__delete__; -%rename("reject!") std::list::reject_bang; -%rename("map!") std::list::map_bang; -%rename("empty?") std::list::empty; -%rename("include?" ) std::list::__contains__ const; -%rename("has_key?" ) std::list::has_key const; - -%alias std::list::push "<<"; - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_map.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_map.i deleted file mode 100755 index 31d835b4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_map.i +++ /dev/null @@ -1,424 +0,0 @@ -// -// Maps -// -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") -{ - namespace swig { - template - struct from_key_oper - { - typedef const ValueType& argument_type; - typedef VALUE result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.first); - } - }; - - template - struct from_value_oper - { - typedef const ValueType& argument_type; - typedef VALUE result_type; - result_type operator()(argument_type v) const - { - return swig::from(v.second); - } - }; - - template - struct MapIterator_T : ConstIteratorClosed_T - { - MapIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq) - : ConstIteratorClosed_T(curr, first, last, seq) - { - } - }; - - - template > - struct MapKeyIterator_T : MapIterator_T - { - MapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq) - : MapIterator_T(curr, first, last, seq) - { - } - }; - - template - inline ConstIterator* - make_output_key_iterator(const OutIter& current, const OutIter& begin, - const OutIter& end, VALUE seq = 0) - { - return new MapKeyIterator_T(current, begin, end, seq); - } - - template > - struct MapValueIterator_T : MapIterator_T - { - MapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq) - : MapIterator_T(curr, first, last, seq) - { - } - }; - - - template - inline ConstIterator* - make_output_value_iterator(const OutIter& current, const OutIter& begin, - const OutIter& end, VALUE seq = 0) - { - return new MapValueIterator_T(current, begin, end, seq); - } - } -} - -%fragment("StdMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::map map_type; - static int asptr(VALUE obj, map_type **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_HASH ) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - map_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static VALUE from(const map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - size_type size = map.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise( rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - rb_hash_aset(obj, key, val); - } - return obj; - } - } - }; - } -} - -%define %swig_map_common(Map...) - %swig_container_methods(%arg(Map)); - // %swig_sequence_iterator(%arg(Map)); - - %extend { - - VALUE __delete__(const key_type& key) { - Map::iterator i = self->find(key); - if (i != self->end()) { - self->erase(i); - return swig::from( key ); - } - else { - return Qnil; - } - } - - bool has_key(const key_type& key) const { - Map::const_iterator i = self->find(key); - return i != self->end(); - } - - VALUE keys() { - Map::size_type size = self->size(); - int rubysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE ary = rb_ary_new2(rubysize); - Map::const_iterator i = self->begin(); - Map::const_iterator e = self->end(); - for ( ; i != e; ++i ) { - rb_ary_push( ary, swig::from(i->first) ); - } - return ary; - } - - Map* each() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE k, v; - Map::iterator i = self->begin(); - Map::iterator e = self->end(); - for ( ; i != e; ++i ) - { - const Map::key_type& key = i->first; - const Map::mapped_type& val = i->second; - - k = swig::from(key); - v = swig::from(val); - rb_yield_values(2, k, v); - } - - return self; - } - - %newobject select; - Map* select() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - Map* r = new Map; - Map::iterator i = $self->begin(); - Map::iterator e = $self->end(); - for ( ; i != e; ++i ) - { - VALUE k = swig::from(i->first); - VALUE v = swig::from(i->second); - if ( RTEST( rb_yield_values(2, k, v) ) ) - $self->insert(r->end(), *i); - } - - return r; - } - - %typemap(in) (int argc, VALUE* argv) { - $1 = argc; - $2 = argv; - } - - VALUE values_at(int argc, VALUE* argv, ...) { - - VALUE r = rb_ary_new(); - ID id = rb_intern("[]"); - swig_type_info* type = swig::type_info< Map >(); - VALUE me = SWIG_NewPointerObj( $self, type, 0 ); - for ( int i = 0; i < argc; ++i ) - { - VALUE key = argv[i]; - VALUE tmp = rb_funcall( me, id, 1, key ); - rb_ary_push( r, tmp ); - } - - return r; - } - - - Map* each_key() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE r; - Map::iterator i = self->begin(); - Map::iterator e = self->end(); - for ( ; i != e; ++i ) - { - r = swig::from( i->first ); - rb_yield(r); - } - - return self; - } - - VALUE values() { - Map::size_type size = self->size(); - int rubysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE ary = rb_ary_new2(rubysize); - Map::const_iterator i = self->begin(); - Map::const_iterator e = self->end(); - for ( ; i != e; ++i ) { - rb_ary_push( ary, swig::from(i->second) ); - } - return ary; - } - - Map* each_value() - { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given"); - - VALUE r; - Map::iterator i = self->begin(); - Map::iterator e = self->end(); - for ( ; i != e; ++i ) - { - r = swig::from( i->second ); - rb_yield(r); - } - - return self; - } - - VALUE entries() { - Map::size_type size = self->size(); - int rubysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE ary = rb_ary_new2(rubysize); - Map::const_iterator i = self->begin(); - Map::const_iterator e = self->end(); - for ( ; i != e; ++i ) { - rb_ary_push( ary, swig::from >(*i) ); - } - return ary; - } - - bool __contains__(const key_type& key) { - return self->find(key) != self->end(); - } - - %newobject key_iterator(VALUE *RUBY_SELF); - swig::ConstIterator* key_iterator(VALUE *RUBY_SELF) { - return swig::make_output_key_iterator($self->begin(), $self->begin(), - $self->end(), *RUBY_SELF); - } - - %newobject value_iterator(VALUE *RUBY_SELF); - swig::ConstIterator* value_iterator(VALUE *RUBY_SELF) { - return swig::make_output_value_iterator($self->begin(), $self->begin(), - $self->end(), *RUBY_SELF); - } - - } -%enddef - -%define %swig_map_methods(Map...) - %swig_map_common(Map) - %extend { - VALUE __getitem__(const key_type& key) const { - Map::const_iterator i = self->find(key); - if ( i != self->end() ) - return swig::from( i->second ); - else - return Qnil; - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - (*self)[key] = x; - } - - VALUE inspect() - { - Map::const_iterator i = $self->begin(); - Map::const_iterator e = $self->end(); - const char *type_name = swig::type_name< Map >(); - VALUE str = rb_str_new2( type_name ); - str = rb_str_cat2( str, " {" ); - bool comma = false; - VALUE tmp; - for ( ; i != e; ++i, comma = true ) - { - if (comma) str = rb_str_cat2( str, "," ); - tmp = swig::from< Map::key_type >( i->first ); - tmp = rb_inspect( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, "=>" ); - tmp = swig::from< Map::mapped_type >( i->second ); - tmp = rb_inspect( tmp ); - str = rb_str_buf_append( str, tmp ); - } - str = rb_str_cat2( str, "}" ); - return str; - } - - VALUE to_a() - { - Map::const_iterator i = $self->begin(); - Map::const_iterator e = $self->end(); - VALUE ary = rb_ary_new2( std::distance( i, e ) ); - VALUE tmp; - for ( ; i != e; ++i ) - { - // @todo: improve -- this should just be swig::from(*i) - tmp = swig::from< std::pair >( *i ); - rb_ary_push( ary, tmp ); - } - return ary; - } - - VALUE to_s() - { - Map::iterator i = $self->begin(); - Map::iterator e = $self->end(); - VALUE str = rb_str_new2( "" ); - VALUE tmp; - for ( ; i != e; ++i ) - { - // @todo: improve -- this should just be swig::from(*i) - tmp = swig::from< std::pair >( *i ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - } - return str; - } - - } -%enddef - - -%mixin std::map "Enumerable"; - - -%rename("delete") std::map::__delete__; -%rename("reject!") std::map::reject_bang; -%rename("map!") std::map::map_bang; -%rename("empty?") std::map::empty; -%rename("include?" ) std::map::__contains__ const; -%rename("has_key?" ) std::map::has_key const; - -%alias std::map::push "<<"; - - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_multimap.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_multimap.i deleted file mode 100755 index ed0f1c35..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_multimap.i +++ /dev/null @@ -1,226 +0,0 @@ -/* - Multimaps -*/ -%include - -%fragment("StdMultimapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::multimap *multimap) { - typedef typename std::multimap::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::multimap multimap_type; - static int asptr(VALUE obj, std::multimap **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_HASH ) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - return traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - multimap_type *p; - res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info(),0); - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::multimap multimap_type; - typedef typename multimap_type::const_iterator const_iterator; - typedef typename multimap_type::size_type size_type; - - static VALUE from(const multimap_type& multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new multimap_type(multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = multimap.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, - "multimap size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - - VALUE oldval = rb_hash_aref( obj, key ); - if ( oldval == Qnil ) - rb_hash_aset(obj, key, val); - else { - // Multiple values for this key, create array if needed - // and add a new element to it. - VALUE ary; - if ( TYPE(oldval) == T_ARRAY ) - ary = oldval; - else - { - ary = rb_ary_new2(2); - rb_ary_push( ary, oldval ); - rb_hash_aset( obj, key, ary ); - } - rb_ary_push( ary, val ); - } - - } - return obj; - } - } - }; - } -} - -%define %swig_multimap_methods(MultiMap...) - %swig_map_common(%arg(MultiMap)); - - %extend { - VALUE __getitem__(const key_type& key) const { - std::pair r = $self->equal_range(key); - if ( r.first != r.second ) - { - VALUE ary = rb_ary_new(); - for (MultiMap::const_iterator i = r.first ; i != r.second; ++i ) - { - rb_ary_push( ary, swig::from( i->second ) ); - } - if ( RARRAY_LEN(ary) == 1 ) - return RARRAY_PTR(ary)[0]; - return ary; - } - else - return Qnil; - } - - void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { - self->insert(MultiMap::value_type(key,x)); - } - - VALUE inspect() - { - MultiMap::iterator i = $self->begin(); - MultiMap::iterator e = $self->end(); - const char *type_name = swig::type_name< MultiMap >(); - VALUE str = rb_str_new2( type_name ); - str = rb_str_cat2( str, " {" ); - VALUE tmp; - while ( i != e ) - { - const MultiMap::key_type& key = i->first; - const MultiMap::key_type& oldkey = key; - tmp = swig::from( key ); - str = rb_str_buf_append( str, rb_inspect(tmp) ); - str = rb_str_cat2( str, "=>" ); - - VALUE vals = rb_ary_new(); - for ( ; i != e && key == oldkey; ++i ) - { - const MultiMap::mapped_type& val = i->second; - tmp = swig::from( val ); - rb_ary_push( vals, tmp ); - } - - if ( RARRAY_LEN(vals) == 1 ) - { - str = rb_str_buf_append( str, rb_inspect(tmp) ); - } - else - { - str = rb_str_buf_append( str, rb_inspect(vals) ); - } - } - str = rb_str_cat2( str, "}" ); - return str; - } - - VALUE to_a() - { - MultiMap::const_iterator i = $self->begin(); - MultiMap::const_iterator e = $self->end(); - VALUE ary = rb_ary_new2( std::distance( i, e ) ); - VALUE tmp; - while ( i != e ) - { - const MultiMap::key_type& key = i->first; - const MultiMap::key_type& oldkey = key; - tmp = swig::from( key ); - rb_ary_push( ary, tmp ); - - VALUE vals = rb_ary_new(); - for ( ; i != e && key == oldkey; ++i ) - { - const MultiMap::mapped_type& val = i->second; - tmp = swig::from( val ); - rb_ary_push( vals, tmp ); - } - - if ( RARRAY_LEN(vals) == 1 ) - { - rb_ary_push( ary, tmp ); - } - else - { - rb_ary_push( ary, vals ); - } - } - return ary; - } - - VALUE to_s() - { - MultiMap::iterator i = $self->begin(); - MultiMap::iterator e = $self->end(); - VALUE str = rb_str_new2( "" ); - VALUE tmp; - while ( i != e ) - { - const MultiMap::key_type& key = i->first; - const MultiMap::key_type& oldkey = key; - tmp = swig::from( key ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - - VALUE vals = rb_ary_new(); - for ( ; i != e && key == oldkey; ++i ) - { - const MultiMap::mapped_type& val = i->second; - tmp = swig::from( val ); - rb_ary_push( vals, tmp ); - } - - tmp = rb_obj_as_string( vals ); - str = rb_str_buf_append( str, tmp ); - } - return str; - } - } -%enddef - - -%mixin std::multimap "Enumerable"; - -%rename("delete") std::multimap::__delete__; -%rename("reject!") std::multimap::reject_bang; -%rename("map!") std::multimap::map_bang; -%rename("empty?") std::multimap::empty; -%rename("include?" ) std::multimap::__contains__ const; -%rename("has_key?" ) std::multimap::has_key const; - -%alias std::multimap::push "<<"; - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_multiset.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_multiset.i deleted file mode 100755 index 3e357136..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_multiset.i +++ /dev/null @@ -1,50 +0,0 @@ -/* - Multisets -*/ - -%include - -%fragment("StdMultisetTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::multiset* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static VALUE from(const std::multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_multiset_methods(Set...) %swig_set_methods(Set) - -%mixin std::multiset "Enumerable"; - -%rename("delete") std::multiset::__delete__; -%rename("reject!") std::multiset::reject_bang; -%rename("map!") std::multiset::map_bang; -%rename("empty?") std::multiset::empty; -%rename("include?" ) std::multiset::__contains__ const; -%rename("has_key?" ) std::multiset::has_key const; - -%alias std::multiset::push "<<"; - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_pair.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_pair.i deleted file mode 100755 index 3f38a8e5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_pair.i +++ /dev/null @@ -1,212 +0,0 @@ -/* - Pairs -*/ -%include - -//#define SWIG_STD_PAIR_ASVAL - -%fragment("StdPairTraits","header",fragment="StdTraits") { - namespace swig { - - template - struct traits_asval > { - typedef std::pair value_type; - - static int get_pair(VALUE first, VALUE second, - std::pair *val) - { - if (val) { - T *pfirst = &(val->first); - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = &(val->second); - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } else { - T *pfirst = 0; - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asval(VALUE obj, std::pair *val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_ARRAY ) { - if (RARRAY_LEN(obj) == 2) { - VALUE first = rb_ary_entry(obj,0); - VALUE second = rb_ary_entry(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = *p; - } - return res; - } - }; - - template - struct traits_asptr > { - typedef std::pair value_type; - - static int get_pair(VALUE first, VALUE second, - std::pair **val) - { - if (val) { - value_type *vp = %new_instance(std::pair); - T *pfirst = &(vp->first); - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) { - %delete(vp); - return res1; - } - U *psecond = &(vp->second); - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) { - %delete(vp); - return res2; - } - *val = vp; - return SWIG_AddNewMask(res1 > res2 ? res1 : res2); - } else { - T *pfirst = 0; - int res1 = swig::asval((VALUE)first, pfirst); - if (!SWIG_IsOK(res1)) return res1; - U *psecond = 0; - int res2 = swig::asval((VALUE)second, psecond); - if (!SWIG_IsOK(res2)) return res2; - return res1 > res2 ? res1 : res2; - } - } - - static int asptr(VALUE obj, std::pair **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_ARRAY ) { - if ( RARRAY_LEN(obj) == 2) { - VALUE first = rb_ary_entry(obj,0); - VALUE second = rb_ary_entry(obj,1); - res = get_pair(first, second, val); - } - } else { - value_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - - - template - struct traits_from > { - static VALUE _wrap_pair_second( VALUE self ) - { - std::pair< typename swig::noconst_traits::noconst_type,U>* p = NULL; - swig::asptr( self, &p ); - return swig::from( p->second ); - } - - static VALUE _wrap_pair_second_eq( VALUE self, VALUE arg ) - { - std::pair< typename swig::noconst_traits::noconst_type,U>* p = NULL; - swig::asptr( self, &p ); - return swig::from( p->second ); - } - - static VALUE from(const std::pair& val) { - VALUE obj = rb_ary_new2(2); - rb_ary_push(obj, swig::from::noconst_type>(val.first)); - rb_ary_push(obj, swig::from(val.second)); - rb_define_singleton_method(obj, "second", - VALUEFUNC(_wrap_pair_second), 0 ); - rb_define_singleton_method(obj, "second=", - VALUEFUNC(_wrap_pair_second_eq), 1 ); - rb_obj_freeze(obj); // treat as immutable tuple - return obj; - } - }; - - } -} - -// Missing typemap -%typemap(in) std::pair* (int res) { - res = swig::asptr( $input, &$1 ); - if (!SWIG_IsOK(res)) - %argument_fail(res, "$1_type", $symname, $argnum); -} - - -%define %swig_pair_methods(pair...) - -%extend { - VALUE inspect() const - { - VALUE tmp; - const char *type_name = swig::type_name< pair >(); - VALUE str = rb_str_new2( type_name ); - str = rb_str_cat2( str, " (" ); - tmp = swig::from( $self->first ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, "," ); - tmp = swig::from( $self->second ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, ")" ); - return str; - } - - VALUE to_s() const - { - VALUE tmp; - VALUE str = rb_str_new2( "(" ); - tmp = swig::from( $self->first ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, "," ); - tmp = swig::from( $self->second ); - tmp = rb_obj_as_string( tmp ); - str = rb_str_buf_append( str, tmp ); - str = rb_str_cat2( str, ")" ); - return str; - } - - VALUE __getitem__( int index ) - { - if (( index % 2 ) == 0 ) - return swig::from( $self->first ); - else - return swig::from( $self->second ); - } - - VALUE __setitem__( int index, VALUE obj ) - { - int res; - if (( index % 2 ) == 0 ) - { - res = swig::asval( obj, &($self->first) ); - } - else - { - res = swig::asval(obj, &($self->second) ); - } - if (!SWIG_IsOK(res)) - rb_raise( rb_eArgError, "invalid item for " #pair ); - return obj; - } - - } // extend - -%enddef - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_queue.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_queue.i deleted file mode 100755 index 0cca3c41..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_queue.i +++ /dev/null @@ -1,33 +0,0 @@ -/* - Queues -*/ - -%fragment("StdQueueTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::queue **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::queue& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -%rename("delete") std::queue::__delete__; -%rename("reject!") std::queue::reject_bang; -%rename("map!") std::queue::map_bang; -%rename("empty?") std::queue::empty; -%rename("include?" ) std::queue::__contains__ const; -%rename("has_key?" ) std::queue::has_key const; - -%alias std::queue::push "<<"; - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_set.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_set.i deleted file mode 100755 index 1d96a65e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_set.i +++ /dev/null @@ -1,228 +0,0 @@ -/* - Sets -*/ - -%fragment("StdSetTraits","header",fragment="",fragment="StdSequenceTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::set* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static VALUE from(const std::set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - - - /** - * Set Iterator class for an iterator with no end() boundaries. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class SetIteratorOpen_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef SetIteratorOpen_T self_type; - - public: - SetIteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil) - : Iterator_T(curr, seq) - { - } - - virtual VALUE value() const { - return from(static_cast(*(base::current))); - } - - // no setValue allowed - - Iterator *dup() const - { - return new self_type(*this); - } - }; - - - /** - * Set Iterator class for a iterator where begin() and end() boundaries - are known. - * - */ - template::value_type, - typename FromOper = from_oper, - typename AsvalOper = asval_oper > - class SetIteratorClosed_T : public Iterator_T - { - public: - FromOper from; - AsvalOper asval; - typedef InOutIterator nonconst_iter; - typedef ValueType value_type; - typedef Iterator_T base; - typedef SetIteratorClosed_T self_type; - - protected: - virtual Iterator* advance(ptrdiff_t n) - { - std::advance( base::current, n ); - if ( base::current == end ) - throw stop_iteration(); - return this; - } - - public: - SetIteratorClosed_T(nonconst_iter curr, nonconst_iter first, - nonconst_iter last, VALUE seq = Qnil) - : Iterator_T(curr, seq), begin(first), end(last) - { - } - - virtual VALUE value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - // no setValue allowed - - - Iterator *dup() const - { - return new self_type(*this); - } - - private: - nonconst_iter begin; - nonconst_iter end; - }; - - // Template specialization to construct a closed iterator for sets - // this turns a nonconst iterator into a const one for ruby to avoid - // allowing the user to change the value - template< typename InOutIter > - inline Iterator* - make_set_nonconst_iterator(const InOutIter& current, - const InOutIter& begin, - const InOutIter& end, - VALUE seq = Qnil) - { - return new SetIteratorClosed_T< InOutIter >(current, - begin, end, seq); - } - - // Template specialization to construct an open iterator for sets - // this turns a nonconst iterator into a const one for ruby to avoid - // allowing the user to change the value - template< typename InOutIter > - inline Iterator* - make_set_nonconst_iterator(const InOutIter& current, - VALUE seq = Qnil) - { - return new SetIteratorOpen_T< InOutIter >(current, seq); - } - - } -%} - -%define %swig_sequence_methods_extra_set(Sequence...) - %extend { - %alias reject_bang "delete_if"; - Sequence* reject_bang() { - if ( !rb_block_given_p() ) - rb_raise( rb_eArgError, "no block given" ); - - for ( Sequence::iterator i = $self->begin(); i != $self->end(); ) { - VALUE r = swig::from< Sequence::value_type >(*i); - Sequence::iterator current = i++; - if ( RTEST( rb_yield(r) ) ) - $self->erase(current); - } - - return self; - } - } -%enddef - -%define %swig_set_methods(set...) - - %swig_sequence_methods_common(%arg(set)); - %swig_sequence_methods_extra_set(%arg(set)); - - %fragment("RubyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="RubySequence_Cont") {} - -// Redefine std::set iterator/reverse_iterator typemap -%typemap(out,noblock=1) iterator, reverse_iterator { - $result = SWIG_NewPointerObj((swig::make_set_nonconst_iterator<$type>($1, self)), swig::Iterator::descriptor(), SWIG_POINTER_OWN); - } - -// Redefine std::set std::pair typemap - %typemap(out,noblock=1,fragment="RubyPairBoolOutputIterator") - std::pair { - $result = rb_ary_new2(2); - rb_ary_push($result, SWIG_NewPointerObj((swig::make_set_nonconst_iterator($1.first)), swig::Iterator::descriptor(), SWIG_POINTER_OWN)); - rb_ary_push($result, SWIG_From(bool)(%static_cast($1,const $type &).second)); - } - - %extend { - %alias push "<<"; - value_type push(const value_type& x) { - self->insert(x); - return x; - } - - bool __contains__(const value_type& x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - - }; -%enddef - - -%mixin std::set "Enumerable"; - - - -%rename("delete") std::set::__delete__; -%rename("reject!") std::set::reject_bang; -%rename("map!") std::set::map_bang; -%rename("empty?") std::set::empty; -%rename("include?" ) std::set::__contains__ const; -%rename("has_key?" ) std::set::has_key const; - -%alias std::set::push "<<"; - - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_shared_ptr.i deleted file mode 100755 index 3090c44a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_shared_ptr.i +++ /dev/null @@ -1,144 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include -%include - - -%fragment("StdSharedPtrTraits","header",fragment="StdTraitsForwardDeclaration",fragment="") -{ -namespace swig { - /* - Template specialization for functions defined in rubystdcommon.swg. Special handling for shared_ptr - is required as, shared_ptr * is used rather than the usual T *, see shared_ptr.i. - */ - template - struct traits_asptr > { - static int asptr(VALUE obj, std::shared_ptr **val) { - int res = SWIG_ERROR; - swig_type_info *descriptor = type_info >(); - if (val) { - std::shared_ptr *p = 0; - swig_ruby_owntype newmem = {0, 0}; - res = descriptor ? SWIG_ConvertPtrAndOwn(obj, (void **)&p, descriptor, 0, &newmem) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (*val) { - **val = p ? *p : std::shared_ptr(); - } else { - *val = p; - if (newmem.own & SWIG_CAST_NEW_MEMORY) { - // Upcast for pointers to shared_ptr in this generic framework has not been implemented - res = SWIG_ERROR; - } - } - if (newmem.own & SWIG_CAST_NEW_MEMORY) - delete p; - } - } else { - res = descriptor ? SWIG_ConvertPtr(obj, 0, descriptor, 0) : SWIG_ERROR; - } - return res; - } - }; - - template - struct traits_asval > { - static int asval(VALUE obj, std::shared_ptr *val) { - if (val) { - std::shared_ptr ret; - std::shared_ptr *p = &ret; - int res = traits_asptr >::asptr(obj, &p); - if (!SWIG_IsOK(res)) - return res; - *val = ret; - return SWIG_OK; - } else { - return traits_asptr >::asptr(obj, (std::shared_ptr **)(0)); - } - } - }; - - template - struct traits_asval *> { - static int asval(VALUE obj, std::shared_ptr **val) { - if (val) { - typedef typename noconst_traits >::noconst_type noconst_type; - if (*val) { - noconst_type ret; - noconst_type *p = &ret; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) - **(const_cast(val)) = ret; - return res; - } else { - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) - *val = p; - return res; - } - } else { - return traits_asptr >::asptr(obj, (std::shared_ptr **)(0)); - } - } - }; - - template - struct traits_as, pointer_category> { - static std::shared_ptr as(VALUE obj) { - std::shared_ptr ret; - std::shared_ptr *v = &ret; - int res = traits_asptr >::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return ret; - } else { - - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) - SWIG_Error(SWIG_TypeError, swig::type_name >()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as *, pointer_category> { - static std::shared_ptr * as(VALUE obj) { - std::shared_ptr *p = 0; - int res = traits_asptr >::asptr(obj, &p); - if (SWIG_IsOK(res)) { - return p; - } else { - - VALUE lastErr = rb_gv_get("$!"); - if (lastErr == Qnil) - SWIG_Error(SWIG_TypeError, swig::type_name *>()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_from_ptr > { - static VALUE from(std::shared_ptr *val, int owner = 0) { - if (val && *val) { - return SWIG_NewPointerObj(val, type_info >(), owner); - } else { - return Qnil; - } - } - }; - - /* - The descriptors in the shared_ptr typemaps remove the const qualifier for the SWIG type system. - Remove const likewise here, otherwise SWIG_TypeQuery("std::shared_ptr") will return NULL. - */ - template - struct traits_from > { - static VALUE from(const std::shared_ptr& val) { - std::shared_ptr p = std::const_pointer_cast(val); - return swig::from(p); - } - }; -} -} - -%fragment("StdSharedPtrTraits"); diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_sstream.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_sstream.i deleted file mode 100755 index c145049e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_sstream.i +++ /dev/null @@ -1,2 +0,0 @@ - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_stack.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_stack.i deleted file mode 100755 index 5d9c205f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_stack.i +++ /dev/null @@ -1,35 +0,0 @@ -/* - Stacks -*/ - -%fragment("StdStackTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::stack **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::stack& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - - -%rename("delete") std::stack::__delete__; -%rename("reject!") std::stack::reject_bang; -%rename("map!") std::stack::map_bang; -%rename("empty?") std::stack::empty; -%rename("include?" ) std::stack::__contains__ const; -%rename("has_key?" ) std::stack::has_key const; - -%alias std::stack::push "<<"; - - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_streambuf.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_streambuf.i deleted file mode 100755 index 7b3552f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_streambuf.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_string.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_string.i deleted file mode 100755 index 680b6887..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_string.i +++ /dev/null @@ -1,7 +0,0 @@ - -%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::basic_string; - -AUTODOC(substr, "Return a portion of the String"); - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_unique_ptr.i deleted file mode 100755 index 79320de6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_map.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_map.i deleted file mode 100755 index 8a74a5c0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_map.i +++ /dev/null @@ -1,83 +0,0 @@ -// -// Maps -// -%include - -%fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_map *map) { - typedef typename std::unordered_map::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::unordered_map map_type; - static int asptr(VALUE obj, map_type **val) { - int res = SWIG_ERROR; - if (TYPE(obj) == T_HASH) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - map_type *p; - swig_type_info *descriptor = swig::type_info(); - res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_map map_type; - typedef typename map_type::const_iterator const_iterator; - typedef typename map_type::size_type size_type; - - static VALUE from(const map_type& map) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); - } else { - size_type size = map.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, "map size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= map.begin(); i!= map.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - rb_hash_aset(obj, key, val); - } - return obj; - } - } - }; - } -} - -#define %swig_unordered_map_common(Map...) %swig_map_common(Map) -#define %swig_unordered_map_methods(Map...) %swig_map_methods(Map) - -%rename("delete") std::unordered_map::__delete__; -%rename("reject!") std::unordered_map::reject_bang; -%rename("map!") std::unordered_map::map_bang; -%rename("empty?") std::unordered_map::empty; -%rename("include?") std::unordered_map::__contains__ const; -%rename("has_key?") std::unordered_map::has_key const; - -%mixin std::unordered_map "Enumerable"; -%alias std::unordered_map::push "<<"; - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_multimap.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_multimap.i deleted file mode 100755 index 3c1071ba..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_multimap.i +++ /dev/null @@ -1,100 +0,0 @@ -/* - Multimaps -*/ -%include - -%fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits") -{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_multimap *multimap) { - typedef typename std::unordered_multimap::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - - template - struct traits_asptr > { - typedef std::unordered_multimap multimap_type; - static int asptr(VALUE obj, std::unordered_multimap **val) { - int res = SWIG_ERROR; - if ( TYPE(obj) == T_HASH ) { - static ID id_to_a = rb_intern("to_a"); - VALUE items = rb_funcall2(obj, id_to_a, 0, 0); - return traits_asptr_stdseq, std::pair >::asptr(items, val); - } else { - multimap_type *p; - res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info(),0); - if (SWIG_IsOK(res) && val) *val = p; - } - return res; - } - }; - - template - struct traits_from > { - typedef std::unordered_multimap multimap_type; - typedef typename multimap_type::const_iterator const_iterator; - typedef typename multimap_type::size_type size_type; - - static VALUE from(const multimap_type& multimap) { - swig_type_info *desc = swig::type_info(); - if (desc && desc->clientdata) { - return SWIG_NewPointerObj(new multimap_type(multimap), desc, SWIG_POINTER_OWN); - } else { - size_type size = multimap.size(); - int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1; - if (rubysize < 0) { - SWIG_RUBY_THREAD_BEGIN_BLOCK; - rb_raise(rb_eRuntimeError, - "multimap_ size not valid in Ruby"); - SWIG_RUBY_THREAD_END_BLOCK; - return Qnil; - } - VALUE obj = rb_hash_new(); - for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) { - VALUE key = swig::from(i->first); - VALUE val = swig::from(i->second); - - VALUE oldval = rb_hash_aref(obj, key); - if (oldval == Qnil) { - rb_hash_aset(obj, key, val); - } else { - // Multiple values for this key, create array if needed - // and add a new element to it. - VALUE ary; - if (TYPE(oldval) == T_ARRAY) { - ary = oldval; - } else { - ary = rb_ary_new2(2); - rb_ary_push(ary, oldval); - rb_hash_aset(obj, key, ary); - } - rb_ary_push(ary, val); - } - } - return obj; - } - } - }; - } -} - -#define %swig_unordered_multimap_methods(MultiMap...) %swig_multimap_methods(MultiMap) - -%mixin std::unordered_multimap "Enumerable"; - -%rename("delete") std::unordered_multimap::__delete__; -%rename("reject!") std::unordered_multimap::reject_bang; -%rename("map!") std::unordered_multimap::map_bang; -%rename("empty?") std::unordered_multimap::empty; -%rename("include?" ) std::unordered_multimap::__contains__ const; -%rename("has_key?" ) std::unordered_multimap::has_key const; - -%alias std::unordered_multimap::push "<<"; - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_multiset.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_multiset.i deleted file mode 100755 index 429c5112..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_multiset.i +++ /dev/null @@ -1,50 +0,0 @@ -/* - Multisets -*/ - -%include - -%fragment("StdUnorderedMultisetTraits","header",fragment="StdUnorderedSetTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_multiset* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::unordered_multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); - } - }; - - template - struct traits_from > { - static VALUE from(const std::unordered_multiset& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_unordered_multiset_methods(Set...) %swig_unordered_set_methods(Set) - -%mixin std::unordered_multiset "Enumerable"; - -%rename("delete") std::unordered_multiset::__delete__; -%rename("reject!") std::unordered_multiset::reject_bang; -%rename("map!") std::unordered_multiset::map_bang; -%rename("empty?") std::unordered_multiset::empty; -%rename("include?") std::unordered_multiset::__contains__ const; -%rename("has_key?") std::unordered_multiset::has_key const; - -%alias std::unordered_multiset::push "<<"; - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_set.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_set.i deleted file mode 100755 index 29bf70f6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_unordered_set.i +++ /dev/null @@ -1,50 +0,0 @@ -/* - Sets -*/ - -%include - -%fragment("StdUnorderedSetTraits","header",fragment="",fragment="StdSetTraits") -%{ - namespace swig { - template - inline void - assign(const RubySeq& rubyseq, std::unordered_set* seq) { - // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented - typedef typename RubySeq::value_type value_type; - typename RubySeq::const_iterator it = rubyseq.begin(); - for (;it != rubyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - - template - struct traits_asptr > { - static int asptr(VALUE obj, std::unordered_set **s) { - return traits_asptr_stdseq >::asptr(obj, s); - } - }; - - template - struct traits_from > { - static VALUE from(const std::unordered_set& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - -#define %swig_unordered_set_methods(set...) %swig_set_methods(set) - -%mixin std::unordered_set "Enumerable"; - -%rename("delete") std::unordered_set::__delete__; -%rename("reject!") std::unordered_set::reject_bang; -%rename("map!") std::unordered_set::map_bang; -%rename("empty?") std::unordered_set::empty; -%rename("include?" ) std::unordered_set::__contains__ const; -%rename("has_key?" ) std::unordered_set::has_key const; - -%alias std::unordered_set::push "<<"; - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_vector.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_vector.i deleted file mode 100755 index 49744314..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_vector.i +++ /dev/null @@ -1,52 +0,0 @@ -/* - Vectors -*/ - -%fragment("StdVectorTraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(VALUE obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static VALUE from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - - - -%define %swig_vector_methods(Type...) - %swig_sequence_methods(Type) - %swig_sequence_front_inserters(Type); -%enddef - -%define %swig_vector_methods_val(Type...) - %swig_sequence_methods_val(Type); - %swig_sequence_front_inserters(Type); -%enddef - - -%mixin std::vector "Enumerable"; -%ignore std::vector::push_back; -%ignore std::vector::pop_back; - - -%rename("delete") std::vector::__delete__; -%rename("reject!") std::vector::reject_bang; -%rename("map!") std::vector::map_bang; -%rename("empty?") std::vector::empty; -%rename("include?" ) std::vector::__contains__ const; -%rename("has_key?" ) std::vector::has_key const; - -%alias std::vector::push "<<"; - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_vectora.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_vectora.i deleted file mode 100755 index 2d18009e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_vectora.i +++ /dev/null @@ -1,36 +0,0 @@ -/* - Vectors + allocators -*/ - -%fragment("StdVectorATraits","header",fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - typedef std::vector vector_type; - typedef T value_type; - static int asptr(VALUE obj, vector_type **vec) { - return traits_asptr_stdseq::asptr(obj, vec); - } - }; - - template - struct traits_from > { - typedef std::vector vector_type; - static VALUE from(const vector_type& vec) { - return traits_from_stdseq::from(vec); - } - }; - } -%} - - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%mixin std::vector "Enumerable"; -%ignore std::vector::push_back; -%ignore std::vector::pop_back; -%alias std::vector::push "<<"; - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/std_wstring.i b/win64/bin/swig/share/swig/4.1.0/ruby/std_wstring.i deleted file mode 100755 index a7026143..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/std_wstring.i +++ /dev/null @@ -1,63 +0,0 @@ -%{ -#if defined(__linux__) -#include -#if BYTE_ORDER == LITTLE_ENDIAN -#define SWIG_RUBY_ENDIAN "LE" -#elif BYTE_ORDER == BIG_ENDIAN -#define SWIG_RUBY_ENDIAN "BE" -#endif -#else -#define SWIG_RUBY_ENDIAN "LE" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_RUBY_ENCODING_H -#include "ruby/encoding.h" -#endif - -/** - * The internal encoding of std::wstring is defined based on - * the size of wchar_t. If it is not appropriate for your library, - * SWIG_RUBY_WSTRING_ENCODING must be given when compiling. - */ -#ifndef SWIG_RUBY_WSTRING_ENCODING - -#if WCHAR_MAX == 0x7fff || WCHAR_MAX == 0xffff -#define SWIG_RUBY_WSTRING_ENCODING "UTF-16" SWIG_RUBY_ENDIAN -#elif WCHAR_MAX == 0x7fffffff || WCHAR_MAX == 0xffffffff -#define SWIG_RUBY_WSTRING_ENCODING "UTF-32" SWIG_RUBY_ENDIAN -#else -#error unsupported wchar_t size. SWIG_RUBY_WSTRING_ENCODING must be given. -#endif - -#endif - -/** - * If Encoding.default_internal is nil, this encoding will be used - * when converting from std::wstring to String object in Ruby. - */ -#ifndef SWIG_RUBY_INTERNAL_ENCODING -#define SWIG_RUBY_INTERNAL_ENCODING "UTF-8" -#endif - -static rb_encoding *swig_ruby_wstring_encoding; -static rb_encoding *swig_ruby_internal_encoding; - -#ifdef __cplusplus -} -#endif -%} - -%fragment("SWIG_ruby_wstring_encoding_init", "init") { - swig_ruby_wstring_encoding = rb_enc_find( SWIG_RUBY_WSTRING_ENCODING ); - swig_ruby_internal_encoding = rb_enc_find( SWIG_RUBY_INTERNAL_ENCODING ); -} - -%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::basic_string; - -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/stl.i b/win64/bin/swig/share/swig/4.1.0/ruby/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/swigmove.i b/win64/bin/swig/share/swig/4.1.0/ruby/swigmove.i deleted file mode 100755 index 03e87fa2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/timeval.i b/win64/bin/swig/share/swig/4.1.0/ruby/timeval.i deleted file mode 100755 index 3df52f34..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/timeval.i +++ /dev/null @@ -1,69 +0,0 @@ -/* - struct timeval * - time_t - - Ruby has builtin class Time. INPUT/OUTPUT typemap for timeval and - time_t is provided. - -*/ -%{ -#ifdef __cplusplus -extern "C" { -#endif -#ifdef HAVE_SYS_TIME_H -# include -struct timeval rb_time_timeval(VALUE); -#endif -#ifdef __cplusplus -} -#endif -%} - -%typemap(in) struct timeval *INPUT (struct timeval temp) -{ - if (NIL_P($input)) - $1 = NULL; - else { - temp = rb_time_timeval($input); - $1 = &temp; - } -} - -%typemap(in,numinputs=0) struct timeval *OUTPUT(struct timeval temp) -{ - $1 = &temp; -} - -%typemap(argout) struct timeval *OUTPUT -{ - $result = rb_time_new($1->tv_sec, $1->tv_usec); -} - -%typemap(out) struct timeval * -{ - $result = rb_time_new($1->tv_sec, $1->tv_usec); -} - -%typemap(out) struct timespec * -{ - $result = rb_time_new($1->tv_sec, $1->tv_nsec / 1000); -} - -// time_t -%typemap(in) time_t -{ - if (NIL_P($input)) - $1 = (time_t)-1; - else - $1 = NUM2LONG(rb_funcall2($input, rb_intern("tv_sec"), 0, 0)); -} - -%typemap(typecheck) time_t -{ - $1 = (NIL_P($input) || TYPE(rb_funcall($input, rb_intern("respond_to?"), 1, ID2SYM(rb_intern("tv_sec")))) == T_TRUE); -} - -%typemap(out) time_t -{ - $result = rb_time_new($1, 0); -} diff --git a/win64/bin/swig/share/swig/4.1.0/ruby/typemaps.i b/win64/bin/swig/share/swig/4.1.0/ruby/typemaps.i deleted file mode 100755 index 84090727..00000000 --- a/win64/bin/swig/share/swig/4.1.0/ruby/typemaps.i +++ /dev/null @@ -1,314 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * - * These mappings provide support for input/output arguments and - * common uses for C/C++ pointers. INOUT mappings allow for C/C++ - * pointer variables in addition to input/output arguments. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_USE_OLD_TYPEMAPS) -%include -#else - -/* -The SWIG typemap library provides a language independent mechanism for -supporting output arguments, input values, and other C function -calling mechanisms. The primary use of the library is to provide a -better interface to certain C function--especially those involving -pointers. -*/ - -// ------------------------------------------------------------------------ -// Pointer handling -// -// These mappings provide support for input/output arguments and common -// uses for C/C++ pointers. -// ------------------------------------------------------------------------ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -%define INPUT_TYPEMAP(type, converter) -%typemap(in) type *INPUT($*1_ltype temp), type &INPUT($*1_ltype temp) -{ - temp = ($*1_ltype) converter($input); - $1 = &temp; -} -%typemap(typecheck) type *INPUT = type; -%typemap(typecheck) type &INPUT = type; -%enddef - -INPUT_TYPEMAP(float, NUM2DBL); -INPUT_TYPEMAP(double, NUM2DBL); -INPUT_TYPEMAP(int, NUM2INT); -INPUT_TYPEMAP(short, NUM2SHRT); -INPUT_TYPEMAP(long, NUM2LONG); -INPUT_TYPEMAP(long long, NUM2LL); -INPUT_TYPEMAP(unsigned int, NUM2UINT); -INPUT_TYPEMAP(unsigned short, NUM2USHRT); -INPUT_TYPEMAP(unsigned long, NUM2ULONG); -INPUT_TYPEMAP(unsigned long long, NUM2ULL); -INPUT_TYPEMAP(unsigned char, NUM2UINT); -INPUT_TYPEMAP(signed char, NUM2INT); -INPUT_TYPEMAP(bool, RTEST); - -#undef INPUT_TYPEMAP - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a array element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Ruby Array. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters) : - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include typemaps.i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Ruby output of the function would be a Array containing both -output values. -*/ - -%define OUTPUT_TYPEMAP(type, converter, convtype) -%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 { - VALUE o = converter(convtype (*$1)); - $result = output_helper($result, o); -} -%enddef - -OUTPUT_TYPEMAP(int, INT2NUM, (int)); -OUTPUT_TYPEMAP(short, INT2NUM, (int)); -OUTPUT_TYPEMAP(long, INT2NUM, (long)); -OUTPUT_TYPEMAP(long long, LL2NUM, (long long)); -OUTPUT_TYPEMAP(unsigned int, UINT2NUM, (unsigned int)); -OUTPUT_TYPEMAP(unsigned short, UINT2NUM, (unsigned int)); -OUTPUT_TYPEMAP(unsigned long, UINT2NUM, (unsigned long)); -OUTPUT_TYPEMAP(unsigned long long, ULL2NUM, (unsigned long long)); -OUTPUT_TYPEMAP(unsigned char, UINT2NUM, (unsigned int)); -OUTPUT_TYPEMAP(signed char, INT2NUM, (int)); -OUTPUT_TYPEMAP(float, rb_float_new, (double)); -OUTPUT_TYPEMAP(double, rb_float_new, (double)); - -#undef OUTPUT_TYPEMAP - -%typemap(in,numinputs=0) bool *OUTPUT(bool temp), bool &OUTPUT(bool temp) "$1 = &temp;" -%typemap(argout, fragment="output_helper") bool *OUTPUT, bool &OUTPUT { - VALUE o = (*$1) ? Qtrue : Qfalse; - $result = output_helper($result, o); -} - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Ruby array. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - void neg(double *INOUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Ruby). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Ruby variable you might do this : - - x = neg(x) - -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - -*/ - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned &INOUT = unsigned &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) signed char &INOUT = signed char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned *INOUT = unsigned *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned &INOUT = unsigned &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) signed char &INOUT = signed char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; - -/* Overloading information */ - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) float *INOUT = float; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) float &INOUT = float; - -#endif - -// -------------------------------------------------------------------- -// Special types -// -------------------------------------------------------------------- -%include -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/runtime.swg b/win64/bin/swig/share/swig/4.1.0/runtime.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/boost_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/scilab/boost_shared_ptr.i deleted file mode 100755 index 96cadd42..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/boost_shared_ptr.i +++ /dev/null @@ -1,401 +0,0 @@ -%include - -// Set SHARED_PTR_DISOWN to $disown if required, for example -// #define SHARED_PTR_DISOWN $disown -#if !defined(SHARED_PTR_DISOWN) -#define SHARED_PTR_DISOWN 0 -#endif - -// Language specific macro implementing all the customisations for handling the smart pointer -%define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) - -// %naturalvar is as documented for member variables -%naturalvar TYPE; -%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - -// destructor wrapper customisation -%feature("unref") TYPE -//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" - "(void)arg1; delete smartarg1;" - -// Typemap customisations... - -// plain value -%typemap(in) CONST TYPE (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { - %argument_nullref("$type", $symname, $argnum); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(out) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - if (!argp) { - %variable_nullref("$type", "$name"); - } else { - $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} -%typemap(varout) CONST TYPE { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype($1)); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (!swig_argp) { - %dirout_nullref("$type"); - } else { - $result = *(%reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - } -} - -// plain pointer -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} - -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE * { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE * %{ -#error "directorout typemap for plain pointer not implemented" -%} - -// plain reference -%typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (!argp) { %argument_nullref("$type", $symname, $argnum); } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = %const_cast(tempshared.get(), $1_ltype); - } else { - $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) CONST TYPE & { - void *argp = 0; - int newmem = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; - if (!argp) { - %variable_nullref("$type", "$name"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - $1 = *%const_cast(tempshared.get(), $1_ltype); - } else { - $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); - } -} -%typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) CONST TYPE & %{ -#error "directorout typemap for plain reference not implemented" -%} - -// plain pointer by reference -// Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance -%typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); - temp = %const_cast(tempshared.get(), $*1_ltype); - } else { - temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); - } - $1 = &temp; -} -%typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) TYPE *CONST& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) TYPE *CONST& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1, fragment="SWIG_null_deleter") TYPE *CONST& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) TYPE *CONST& %{ -#error "directorout typemap for plain pointer by reference not implemented" -%} - -// shared_ptr by value -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - int newmem = 0; - void *argp = 0; - int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %variable_fail(res, "$type", "$name"); - } - $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); -} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *swig_argp, int swig_res = 0) { - int newmem = 0; - swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(swig_res)) { - %dirout_fail(swig_res, "$type"); - } - if (swig_argp) { - $result = *(%reinterpret_cast(swig_argp, $<ype)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(swig_argp, $<ype); - } -} - -// shared_ptr by reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ -#error "directorout typemap for shared_ptr ref not implemented" -%} - -// shared_ptr by pointer -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - if (argp) tempshared = *%reinterpret_cast(argp, $ltype); - delete %reinterpret_cast(argp, $ltype); - $1 = &tempshared; - } else { - $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; - } -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); - if ($owner) delete $1; -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ -#error "directorout typemap for pointer to shared_ptr not implemented" -%} - -// shared_ptr by pointer reference -%typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { - int newmem = 0; - res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); - if (!SWIG_IsOK(res)) { - %argument_fail(res, "$type", $symname, $argnum); - } - if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); - if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); - temp = &tempshared; - $1 = &temp; -} -%typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; - %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); -} - -%typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varin typemap not implemented" -%} -%typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "varout typemap not implemented" -%} - -%typemap(directorin,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = ($1 && *$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; - $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); -%} -%typemap(directorout,noblock=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ -#error "directorout typemap for pointer ref to shared_ptr not implemented" -%} - -// Typecheck typemaps -// Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting -// function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) - TYPE CONST, - TYPE CONST &, - TYPE CONST *, - TYPE *CONST&, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, - SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { - int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); - $1 = SWIG_CheckState(res); -} - - -// various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug -%typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} -%typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ -#error "typemaps for $1_type not available" -%} - - -%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; - - -%enddef diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/carrays.i b/win64/bin/swig/share/swig/4.1.0/scilab/carrays.i deleted file mode 100755 index eb4fd683..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/carrays.i +++ /dev/null @@ -1,5 +0,0 @@ -%define %array_class(TYPE,NAME) - %array_class_wrap(TYPE,NAME,__paren__,__paren_asgn__) -%enddef - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/cmalloc.i b/win64/bin/swig/share/swig/4.1.0/scilab/cmalloc.i deleted file mode 100755 index d3a1222e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/cpointer.i b/win64/bin/swig/share/swig/4.1.0/scilab/cpointer.i deleted file mode 100755 index 0e75cbcd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/exception.i b/win64/bin/swig/share/swig/4.1.0/scilab/exception.i deleted file mode 100755 index 14ec9e4c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/exception.i +++ /dev/null @@ -1,6 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), SWIG_Scilab_Error(code, msg);) -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/matrix.i b/win64/bin/swig/share/swig/4.1.0/scilab/matrix.i deleted file mode 100755 index 63912a1e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/matrix.i +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Matrix typemaps - * - */ - -%include -%include -%include -%include - - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/sciarray.swg b/win64/bin/swig/share/swig/4.1.0/scilab/sciarray.swg deleted file mode 100755 index 23bf1e67..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/sciarray.swg +++ /dev/null @@ -1,115 +0,0 @@ -/* -------------------------------------------------------------------------- - * - * Arrays typemaps - * - * --------------------------------------------------------------------------*/ - -%{ -#include -%} - -%define %scilab_asarray_withallocatecopy(TYPEMAPTYPE, FRAGMENTNAME, CTYPE, TEMPDATATYPE) -%typemap(TYPEMAPTYPE, fragment="FRAGMENTNAME") CTYPE { - size_t i = 0; - int iRows = 0; - int iCols = 0; - TEMPDATATYPE *pTempData = NULL; - if (FRAGMENTNAME(pvApiCtx, $input, &iRows, &iCols, &pTempData, fname)) { - return SWIG_ERROR; - } - $1 = ($1_ltype)MALLOC(sizeof($*1_ltype) * iRows * iCols); - for (i = 0; i < iRows * iCols; i++) { - $1[i] = ($*1_ltype) pTempData[i]; - } -} -%enddef - -%define %scilab_asarrayandsize_withcopy(TYPEMAPTYPE, FRAGMENTNAME, CTYPE, TEMPDATATYPE) -%typemap(TYPEMAPTYPE, fragment="FRAGMENTNAME") CTYPE { - int iRows = 0; - int iCols = 0; - TEMPDATATYPE *pTempData = NULL; - if (FRAGMENTNAME(pvApiCtx, $input, &iRows, &iCols, &pTempData, fname)) { - return SWIG_ERROR; - } - if (iRows*iCols <= $1_dim0) { - size_t i; - for (i = 0; i < $1_dim0; i++) { - $1[i] = ($*1_ltype) pTempData[i]; - } - } - else { - char errmsg[100]; - sprintf(errmsg, "Size of input data (%d) is too big (maximum is %d)", - iRows*iCols, $1_dim0); - SWIG_exception_fail(SWIG_OverflowError, errmsg); - } -} -%enddef - -%define %scilab_fromarrayandsize(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - %set_output(FRAGMENTNAME(pvApiCtx, $result, 1, $1_dim0, $1)); -} -%enddef - -%define %scilab_array_typemaps(CTYPE, ASARRAY_FRAGMENT, FROMARRAY_FRAGMENT, TEMPDATATYPE) - %scilab_asarrayandsize_withcopy(varin, ASARRAY_FRAGMENT, CTYPE[ANY], TEMPDATATYPE); - %scilab_asarray_withallocatecopy(in, ASARRAY_FRAGMENT, CTYPE[ANY], TEMPDATATYPE); - %scilab_fromarrayandsize(varout, FROMARRAY_FRAGMENT, CTYPE[ANY]); - %scilab_fromarrayandsize(out, FROMARRAY_FRAGMENT, CTYPE[ANY]); - - %apply SWIGTYPE[] { CTYPE[] }; - %scilab_asarray_withallocatecopy(in, ASARRAY_FRAGMENT, CTYPE[], TEMPDATATYPE); -%enddef - - -// Double -%scilab_array_typemaps(double, SWIG_SciDouble_AsDoubleArrayAndSize, - SWIG_SciDouble_FromDoubleArrayAndSize, double); - -// Signed char - -%scilab_array_typemaps(signed char, SWIG_SciDoubleOrInt8_AsSignedCharArrayAndSize, - SWIG_SciDouble_FromSignedCharArrayAndSize, signed char); - -// Unsigned char -%scilab_array_typemaps(unsigned char, SWIG_SciDoubleOrUint8_AsUnsignedCharArrayAndSize, - SWIG_SciDouble_FromUnsignedCharArrayAndSize, unsigned char); - -// Short -%scilab_array_typemaps(short, SWIG_SciDoubleOrInt16_AsShortArrayAndSize, - SWIG_SciDouble_FromShortArrayAndSize, short); - -// Unsigned short -%scilab_array_typemaps(unsigned short, SWIG_SciDoubleOrUint16_AsUnsignedShortArrayAndSize, - SWIG_SciDouble_FromUnsignedShortArrayAndSize, unsigned short); - -// Int -%scilab_array_typemaps(int, SWIG_SciDoubleOrInt32_AsIntArrayAndSize, - SWIG_SciDouble_FromIntArrayAndSize, int); - -// Unsigned int -%scilab_array_typemaps(unsigned int, SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize, - SWIG_SciDouble_FromUnsignedIntArrayAndSize, unsigned int); - -// Long -%scilab_array_typemaps(long, SWIG_SciDoubleOrInt32_AsIntArrayAndSize, - SWIG_SciDouble_FromLongArrayAndSize, int); - -// Unsigned long -%scilab_array_typemaps(unsigned long, SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize, - SWIG_SciDouble_FromUnsignedLongArrayAndSize, unsigned int); - -// Float -%scilab_array_typemaps(float, SWIG_SciDouble_AsFloatArrayAndSize, - SWIG_SciDouble_FromFloatArrayAndSize, float); - -// Bool -%scilab_array_typemaps(bool, SWIG_SciBoolean_AsIntArrayAndSize, - SWIG_SciBoolean_FromBoolArrayAndSize, int); - -// Char * -%scilab_array_typemaps(char *, SWIG_SciString_AsCharPtrArrayAndSize, - SWIG_SciString_FromCharPtrArrayAndSize, char *); - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scibool.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scibool.swg deleted file mode 100755 index 85d205bd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scibool.swg +++ /dev/null @@ -1,156 +0,0 @@ -/* - * C-type: bool - * Scilab type: boolean scalar - */ -%fragment(SWIG_AsVal_frag(bool), "header") { -SWIGINTERN int -SWIG_AsVal_dec(bool)(SwigSciObject iVar, bool *pbValue) { - SciErr sciErr; - int iRet = 0; - int *piAddrVar = NULL; - int iTempValue = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (!isBooleanType(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean expected.\n"), SWIG_Scilab_GetFuncName(), iVar); - return SWIG_ERROR; - } - - if (!isScalar(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A boolean expected.\n"), SWIG_Scilab_GetFuncName(), iVar); - return SWIG_ERROR; - } - - iRet = getScalarBoolean(pvApiCtx, piAddrVar, &iTempValue); - if (iRet) { - return SWIG_ERROR; - } - - *pbValue = iTempValue; - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(bool), "header") { -SWIGINTERN int -SWIG_From_dec(bool)(bool bValue) { - if (createScalarBoolean(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) - + SWIG_Scilab_GetOutputPosition(), bValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: bool[] - * Scilab type: boolean matrix - */ -%fragment("SWIG_SciBoolean_AsBoolArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_AsBoolArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, bool **pbValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - int *piValue = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isBooleanType(pvApiCtx, piAddrVar)) { - int i; - sciErr = getMatrixOfBoolean(pvApiCtx, piAddrVar, iRows, iCols, &piValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - *pbValue = (bool*) malloc((*iRows) * (*iCols) * sizeof(bool)); - for (i = 0; i < (*iRows) * (*iCols); i++) - (*pbValue)[i] = piValue[i] != 0; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciBoolean_FromBoolArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_FromBoolArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, bool *pbValue) { - SciErr sciErr; - int *piValue = NULL; - int i; - - piValue = (int*) malloc(iRows * iCols * sizeof(int)); - for (i = 0; i < iRows * iCols; i++) - piValue[i] = pbValue[i]; - - sciErr = createMatrixOfBoolean(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, piValue); - if(sciErr.iErr) { - printError(&sciErr, 0); - free(piValue); - return SWIG_ERROR; - } - - free(piValue); - return SWIG_OK; -} -} - -/* - * C-type: int[] - * Scilab type: boolean matrix - */ -%fragment("SWIG_SciBoolean_AsIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_AsIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, int **piValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isBooleanType(pvApiCtx, piAddrVar)) { - sciErr = getMatrixOfBoolean(pvApiCtx, piAddrVar, iRows, iCols, piValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciBoolean_FromIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciBoolean_FromIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, int *piValue) { - SciErr sciErr; - - sciErr = createMatrixOfBoolean(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, piValue); - if(sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scichar.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scichar.swg deleted file mode 100755 index 16ea2818..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scichar.swg +++ /dev/null @@ -1,292 +0,0 @@ -/* - * C-type: char or char* - * Scilab type: string - */ - -/* - * CHAR - */ - -%fragment(SWIG_AsVal_frag(char), "header", fragment="SWIG_SciString_AsChar") { -#define SWIG_AsVal_char(scilabValue, valuePointer) SWIG_SciString_AsChar(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciString_AsChar", "header") { -SWIGINTERN int -SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - char *pstValue = NULL; - int iRet; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isStringType(pvApiCtx, piAddrVar) == 0) - { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - iRet = getAllocatedSingleString(pvApiCtx, piAddrVar, &pstValue); - if (iRet) { - return SWIG_ERROR; - } - - if (pcValue != NULL) { - *pcValue = pstValue[0]; - } - - freeAllocatedSingleString(pstValue); - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(char), "header", fragment="SWIG_SciString_FromChar") { -#define SWIG_From_char(value) SWIG_SciString_FromChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value) -} -%fragment("SWIG_SciString_FromChar", "header") { -SWIGINTERN int -SWIG_SciString_FromChar(void *pvApiCtx, int iVarOut, char chValue) { - char *pchValue = (char*)malloc(sizeof(char) * 2); - pchValue[0] = chValue; - pchValue[1] = '\0'; - - if (createSingleString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, pchValue)) - return SWIG_ERROR; - - free(pchValue); - return SWIG_OK; -} -} - -/* - * CHAR * -*/ - -%fragment("SWIG_AsCharArray", "header", fragment = "SWIG_SciString_AsCharPtr") { -#define SWIG_AsCharArray(scilabValue, charPtrPointer, charPtrLength) SWIG_SciString_AsCharPtr(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciString_AsCharPtr", "header") { -SWIGINTERN int -SWIG_SciString_AsCharPtr(void *pvApiCtx, int iVar, char *pcValue, int iLength, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - char* pcTmpValue = NULL; - int iRet; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - iRet = getAllocatedSingleString(pvApiCtx, piAddrVar, &pcTmpValue); - if (iRet) { - return SWIG_ERROR; - } - - if (pcValue != NULL) { - strncpy(pcValue, pcTmpValue, iLength); - } - - freeAllocatedSingleString(pcTmpValue); - return SWIG_OK; -} -} - -%fragment("SWIG_AsCharPtrAndSize", "header", fragment = "SWIG_SciString_AsCharPtrAndSize") { -#define SWIG_AsCharPtrAndSize(scilabValue, charPtrPointer, charPtrLength, allocMemory) SWIG_SciString_AsCharPtrAndSize(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, allocMemory, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciString_AsCharPtrAndSize", "header") { -SWIGINTERN int -SWIG_SciString_AsCharPtrAndSize(void *pvApiCtx, int iVar, char **pcValue, size_t *piLength, int *alloc, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - char *pstString = NULL; - int iRows = 0; - int iCols = 0; - int iLen = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isScalar(pvApiCtx, piAddrVar) == 0 || isStringType(pvApiCtx, piAddrVar) == 0) - { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &iLen, NULL); - if (sciErr.iErr) - { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - pstString = %new_array(iLen + 1, char); - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &iLen, &pstString); - if (sciErr.iErr) - { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - // TODO: return SWIG_ERROR if pcValue NULL (now returning SWIG_ERROR fails some typechecks) - if (pcValue) { - *pcValue = pstString; - } - - if (alloc != NULL) { - *alloc = SWIG_NEWOBJ; - } - - if (piLength != NULL) { - *piLength = strlen(pstString); - } - - return SWIG_OK; -} -} - -%fragment("SWIG_FromCharPtr", "header", fragment = "SWIG_SciString_FromCharPtr") { -#define SWIG_FromCharPtr(charPtr) SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr) -} -%fragment("SWIG_SciString_FromCharPtr", "header") { -SWIGINTERN int -SWIG_SciString_FromCharPtr(void *pvApiCtx, int iVarOut, const char *pchValue) { - if (pchValue) { - SciErr sciErr; - const char* pstStrings[1]; - pstStrings[0] = pchValue; - - sciErr = createMatrixOfString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, 1, 1, pstStrings); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - int iRet = createEmptyMatrix(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut); - if (iRet) { - return SWIG_ERROR; - } - } - - return SWIG_OK; -} -} - -/* - * CHAR * ARRAY - */ - -%fragment("SWIG_SciString_AsCharPtrArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciString_AsCharPtrArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, char ***charPtrArray, char *fname) { - SciErr sciErr; - int i = 0; - int *piAddrVar = NULL; - int* piLength = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, iRows, iCols, NULL, NULL); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - piLength = (int*) malloc((*iRows) * (*iCols) * sizeof(int)); - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, iRows, iCols, piLength, NULL); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - *charPtrArray = (char**) malloc((*iRows) * (*iCols) * sizeof(char*)); - for(i = 0 ; i < (*iRows) * (*iCols); i++) { - (*charPtrArray)[i] = (char*) malloc(sizeof(char) * (piLength[i] + 1)); - } - - sciErr = getMatrixOfString(pvApiCtx, piAddrVar, iRows, iCols, piLength, *charPtrArray); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - free(piLength); - return SWIG_OK; -} -} - -%fragment("SWIG_SciString_FromCharPtrArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciString_FromCharPtrArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, char **charPtrArray) { - SciErr sciErr; - - sciErr = createMatrixOfString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, (const char* const*) charPtrArray); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_FromCharPtrAndSize", "header", fragment = "SWIG_SciString_FromCharPtr") { -#define SWIG_FromCharPtrAndSize(charPtr, charPtrLength) SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr) -} - - -/* - * Char* Scilab variable - */ - -%fragment(SWIG_CreateScilabVariable_frag(char), "wrapper") { -SWIGINTERN int -SWIG_CreateScilabVariable_dec(char)(void *pvApiCtx, const char* psVariableName, const char cVariableValue) { - SciErr sciErr; - char sValue[2]; - const char* psStrings[1]; - - sValue[0] = cVariableValue; - sValue[1] = '\0'; - psStrings[0] = sValue; - - sciErr = createNamedMatrixOfString(pvApiCtx, psVariableName, 1, 1, psStrings); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - return SWIG_OK; -} -} - -%fragment(SWIG_CreateScilabVariable_frag(charptr), "wrapper") { -SWIGINTERN int -SWIG_CreateScilabVariable_dec(charptr)(void *pvApiCtx, const char* psVariableName, const char* psVariableValue) { - SciErr sciErr; - const char* psStrings[1]; - psStrings[0] = psVariableValue; - - sciErr = createNamedMatrixOfString(pvApiCtx, psVariableName, 1, 1, psStrings); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - return SWIG_OK; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scicontainer.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scicontainer.swg deleted file mode 100755 index 9998c5ab..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scicontainer.swg +++ /dev/null @@ -1,445 +0,0 @@ -/* ----------------------------------------------------------------------------- - * scicontainer.swg - * - * Scilab list <-> C++ container wrapper - * - * This wrapper, and its iterator, allows a general use (and reuse) of - * the mapping between C++ and Scilab, thanks to the C++ templates. - * - * Of course, it needs the C++ compiler to support templates, but - * since we will use this wrapper with the STL containers, that should - * be the case. - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -#if !defined(SWIG_NO_EXPORT_ITERATOR_METHODS) -# if !defined(SWIG_EXPORT_ITERATOR_METHODS) -# define SWIG_EXPORT_ITERATOR_METHODS SWIG_EXPORT_ITERATOR_METHODS -# endif -#endif - - -// #define (SWIG_SCILAB_EXTRA_NATIVE_CONTAINERS) -// if defined: sequences in return are converted from/to Scilab lists or matrices -// if not defined: sequences are passed from/to Scilab as pointers - -%{ -#define SWIG_STD_NOASSIGN_STL -%} - -%include -%include - -%{ -#include -%} - -%include -%include - -%fragment("SciSequence_Cont", "header", - fragment="StdTraits", - fragment="SwigSciIterator_T", - fragment=SWIG_Traits_Sequence_frag(ptr), - fragment=SWIG_Traits_SequenceItem_frag(ptr)) -{ -namespace swig -{ - template - struct SciSequence_Ref - { - SciSequence_Ref(const SwigSciObject& seq, int index) - : _seq(seq), _index(index) - { - if (traits_as_sequence::get(_seq, &piSeqAddr) != SWIG_OK) - { - throw std::invalid_argument("Cannot get sequence data."); - } - } - - operator T () const - { - return traits_asval_sequenceitem::asval(_seq, piSeqAddr, _index); - } - - SciSequence_Ref& operator=(const T& v) - { - // TODO - return *this; - } - - private: - SwigSciObject _seq; - int _index; - void *piSeqAddr; - }; - - - template - struct SciSequence_ArrowProxy - { - SciSequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct SwigSciSequence_InputIterator - { - typedef SwigSciSequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - - SwigSciSequence_InputIterator() - { - } - - SwigSciSequence_InputIterator(const SwigSciObject& seq, int index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - SciSequence_ArrowProxy - operator->() const { - return SciSequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - SwigSciObject _seq; - difference_type _index; - }; - - template - struct SciSequence_Cont - { - typedef SciSequence_Ref reference; - typedef const SciSequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef int difference_type; - typedef int size_type; - typedef const pointer const_pointer; - typedef SwigSciSequence_InputIterator iterator; - typedef SwigSciSequence_InputIterator const_iterator; - - SciSequence_Cont(const SwigSciObject& seq) : _seq(seq) - { - } - - ~SciSequence_Cont() - { - } - - size_type size() const - { - int iSeqSize; - if (traits_as_sequence::size(_seq, &iSeqSize) == SWIG_OK) - { - return iSeqSize; - } - else - { - return SWIG_ERROR; - } - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - private: - SwigSciObject _seq; - }; -} -} - -%define %swig_sequence_iterator(Sequence...) -#if defined(SWIG_EXPORT_ITERATOR_METHODS) - class iterator; - class reverse_iterator; - class const_iterator; - class const_reverse_iterator; - - %typemap(out,noblock=1,fragment="SciSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - %set_output(SWIG_NewPointerObj(swig::make_output_iterator(%static_cast($1,const $type &)), - swig::SciSwigIterator::descriptor(),SWIG_POINTER_OWN)); - } - %typemap(out,fragment="SciSequence_Cont") - std::pair, std::pair { - // TODO: return a Scilab list from the pair (see code for Octave) - } - - %fragment("SciSwigPairBoolOutputIterator", "header", - fragment=SWIG_From_frag(bool), fragment="SciSequence_Cont") {} - - %typemap(out,fragment="SciSwigPairBoolOutputIterator") - std::pair, std::pair { - // TODO: return a Scilab list from the pair (see code for Octave) - } - - %typemap(in,noblock=1,fragment="SciSequence_Cont") - iterator(swig::SciSwigIterator *iter = 0, int res), - reverse_iterator(swig::SciSwigIterator *iter = 0, int res), - const_iterator(swig::SciSwigIterator *iter = 0, int res), - const_reverse_iterator(swig::SciSwigIterator *iter = 0, int res) { - res = SWIG_ConvertPtr((SwigSciObject)$input, %as_voidptrptr(&iter), swig::SciSwigIterator::descriptor(), 0); - if (!SWIG_IsOK(res) || !iter) { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } else { - swig::SwigSciIterator_T<$type > *iter_t = dynamic_cast *>(iter); - if (iter_t) { - $1 = iter_t->get_current(); - } else { - %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); - } - } - } - - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="SciSequence_Cont") - iterator, reverse_iterator, const_iterator, const_reverse_iterator { - swig::SciSwigIterator *iter = 0; - int res = SWIG_ConvertPtr((SwigSciObject)$input, %as_voidptrptr(&iter), swig::SciSwigIterator::descriptor(), 0); - $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); - } - - %fragment("SciSequence_Cont"); -#endif //SWIG_EXPORT_ITERATOR_METHODS -%enddef - -// The Scilab container methods - -%define %swig_container_methods(Container...) -%enddef - -%define %swig_sequence_methods_common(Sequence...) - %swig_sequence_iterator(%arg(Sequence)) - %swig_container_methods(%arg(Sequence)) - -%enddef - -%define %swig_sequence_methods(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -%define %swig_sequence_methods_val(Sequence...) - %swig_sequence_methods_common(%arg(Sequence)) -%enddef - -// -// Common fragments -// - -%fragment("StdSequenceTraits","header", - fragment="StdTraits", - fragment="SciSequence_Cont") -{ -namespace swig { - template - inline void - assign(const SciSeq& sciSeq, Seq* seq) { -%#ifdef SWIG_STD_NOASSIGN_STL - typedef typename SciSeq::value_type value_type; - typename SciSeq::const_iterator it = sciSeq.begin(); - for (;it != sciSeq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } -%#else - seq->assign(sciSeq.begin(), sciSeq.end()); -%#endif - } - - template - struct traits_asptr_stdseq { - typedef Seq sequence; - typedef T value_type; - - static int asptr(const SwigSciObject& obj, sequence **seq) - { - swig_type_info *typeInfo = swig::type_info(); - if (typeInfo) - { - sequence *p; - if (SWIG_ConvertPtr(obj, (void**)&p, typeInfo, 0) == SWIG_OK) - { - if (seq) - *seq = p; - return SWIG_OLDOBJ; - } - } - - if (traits_as_sequence::check(obj) == SWIG_OK) - { - try - { - SciSequence_Cont sciSeq(obj); - if (seq) - { - *seq = new sequence(); - assign(sciSeq, *seq); - return SWIG_NEWOBJ; - } - else - { - return SWIG_ERROR; - } - } - catch (std::exception& e) - { - SWIG_exception(SWIG_RuntimeError, e.what()); - return SWIG_ERROR; - } - } - else - { - return SWIG_ERROR; - } - } - }; - - template - struct traits_from_stdseq { - typedef Seq sequence; - typedef T value_type; - typedef typename Seq::size_type size_type; - typedef typename sequence::const_iterator const_iterator; - - static SwigSciObject from(const sequence& seq) - { - %#ifdef SWIG_SCILAB_EXTRA_NATIVE_CONTAINERS - swig_type_info *typeInfo = swig::type_info(); - if (typeInfo) - { - return SWIG_NewPointerObj(new sequence(seq), typeInfo, SWIG_POINTER_OWN); - } - %#endif - - try - { - void *data; - size_type size = seq.size(); - if (traits_from_sequence::create(size, &data) == SWIG_OK) { - const_iterator it; - int index = 0; - for (it = seq.begin(); it != seq.end(); ++it) - { - traits_from_sequenceitem::from(data, index, *it); - index++; - } - return traits_from_sequence::set(size, data); - } - return SWIG_OK; - } - catch (std::exception& e) - { - SWIG_exception(SWIG_RuntimeError, e.what()); - return SWIG_ERROR; - } - } - }; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scidouble.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scidouble.swg deleted file mode 100755 index 53ffa8f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scidouble.swg +++ /dev/null @@ -1,108 +0,0 @@ -/* - * DOUBLE SCALAR - */ -%fragment(SWIG_AsVal_frag(double), "header", fragment="SWIG_SciDouble_AsDouble") { -%#define SWIG_AsVal_double(scilabValue, valuePointer) SWIG_SciDouble_AsDouble(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_AsDouble", "header") { -SWIGINTERN int -SWIG_SciDouble_AsDouble(void *pvApiCtx, SwigSciObject iVar, double *pdblValue, char *fname) { - SciErr sciErr; - int iRet = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (!isDoubleType(pvApiCtx, piAddrVar) || isVarComplex(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - if (!isScalar(pvApiCtx, piAddrVar)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A real expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - iRet = getScalarDouble(pvApiCtx, piAddrVar, pdblValue); - if (iRet) { - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(double), "header", fragment="SWIG_SciDouble_FromDouble") { -%#define SWIG_From_double(scilabValue) SWIG_SciDouble_FromDouble(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromDouble", "header") { -SWIGINTERN int -SWIG_SciDouble_FromDouble(void *pvApiCtx, int iVarOut, double dblValue, char *fname) { - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, dblValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * DOUBLE ARRAY - */ - -%fragment("SWIG_SciDouble_AsDoubleArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_AsDoubleArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, double **pdValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar) && !isVarComplex(pvApiCtx, piAddrVar)) { - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, pdValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromDoubleArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromDoubleArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, double *pdblValue) { - SciErr sciErr; - sciErr = createMatrixOfDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, pdblValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_CreateScilabVariable_frag(double), "wrapper") { -SWIGINTERN int -SWIG_CreateScilabVariable_dec(double)(void *pvApiCtx, const char* psVariableName, const double dVariableValue) { - SciErr sciErr; - sciErr = createNamedMatrixOfDouble(pvApiCtx, psVariableName, 1, 1, &dVariableValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - return SWIG_OK; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scienum.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scienum.swg deleted file mode 100755 index 21707e80..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scienum.swg +++ /dev/null @@ -1,31 +0,0 @@ -/* - * C-type: enum - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(Enum), "header", fragment="SWIG_Int_AsEnum") { -%#define SWIG_AsVal_Enum(scilabValue, valuePointer) SWIG_Int_AsEnum(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_AsEnum", "header", fragment="SWIG_SciDoubleOrInt32_AsInt") { -SWIGINTERN int -SWIG_Int_AsEnum(void *pvApiCtx, int iVar, int *enumValue, char *fname) { - int iValue = 0; - if (SWIG_SciDoubleOrInt32_AsInt(pvApiCtx, iVar, &iValue, fname) != SWIG_OK) - return SWIG_ERROR; - *enumValue = iValue; - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(Enum), "header", fragment="SWIG_Int_FromEnum") { -%#define SWIG_From_Enum(scilabValue) SWIG_Int_FromEnum(pvApiCtx, SWIG_Scilab_GetOutputPosition(), (int)scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_FromEnum", "header", fragment="SWIG_SciDouble_FromInt") { -SWIGINTERN int -SWIG_Int_FromEnum(void *pvApiCtx, int iVarOut, int enumValue, char *fname) { - if (SWIG_SciDouble_FromInt(pvApiCtx, iVarOut, enumValue, fname) != SWIG_OK) - return SWIG_ERROR; - SWIG_Scilab_SetOutput(pvApiCtx, iVarOut); - return SWIG_OK; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/sciexception.swg b/win64/bin/swig/share/swig/4.1.0/scilab/sciexception.swg deleted file mode 100755 index 53a439b6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/sciexception.swg +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Exception typemaps (throws) - */ - -%include - -%typemap(throws, noblock=1) int, unsigned int, signed int, - int&,unsigned int&, signed int&, - long, unsigned long, signed long, - short, unsigned short,signed short, - long long, unsigned long long, - unsigned char, signed char, - long&, unsigned long&, signed long&, - short&, unsigned short&, signed short&, - long long&, unsigned long long&, - unsigned char&, signed char&, - size_t, size_t&, - ptrdiff_t, ptrdiff_t& { - char obj[20]; - sprintf(obj, "%d", (int)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) enum SWIGTYPE { - char obj[20]; - sprintf(obj, "%d", (int)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) float, double, - float&, double& { - char obj[20]; - sprintf(obj, "%5.3f", (double)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) bool, bool& { - SWIG_Scilab_Raise_Ex($1 ? "true" : "false", "$type", $descriptor); -} - -%typemap(throws, noblock=1) char*, char[ANY] { - SWIG_Scilab_Raise_Ex($1, "$type", $descriptor); -} - -%typemap(throws, noblock=1) char, char& { - char obj[2]; - sprintf(obj, "%c", (char)$1); - SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); -} - -%typemap(throws, noblock=1) SWIGTYPE, - SWIGTYPE*, - SWIGTYPE [ANY], - SWIGTYPE & { - SWIG_Scilab_Raise_Ex((char*)NULL, "$type", $descriptor); -} - -%typemap(throws, noblock=1) (...) { - SWIG_exception(SWIG_RuntimeError, "unknown exception"); -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scifloat.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scifloat.swg deleted file mode 100755 index baa4e1d4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scifloat.swg +++ /dev/null @@ -1,83 +0,0 @@ -/* - * FLOAT SCALAR - */ - -%fragment(SWIG_AsVal_frag(float), "header", fragment=SWIG_AsVal_frag(double)) { -SWIGINTERN int -SWIG_AsVal_dec(float)(SwigSciObject iVar, float *pfValue) { - double dblValue = 0.0; - if(SWIG_AsVal_dec(double)(iVar, &dblValue) != SWIG_OK) { - return SWIG_ERROR; - } - if (pfValue) - *pfValue = (float) dblValue; - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(float), "header") { -SWIGINTERN int -SWIG_From_dec(float)(float flValue) { - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) - + SWIG_Scilab_GetOutputPosition(), (double)flValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_AsFloatArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_AsFloatArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, float **pfValue, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - double *pdValue = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar) && !isVarComplex(pvApiCtx, piAddrVar)) { - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - *pfValue = (float *) malloc((*iRows) * (*iCols) * sizeof(float)); - for (i=0; i < (*iRows) * (*iCols); i++) - (*pfValue)[i] = (float) pdValue[i]; - - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } -} -} - -%fragment("SWIG_SciDouble_FromFloatArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromFloatArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, float *pfValue) { - SciErr sciErr; - double *pdValue; - int i; - - pdValue = (double *) malloc(iRows * iCols * sizeof(double)); - for (i = 0; i < iRows * iCols; i++) - pdValue[i] = pfValue[i]; - - sciErr = createMatrixOfDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, iRows, iCols, pdValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - free(pdValue); - return SWIG_OK; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/sciint.swg b/win64/bin/swig/share/swig/4.1.0/scilab/sciint.swg deleted file mode 100755 index 323fa085..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/sciint.swg +++ /dev/null @@ -1,202 +0,0 @@ -/* - * C-type: int - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(int), "header", fragment="SWIG_SciDoubleOrInt32_AsInt", fragment="") { -%#define SWIG_AsVal_int(scilabValue, valuePointer) SWIG_SciDoubleOrInt32_AsInt(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDoubleOrInt32_AsInt", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt32_AsInt(void *pvApiCtx, SwigSciObject iVar, int *piValue, char *fname) -{ - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - if (piValue) { - int iPrec = 0; - int *piData = NULL; - - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - sciErr = getMatrixOfInteger32(pvApiCtx, piAddrVar, &iRows, &iCols, &piData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - *piValue = *piData; - } - } - else if (iType == sci_matrix) { - if (piValue) { - double *pdData = NULL; - double dValue = 0.0f; - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < INT_MIN) || (dValue > INT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *piValue = (int) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(int), "header", fragment="SWIG_SciDouble_FromInt") { -%#define SWIG_From_int(scilabValue) SWIG_SciDouble_FromInt(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromInt", "header") { -SWIGINTERN int -SWIG_SciDouble_FromInt(void *pvApiCtx, int iVarOut, int iValue, char *fname){ - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) - + iVarOut, (double) iValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: int[] - * Scilab type: double or int32 matrix - */ -%fragment("SWIG_SciDoubleOrInt32_AsIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt32_AsIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, int **piValue, char *fname) { - SciErr sciErr; - int iType = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *piValue = (int*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*piValue)[i] = (int) pdData[i]; - } - else if (iType == sci_ints) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - sciErr = getMatrixOfInteger32(pvApiCtx, piAddrVar, iRows, iCols, piValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const int *piData) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i - -%fragment("SciSwigIterator","header",fragment="") { -namespace swig { - struct stop_iteration { - }; - - struct SciSwigIterator { - private: - SwigSciObject _seq; - - protected: - SciSwigIterator(SwigSciObject seq) : _seq(seq) - { - } - - public: - virtual ~SciSwigIterator() {} - - virtual SwigSciObject value() const = 0; - - virtual SciSwigIterator *incr(size_t n = 1) = 0; - - virtual SciSwigIterator *decr(size_t n = 1) - { - throw stop_iteration(); - } - - virtual ptrdiff_t distance(const SciSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual bool equal (const SciSwigIterator &x) const - { - throw std::invalid_argument("operation not supported"); - } - - virtual SciSwigIterator *copy() const = 0; - - SwigSciObject next() - { - SwigSciObject obj = value(); - incr(); - return obj; - } - - SwigSciObject previous() - { - decr(); - return value(); - } - - SciSwigIterator *advance(ptrdiff_t n) - { - return (n > 0) ? incr(n) : decr(-n); - } - - bool operator == (const SciSwigIterator& x) const - { - return equal(x); - } - - bool operator != (const SciSwigIterator& x) const - { - return ! operator==(x); - } - - SciSwigIterator* operator ++ () { - incr(); - return this; - } - - SciSwigIterator* operator -- () { - decr(); - return this; - } - - SciSwigIterator* operator + (ptrdiff_t n) const - { - return copy()->advance(n); - } - - SciSwigIterator* operator - (ptrdiff_t n) const - { - return copy()->advance(-n); - } - - ptrdiff_t operator - (const SciSwigIterator& x) const - { - return x.distance(*this); - } - - static swig_type_info* descriptor() { - static int init = 0; - static swig_type_info* desc = 0; - if (!init) { - desc = SWIG_TypeQuery("swig::SciSwigIterator *"); - init = 1; - } - return desc; - } - }; -} -} - -%fragment("SwigSciIterator_T","header",fragment="",fragment="SciSwigIterator",fragment="StdTraits",fragment="StdIteratorTraits") { -namespace swig { - template - class SwigSciIterator_T : public SciSwigIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef SwigSciIterator_T self_type; - - SwigSciIterator_T(out_iterator curr, SwigSciObject seq) - : SciSwigIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const SciSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const SciSwigIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef SwigSciObject result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; - - template::value_type, - typename FromOper = from_oper > - class SciSwigIteratorOpen_T : public SwigSciIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigSciIterator_T base; - typedef SciSwigIteratorOpen_T self_type; - - SciSwigIteratorOpen_T(out_iterator curr, SwigSciObject seq) - : SwigSciIterator_T(curr, seq) - { - } - - SwigSciObject value() const { - return from(static_cast(*(base::current))); - } - - SciSwigIterator *copy() const - { - return new self_type(*this); - } - - SciSwigIterator *incr(size_t n = 1) - { - while (n--) { - ++base::current; - } - return this; - } - - SciSwigIterator *decr(size_t n = 1) - { - while (n--) { - --base::current; - } - return this; - } - }; - - template::value_type, - typename FromOper = from_oper > - class SciSwigIteratorClosed_T : public SwigSciIterator_T - { - public: - FromOper from; - typedef OutIterator out_iterator; - typedef ValueType value_type; - typedef SwigSciIterator_T base; - typedef SciSwigIteratorClosed_T self_type; - - SciSwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, SwigSciObject seq) - : SwigSciIterator_T(curr, seq), begin(first), end(last) - { - } - - SwigSciObject value() const { - if (base::current == end) { - throw stop_iteration(); - } else { - return from(static_cast(*(base::current))); - } - } - - SciSwigIterator *copy() const - { - return new self_type(*this); - } - - SciSwigIterator *incr(size_t n = 1) - { - while (n--) { - if (base::current == end) { - throw stop_iteration(); - } else { - ++base::current; - } - } - return this; - } - - SciSwigIterator *decr(size_t n = 1) - { - while (n--) { - if (base::current == begin) { - throw stop_iteration(); - } else { - --base::current; - } - } - return this; - } - - private: - out_iterator begin; - out_iterator end; - }; - - template - inline SciSwigIterator* - make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, SwigSciObject seq = SwigSciObject()) - { - return new SciSwigIteratorClosed_T(current, begin, end, seq); - } - - template - inline SciSwigIterator* - make_output_iterator(const OutIter& current, SwigSciObject seq = SwigSciObject()) - { - return new SciSwigIteratorOpen_T(current, seq); - } -} -} - - -%fragment("SciSwigIterator"); -namespace swig -{ -// Throw a StopIteration exception - %ignore stop_iteration; - struct stop_iteration {}; - - %typemap(throws, noblock=1) stop_iteration - { - SWIG_Scilab_Raise(0, "stop_iteration", NULL); - return SWIG_ERROR; - } - -// Mark methods that return new objects - %newobject SciSwigIterator::copy; - %newobject SciSwigIterator::operator + (ptrdiff_t n) const; - %newobject SciSwigIterator::operator - (ptrdiff_t n) const; - - %nodirector SciSwigIterator; - - %catches(swig::stop_iteration) SciSwigIterator::value() const; - %catches(swig::stop_iteration) SciSwigIterator::incr(size_t n = 1); - %catches(swig::stop_iteration) SciSwigIterator::decr(size_t n = 1); - %catches(std::invalid_argument) SciSwigIterator::distance(const SciSwigIterator &x) const; - %catches(std::invalid_argument) SciSwigIterator::equal (const SciSwigIterator &x) const; - %catches(swig::stop_iteration) SciSwigIterator::next(); - %catches(swig::stop_iteration) SciSwigIterator::previous(); - %catches(swig::stop_iteration) SciSwigIterator::advance(ptrdiff_t n); - %catches(swig::stop_iteration) SciSwigIterator::operator += (ptrdiff_t n); - %catches(swig::stop_iteration) SciSwigIterator::operator -= (ptrdiff_t n); - %catches(swig::stop_iteration) SciSwigIterator::operator + (ptrdiff_t n) const; - %catches(swig::stop_iteration) SciSwigIterator::operator - (ptrdiff_t n) const; - - %ignore SciSwigIterator::operator==; - %ignore SciSwigIterator::operator!=; - %ignore SciSwigIterator::operator++; - %ignore SciSwigIterator::operator--; - %ignore SciSwigIterator::operator+; - %ignore SciSwigIterator::operator-; - - struct SciSwigIterator - { - protected: - SciSwigIterator(SwigSciObject seq); - - public: - virtual ~SciSwigIterator(); - - virtual SwigSciObject value() const = 0; - - virtual SciSwigIterator *incr(size_t n = 1) = 0; - - virtual SciSwigIterator *decr(size_t n = 1); - - virtual ptrdiff_t distance(const SciSwigIterator &x) const; - - virtual bool equal (const SciSwigIterator &x) const; - - virtual SciSwigIterator *copy() const = 0; - - SwigSciObject next(); - SwigSciObject previous(); - SciSwigIterator *advance(ptrdiff_t n); - - bool operator == (const SciSwigIterator& x) const; - bool operator != (const SciSwigIterator& x) const; - SciSwigIterator* operator ++ (); - SciSwigIterator* operator -- (); - SciSwigIterator* operator + (ptrdiff_t n) const; - SciSwigIterator* operator - (ptrdiff_t n) const; - ptrdiff_t operator - (const SciSwigIterator& x) const; - }; -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scilab.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scilab.swg deleted file mode 100755 index dfabfb79..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scilab.swg +++ /dev/null @@ -1,6 +0,0 @@ -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scilist.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scilist.swg deleted file mode 100755 index c689ede9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scilist.swg +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Scilab list related functions - * - */ - -%fragment("SWIG_ScilabList", "header") -{ -SWIGINTERN int -SWIG_GetScilabList(SwigSciObject obj, int **piListAddr) -{ - SciErr sciErr; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -SWIGINTERN int -SWIG_GetScilabListSize(SwigSciObject obj, int *piListSize) -{ - SciErr sciErr; - int *piListAddr; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getListItemNumber(pvApiCtx, piListAddr, piListSize); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -SWIGINTERN int -SWIG_GetScilabListAndSize(SwigSciObject obj, int **piListAddr, int *piListSize) -{ - SciErr sciErr; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getListItemNumber(pvApiCtx, *piListAddr, piListSize); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -SWIGINTERN int -SWIG_CheckScilabList(SwigSciObject obj) -{ - SciErr sciErr; - int *piListAddr; - int iType; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piListAddr, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if ((iType != sci_list) && (iType != sci_tlist) && (iType != sci_mlist)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A list is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - - return SWIG_OK; -} - -} - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scilong.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scilong.swg deleted file mode 100755 index fbc61f6f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scilong.swg +++ /dev/null @@ -1,123 +0,0 @@ -/* - * C-type: long - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(long), "header", fragment="SWIG_SciDoubleOrInt32_AsLong", fragment="") { -%#define SWIG_AsVal_long(scilabValue, valuePointer) SWIG_SciDoubleOrInt32_AsLong(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()); -} -%fragment("SWIG_SciDoubleOrInt32_AsLong", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt32_AsLong(void *pvApiCtx, SwigSciObject iVar, long *plValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - int iPrec = 0; - int *piData = NULL; - - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - sciErr = getMatrixOfInteger32(pvApiCtx, piAddrVar, &iRows, &iCols, &piData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - *plValue = (long) *piData; - } - else if (iType == sci_matrix) { - double *pdData = NULL; - double dValue = 0.0f; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < LONG_MIN) || (dValue > LONG_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 32-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *plValue = (long) dValue; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(long), "header", fragment="SWIG_SciDouble_FromLong") { -%#define SWIG_From_long(scilabValue) SWIG_SciDouble_FromLong(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromLong", "header") { -SWIGINTERN int -SWIG_SciDouble_FromLong(void *pvApiCtx, int iVarOut, long lValue, char *fname) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) lValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - - -%fragment("SWIG_SciDouble_FromLongArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromLongArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const long *plData) { - SciErr sciErr; - int i; - double *pdValues = NULL; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i - -// in (bool *IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, bool *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, bool *IN) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (bool *IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, bool *IN) - -%typemap(in, noblock=1) (int IN_SIZE, bool *IN) (int rowCount, int colCount) -{ - if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (bool**) malloc(sizeof(bool*)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(freearg, noblock=1) (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - free(*$1); - free($1); - free($2); - free($3); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (bool **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int*) malloc(sizeof(int)); - $3 = (bool**) malloc(sizeof(bool*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, bool **OUT) -{ - free($1); - free($2); - free(*$3); - free($3); -} - - -// out (bool **OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (bool **OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit, noblock=1) (bool **OUT, int *OUT_SIZE) -{ - $1 = (bool**) malloc(sizeof(bool*)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (bool **OUT, int *OUT_SIZE) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (bool **OUT, int *OUT_SIZE) -{ - free(*$1); - free($1); - free($2); -} - - -// out (int *OUT_SIZE, bool **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, bool **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, bool **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (bool**) malloc(sizeof(bool*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciBoolean_FromBoolArrayAndSize") (int *OUT_SIZE, bool **OUT) -{ - if (SWIG_SciBoolean_FromBoolArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_SIZE, bool **OUT) -{ - free($1); - free(*$2); - free($2); -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scimatrixchar.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scimatrixchar.swg deleted file mode 100755 index 8fbbb8ec..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scimatrixchar.swg +++ /dev/null @@ -1,199 +0,0 @@ -/* - * C-type: char* - * Scilab type: string matrix - */ - -%include - -// in (char **IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, char **IN) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, char **IN) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (char **IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, char **IN) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN) (int rowCount, int colCount) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (char***) malloc(sizeof(char**)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (char ***OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - { - int i; - for (i = 0; i < (*$2) * (*$3); i++) - free((*$1)[i]); - } - free(*$1); - free($1); - free($2); - free($3); -} - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ - $1 = (char***) malloc(sizeof(char**)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int**) malloc(sizeof(int*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, char ***OUT) -{ - free($1); - free($2); - { - int i; - for (i = 0; i < (*$1) * (*$2); i++) - free((*$3)[i]); - } - free(*$3); - free($3); -} - - -// out (char ***OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (char ***OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit, noblock=1) (char ***OUT, int *OUT_SIZE) -{ - $1 = (char***) malloc(sizeof(char**)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(freearg, noblock=1) (char ***OUT, int *OUT_SIZE) -{ - { - int i; - for (i = 0; i < *$2; i++) - free((*$1)[i]); - } - free(*$1); - free($1); - free($2); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (char ***OUT, int *OUT_SIZE) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, char **IN) - -%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN) -{ - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, 1, &$1, &$2, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// out (int *OUT_SIZE, char ***OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, char ***OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, char ***OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (char***) malloc(sizeof(char**)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciString_FromCharPtrArrayAndSize") (int *OUT_SIZE, char ***OUT) -{ - if (SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_SIZE, char ***OUT) -{ - free($1); - { - int i; - for (i = 0; i < *$1; i++) - free((*$2)[i]); - } - free(*$2); - free($2); -} - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scimatrixdouble.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scimatrixdouble.swg deleted file mode 100755 index 701fe8fe..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scimatrixdouble.swg +++ /dev/null @@ -1,170 +0,0 @@ -/* - * C-type: double array - * Scilab type: double matrix - */ - -%include - -// in (double *IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, double *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, double *IN) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - -// in (double *IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// in (int IN_SIZE, double *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_SIZE, double *IN) (int rowCount, int colCount) -{ - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (double**) malloc(sizeof(double*)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(freearg, noblock=1) (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - free(*$1); - free($1); - free($2); - free($3); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int*) malloc(sizeof(int)); - $3 = (double**) malloc(sizeof(double*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (int *IN_ROWCOUNT, int *IN_COLCOUNT, double **OUT) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, double **OUT) -{ - free($1); - free($2); - free(*$3); - free($3); -} - - -// out (double **OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (double **OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit, noblock=1) (double **OUT, int *OUT_SIZE) -{ - $1 = (double**) malloc(sizeof(double*)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (double **OUT, int *OUT_SIZE) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (double **OUT, int *OUT_SIZE) -{ - free(*$1); - free($1); - free($2); -} - - -// out (int *OUT_SIZE, double **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, double **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, double **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (double**) malloc(sizeof(double*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") (int *OUT_SIZE, double **OUT) -{ - if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_SIZE, double **OUT) -{ - free($1); - free(*$2); - free($2); -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scimatrixint.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scimatrixint.swg deleted file mode 100755 index 2aec1b72..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scimatrixint.swg +++ /dev/null @@ -1,175 +0,0 @@ -/* - * C-type: int array - * Scilab type: 32-bit integer matrix - */ - -%include - -// in (int *IN, int IN_ROWCOUNT, int IN_COLCOUNT) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_ROWCOUNT, int IN_COLCOUNT) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &$2, &$3, &$1, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - - -// in (int IN_ROWCOUNT, int IN_COLCOUNT, int *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, int *IN) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) { - return SWIG_ERROR; - } -} - - -// in (int *IN, int IN_SIZE) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_SIZE) (int rowCount, int colCount) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - - -// in (int IN_SIZE, int *IN) - -%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_SIZE, int *IN) (int rowCount, int colCount) -{ - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; - } - else { - return SWIG_ERROR; - } -} - -// out (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) - -%typemap(in, noblock=1, numinputs=0) (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ -} - -%typemap(arginit, noblock=1) (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - $1 = (int**) malloc(sizeof(int*)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) -{ - free(*$1); - free($1); - free($2); - free($3); -} - - -// out (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int*) malloc(sizeof(int)); - $3 = (int**) malloc(sizeof(int*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *OUT_ROWCOUNT, int *OUT_COLCOUNT, int **OUT) -{ - free($1); - free($2); - free(*$3); - free($3); -} - - -// out (int **OUT, int *OUT_SIZE) - -%typemap(in, noblock=1, numinputs=0) (int **OUT, int *OUT_SIZE) -{ -} - -%typemap(arginit) (int **OUT, int *OUT_SIZE) -{ - $1 = (int**) malloc(sizeof(int*)); - $2 = (int*) malloc(sizeof(int)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int **OUT, int *OUT_SIZE) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int **OUT, int *OUT_SIZE) -{ - free(*$1); - free($1); - free($2); -} - - -// out (int *OUT_SIZE, int **OUT) - -%typemap(in, noblock=1, numinputs=0) (int *OUT_SIZE, int **OUT) -{ -} - -%typemap(arginit, noblock=1) (int *OUT_SIZE, int **OUT) -{ - $1 = (int*) malloc(sizeof(int)); - $2 = (int**) malloc(sizeof(int*)); -} - -%typemap(argout, noblock=1, fragment="SWIG_SciDouble_FromIntArrayAndSize") (int *OUT_SIZE, int **OUT) -{ - if (SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) == SWIG_OK) { - SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); - } - else { - return SWIG_ERROR; - } -} - -%typemap(freearg, noblock=1) (int *IN_SIZE, int **OUT) -{ - free($1); - free(*$2); - free($2); -} - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scimisctypes.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scimisctypes.swg deleted file mode 100755 index ec81351c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scimisctypes.swg +++ /dev/null @@ -1,69 +0,0 @@ -// Other primitive such as size_t and ptrdiff_t - -/* - * C-type: size_t - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(size_t), "header", fragment="SWIG_Int_AsSize") { -%#define SWIG_AsVal_size_t(scilabValue, valuePointer) SWIG_Int_AsSize(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_AsSize", "header", fragment=SWIG_AsVal_frag(int)) -{ -SWIGINTERN int -SWIG_Int_AsSize(void *pvApiCtx, SwigSciObject iVar, size_t *piValue, char *fname) { - int iValue = 0; - if (SWIG_AsVal_dec(int)(iVar, &iValue) != SWIG_OK) - return SWIG_ERROR; - - if (piValue) - *piValue = (size_t) iValue; - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(size_t), "header", fragment="SWIG_Int_FromSize") { -%#define SWIG_From_size_t(scilabValue) SWIG_Int_FromSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_FromSize", "header", fragment=SWIG_From_frag(int)) -{ -SWIGINTERN int -SWIG_Int_FromSize(void *pvApiCtx, int iVarOut, size_t iValue, char *fname) { - return SWIG_From_dec(int)((int)iValue); -} -} - -/* - * C-type: ptrdiff_t - * Scilab type: double or int32 - */ - -%fragment(SWIG_AsVal_frag(ptrdiff_t), "header", fragment="SWIG_Int_AsPtrDiff") { -%#define SWIG_AsVal_ptrdiff_t(scilabValue, valuePointer) SWIG_Int_AsPtrDiff(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_AsPtrDiff", "header", fragment=SWIG_AsVal_frag(int)) -{ -SWIGINTERN int -SWIG_Int_AsPtrDiff(void *pvApiCtx, SwigSciObject iVar, ptrdiff_t *piValue, char *fname) { - int iValue = 0; - if (SWIG_AsVal_dec(int)(iVar, &iValue) != SWIG_OK) - return SWIG_ERROR; - - if (piValue) - *piValue = (ptrdiff_t) iValue; - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(ptrdiff_t), "header", fragment="SWIG_Int_FromPtrDiff") { -%#define SWIG_From_ptrdiff_t(scilabValue) SWIG_Int_FromPtrDiff(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_Int_FromPtrDiff", "header", fragment=SWIG_From_frag(int)) { -SWIGINTERN int -SWIG_Int_FromPtrDiff(void *pvApiCtx, int iVarOut, ptrdiff_t iValue, char *fname) { - return SWIG_From_dec(int)((int)iValue); -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scipointer.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scipointer.swg deleted file mode 100755 index 005f7a5c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scipointer.swg +++ /dev/null @@ -1,32 +0,0 @@ -/* - * POINTER - */ -%fragment("SWIG_ConvertPtr", "header") { -#define SWIG_ConvertPtr(scilabValue, voidPointer, pointerDescriptor, flags) SwigScilabPtrToObject(pvApiCtx, scilabValue, voidPointer, pointerDescriptor, flags, SWIG_Scilab_GetFuncName()) -} - -%fragment("SWIG_NewPointerObj", "header") { -#define SWIG_NewPointerObj(pointer, pointerDescriptor, flags) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, flags, NULL) -} - -/* - * FUNCTION POINTER - */ -%fragment("SWIG_ConvertFunctionPtr", "header") { -#define SWIG_ConvertFunctionPtr(scilabValue, voidPointer, pointerDescriptor) SwigScilabPtrToObject(pvApiCtx, scilabValue, voidPointer, pointerDescriptor, 0, SWIG_Scilab_GetFuncName()) -} - -%fragment("SWIG_NewFunctionPtrObj", "header") { -#define SWIG_NewFunctionPtrObj(pointer, pointerDescriptor) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, 0, NULL) -} -// No fragment used here, the functions "SwigScilabPtrToObject" and "SwigScilabPtrFromObject" are defined in sciruntime.swg - -/* - * C++ member pointers, ie, member methods - */ -%fragment("SWIG_NewMemberObj", "header") { -#define SWIG_NewMemberObj(ptr, sz, tp) SWIG_Scilab_NewMemberObj(pvApiCtx, $result, ptr, sz, tp) -} -%fragment("SWIG_ConvertMember", "header") { -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Scilab_ConvertPacked(pvApiCtx, obj, ptr, sz, ty, SWIG_Scilab_GetFuncName()) -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/sciprimtypes.swg b/win64/bin/swig/share/swig/4.1.0/scilab/sciprimtypes.swg deleted file mode 100755 index 80b88d20..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/sciprimtypes.swg +++ /dev/null @@ -1,23 +0,0 @@ -%include -%include - -%include - -%include -%include - -%include -%include - -%include -%include - -%include -%include -%include - -%include - -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scirun.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scirun.swg deleted file mode 100755 index 723b1fab..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scirun.swg +++ /dev/null @@ -1,532 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Scilab support runtime - * -----------------------------------------------------------------------------*/ - -/* Scilab version macro */ - -#include "version.h" -#define SWIG_SCILAB_VERSION (SCI_VERSION_MAJOR * 100) + (SCI_VERSION_MINOR * 10) + SCI_VERSION_MAINTENANCE - -/* Scilab standard headers */ - -#ifdef __cplusplus -extern "C" { -#endif -#include "api_scilab.h" -#if SWIG_SCILAB_VERSION < 540 -#define __USE_DEPRECATED_STACK_FUNCTIONS__ -#include "stack-c.h" -#endif -#if SWIG_SCILAB_VERSION < 600 -#include "MALLOC.h" -#endif -#include "Scierror.h" -#include "localization.h" -#include "freeArrayOfString.h" -#include -#include -#ifdef __cplusplus -} -#endif - -/* Gateway signature */ - -#if SWIG_SCILAB_VERSION >= 600 -#define SWIG_GatewayParameters char* fname, void *pvApiCtx -#define SWIG_GatewayArguments fname, pvApiCtx -#else -#define SWIG_GatewayParameters char* fname, unsigned long fname_len -#define SWIG_GatewayArguments fname, fname_len -#endif - -/* Function name management functions */ - -#include -static char *SwigFuncName = NULL; -static char *SWIG_Scilab_GetFuncName(void) { - return SwigFuncName; -} -static void SWIG_Scilab_SetFuncName(char *funcName) { - free(SwigFuncName); - SwigFuncName = NULL; - if (funcName) { - SwigFuncName = (char *)malloc(strlen(funcName) + 1); - if (SwigFuncName) - strcpy(SwigFuncName, funcName); - } -} - -/* Api context management functions */ - -#if SWIG_SCILAB_VERSION >= 600 -static void *pvApiCtx = NULL; -static void SWIG_Scilab_SetApiContext(void *apiCtx) { - pvApiCtx = apiCtx; -} -#else -#define SWIG_Scilab_SetApiContext(apiCtx) -#endif - -/* Argument management functions */ - -#if SWIG_SCILAB_VERSION >= 540 -#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) -#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) -#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) -#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) -#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos -#else -#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument) -#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckRhs(minInputArgument, 256) -#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument) -#define SWIG_NbInputArgument(pvApiCtx) Rhs -#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) LhsVar(outputArgumentPos) = argumentPos -#endif - -typedef int SwigSciObject; - -static int SwigOutputPosition = -1; -static int SWIG_Scilab_GetOutputPosition(void) { - return SwigOutputPosition; -} -static void SWIG_Scilab_SetOutputPosition(int outputPosition) { - SwigOutputPosition = outputPosition; -} - -SWIGRUNTIME int -SWIG_Scilab_SetOutput(void *pvApiCtx, SwigSciObject output) { - int outputPosition = SWIG_Scilab_GetOutputPosition(); - if (outputPosition < 0) - return SWIG_ERROR; - SWIG_AssignOutputArgument(pvApiCtx, outputPosition, - SWIG_NbInputArgument(pvApiCtx) + outputPosition); - return SWIG_OK; -} - -/* Error functions */ - -#define SCILAB_API_ARGUMENT_ERROR 999 - -SWIGINTERN const char* -SWIG_Scilab_ErrorType(int code) { - switch(code) { - case SWIG_MemoryError: - return "MemoryError"; - case SWIG_IOError: - return "IOError"; - case SWIG_RuntimeError: - return "RuntimeError"; - case SWIG_IndexError: - return "IndexError"; - case SWIG_TypeError: - return "TypeError"; - case SWIG_DivisionByZero: - return "ZeroDivisionError"; - case SWIG_OverflowError: - return "OverflowError"; - case SWIG_SyntaxError: - return "SyntaxError"; - case SWIG_ValueError: - return "ValueError"; - case SWIG_SystemError: - return "SystemError"; - case SWIG_AttributeError: - return "AttributeError"; - default: - return "RuntimeError"; - } -} -#define SWIG_ErrorType(code) SWIG_Scilab_ErrorType(code) - -#ifndef SWIG_SCILAB_ERROR -#define SWIG_SCILAB_ERROR 20000 -#endif - -SWIGINTERN void -SWIG_Scilab_Error(int code, const char *msg) { - Scierror(SWIG_SCILAB_ERROR - code, _("SWIG/Scilab: %s: %s\n"), SWIG_Scilab_ErrorType(code), msg); -} - -#define SWIG_Error(code, msg) SWIG_Scilab_Error(code, msg) - -#define SWIG_fail return SWIG_ERROR; - -SWIGRUNTIME void -SWIG_Scilab_Raise_Ex(const char *obj, const char *type, swig_type_info *descriptor) { - if (type) { - if (obj) - Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occurred: %s\n", type, obj); - else - Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occurred.\n", type); - } -} - -SWIGRUNTIME void -SWIG_Scilab_Raise(const int obj, const char *type, swig_type_info *descriptor) { - Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occurred.\n", type); -} - -/* Module initialization */ - -static int swig_module_initialized = 0; - -SWIGRUNTIME int -SWIG_Module_Initialized() { - return swig_module_initialized; -} - -/* Pointer conversion functions */ - -SWIGRUNTIME swig_type_info * -SWIG_Scilab_TypeQuery(const char *name); - -SWIGINTERN int -SwigScilabCheckPtr(void *pvApiCtx, int iVar, swig_type_info *descriptor, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - int iType = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_mlist) { - int iItemCount = 0; - void *pvTypeinfo = NULL; - - sciErr = getListItemNumber(pvApiCtx, piAddrVar, &iItemCount); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iItemCount < 3) { - return SWIG_ERROR; - } - - sciErr = getPointerInList(pvApiCtx, piAddrVar, 2, &pvTypeinfo); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (descriptor) { - swig_cast_info *cast = SWIG_TypeCheck(SWIG_TypeName((swig_type_info*)pvTypeinfo), descriptor); - return (cast != NULL); - } - else { - return SWIG_ERROR; - } - } - else { - return (iType == sci_pointer); - } -} - -SWIGINTERN int -SwigScilabPtrToObject(void *pvApiCtx, int iVar, void **pvObj, swig_type_info *descriptor, int flags, char *fname) { - SciErr sciErr; - int *piAddrVar = NULL; - int iType = 0; - void *pvPtr = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_mlist) { - int iItemCount = 0; - void *pvTypeinfo = NULL; - - sciErr = getListItemNumber(pvApiCtx, piAddrVar, &iItemCount); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iItemCount < 3) { - return SWIG_ERROR; - } - - sciErr = getPointerInList(pvApiCtx, piAddrVar, 2, &pvTypeinfo); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getPointerInList(pvApiCtx, piAddrVar, 3, &pvPtr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (pvPtr) { - if (descriptor) { - swig_cast_info *cast = SWIG_TypeCheck(SWIG_TypeName((swig_type_info *)pvTypeinfo), descriptor); - if (cast) { - int newmemory = 0; - pvPtr = SWIG_TypeCast(cast, pvPtr, &newmemory); - // TODO newmemory - } - else { - return SWIG_ERROR; - } - } - } - } - else if (iType == sci_pointer) { - sciErr = getPointer(pvApiCtx, piAddrVar, &pvPtr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - return SWIG_ERROR; - } - - if (pvObj) { - *pvObj = pvPtr; - if (pvPtr) - return SWIG_OK; - else - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - } - else { - return SWIG_ERROR; - } -} - -SWIGRUNTIMEINLINE int -SwigScilabPtrFromObject(void *pvApiCtx, int iVarOut, void *pvObj, swig_type_info *descriptor, int flags, const char *pstTypeName) { - SciErr sciErr; - - if (descriptor) { - int *piMListAddr = NULL; - - sciErr = createMList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, 3, &piMListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (pstTypeName == NULL) { - pstTypeName = SWIG_TypeName(descriptor); - } - - sciErr = createMatrixOfStringInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 1, 1, 1, &pstTypeName); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = createPointerInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 2, descriptor); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = createPointerInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 3, pvObj); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - sciErr = createPointer(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, pvObj); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - - return SWIG_OK; -} - -/* Pointer argument conversions */ - - -SWIGRUNTIME int -SWIG_Scilab_ConvertPacked(void *pvApiCtx, int iVar, void *ptr, int sz, swig_type_info *ty, char *fname) { - swig_cast_info *tc; - int *piAddrVar = NULL; - char *pstString = NULL; - char *pstStringPtr = NULL; - SciErr sciErr; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (getAllocatedSingleString(pvApiCtx, piAddrVar, &pstString)) { - return SWIG_ERROR; - } - - /* Pointer values must start with leading underscore */ - if (*pstString != '_') { - freeAllocatedSingleString(pstString); - return SWIG_ERROR; - } - - pstStringPtr = pstString; - pstStringPtr++; - pstStringPtr = (char*)SWIG_UnpackData(pstStringPtr, ptr, sz); - - if (ty) { - if (!pstStringPtr) { - freeAllocatedSingleString(pstString); - return SWIG_ERROR; - } - tc = SWIG_TypeCheck(pstStringPtr, ty); - if (!tc) { - freeAllocatedSingleString(pstString); - return SWIG_ERROR; - } - } - - freeAllocatedSingleString(pstString); - return SWIG_OK; -} - -SWIGRUNTIME int -SWIG_Scilab_NewMemberObj(void *pvApiCtx, int iVarOut, void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - - if ((2*sz + 1 + strlen(type->name)) > 1000) { - return SWIG_ERROR; - } - *(r++) = '_'; - r = SWIG_PackData(r, ptr, sz); - strcpy(r, type->name); - - if (createSingleString(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, &result[0])) - return SWIG_ERROR; - - return SWIG_OK; -} - - - - -/* - * Pointer utility functions - */ - -#include - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT int SWIG_this(SWIG_GatewayParameters) { - void *ptrValue = NULL; - if (SwigScilabPtrToObject(pvApiCtx, 1, &ptrValue, NULL, 0, fname) == SWIG_OK) { - SWIG_Scilab_SetOutputPosition(1); - return SWIG_Scilab_SetOutput(pvApiCtx, - createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + 1, - (double)(uintptr_t)ptrValue)); - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The value is not a pointer.\n"), fname, 1); - return SWIG_ERROR; - } -} - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT int SWIG_ptr(SWIG_GatewayParameters) { - if (SWIG_NbInputArgument(pvApiCtx) > 0) { - SciErr sciErr; - int *piAddrVar1 = NULL; - int iTypeVar1 = 0; - char *pstInputPtrTypeName = NULL; - char *pstOutputMListTypeName = NULL; - if (SWIG_NbInputArgument(pvApiCtx) > 2) { - int *piAddrVar2 = NULL; - int *piAddrVar3 = NULL; - sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddrVar2); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (getAllocatedSingleString(pvApiCtx, piAddrVar2, &pstInputPtrTypeName)) { - return SWIG_ERROR; - } - sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddrVar3); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (getAllocatedSingleString(pvApiCtx, piAddrVar3, &pstOutputMListTypeName)) { - return SWIG_ERROR; - } - } - - sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddrVar1); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - sciErr = getVarType(pvApiCtx, piAddrVar1, &iTypeVar1); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if ((iTypeVar1 == sci_pointer) || (iTypeVar1 == sci_mlist)) { - void *ptrValue = NULL; - if (SwigScilabPtrToObject(pvApiCtx, 1, &ptrValue, SWIG_Scilab_TypeQuery(pstInputPtrTypeName), 0, (char *) "SWIG_ptr") == SWIG_OK) { - SWIG_Scilab_SetOutputPosition(1); - return SWIG_Scilab_SetOutput(pvApiCtx, - SwigScilabPtrFromObject(pvApiCtx, 1, ptrValue, SWIG_Scilab_TypeQuery(pstInputPtrTypeName), 0, pstOutputMListTypeName)); - } - else { - return SWIG_ERROR; - } - } - else if (iTypeVar1 == sci_matrix) { - double dValue = 0; - if (getScalarDouble(pvApiCtx, piAddrVar1, &dValue) == 0) { - if (dValue != (uintptr_t)dValue) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a pointer.\n"), fname, 1); - return SWIG_ValueError; - } - if ((dValue < 0) || (dValue > ULONG_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a pointer.\n"), fname, 1); - return SWIG_OverflowError; - } - SWIG_Scilab_SetOutputPosition(1); - return SWIG_Scilab_SetOutput(pvApiCtx, - SwigScilabPtrFromObject(pvApiCtx, 1, (void *) (uintptr_t)dValue, SWIG_Scilab_TypeQuery(pstInputPtrTypeName), 0, pstOutputMListTypeName)); - } - else { - return SWIG_TypeError; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A mlist, pointer or a double expected.\n"), (char *) "SWIG_ptr", 1); - return SWIG_TypeError; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: A mlist, pointer, or a double expected.\n"), "SWIG_ptr", 1); - return SWIG_TypeError; - } -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/sciruntime.swg b/win64/bin/swig/share/swig/4.1.0/scilab/sciruntime.swg deleted file mode 100755 index 34e30665..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/sciruntime.swg +++ /dev/null @@ -1,47 +0,0 @@ -%insert(runtime) "swigrun.swg"; -%insert(runtime) "swigerrors.swg"; - -%insert(runtime) "scirun.swg"; - -%insert(init) %{ -/* Module management functions */ - -#define SWIG_GetModule(clientdata) SWIG_Scilab_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Scilab_SetModule(pointer) - -SWIGRUNTIME swig_module_info* -SWIG_Scilab_GetModule(void) { - return NULL; -} - -SWIGRUNTIME void -SWIG_Scilab_SetModule(swig_module_info *swig_module) { -} -%} - -%insert(init) "swiginit.swg" - -%insert(init) %{ -SWIGRUNTIME swig_type_info * -SWIG_Scilab_TypeQuery(const char *name) { - if (SWIG_Module_Initialized()) { - if (name) { - return SWIG_TypeQuery(name); - } - } - else { - SWIG_Error(SWIG_RuntimeError, "the module is not initialized"); - } - return NULL; -} -%} - -%insert(init) %{ -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT int SWIG__Init(SWIG_GatewayParameters) { - SWIG_InitializeModule(NULL); - SWIG_CreateScilabVariables(pvApiCtx); - swig_module_initialized = 1; -%} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scisequence.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scisequence.swg deleted file mode 100755 index 03fb2026..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scisequence.swg +++ /dev/null @@ -1,195 +0,0 @@ -/* - * - * Scilab sequence conversions - * - */ - -#define SWIG_Traits_Sequence_frag(Type) %fragment_name(AsVal_Traits_Sequence, Type) - -#define SWIG_AsCheck_Sequence_frag(Type...) %fragment_name(AsCheck_Sequence, Type) -#define SWIG_AsCheck_Sequence_dec(Type...) %symbol_name(AsCheck_Sequence, Type) -#define SWIG_AsGet_Sequence_frag(Type...) %fragment_name(AsGet_Sequence, Type) -#define SWIG_AsGet_Sequence_dec(Type...) %symbol_name(AsGet_Sequence, Type) -#define SWIG_AsSize_Sequence_frag(Type...) %fragment_name(AsSize_Sequence, Type) -#define SWIG_AsSize_Sequence_dec(Type...) %symbol_name(AsSize_Sequence, Type) -#define SWIG_FromCreate_Sequence_frag(Type...) %fragment_name(FromCreate_Sequence, Type) -#define SWIG_FromCreate_Sequence_dec(Type...) %symbol_name(FromCreate_Sequence, Type) -#define SWIG_FromSet_Sequence_frag(Type...) %fragment_name(FromSet_Sequence, Type) -#define SWIG_FromSet_Sequence_dec(Type...) %symbol_name(FromSet_Sequence, Type) - -#define SWIG_Traits_SequenceItem_frag(Type) %fragment_name(AsVal_Traits_SequenceItem, Type) -#define SWIG_AsVal_SequenceItem_frag(Type...) %fragment_name(AsVal_SequenceItem, Type) -#define SWIG_AsVal_SequenceItem_dec(Type...) %symbol_name(AsVal_SequenceItem, Type) -#define SWIG_From_SequenceItem_frag(Type...) %fragment_name(From_SequenceItem, Type) -#define SWIG_From_SequenceItem_dec(Type...) %symbol_name(From_SequenceItem, Type) - -%include -%include -%include -%include -%include -%include - -// -// Sequence conversion -// - -%fragment(SWIG_Traits_Sequence_frag(ptr), "header", - fragment=SWIG_AsCheck_Sequence_frag(ptr), - fragment=SWIG_AsGet_Sequence_frag(ptr), - fragment=SWIG_AsSize_Sequence_frag(ptr), - fragment=SWIG_FromCreate_Sequence_frag(ptr), - fragment=SWIG_FromSet_Sequence_frag(ptr), - fragment="StdTraits", - fragment="") { - -namespace swig { - // Error returned for sequence containers of default item type - template struct traits_as_sequence { - static int check(SwigSciObject obj) { - throw std::invalid_argument("The container data type is not supported."); - } - static int get(SwigSciObject obj, void **sequence) { - throw std::invalid_argument("The container data type is not supported."); - } - static int size(SwigSciObject obj, int *size) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - template struct traits_from_sequence { - static int create(int size, void **sequence) { - throw std::invalid_argument("The container data type is not supported."); - } - static SwigSciObject set(int size, void *sequence) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - - // Support sequence containers of pointers - template struct traits_as_sequence { - static int check(SwigSciObject obj) { - return SWIG_AsCheck_Sequence_dec(ptr)(obj); - } - static int get(SwigSciObject obj, void **sequence) { - return SWIG_AsGet_Sequence_dec(ptr)(obj, (int **)sequence); - } - static int size(SwigSciObject obj, int *size) { - return SWIG_AsSize_Sequence_dec(ptr)(obj, size); - } - }; - template struct traits_from_sequence { - static int create(int size, void **sequence) { - return SWIG_FromCreate_Sequence_dec(ptr)(size, (uintptr_t **)sequence); - } - static SwigSciObject set(int size, void *sequence) { - return SWIG_FromSet_Sequence_dec(ptr)(size, (uintptr_t *)sequence); - } - }; -} -} - -%define %traits_sequence(CppType, ScilabType) - %fragment(SWIG_Traits_Sequence_frag(CppType), "header", - fragment=SWIG_Traits_Sequence_frag(ptr), - fragment=SWIG_AsCheck_Sequence_frag(CppType), - fragment=SWIG_AsGet_Sequence_frag(CppType), - fragment=SWIG_AsSize_Sequence_frag(CppType), - fragment=SWIG_FromCreate_Sequence_frag(CppType), - fragment=SWIG_FromSet_Sequence_frag(CppType)) { - -namespace swig { - template <> struct traits_as_sequence { - static int check(SwigSciObject obj) { - return SWIG_AsCheck_Sequence_dec(CppType)(obj); - } - static int get(SwigSciObject obj, void **sequence) { - return SWIG_AsGet_Sequence_dec(CppType)(obj, (ScilabType **)sequence); - } - static int size(SwigSciObject obj, int *size) { - return SWIG_AsSize_Sequence_dec(CppType)(obj, size); - } - }; - template <> struct traits_from_sequence { - static int create(int size, void **sequence) { - return SWIG_FromCreate_Sequence_dec(CppType)(size, (ScilabType **)sequence); - } - static SwigSciObject set(int size, void *sequence) { - return SWIG_FromSet_Sequence_dec(CppType)(size, (ScilabType *)sequence); - } - }; -} -} -%enddef - - -// -// Sequence item conversion -// - -%fragment(SWIG_Traits_SequenceItem_frag(ptr), "header", - fragment=SWIG_AsVal_SequenceItem_frag(ptr), - fragment=SWIG_From_SequenceItem_frag(ptr), - fragment="StdTraits", - fragment="") { - -namespace swig { - // Error returned for sequence containers of default item type - template struct traits_asval_sequenceitem { - static T asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - template struct traits_from_sequenceitem { - static int from(void *pSequence, int iItemIndex, T itemValue) { - throw std::invalid_argument("The container data type is not supported."); - } - }; - - // Support sequence containers of pointers - template struct traits_asval_sequenceitem { - static T* asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - return static_cast(SWIG_AsVal_SequenceItem_dec(ptr)(obj, (int *)pSequence, iItemIndex)); - } - }; - template struct traits_from_sequenceitem { - static int from(void *pSequence, int iItemIndex, T *itemValue) { - return SWIG_From_SequenceItem_dec(ptr)((uintptr_t *)pSequence, iItemIndex, (uintptr_t) itemValue); - } - }; -} -} - -%define %traits_sequenceitem(CppType, ScilabType) - %fragment(SWIG_Traits_SequenceItem_frag(CppType), "header", - fragment=SWIG_Traits_SequenceItem_frag(ptr), - fragment=SWIG_AsVal_SequenceItem_frag(CppType), - fragment=SWIG_From_SequenceItem_frag(CppType)) { - -namespace swig { - template <> struct traits_asval_sequenceitem { - static CppType asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - return SWIG_AsVal_SequenceItem_dec(CppType)(obj, (ScilabType *)pSequence, iItemIndex); - } - }; - template <> struct traits_from_sequenceitem { - static int from(void *pSequence, int iItemIndex, CppType itemValue) { - return SWIG_From_SequenceItem_dec(CppType)((ScilabType *)pSequence, iItemIndex, itemValue); - } - }; -} -} -%enddef - -%define %add_traits_sequence(CppType, ScilabType) - %traits_sequence(CppType, ScilabType); - %fragment(SWIG_Traits_Sequence_frag(CppType)); - %traits_sequenceitem(CppType, ScilabType); - %fragment(SWIG_Traits_SequenceItem_frag(CppType)); -%enddef - -%add_traits_sequence(int, int); -%add_traits_sequence(double, double); -%add_traits_sequence(float, float); -%add_traits_sequence(std::string, char*); -%add_traits_sequence(bool, int); - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scisequencebool.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scisequencebool.swg deleted file mode 100755 index ad7e8327..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scisequencebool.swg +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Scilab matrix of bool <-> C++ bool container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(bool), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(bool)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isBooleanType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A boolean is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(bool), "header", - fragment="SWIG_SciBoolean_AsIntArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(bool)(SwigSciObject obj, int **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciBoolean_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(bool), "header", - fragment="SWIG_SciBoolean_AsIntArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(bool)(SwigSciObject obj, int *piSize) { - int *piMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciBoolean_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &piMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: An integer vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(bool), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(bool)(int size, int **pSequence) { - *pSequence = new int[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(bool), "header", - fragment="SWIG_SciBoolean_FromIntArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(bool)(int size, int *pSequence) { - SwigSciObject obj = SWIG_SciBoolean_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (int *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(bool), "header") { - -SWIGINTERN bool -SWIG_AsVal_SequenceItem_dec(bool)(SwigSciObject obj, int *pSequence, int iItemIndex) { - return (bool) pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(bool), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(bool)(int *pSequence, int iItemIndex, bool itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scisequencedouble.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scisequencedouble.swg deleted file mode 100755 index 3989bb22..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scisequencedouble.swg +++ /dev/null @@ -1,99 +0,0 @@ -/* - * - * Scilab matrix of double <-> C++ double container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(double), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(double)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A double is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(double), "header", - fragment="SWIG_SciDouble_AsDoubleArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(double)(SwigSciObject obj, double **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(double), "header", - fragment="SWIG_SciDouble_AsDoubleArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(double)(SwigSciObject obj, int *piSize) { - double *pdblMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &pdblMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A double vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(double), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(double)(int size, double **pSequence) { - *pSequence = new double[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(double), "header", - fragment="SWIG_SciDouble_FromDoubleArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(double)(int size, double *pSequence) { - SwigSciObject obj = SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (double *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(double), "header") { - -SWIGINTERN double -SWIG_AsVal_SequenceItem_dec(double)(SwigSciObject obj, double *pSequence, int iItemIndex) { - return pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(double), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(double)(double *pSequence, int iItemIndex, double itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scisequencefloat.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scisequencefloat.swg deleted file mode 100755 index ec4d55f4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scisequencefloat.swg +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Scilab matrix of float <-> C++ float container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(float), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(float)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isDoubleType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A double is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(float), "header", - fragment="SWIG_SciDouble_AsFloatArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(float)(SwigSciObject obj, float **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciDouble_AsFloatArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(float), "header", - fragment="SWIG_SciDouble_AsFloatArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(float)(SwigSciObject obj, int *piSize) { - float *pdblMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciDouble_AsFloatArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &pdblMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A float vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(float), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(float)(int size, float **pSequence) { - *pSequence = new float[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(float), "header", - fragment="SWIG_SciDouble_FromFloatArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(float)(int size, float *pSequence) { - SwigSciObject obj = SWIG_SciDouble_FromFloatArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (float *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(float), "header") { - -SWIGINTERN float -SWIG_AsVal_SequenceItem_dec(float)(SwigSciObject obj, float *pSequence, int iItemIndex) { - return pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(float), "header") { -SWIGINTERN int -SWIG_From_SequenceItem_dec(float)(float *pSequence, int iItemIndex, float itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scisequenceint.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scisequenceint.swg deleted file mode 100755 index b29d045f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scisequenceint.swg +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * Scilab matrix of int <-> C++ int container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(int), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(int)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - int iType = 0; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if ((iType == sci_matrix) || (iType == sci_ints)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: An integer is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(int), "header", - fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") { -SWIGINTERN int -SWIG_AsGet_Sequence_dec(int)(SwigSciObject obj, int **pSequence) { - int iMatrixRowCount; - int iMatrixColCount; - return (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(int), "header", - fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(int)(SwigSciObject obj, int *piSize) { - int *piMatrix; - int iMatrixRowCount; - int iMatrixColCount; - if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, obj, &iMatrixRowCount, &iMatrixColCount, &piMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - if ((iMatrixRowCount > 1) && (iMatrixColCount > 1)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: An integer vector is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } - *piSize = iMatrixRowCount * iMatrixColCount; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(int), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(int)(int size, int **pSequence) { - *pSequence = new int[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(int), "header", - fragment="SWIG_SciDouble_FromIntArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(int)(int size, int *pSequence) { - SwigSciObject obj = SWIG_SciDouble_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (int *)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(int), "header") { - -SWIGINTERN int -SWIG_AsVal_SequenceItem_dec(int)(SwigSciObject obj, int *pSequence, int iItemIndex) { - return pSequence[iItemIndex]; -} -} - -%fragment(SWIG_From_SequenceItem_frag(int), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(int)(int *pSequence, int iItemIndex, int itemValue) { - pSequence[iItemIndex] = itemValue; - return SWIG_OK; -} -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scisequencepointer.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scisequencepointer.swg deleted file mode 100755 index e74270d3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scisequencepointer.swg +++ /dev/null @@ -1,123 +0,0 @@ -/* - * - * Scilab list of pointer <-> C++ pointer container - * - */ - -%include - -%fragment("", "header") { -%#include -} - -%fragment(SWIG_AsCheck_Sequence_frag(ptr), "header", - fragment="SWIG_ScilabList") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(ptr)(SwigSciObject obj) { - return SWIG_CheckScilabList(obj); -} -} - -%fragment(SWIG_AsGet_Sequence_frag(ptr), "header", - fragment="SWIG_ScilabList") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(ptr)(SwigSciObject obj, int **piSequence) { - return SWIG_GetScilabList(obj, piSequence); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(ptr), "header", - fragment="SWIG_ScilabList") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(ptr)(SwigSciObject obj, int *piSize) { - return SWIG_GetScilabListSize(obj, piSize); -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(ptr), "header", - fragment="") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(ptr)(int size, uintptr_t **pSequence) { - *pSequence = new uintptr_t[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(ptr), "header", - fragment="") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(ptr)(int size, uintptr_t *pSequence) { - SciErr sciErr; - int *piListAddr; - - int iVarOut = SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); - - sciErr = createList(pvApiCtx, iVarOut, size, &piListAddr); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - for (int i=0; i C++ std::string container - * - */ - -%include - -%fragment(SWIG_AsCheck_Sequence_frag(std::string), "header") { - -SWIGINTERN int -SWIG_AsCheck_Sequence_dec(std::string)(SwigSciObject obj) { - SciErr sciErr; - int *piAddrVar; - - sciErr = getVarAddressFromPosition(pvApiCtx, obj, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (isStringType(pvApiCtx, piAddrVar)) { - return SWIG_OK; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A string is expected.\n"), SWIG_Scilab_GetFuncName(), obj); - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_AsGet_Sequence_frag(std::string), "header", - fragment="SWIG_SciString_AsCharPtrArrayAndSize") { - -SWIGINTERN int -SWIG_AsGet_Sequence_dec(std::string)(SwigSciObject obj, char ***pSequence) { - int iRows = 0; - int iCols = 0; - return (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, obj, &iRows, &iCols, pSequence, SWIG_Scilab_GetFuncName())); -} -} - -%fragment(SWIG_AsSize_Sequence_frag(std::string), "header", - fragment="SWIG_SciString_AsCharPtrArrayAndSize") { - -SWIGINTERN int -SWIG_AsSize_Sequence_dec(std::string)(SwigSciObject obj, int *piSize) { - char **pstMatrix; - int iCols = 0; - int iRows = 0; - if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, obj, &iRows, &iCols, &pstMatrix, SWIG_Scilab_GetFuncName()) == SWIG_OK) { - *piSize = iRows * iCols; - return SWIG_OK; - } - return SWIG_ERROR; -} -} - -%fragment(SWIG_FromCreate_Sequence_frag(std::string), "header") { - -SWIGINTERN int -SWIG_FromCreate_Sequence_dec(std::string)(int size, char ***pSequence) { - *pSequence = new char*[size]; - return *pSequence != NULL ? SWIG_OK : SWIG_ERROR; -} -} - -%fragment(SWIG_FromSet_Sequence_frag(std::string), "header", - fragment="SWIG_SciString_FromCharPtrArrayAndSize") { - -SWIGINTERN SwigSciObject -SWIG_FromSet_Sequence_dec(std::string)(int size, char **pSequence) { - SwigSciObject obj = SWIG_SciString_FromCharPtrArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, size, pSequence); - delete (char **)pSequence; - return obj; -} -} - -%fragment(SWIG_AsVal_SequenceItem_frag(std::string), "header") { - -SWIGINTERN std::string -SWIG_AsVal_SequenceItem_dec(std::string)(SwigSciObject obj, char **pSequence, int iItemIndex) { - return std::string(pSequence[iItemIndex]); -} -} - -%fragment(SWIG_From_SequenceItem_frag(std::string), "header") { - -SWIGINTERN int -SWIG_From_SequenceItem_dec(std::string)(char **pSequence, int iItemIndex, std::string itemValue) { - char *pChar = new char((int) itemValue.size() + 1); - strcpy(pChar, itemValue.c_str()); - pSequence[iItemIndex] = pChar; - return SWIG_OK; -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scishort.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scishort.swg deleted file mode 100755 index a87ebc79..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scishort.swg +++ /dev/null @@ -1,188 +0,0 @@ -/* - * C-type: short - * Scilab type: double or int16 - */ - -%fragment(SWIG_AsVal_frag(short), "header", fragment="SWIG_SciDoubleOrInt16_AsShort", fragment="") { -#define SWIG_AsVal_short(scilabValue, valuePointer) SWIG_SciDoubleOrInt16_AsShort(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDoubleOrInt16_AsShort", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt16_AsShort(void *pvApiCtx, int iVar, short *psValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - int iPrec = 0; - short *psData = NULL; - - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT16) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - sciErr = getMatrixOfInteger16(pvApiCtx, piAddrVar, &iRows, &iCols, &psData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - *psValue = *psData; - } - else if (iType == sci_matrix) { - double *pdData = NULL; - double dValue = 0.0f; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 16-bit signed integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < SHRT_MIN) || (dValue > SHRT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 16-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *psValue = (short) dValue; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(short), "header", fragment="SWIG_SciDouble_FromShort") { -#define SWIG_From_short(scilabValue) SWIG_SciDouble_FromShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromShort", "header") { -SWIGINTERN int -SWIG_SciDouble_FromShort(void *pvApiCtx, int iVarOut, short sValue, char *fname) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) sValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: short[] - * Scilab type: double or int16 matrix - */ -%fragment("SWIG_SciDoubleOrInt16_AsShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt16_AsShortArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, short **psValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *psValue = (short*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*psValue)[i] = (short) pdData[i]; - } - else if (iType == sci_ints) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT16) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfInteger16(pvApiCtx, piAddrVar, iRows, iCols, psValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} -%fragment("SWIG_SciDouble_FromShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromShortArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, short *psValue) { - SciErr sciErr; - int i; - double *pdValues = NULL; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i SCHAR_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 8-bit signed integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *pscValue = (signed char) dValue; - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(signed char), "header", fragment="SWIG_SciDouble_FromSignedChar") { -#define SWIG_From_signed_SS_char(scilabValue) SWIG_SciDouble_FromSignedChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue) -} -%fragment("SWIG_SciDouble_FromSignedChar", "header") { -SWIGINTERN int -SWIG_SciDouble_FromSignedChar(void *pvApiCtx, int iVarOut, signed char scValue) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) scValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: signed char[] - * Scilab type: double or int8 matrix - */ -%fragment("SWIG_SciDoubleOrInt8_AsSignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrInt8_AsSignedCharArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, signed char **pscValue, char *fname) { - SciErr sciErr; - int iType = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *pscValue = (signed char*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*pscValue)[i] = (signed char) pdData[i]; - } - else if (iType == sci_ints) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_INT8) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfInteger8(pvApiCtx, piAddrVar, iRows, iCols, (char **)pscValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double matrix expected.\n"), fname, iVar); - return SWIG_ERROR; - } - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromSignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromSignedCharArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const signed char *pscValue) { - SciErr sciErr; - int i; - double *pdValues = NULL; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i struct traits_from_ptr { - static SwigSciObject from(Type *val, int owner = 0) { - return SWIG_OK; //SWIG_NewPointerObj(val, type_info(), owner); - } - }; - - template struct traits_from { - static SwigSciObject from(const Type& val) { - return traits_from_ptr::from(new Type(val), 1); - } - }; - - template struct traits_from { - static SwigSciObject from(Type* val) { - return traits_from_ptr::from(val, 0); - } - }; - - template struct traits_from { - static SwigSciObject from(const Type* val) { - return traits_from_ptr::from(const_cast(val), 0); - } - }; - - - template - inline SwigSciObject from(const Type& val) { - return traits_from::from(val); - } - - template - inline SwigSciObject from_ptr(Type* val, int owner) { - return traits_from_ptr::from(val, owner); - } - - // Traits that provides the asval/as/check method - template - struct traits_asptr { - static int asptr(const SwigSciObject& obj, Type **val) { - Type *p = 0; - swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; - } - return res; - } - }; - - template - inline int asptr(const SwigSciObject& obj, Type **vptr) { - return traits_asptr::asptr(obj, vptr); - } - - template - struct traits_asval { - static int asval(const SwigSciObject& obj, Type *val) { - if (val) { - Type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (!SWIG_IsOK(res)) - return res; - if (p) { - typedef typename noconst_traits::noconst_type noconst_type; - *(const_cast(val)) = *p; - if (SWIG_IsNewObj(res)){ - %delete(p); - res = SWIG_DelNewMask(res); - } - return res; - } else { - return SWIG_ERROR; - } - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template struct traits_asval { - static int asval(const SwigSciObject& obj, Type **val) { - if (val) { - typedef typename noconst_traits::noconst_type noconst_type; - noconst_type *p = 0; - int res = traits_asptr::asptr(obj, &p); - if (SWIG_IsOK(res)) { - *(const_cast(val)) = p; - } - return res; - } else { - return traits_asptr::asptr(obj, (Type **)(0)); - } - } - }; - - template - inline int asval(const SwigSciObject& obj, Type *val) { - return traits_asval::asval(obj, val); - } - - template - struct traits_as { - static Type as(const SwigSciObject& obj) { - Type v; - int res = asval(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - %type_error(swig::type_name()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type as(const SwigSciObject& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res) && v) { - if (SWIG_IsNewObj(res)) { - Type r(*v); - %delete(v); - return r; - } else { - return *v; - } - } else { - %type_error(swig::type_name()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - struct traits_as { - static Type* as(const SwigSciObject& obj) { - Type *v = 0; - int res = traits_asptr::asptr(obj, &v); - if (SWIG_IsOK(res)) { - return v; - } else { - %type_error(swig::type_name()); - throw std::invalid_argument("bad type"); - } - } - }; - - template - inline Type as(const SwigSciObject& obj) { - return traits_as::category>::as(obj); - } - - template - struct traits_check { - static bool check(const SwigSciObject& obj) { - int res = asval(obj, (Type *)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - struct traits_check { - static bool check(const SwigSciObject& obj) { - int res = asptr(obj, (Type **)(0)); - return SWIG_IsOK(res) ? true : false; - } - }; - - template - inline bool check(const SwigSciObject& obj) { - return traits_check::category>::check(obj); - } -} -} - -%define %specialize_std_container(Type,Check,As,From) -%{ -namespace swig { - template <> struct traits_asval { - typedef Type value_type; - static int asval(const SwigSciObject& obj, value_type *val) { - if (Check(obj)) { - if (val) *val = As(obj); - return SWIG_OK; - } - return SWIG_ERROR; - } - }; - template <> struct traits_from { - typedef Type value_type; - static SwigSciObject from(const value_type& val) { - return From(val); - } - }; - - template <> - struct traits_check { - static int check(const SwigSciObject& obj) { - int res = Check(obj); - return obj && res ? res : 0; - } - }; -} -%} -%enddef - - -#define specialize_std_vector(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_list(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_deque(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_set(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) -#define specialize_std_multiset(Type,Check,As,From) %specialize_std_container(%arg(Type),Check,As,From) - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/scitypemaps.swg b/win64/bin/swig/share/swig/4.1.0/scilab/scitypemaps.swg deleted file mode 100755 index bd9906bc..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/scitypemaps.swg +++ /dev/null @@ -1,259 +0,0 @@ -// Scilab fragments for primitive types -%include - -%include - -// Scilab object type -#define SWIG_Object int - -#define %append_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR -#define %set_constant(name, obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR // Name is managed by the function name -#define %raise(obj, type, desc) SWIG_Scilab_Raise(obj, type, desc) -#define %set_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR -#define %set_varoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR -#define %set_argoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR - -// Include the unified typemap library -%include - -/* ---------------------------------------------------------------------------*/ -/* Generic typmemaps */ -/* */ -/* This typemap is used when Scilab does not store this type directly */ -/* For example, a 'float' is stored in Scilab as a 'double' */ -/* So we read a 'double' in Scilab and cast it to a 'float' */ -/* ---------------------------------------------------------------------------*/ - -%define %scilab_in_typemap_withcast(TYPEMAPTYPE, FRAGMENTNAME, CTYPE, TEMPTYPE, TEMPINIT) -%typemap(TYPEMAPTYPE, fragment="FRAGMENTNAME") CTYPE { - TEMPTYPE tempValue = TEMPINIT; - if(FRAGMENTNAME(pvApiCtx, $input, &tempValue, SWIG_Scilab_GetFuncName()) != SWIG_OK) { - return SWIG_ERROR; - } - $1 = (CTYPE) tempValue; -} -%enddef -%define %scilab_inptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $input, %as_voidptrptr(&$1), SWIG_Scilab_GetFuncName()) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_out_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, $1) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_outptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, %as_voidptr($1)) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_varout_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, $value) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_varoutptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $result, %as_voidptr($value)) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - -%define %scilab_in_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) -%typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { - if (FRAGMENTNAME(pvApiCtx, $input, &$1, SWIG_Scilab_GetFuncName()) != SWIG_OK) { - return SWIG_ERROR; - } -} -%enddef - - -/* ---------------------------------------------------------------------------*/ -/* Array typmemaps */ -/* ---------------------------------------------------------------------------*/ - -%include - - -/* ---------------------------------------------------------------------------*/ -/* Enum typemaps */ -/* ---------------------------------------------------------------------------*/ - -%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Enum)) enum SWIGTYPE (int val) { - if (SWIG_AsVal_dec(Enum)($input, &val) != SWIG_OK) { - return SWIG_ERROR; - } - $1 = %static_cast(val, $1_ltype); -} - -%typemap(out, fragment=SWIG_From_frag(Enum)) enum SWIGTYPE { - if (SWIG_From_dec(Enum)($1) != SWIG_OK) { - return SWIG_ERROR; - } -} - -/* ---------------------------------------------------------------------------*/ -/* Typecheck typemaps */ -/* ---------------------------------------------------------------------------*/ - -%define %scilab_typecheck_generic(PRECEDENCE, TYPE_CHECK_FUNCTION, TYPE) -%typecheck(PRECEDENCE) TYPE { - int *piAddrVar = NULL; - SciErr sciErr = getVarAddressFromPosition(pvApiCtx, $input, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - $1 = TYPE_CHECK_FUNCTION(pvApiCtx, piAddrVar); -} -%enddef - -%fragment("SWIG_Check_SciDoubleOrInt", "header") { -SWIGINTERN int -SWIG_Check_SciDoubleOrInt(void *pvApiCtx, SwigSciObject iVar, int iIntegerType) { - int *piAddrVar = NULL; - int ret = 0; - SciErr sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return 0; - } - ret = isIntegerType(pvApiCtx, piAddrVar); - if (ret == 1) { - int iPrec = 0; - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return 0; - } - ret = (iPrec == iIntegerType) ? 1 : 0; - } - else { - ret = isDoubleType(pvApiCtx, piAddrVar); - } - return ret; -} -} - -/* Scilab equivalent for C integers can be sci_intXX or sci_matrix */ -%define %scilab_typecheck_integer(PRECEDENCE, INTTYPE, TYPE) -%typecheck(PRECEDENCE, fragment="SWIG_Check_SciDoubleOrInt") TYPE { - $1 = SWIG_Check_SciDoubleOrInt(pvApiCtx, $input, INTTYPE); -} -%enddef - -%define %scilab_typecheck_pointer(PRECEDENCE, TYPE) -%typecheck(PRECEDENCE) TYPE { - $1 = SwigScilabCheckPtr(pvApiCtx, $input, $descriptor, SWIG_Scilab_GetFuncName()); -} -%enddef - - -// Double (and Float) have priority over before Integer type. - -// Primitive types -%scilab_typecheck_pointer(SWIG_TYPECHECK_VOIDPTR, SWIGTYPE *) -%scilab_typecheck_pointer(SWIG_TYPECHECK_POINTER, SWIGTYPE *) -%scilab_typecheck_generic(SWIG_TYPECHECK_BOOL, isBooleanType, bool) -%scilab_typecheck_generic(16, isDoubleType, double) -%scilab_typecheck_generic(17, isDoubleType, float) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT8, SCI_INT8, signed char) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT8, SCI_UINT8, unsigned char) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT16, SCI_INT16, short) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT16, SCI_UINT16, unsigned short) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, int) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, long) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT32, SCI_UINT32, unsigned int) -%scilab_typecheck_integer(SWIG_TYPECHECK_UINT32, SCI_UINT32, unsigned long) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, enum SWIGTYPE) -%scilab_typecheck_generic(SWIG_TYPECHECK_CHAR, isStringType, char) - -// Arrays -%scilab_typecheck_generic(SWIG_TYPECHECK_BOOL_ARRAY, isBooleanType, bool) -%scilab_typecheck_generic(1016, isDoubleType, double [ANY]) -%scilab_typecheck_generic(1017, isDoubleType, float [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT8_ARRAY, SCI_INT8, signed char [ANY]) -%scilab_typecheck_integer(1026, SCI_UINT8, unsigned char [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT16_ARRAY, SCI_INT16, short [ANY]) -%scilab_typecheck_integer(1036, SCI_UINT16, unsigned short [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32_ARRAY, SCI_INT32, int [ANY]) -%scilab_typecheck_integer(SWIG_TYPECHECK_INT32_ARRAY, SCI_INT32, long [ANY]) -%scilab_typecheck_integer(1046, SCI_UINT32, unsigned int [ANY]) -%scilab_typecheck_integer(1046, SCI_UINT32, unsigned long [ANY]) -%scilab_typecheck_generic(SWIG_TYPECHECK_CHAR_ARRAY, isStringType, char [ANY]) -%scilab_typecheck_generic(SWIG_TYPECHECK_STRING_ARRAY, isStringType, char *[ANY]) -%scilab_typecheck_generic(SWIG_TYPECHECK_STRING_ARRAY, isStringType, char **) - - -/* ---------------------------------------------------------------------------*/ -/* %scilabconstcode() feature typemaps */ -/* ---------------------------------------------------------------------------*/ - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(double)) double -%{ - if (SWIG_CreateScilabVariable_double(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(int)) int -%{ - if (SWIG_CreateScilabVariable_int(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(uint)) unsigned int -%{ - if (SWIG_CreateScilabVariable_uint(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(int)) long -%{ - if (SWIG_CreateScilabVariable_int(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(uint)) unsigned long -%{ - if (SWIG_CreateScilabVariable_uint(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(char)) char -%{ - if (SWIG_CreateScilabVariable_char(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(charptr)) char * -%{ - if (SWIG_CreateScilabVariable_charptr(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - -%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(double)) enum SWIGTYPE -%{ - if (SWIG_CreateScilabVariable_double(pvApiCtx, "$result", $value) != SWIG_OK) - return SWIG_ERROR; -%} - - -/* ---------------------------------------------------------------------------*/ -/* Exception typmemaps */ -/* ---------------------------------------------------------------------------*/ - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/sciunsignedchar.swg b/win64/bin/swig/share/swig/4.1.0/scilab/sciunsignedchar.swg deleted file mode 100755 index 0eb9cc25..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/sciunsignedchar.swg +++ /dev/null @@ -1,190 +0,0 @@ -/* - * C-type: unsigned char - * Scilab type: double or uint8 - */ -%fragment(SWIG_AsVal_frag(unsigned char), "header", fragment="SWIG_SciDoubleOrUint8_AsUnsignedChar", fragment="") { -#define SWIG_AsVal_unsigned_SS_char(scilabValue, valuePointer) SWIG_SciDoubleOrUint8_AsUnsignedChar(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDoubleOrUint8_AsUnsignedChar", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint8_AsUnsignedChar(void *pvApiCtx, int iVar, unsigned char *pucValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iRows = 0; - int iCols = 0; - int iPrec = 0; - int *piAddrVar = NULL; - unsigned char *pucData = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_ints) { - if (pucValue) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iPrec != SCI_UINT8) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger8(pvApiCtx, piAddrVar, &iRows, &iCols, &pucData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - *pucValue = *pucData; - } - } - else if (iType == sci_matrix) { - if (pucValue) { - double *pdData = NULL; - double dValue = 0.0f; - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - if (iRows * iCols != 1) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_TypeError; - } - dValue = *pdData; - if (dValue != floor(dValue)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Incorrect value for input argument #%d: The double value cannot be converted to a 8-bit unsigned integer.\n"), fname, iVar); - return SWIG_ValueError; - } - if ((dValue < 0) || (dValue > UCHAR_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 8-bit unsigned integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *pucValue = (unsigned char) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(unsigned char), "header", fragment="SWIG_SciDouble_FromUnsignedChar") { -#define SWIG_From_unsigned_SS_char(value) SWIG_SciDouble_FromUnsignedChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value) -} -%fragment("SWIG_SciDouble_FromUnsignedChar", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedChar(void *pvApiCtx, int iVarOut, unsigned char ucValue) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) ucValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: unsigned char[] - * Scilab type: double or uint8 matrix - */ -%fragment("SWIG_SciDoubleOrUint8_AsUnsignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint8_AsUnsignedCharArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, unsigned char **pucValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *pucValue = (unsigned char*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*pucValue)[i] = (unsigned char) pdData[i]; - } - else if (iType == sci_ints) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iPrec != SCI_UINT8) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger8(pvApiCtx, piAddrVar, iRows, iCols, pucValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 8-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromUnsignedCharArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedCharArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, const unsigned char *pucValues) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i UINT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 32-bit unsigned integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *puiValue = (unsigned int) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(unsigned int), "header", fragment="SWIG_SciDouble_FromUnsignedInt") { -%#define SWIG_From_unsigned_SS_int(scilabValue) SWIG_SciDouble_FromUnsignedInt(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromUnsignedInt", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedInt(void *pvApiCtx, int iVarOut, unsigned int uiValue, char *fname) { - if (createScalarDouble(pvApiCtx, - SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) uiValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: unsigned int[] - * Scilab type: uint32 vector - */ -%fragment("SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint32_AsUnsignedIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, unsigned int **puiValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *puiValue = (unsigned int*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*puiValue)[i] = (unsigned int) pdData[i]; - } - else if (iType == sci_ints) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iPrec != SCI_UINT32) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger32(pvApiCtx, piAddrVar, iRows, iCols, puiValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromUnsignedIntArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, unsigned int *puiValues) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i USHRT_MAX)) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Overflow error for input argument #%d: The double value cannot be converted to a 16-bit unsigned integer.\n"), fname, iVar); - return SWIG_OverflowError; - } - *pusValue = (unsigned short) dValue; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit unsigned integer or a double expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment(SWIG_From_frag(unsigned short), "header", fragment="SWIG_SciDouble_FromUnsignedShort") { -%#define SWIG_From_unsigned_SS_short(scilabValue) SWIG_SciDouble_FromUnsignedShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFuncName()) -} -%fragment("SWIG_SciDouble_FromUnsignedShort", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedShort(void *pvApiCtx, int iVarOut, unsigned short usValue, char *fname) { - if (createScalarDouble(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, (double) usValue)) - return SWIG_ERROR; - return SWIG_OK; -} -} - -/* - * C-type: unsigned short[] - * Scilab type: uint16 vector - */ -%fragment("SWIG_SciDoubleOrUint16_AsUnsignedShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDoubleOrUint16_AsUnsignedShortArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, unsigned short **pusValue, char *fname) { - SciErr sciErr; - int iType = 0; - int iPrec = 0; - int *piAddrVar = NULL; - - sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - sciErr = getVarType(pvApiCtx, piAddrVar, &iType); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iType == sci_matrix) { - double *pdData = NULL; - int size = 0; - int i; - - sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, &pdData); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - size = (*iRows) * (*iCols); - *pusValue = (unsigned short*) malloc(size * sizeof(int*)); - for (i = 0; i < size; i++) - (*pusValue)[i] = (unsigned short) pdData[i]; - } - else if (iType == sci_ints) { - sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - - if (iPrec != SCI_UINT16) { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - sciErr = getMatrixOfUnsignedInteger16(pvApiCtx, piAddrVar, iRows, iCols, pusValue); - if (sciErr.iErr) { - printError(&sciErr, 0); - return SWIG_ERROR; - } - } - else { - Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 16-bit unsigned integer or a double vector expected.\n"), fname, iVar); - return SWIG_ERROR; - } - - return SWIG_OK; -} -} - -%fragment("SWIG_SciDouble_FromUnsignedShortArrayAndSize", "header") { -SWIGINTERN int -SWIG_SciDouble_FromUnsignedShortArrayAndSize(void *pvApiCtx, int iVarOut, int iRows, int iCols, unsigned short *pusValues) { - SciErr sciErr; - double *pdValues = NULL; - int i; - - pdValues = (double*) malloc(iRows * iCols * sizeof(double)); - for (i=0; i - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_basic_string.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_basic_string.i deleted file mode 100755 index 2cd1bf93..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_basic_string.i +++ /dev/null @@ -1,45 +0,0 @@ -/* - * C++: basic_string - * Scilab: string - */ - -#define %swig_basic_string(Type...) %swig_sequence_methods_val(Type) - -%fragment(SWIG_AsPtr_frag(std::basic_string), "header", fragment="SWIG_SciString_AsCharPtrAndLength") { -SWIGINTERN int -SWIG_AsPtr_dec(std::basic_string)(int _iVar, std::basic_string **_pstValue) { - char* buf = 0; - size_t len = 0; - int alloc = SWIG_OLDOBJ; - - if (SWIG_IsOK((SWIG_SciString_AsCharPtrAndSize(pvApiCtx, _iVar, &buf, &len, &alloc, SWIG_Scilab_GetFuncName())))) { - if (buf) { - if (_pstValue) { - *_pstValue = new std::string(buf, len - 1); - } - if (alloc == SWIG_NEWOBJ) { - delete[] buf; - } - return SWIG_NEWOBJ; - } else { - if (_pstValue) { - *_pstValue = NULL; - } - return SWIG_OLDOBJ; - } - } else { - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::basic_string), "header", fragment="SWIG_SciString_FromCharPtr") { -SWIGINTERN int -SWIG_From_dec(std::basic_string)(std::basic_string _pstValue) { - return SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), _pstValue.c_str()); -} -} - -%include - - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_char_traits.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_char_traits.i deleted file mode 100755 index e60261f9..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_char_traits.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_common.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_common.i deleted file mode 100755 index cce7fb40..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_common.i +++ /dev/null @@ -1,72 +0,0 @@ -%include -%include - - -// Generate the traits for a 'primitive' type, such as 'double', -// for which the SWIG_AsVal and SWIG_From methods are already defined. - -%define %traits_ptypen(Type...) - %fragment(SWIG_Traits_frag(Type),"header", - fragment=SWIG_AsVal_frag(Type), - fragment=SWIG_From_frag(Type), - fragment="StdTraits") { -namespace swig { - template <> struct traits< Type > { - typedef value_category category; - static const char* type_name() { return #Type; } - }; - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SwigSciObject obj, value_type *val) { - return SWIG_AsVal(Type)(obj, val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SwigSciObject from(const value_type& val) { - return SWIG_From(Type)(val); - } - }; -} -} -%enddef - -/* Traits for enums. This is bit of a sneaky trick needed because a generic template specialization of enums - is not possible (unless using template meta-programming which SWIG doesn't support because of the explicit - instantiations required using %template). The STL containers define the 'front' method and the typemap - below is used whenever the front method is wrapped returning an enum. This typemap simply picks up the - standard enum typemap, but additionally drags in a fragment containing the traits_asval and traits_from - required in the generated code for enums. */ - -%define %traits_enum(Type...) - %fragment("SWIG_Traits_enum_"{Type},"header", - fragment=SWIG_AsVal_frag(int), - fragment=SWIG_From_frag(int), - fragment="StdTraits") { -namespace swig { - template <> struct traits_asval< Type > { - typedef Type value_type; - static int asval(SwigSciObject obj, value_type *val) { - return SWIG_AsVal(int)(obj, (int *)val); - } - }; - template <> struct traits_from< Type > { - typedef Type value_type; - static SwigSciObject from(const value_type& val) { - return SWIG_From(int)((int)val); - } - }; -} -} -%typemap(out, fragment="SWIG_Traits_enum_"{Type}) const enum SWIGTYPE& front %{$typemap(out, const enum SWIGTYPE&)%} -%enddef - - -%include - -// -// Generates the traits for all the known primitive -// C++ types (int, double, ...) -// -%apply_cpptypes(%traits_ptypen); - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_container.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_container.i deleted file mode 100755 index 4ab39feb..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_container.i +++ /dev/null @@ -1,3 +0,0 @@ -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_deque.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_deque.i deleted file mode 100755 index bb8a8017..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_deque.i +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * C++ type : STL deque - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdDequeTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::deque **deq) { - return traits_asptr_stdseq >::asptr(obj, deq); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::deque& deq) { - return traits_from_stdseq >::from(deq); - } - }; - } -%} - - -#define %swig_deque_methods(Type...) %swig_sequence_methods(Type) -#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_except.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_except.i deleted file mode 100755 index 3e056e7d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_list.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_list.i deleted file mode 100755 index 17b01f3d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_list.i +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * C++ type : STL list - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdListTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(SwigSciObject obj, std::list **lis) { - return traits_asptr_stdseq >::asptr(obj, lis); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::list &lis) { - return traits_from_stdseq >::from(lis); - } - }; - } -%} - -#define %swig_list_methods(Type...) %swig_sequence_methods(Type) -#define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_map.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_map.i deleted file mode 100755 index 34f11399..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_map.i +++ /dev/null @@ -1,79 +0,0 @@ -// -// SWIG typemaps for std::map -// -// Common implementation - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_multiset.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_multiset.i deleted file mode 100755 index f8c9fa8c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_multiset.i +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * C++ type : STL multiset - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdMultisetTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::multiset **multiset) { - return traits_asptr_stdseq >::asptr(obj, multiset); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::multiset& multiset) { - return traits_from_stdseq >::from(multiset); - } - }; - } -%} - -#define %swig_multiset_methods(Set...) %swig_sequence_methods(Type) -#define %swig_multiset_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_pair.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_pair.i deleted file mode 100755 index ee9b16d4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * Typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_set.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_set.i deleted file mode 100755 index 44e466bf..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_set.i +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * C++ type : STL set - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdSetTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::set **set) { - return traits_asptr_stdseq >::asptr(obj, set); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::set& set) { - return traits_from_stdseq >::from(set); - } - }; - } -%} - - -#define %swig_set_methods(Type...) %swig_sequence_methods(Type) -#define %swig_set_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_shared_ptr.i deleted file mode 100755 index 01a0e9dd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_shared_ptr.i +++ /dev/null @@ -1,2 +0,0 @@ -#define SWIG_SHARED_PTR_NAMESPACE std -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_string.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_string.i deleted file mode 100755 index 62a65e9f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_string.i +++ /dev/null @@ -1,47 +0,0 @@ -/* - * POINTER - */ -%fragment(SWIG_AsPtr_frag(std::string), "header", fragment="SWIG_SciString_AsCharPtrAndSize") { -SWIGINTERN int -SWIG_AsPtr_dec(std::string)(int iVar, std::string **pstValue) { - char* buf = 0; - size_t size = 0; - int alloc = SWIG_OLDOBJ; - - if (SWIG_IsOK((SWIG_SciString_AsCharPtrAndSize(pvApiCtx, iVar, &buf, &size, &alloc, SWIG_Scilab_GetFuncName())))) { - if (buf) { - if (pstValue) { - *pstValue = new std::string(buf, size); - } - if (alloc == SWIG_NEWOBJ) { - delete[] buf; - } - return SWIG_NEWOBJ; - } else { - if (pstValue) { - *pstValue = NULL; - } - return SWIG_OLDOBJ; - } - } else { - return SWIG_ERROR; - } -} -} - -%fragment(SWIG_From_frag(std::string), "header", fragment="SWIG_SciString_FromCharPtr") { -SWIGINTERN int -SWIG_From_dec(std::string)(std::string pstValue) { - return SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pstValue.c_str()); -} -} - -%include - -%typemap(throws, noblock=1) std::string { - SWIG_Scilab_Raise_Ex($1.c_str(), "$type", $&descriptor); -} - -%typemap(throws, noblock=1) const std::string & { - SWIG_Scilab_Raise_Ex($1.c_str(), "$type", $descriptor); -} diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/std_vector.i b/win64/bin/swig/share/swig/4.1.0/scilab/std_vector.i deleted file mode 100755 index 59fb165b..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/std_vector.i +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * C++ type : STL vector - * Scilab type : matrix (for primitive types) or list (for pointer types) - * -*/ - -%fragment("StdVectorTraits", "header", fragment="StdSequenceTraits") -%{ - namespace swig { - template - struct traits_asptr > { - static int asptr(const SwigSciObject &obj, std::vector **vec) { - return traits_asptr_stdseq >::asptr(obj, vec); - } - }; - - template - struct traits_from > { - static SwigSciObject from(const std::vector& vec) { - return traits_from_stdseq >::from(vec); - } - }; - } -%} - - -#define %swig_vector_methods(Type...) %swig_sequence_methods(Type) -#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type); - -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/stl.i b/win64/bin/swig/share/swig/4.1.0/scilab/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/swigmove.i b/win64/bin/swig/share/swig/4.1.0/scilab/swigmove.i deleted file mode 100755 index 03e87fa2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/scilab/typemaps.i b/win64/bin/swig/share/swig/4.1.0/scilab/typemaps.i deleted file mode 100755 index 16046d48..00000000 --- a/win64/bin/swig/share/swig/4.1.0/scilab/typemaps.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps -%define %scilab_input_typemap(Type) -%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Type)) Type *INPUT(Type temp)(int ecode), Type &INPUT(Type temp)(int ecode) { - ecode = SWIG_AsVal_dec(Type)($input, &temp); - if (!SWIG_IsOK(ecode)) { - %argument_fail(ecode, "$type", $symname, $argnum); - } - $1 = &temp; -} - -%typemap(freearg, noblock=1) Type *INPUT, Type &INPUT { -} - -%typemap(typecheck) Type *INPUT, Type &INPUT { -} -%enddef - -// OUTPUT typemaps -%define %scilab_output_typemap(Type) -%typemap(argout, noblock=1, fragment=SWIG_From_frag(Type)) Type *OUTPUT, Type &OUTPUT { - %set_output(SWIG_From_dec(Type)(*$1)); -} -%enddef - -// INOUT typemaps -%define %scilab_inout_typemap(Type) - %typemap(in) Type *INOUT = Type *INPUT; - %typemap(in) Type &INOUT = Type &INPUT; - %typemap(argout) Type *INOUT = Type *OUTPUT; - %typemap(argout) Type &INOUT = Type &OUTPUT; -%enddef - - -%define %scilab_inout_typemaps(Type) - %scilab_input_typemap(%arg(Type)) - %scilab_output_typemap(%arg(Type)) - %scilab_inout_typemap(%arg(Type)) -%enddef - -%scilab_inout_typemaps(double); -%scilab_inout_typemaps(signed char); -%scilab_inout_typemaps(unsigned char); -%scilab_inout_typemaps(short); -%scilab_inout_typemaps(unsigned short); -%scilab_inout_typemaps(int); -%scilab_inout_typemaps(unsigned int); -%scilab_inout_typemaps(long); -%scilab_inout_typemaps(unsigned long); -%scilab_inout_typemaps(bool); -%scilab_inout_typemaps(float); - -//%apply_ctypes(%scilab_inout_typemaps); - - - - - diff --git a/win64/bin/swig/share/swig/4.1.0/shared_ptr.i b/win64/bin/swig/share/swig/4.1.0/shared_ptr.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/README b/win64/bin/swig/share/swig/4.1.0/std/README old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/_std_deque.i b/win64/bin/swig/share/swig/4.1.0/std/_std_deque.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_alloc.i b/win64/bin/swig/share/swig/4.1.0/std/std_alloc.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_array.i b/win64/bin/swig/share/swig/4.1.0/std/std_array.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_basic_string.i b/win64/bin/swig/share/swig/4.1.0/std/std_basic_string.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_carray.swg b/win64/bin/swig/share/swig/4.1.0/std/std_carray.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_char_traits.i b/win64/bin/swig/share/swig/4.1.0/std/std_char_traits.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_common.i b/win64/bin/swig/share/swig/4.1.0/std/std_common.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_container.i b/win64/bin/swig/share/swig/4.1.0/std/std_container.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_deque.i b/win64/bin/swig/share/swig/4.1.0/std/std_deque.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_except.i b/win64/bin/swig/share/swig/4.1.0/std/std_except.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_ios.i b/win64/bin/swig/share/swig/4.1.0/std/std_ios.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_iostream.i b/win64/bin/swig/share/swig/4.1.0/std/std_iostream.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_list.i b/win64/bin/swig/share/swig/4.1.0/std/std_list.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_map.i b/win64/bin/swig/share/swig/4.1.0/std/std_map.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_multimap.i b/win64/bin/swig/share/swig/4.1.0/std/std_multimap.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_multiset.i b/win64/bin/swig/share/swig/4.1.0/std/std_multiset.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_pair.i b/win64/bin/swig/share/swig/4.1.0/std/std_pair.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_queue.i b/win64/bin/swig/share/swig/4.1.0/std/std_queue.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_set.i b/win64/bin/swig/share/swig/4.1.0/std/std_set.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_sstream.i b/win64/bin/swig/share/swig/4.1.0/std/std_sstream.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_stack.i b/win64/bin/swig/share/swig/4.1.0/std/std_stack.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_streambuf.i b/win64/bin/swig/share/swig/4.1.0/std/std_streambuf.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_string.i b/win64/bin/swig/share/swig/4.1.0/std/std_string.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_unordered_map.i b/win64/bin/swig/share/swig/4.1.0/std/std_unordered_map.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_unordered_multimap.i b/win64/bin/swig/share/swig/4.1.0/std/std_unordered_multimap.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_unordered_multiset.i b/win64/bin/swig/share/swig/4.1.0/std/std_unordered_multiset.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_unordered_set.i b/win64/bin/swig/share/swig/4.1.0/std/std_unordered_set.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_vector.i b/win64/bin/swig/share/swig/4.1.0/std/std_vector.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_vectora.i b/win64/bin/swig/share/swig/4.1.0/std/std_vectora.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_wios.i b/win64/bin/swig/share/swig/4.1.0/std/std_wios.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_wiostream.i b/win64/bin/swig/share/swig/4.1.0/std/std_wiostream.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_wsstream.i b/win64/bin/swig/share/swig/4.1.0/std/std_wsstream.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_wstreambuf.i b/win64/bin/swig/share/swig/4.1.0/std/std_wstreambuf.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std/std_wstring.i b/win64/bin/swig/share/swig/4.1.0/std/std_wstring.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/std_except.i b/win64/bin/swig/share/swig/4.1.0/std_except.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/stdint.i b/win64/bin/swig/share/swig/4.1.0/stdint.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/stl.i b/win64/bin/swig/share/swig/4.1.0/stl.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swig.swg b/win64/bin/swig/share/swig/4.1.0/swig.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swigarch.i b/win64/bin/swig/share/swig/4.1.0/swigarch.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swigerrors.swg b/win64/bin/swig/share/swig/4.1.0/swigerrors.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swigfragments.swg b/win64/bin/swig/share/swig/4.1.0/swigfragments.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swiginit.swg b/win64/bin/swig/share/swig/4.1.0/swiginit.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swiglabels.swg b/win64/bin/swig/share/swig/4.1.0/swiglabels.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swigrun.i b/win64/bin/swig/share/swig/4.1.0/swigrun.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swigrun.swg b/win64/bin/swig/share/swig/4.1.0/swigrun.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swigwarn.swg b/win64/bin/swig/share/swig/4.1.0/swigwarn.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/swigwarnings.swg b/win64/bin/swig/share/swig/4.1.0/swigwarnings.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/Makefile.in b/win64/bin/swig/share/swig/4.1.0/tcl/Makefile.in deleted file mode 100755 index d1b6468e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/Makefile.in +++ /dev/null @@ -1,122 +0,0 @@ -# --------------------------------------------------------------- -# SWIG Tcl Makefile -# -# This file can be used to build various Tcl extensions with SWIG. -# By default this file is set up for dynamic loading, but it can -# be easily customized for static extensions by modifying various -# portions of the file. -# -# SRCS = C source files -# CXXSRCS = C++ source files -# OBJCSRCS = Objective-C source files -# OBJS = Additional .o files (compiled previously) -# INTERFACE = SWIG interface file -# TARGET = Name of target module or executable -# -# Many portions of this file were created by the SWIG configure -# script and should already reflect your machine. However, you -# may need to modify the Makefile to reflect your specific -# application. -#---------------------------------------------------------------- - -SRCS = -CXXSRCS = -OBJCSRCS = -OBJS = -INTERFACE = -WRAPFILE = $(INTERFACE:.i=_wrap.c) -WRAPOBJ = $(INTERFACE:.i=_wrap.o) -TARGET = module@SO@ # Use this kind of target for dynamic loading -#TARGET = my_tclsh # Use this target for static linking - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -CC = @CC@ -CXX = @CXX@ -OBJC = @CC@ -Wno-import # -Wno-import needed for gcc -CFLAGS = -INCLUDES = -LIBS = - -# SWIG Options -# SWIG = location of the SWIG executable -# SWIGOPT = SWIG compiler options -# SWIGCC = Compiler used to compile the wrapper file - -SWIG = $(exec_prefix)/bin/swig -SWIGOPT = -tcl -SWIGCC = $(CC) - -# SWIG Library files. Uncomment if rebuilding tclsh -#SWIGLIBS = -ltclsh.i - -# Rules for creating .o files from source. - -COBJS = $(SRCS:.c=.o) -CXXOBJS = $(CXXSRCS:.cxx=.o) -OBJCOBJS = $(OBJCSRCS:.m=.o) -ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) - -# Command that will be used to build the final extension. -BUILD = $(SWIGCC) - -# Uncomment the following if you are using dynamic loading -CCSHARED = @CCSHARED@ -BUILD = @LDSHARED@ - -# Uncomment the following if you are using dynamic loading with C++ and -# need to provide additional link libraries (this is not always required). - -#DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ - -L/usr/local/lib -lg++ -lstdc++ -lgcc - -# Tcl installation (where is Tcl located) - -TCL_INCLUDE = @TCLINCLUDE@ -TCL_LIB = @TCLLIB@ - -# Build libraries (needed for static builds) - -LIBM = @LIBM@ -LIBC = @LIBC@ -SYSLIBS = $(LIBM) $(LIBC) @LIBS@ - -# Build options (uncomment only one of these) - -BUILD_LIBS = $(LIBS) # Dynamic loading -#BUILD_LIBS = $(TCL_LIB) -ltcl $(LIBS) $(SYSLIBS) # tclsh - -# Compilation rules for non-SWIG components - -.SUFFIXES: .c .cxx .m - -.c.o: - $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - -.cxx.o: - $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< - -.m.o: - $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< - - -# ---------------------------------------------------------------------- -# Rules for building the extension -# ---------------------------------------------------------------------- - -all: $(TARGET) - -# Convert the wrapper file into an object file - -$(WRAPOBJ) : $(WRAPFILE) - $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDES) $(TCL_INCLUDE) - -$(WRAPFILE) : $(INTERFACE) - $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIBS) $(INTERFACE) - -$(TARGET): $(WRAPOBJ) $(ALLOBJS) - $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) - -clean: - rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/argcargv.i b/win64/bin/swig/share/swig/4.1.0/tcl/argcargv.i deleted file mode 100755 index 988c2766..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/argcargv.i +++ /dev/null @@ -1,29 +0,0 @@ -/* ------------------------------------------------------------ - * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ - -%typemap(in) (int ARGC, char **ARGV) { - int i, nitems; - Tcl_Obj **listobjv; - if (Tcl_ListObjGetElements(interp, $input, &nitems, &listobjv) == TCL_ERROR) { - SWIG_exception_fail(SWIG_ValueError, "in method '$symname', Expecting list of argv"); - goto fail; - } - $1 = ($1_ltype) nitems; - $2 = (char **) malloc((nitems+1)*sizeof(char *)); - for (i = 0; i < nitems; i++) { - $2[i] = Tcl_GetStringFromObj(listobjv[i], NULL); - } - $2[i] = NULL; -} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - int len; - $1 = Tcl_ListObjLength(interp, $input, &len) == TCL_OK; -} - -%typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } -} diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/attribute.i b/win64/bin/swig/share/swig/4.1.0/tcl/attribute.i deleted file mode 100755 index b18f9ae8..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/attribute.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/carrays.i b/win64/bin/swig/share/swig/4.1.0/tcl/carrays.i deleted file mode 100755 index beca74af..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/carrays.i +++ /dev/null @@ -1,4 +0,0 @@ -%include - - - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/cdata.i b/win64/bin/swig/share/swig/4.1.0/tcl/cdata.i deleted file mode 100755 index 1c6de446..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/cdata.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/cmalloc.i b/win64/bin/swig/share/swig/4.1.0/tcl/cmalloc.i deleted file mode 100755 index d3a1222e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/cmalloc.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/cpointer.i b/win64/bin/swig/share/swig/4.1.0/tcl/cpointer.i deleted file mode 100755 index 0e75cbcd..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/cpointer.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/cstring.i b/win64/bin/swig/share/swig/4.1.0/tcl/cstring.i deleted file mode 100755 index 033677b3..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/cstring.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/cwstring.i b/win64/bin/swig/share/swig/4.1.0/tcl/cwstring.i deleted file mode 100755 index 6a92584e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/cwstring.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/exception.i b/win64/bin/swig/share/swig/4.1.0/tcl/exception.i deleted file mode 100755 index 1ddbb028..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/exception.i +++ /dev/null @@ -1,6 +0,0 @@ -%include - - -%insert("runtime") { - %define_as(SWIG_exception(code, msg), %block(%error(code, msg); return TCL_ERROR;)) -} diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/factory.i b/win64/bin/swig/share/swig/4.1.0/tcl/factory.i deleted file mode 100755 index 377f0080..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/factory.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_auto_ptr.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_auto_ptr.i deleted file mode 100755 index 77738159..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_auto_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_auto_ptr.i - * - * SWIG library file for handling std::auto_ptr. - * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy - * class when returning a std::auto_ptr from a function. - * Memory ownership is passed from the proxy class to the std::auto_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %auto_ptr(TYPE) -%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::auto_ptr< TYPE > %{ - Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::auto_ptr< TYPE >; -%enddef - -namespace std { - template class auto_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_common.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_common.i deleted file mode 100755 index 5710a74c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_common.i +++ /dev/null @@ -1,17 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_common.i - * - * SWIG typemaps for STL - common utilities - * ----------------------------------------------------------------------------- */ - -%include - -%types(std::size_t); -%apply size_t { std::size_t }; -%apply const unsigned long& { const std::size_t& }; - -%types(std::ptrdiff_t); -%apply long { std::ptrdiff_t }; -%apply const long& { const std::ptrdiff_t& }; - - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_deque.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_deque.i deleted file mode 100755 index 30b13946..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_deque.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_except.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_except.i deleted file mode 100755 index 3e056e7d..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_except.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_map.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_map.i deleted file mode 100755 index 844c3db1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_map.i +++ /dev/null @@ -1,79 +0,0 @@ -// -// SWIG typemaps for std::map -// -// Common implementation - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -%} -%fragment(""); -%fragment(""); - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_pair.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_pair.i deleted file mode 100755 index ee9b16d4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_pair.i +++ /dev/null @@ -1,36 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_pair.i - * - * Typemaps for std::pair - * ----------------------------------------------------------------------------- */ - -%include -%include - -// ------------------------------------------------------------------------ -// std::pair -// ------------------------------------------------------------------------ - -%{ -#include -%} - -namespace std { - - template struct pair { - typedef T first_type; - typedef U second_type; - - pair(); - pair(T first, U second); - pair(const pair& other); - - template pair(const pair &other); - - T first; - U second; - }; - - // add specializations here - -} diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_string.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_string.i deleted file mode 100755 index fcef0362..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_string.i +++ /dev/null @@ -1,2 +0,0 @@ -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_unique_ptr.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_unique_ptr.i deleted file mode 100755 index 6609012a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_unique_ptr.i +++ /dev/null @@ -1,39 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_unique_ptr.i - * - * SWIG library file for handling std::unique_ptr. - * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy - * class when returning a std::unique_ptr from a function. - * Memory ownership is passed from the proxy class to the std::unique_ptr in the - * C++ layer when passed as a parameter to a wrapped function. - * ----------------------------------------------------------------------------- */ - -%define %unique_ptr(TYPE) -%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { - res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); - if (!SWIG_IsOK(res)) { - if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { - %releasenotowned_fail(res, "TYPE *", $symname, $argnum); - } else { - %argument_fail(res, "TYPE *", $symname, $argnum); - } - } - $1.reset((TYPE *)argp); -} - -%typemap (out) std::unique_ptr< TYPE > %{ - Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); -%} - -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { - void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); - $1 = SWIG_CheckState(res); -} - -%template() std::unique_ptr< TYPE >; -%enddef - -namespace std { - template class unique_ptr {}; -} diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_vector.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_vector.i deleted file mode 100755 index cbcff732..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_vector.i +++ /dev/null @@ -1,436 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_vector.i - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::vector -// -// The aim of all that follows would be to integrate std::vector with -// Tcl as much as possible, namely, to allow the user to pass and -// be returned Tcl lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::vector< T >), f(const std::vector< T >&), f(const std::vector< T >*): -// the parameter being read-only, either a Tcl list or a -// previously wrapped std::vector< T > can be passed. -// -- f(std::vector< T >&), f(std::vector< T >*): -// the parameter must be modified; therefore, only a wrapped std::vector -// can be passed. -// -- std::vector< T > f(): -// the vector is returned by copy; therefore, a Tcl list of T:s -// is returned which is most easily used in other Tcl functions procs -// -- std::vector< T >& f(), std::vector< T >* f(), const std::vector< T >& f(), -// const std::vector< T >* f(): -// the vector is returned by reference; therefore, a wrapped std::vector -// is returned -// ------------------------------------------------------------------------ - -%fragment(""); -%fragment(""); -%fragment(""); -%{ -#include - -SWIGINTERN Tcl_Obj* SwigString_FromString(const std::string &s) { - return Tcl_NewStringObj(s.data(), (int)s.length()); -} - -SWIGINTERN int Tcl_GetBoolFromObj(Tcl_Interp *interp, Tcl_Obj *o, bool *val) { - int v; - int res = Tcl_GetBooleanFromObj(interp, o, &v); - if (res == TCL_OK) { - *val = v ? true : false; - } - return res; -} - -SWIGINTERN int SwigString_AsString(Tcl_Interp *interp, Tcl_Obj *o, std::string *val) { - int len; - const char* temp = Tcl_GetStringFromObj(o, &len); - (void)interp; - if (temp == NULL) - return TCL_ERROR; - val->assign(temp, len); - return TCL_OK; -} - -// behaviour of this is such as the real Tcl_GetIntFromObj -template -int SwigInt_As(Tcl_Interp *interp, Tcl_Obj *o, Type *val) { - int temp_val, return_val; - return_val = Tcl_GetIntFromObj(interp, o, &temp_val); - *val = (Type) temp_val; - return return_val; -} - -// behaviour of this is such as the real Tcl_GetDoubleFromObj -template -int SwigDouble_As(Tcl_Interp *interp, Tcl_Obj *o, Type *val) { - int return_val; - double temp_val; - return_val = Tcl_GetDoubleFromObj(interp, o, &temp_val); - *val = (Type) temp_val; - return return_val; -} - -%} - -// exported class - -namespace std { - - template class vector { - %typemap(in) vector< T > (std::vector< T > *v) { - Tcl_Obj **listobjv; - int nitems; - int i; - T* temp; - - if (SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0){ - $1 = *v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - $1 = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if ((SWIG_ConvertPtr(listobjv[i],(void **) &temp, - $descriptor(T *),0)) != 0) { - char message[] = - "list of " #T " expected"; - Tcl_SetResult(interp, message, TCL_VOLATILE); - return TCL_ERROR; - } - $1.push_back(*temp); - } - } - } - - %typemap(in) const vector< T >* (std::vector< T > *v, std::vector< T > w), - const vector< T >& (std::vector< T > *v, std::vector< T > w) { - Tcl_Obj **listobjv; - int nitems; - int i; - T* temp; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0) { - $1 = v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - w = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if ((SWIG_ConvertPtr(listobjv[i],(void **) &temp, - $descriptor(T *),0)) != 0) { - char message[] = - "list of " #T " expected"; - Tcl_SetResult(interp, message, TCL_VOLATILE); - return TCL_ERROR; - } - w.push_back(*temp); - } - $1 = &w; - } - } - - %typemap(out) vector< T > { - for (unsigned int i=0; i<$1.size(); i++) { - T* ptr = new T((($1_type &)$1)[i]); - Tcl_ListObjAppendElement(interp, $result, - SWIG_NewInstanceObj(ptr, - $descriptor(T *), - 0)); - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) vector< T > { - Tcl_Obj **listobjv; - int nitems; - T* temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0) { - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if ((SWIG_ConvertPtr(listobjv[0], - (void **) &temp, - $descriptor(T *),0)) != 0) - $1 = 0; - else - $1 = 1; - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) const vector< T >&, - const vector< T >* { - Tcl_Obj **listobjv; - int nitems; - T* temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0){ - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if ((SWIG_ConvertPtr(listobjv[0], - (void **) &temp, - $descriptor(T *),0)) != 0) - $1 = 0; - else - $1 = 1; - } - } - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(const T& x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T& get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && isize()); - if (i<0) i+= size; - if (i>=0 && i class vector< T > { - - %typemap(in) vector< T > (std::vector< T > *v){ - Tcl_Obj **listobjv; - int nitems; - int i; - T temp; - - if(SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0) { - $1 = *v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - $1 = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if (CONVERT_FROM(interp, listobjv[i], &temp) == TCL_ERROR) - return TCL_ERROR; - $1.push_back(temp); - } - } - } - - %typemap(in) const vector< T >& (std::vector< T > *v,std::vector< T > w), - const vector< T >* (std::vector< T > *v,std::vector< T > w) { - Tcl_Obj **listobjv; - int nitems; - int i; - T temp; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0) { - $1 = v; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - return TCL_ERROR; - w = std::vector< T >(); - for (i = 0; i < nitems; i++) { - if (CONVERT_FROM(interp, listobjv[i], &temp) == TCL_ERROR) - return TCL_ERROR; - w.push_back(temp); - } - $1 = &w; - } - } - - %typemap(out) vector< T > { - for (unsigned int i=0; i<$1.size(); i++) { - Tcl_ListObjAppendElement(interp, $result, - CONVERT_TO((($1_type &)$1)[i])); - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) vector< T > { - Tcl_Obj **listobjv; - int nitems; - T temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $&1_descriptor, 0) == 0){ - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if (CONVERT_FROM(interp, listobjv[0], &temp) == TCL_ERROR) - $1 = 0; - else - $1 = 1; - } - } - - %typecheck(SWIG_TYPECHECK_VECTOR) const vector< T >&, - const vector< T >*{ - Tcl_Obj **listobjv; - int nitems; - T temp; - std::vector< T > *v; - - if(SWIG_ConvertPtr($input, (void **) &v, - $1_descriptor, 0) == 0){ - /* wrapped vector */ - $1 = 1; - } else { - // It isn't a vector< T > so it should be a list of T's - if(Tcl_ListObjGetElements(interp, $input, - &nitems, &listobjv) == TCL_ERROR) - $1 = 0; - else - if (nitems == 0) - $1 = 1; - //check the first value to see if it is of correct type - else if (CONVERT_FROM(interp, listobjv[0], &temp) == TCL_ERROR) - $1 = 0; - else - $1 = 1; - } - } - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - vector(unsigned int size = 0); - vector(unsigned int size, const T& value); - vector(const vector& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %rename(push) push_back; - void push_back(T x); - %extend { - T pop() throw (std::out_of_range) { - if (self->size() == 0) - throw std::out_of_range("pop from empty vector"); - T x = self->back(); - self->pop_back(); - return x; - } - T get(int i) throw (std::out_of_range) { - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && isize()); - if (i<0) i+= size; - if (i>=0 && i,Tcl_NewIntObj); - specialize_std_vector(int, Tcl_GetIntFromObj,Tcl_NewIntObj); - specialize_std_vector(short, SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(long, SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned char, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned int, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned short, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(unsigned long, - SwigInt_As, Tcl_NewIntObj); - specialize_std_vector(double, Tcl_GetDoubleFromObj, Tcl_NewDoubleObj); - specialize_std_vector(float, SwigDouble_As, Tcl_NewDoubleObj); - specialize_std_vector(std::string, - SwigString_AsString, SwigString_FromString); - -} - - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/std_wstring.i b/win64/bin/swig/share/swig/4.1.0/tcl/std_wstring.i deleted file mode 100755 index 3e13bdec..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/std_wstring.i +++ /dev/null @@ -1,2 +0,0 @@ -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/stl.i b/win64/bin/swig/share/swig/4.1.0/tcl/stl.i deleted file mode 100755 index 534c6931..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/stl.i +++ /dev/null @@ -1,10 +0,0 @@ -/* ----------------------------------------------------------------------------- - * stl.i - * ----------------------------------------------------------------------------- */ - -%include -%include -%include -%include -%include - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/swigmove.i b/win64/bin/swig/share/swig/4.1.0/tcl/swigmove.i deleted file mode 100755 index 03e87fa2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/swigmove.i +++ /dev/null @@ -1 +0,0 @@ -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tcl8.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tcl8.swg deleted file mode 100755 index 79d1f58c..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tcl8.swg +++ /dev/null @@ -1,42 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tcl8.swg - * - * Tcl configuration module. - * ----------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------ - * Inner macros - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The runtime part - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Special user directives - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Typemap specializations - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * Warnings for Tcl keywords - * ------------------------------------------------------------ */ -%include - -/* ------------------------------------------------------------ - * The Tcl initialization function - * ------------------------------------------------------------ */ -%include - - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclapi.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclapi.swg deleted file mode 100755 index 96db7b9e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclapi.swg +++ /dev/null @@ -1,108 +0,0 @@ -/* ----------------------------------------------------------------------------- - * SWIG API. Portion that goes into the runtime - * ----------------------------------------------------------------------------- */ -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_TCL_POINTER 4 -#define SWIG_TCL_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -typedef int (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); -typedef int (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); -typedef char *(*swig_variable_func)(ClientData, Tcl_Interp *, char *, char *, int); -typedef void (*swig_delete_func)(ClientData); - -typedef struct swig_method { - const char *name; - swig_wrapper method; -} swig_method; - -typedef struct swig_attribute { - const char *name; - swig_wrapper getmethod; - swig_wrapper setmethod; -} swig_attribute; - -typedef struct swig_class { - const char *name; - swig_type_info **type; - swig_wrapper constructor; - void (*destructor)(void *); - swig_method *methods; - swig_attribute *attributes; - struct swig_class **bases; - const char **base_names; - swig_module_info *module; - Tcl_HashTable hashtable; -} swig_class; - -typedef struct swig_instance { - Tcl_Obj *thisptr; - void *thisvalue; - swig_class *classptr; - int destroy; - Tcl_Command cmdtok; -} swig_instance; - -/* Structure for command table */ -typedef struct { - const char *name; - int (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); - ClientData clientdata; -} swig_command_info; - -/* Structure for variable linking table */ -typedef struct { - const char *name; - void *addr; - char * (*get)(ClientData, Tcl_Interp *, char *, char *, int); - char * (*set)(ClientData, Tcl_Interp *, char *, char *, int); -} swig_var_info; - - -/* -----------------------------------------------------------------------------* - * Install a constant object - * -----------------------------------------------------------------------------*/ - -static Tcl_HashTable swigconstTable; -static int swigconstTableinit = 0; - -SWIGINTERN void -SWIG_Tcl_SetConstantObj(Tcl_Interp *interp, const char* name, Tcl_Obj *obj) { - int newobj; - Tcl_ObjSetVar2(interp,Tcl_NewStringObj(name,-1), NULL, obj, TCL_GLOBAL_ONLY); - Tcl_SetHashValue(Tcl_CreateHashEntry(&swigconstTable, name, &newobj), (ClientData) obj); -} - -SWIGINTERN Tcl_Obj * -SWIG_Tcl_GetConstantObj(const char *key) { - Tcl_HashEntry *entryPtr; - if (!swigconstTableinit) return 0; - entryPtr = Tcl_FindHashEntry(&swigconstTable, key); - if (entryPtr) { - return (Tcl_Obj *) Tcl_GetHashValue(entryPtr); - } - return 0; -} - -#ifdef __cplusplus -} -#endif - - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclerrors.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclerrors.swg deleted file mode 100755 index 8604e443..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclerrors.swg +++ /dev/null @@ -1,76 +0,0 @@ -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGINTERN const char* -SWIG_Tcl_ErrorType(int code) { - const char* type = 0; - switch(code) { - case SWIG_MemoryError: - type = "MemoryError"; - break; - case SWIG_IOError: - type = "IOError"; - break; - case SWIG_RuntimeError: - type = "RuntimeError"; - break; - case SWIG_IndexError: - type = "IndexError"; - break; - case SWIG_TypeError: - type = "TypeError"; - break; - case SWIG_DivisionByZero: - type = "ZeroDivisionError"; - break; - case SWIG_OverflowError: - type = "OverflowError"; - break; - case SWIG_SyntaxError: - type = "SyntaxError"; - break; - case SWIG_ValueError: - type = "ValueError"; - break; - case SWIG_SystemError: - type = "SystemError"; - break; - case SWIG_AttributeError: - type = "AttributeError"; - break; - default: - type = "RuntimeError"; - } - return type; -} - - -SWIGINTERN void -SWIG_Tcl_SetErrorObj(Tcl_Interp *interp, const char *ctype, Tcl_Obj *obj) -{ - Tcl_ResetResult(interp); - Tcl_SetObjResult(interp, obj); - Tcl_SetErrorCode(interp, "SWIG", ctype, NULL); -} - -SWIGINTERN void -SWIG_Tcl_SetErrorMsg(Tcl_Interp *interp, const char *ctype, const char *mesg) -{ - Tcl_ResetResult(interp); - Tcl_SetErrorCode(interp, "SWIG", ctype, NULL); - Tcl_AppendResult(interp, ctype, " ", mesg, NULL); - /* - Tcl_AddErrorInfo(interp, ctype); - Tcl_AddErrorInfo(interp, " "); - Tcl_AddErrorInfo(interp, mesg); - */ -} - -SWIGINTERNINLINE void -SWIG_Tcl_AddErrorMsg(Tcl_Interp *interp, const char* mesg) -{ - Tcl_AddErrorInfo(interp, mesg); -} - - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclfragments.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclfragments.swg deleted file mode 100755 index 6c9b3f9a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclfragments.swg +++ /dev/null @@ -1,22 +0,0 @@ -/* - - Create a file with this name, 'tclfragments.swg', in your working - directory and add all the %fragments you want to take precedence - over the ones defined by default by swig. - - For example, if you add: - - %fragment(SWIG_AsVal_frag(int),"header") { - SWIGINTERNINLINE int - SWIG_AsVal_dec(int)(TclObject *obj, int *val) - { - ; - } - } - - this will replace the code used to retrieve an integer value for all - the typemaps that need it, including: - - int, std::vector, std::list >, etc. - -*/ diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclinit.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclinit.swg deleted file mode 100755 index 7a08c377..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclinit.swg +++ /dev/null @@ -1,140 +0,0 @@ -/* ------------------------------------------------------------ - * The start of the Tcl initialization function - * ------------------------------------------------------------ */ - -%insert(init) "swiginit.swg" - -/* This initialization code exports the module initialization function */ - -%header %{ - -#ifdef __cplusplus -extern "C" { -#endif -#ifdef MAC_TCL -#pragma export on -#endif -SWIGEXPORT int SWIG_init(Tcl_Interp *); -#ifdef MAC_TCL -#pragma export off -#endif -#ifdef __cplusplus -} -#endif - -/* Compatibility version for TCL stubs */ -#ifndef SWIG_TCL_STUBS_VERSION -#define SWIG_TCL_STUBS_VERSION "8.4" -#endif - -%} - -%init %{ -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - -/* Install Constants */ - -SWIGINTERN void -SWIG_Tcl_InstallConstants(Tcl_Interp *interp, swig_const_info constants[]) { - size_t i; - Tcl_Obj *obj; - - if (!swigconstTableinit) { - Tcl_InitHashTable(&swigconstTable, TCL_STRING_KEYS); - swigconstTableinit = 1; - } - for (i = 0; constants[i].type; i++) { - switch(constants[i].type) { - case SWIG_TCL_POINTER: - obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_TCL_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - SWIG_Tcl_SetConstantObj(interp, constants[i].name, obj); - } - } -} - -/* Create fast method lookup tables */ - -SWIGINTERN void -SWIG_Tcl_InstallMethodLookupTables(void) { - size_t i; - - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = swig_module.type_initial[i]; - if (type->clientdata) { - swig_class* klass = (swig_class*) type->clientdata; - swig_method* meth; - Tcl_InitHashTable(&(klass->hashtable), TCL_STRING_KEYS); - for (meth = klass->methods; meth && meth->name; ++meth) { - int newEntry; - Tcl_HashEntry* hashentry = Tcl_CreateHashEntry(&(klass->hashtable), meth->name, &newEntry); - Tcl_SetHashValue(hashentry, (ClientData)meth->method); - } - } - } -} - -#ifdef __cplusplus -} -#endif - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -SWIGEXPORT int SWIG_init(Tcl_Interp *interp) { - size_t i; - if (interp == 0) return TCL_ERROR; -#ifdef USE_TCL_STUBS - if (Tcl_InitStubs(interp, SWIG_TCL_STUBS_VERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif -#ifdef USE_TK_STUBS - /* (char*) cast is required to avoid compiler warning/error. */ - if (Tk_InitStubs(interp, (char*)SWIG_TCL_STUBS_VERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif - - Tcl_PkgProvide(interp, (char*)SWIG_name, (char*)SWIG_version); - -#ifdef SWIG_namespace - Tcl_Eval(interp, "namespace eval " SWIG_namespace " { }"); -#endif - - SWIG_InitializeModule((void *) interp); - SWIG_PropagateClientData(); - - for (i = 0; swig_commands[i].name; i++) { - Tcl_CreateObjCommand(interp, (char *) swig_commands[i].name, (swig_wrapper_func) swig_commands[i].wrapper, - swig_commands[i].clientdata, NULL); - } - for (i = 0; swig_variables[i].name; i++) { - Tcl_SetVar(interp, (char *) swig_variables[i].name, (char *) "", TCL_GLOBAL_ONLY); - Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_READS | TCL_GLOBAL_ONLY, - (Tcl_VarTraceProc *) swig_variables[i].get, (ClientData) swig_variables[i].addr); - Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_WRITES | TCL_GLOBAL_ONLY, - (Tcl_VarTraceProc *) swig_variables[i].set, (ClientData) swig_variables[i].addr); - } - - SWIG_Tcl_InstallConstants(interp, swig_constants); - SWIG_Tcl_InstallMethodLookupTables(); - -%} - -/* Note: the initialization function is closed after all code is generated */ diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclinterp.i b/win64/bin/swig/share/swig/4.1.0/tcl/tclinterp.i deleted file mode 100755 index 7d9c5883..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclinterp.i +++ /dev/null @@ -1,17 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclinterp.i - * - * Tcl_Interp *interp - * - * Passes the current Tcl_Interp value directly to a C function. - * This can be used to work with existing wrapper functions or - * if you just need the interp value for some reason. When used, - * the 'interp' parameter becomes hidden in the Tcl interface--that - * is, you don't specify it explicitly. SWIG fills in its value - * automatically. - * ----------------------------------------------------------------------------- */ - -%typemap(in,numinputs=0) Tcl_Interp *interp { - $1 = interp; -} - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclkw.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclkw.swg deleted file mode 100755 index 39242fd4..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclkw.swg +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TCL_TCLKW_SWG_ -#define TCL_TCLKW_SWG_ - -// Some special reserved words in classes - -%keywordwarn("cget is a tcl reserved method name") *::cget; -%keywordwarn("configure is a tcl reserved method name") *::configure; - - -#endif //_TCL_TCLKW_SWG_ diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclmacros.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclmacros.swg deleted file mode 100755 index c063d360..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclmacros.swg +++ /dev/null @@ -1,4 +0,0 @@ -%include - - - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclopers.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclopers.swg deleted file mode 100755 index f9509475..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclopers.swg +++ /dev/null @@ -1,43 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclopers.swg - * - * C++ overloaded operators. - * - * These declarations define how SWIG is going to rename C++ - * overloaded operators in Tcl. Since Tcl allows identifiers - * to be essentially any valid string, we'll just use the - * normal operator names. - * ----------------------------------------------------------------------------- */ - - -#ifdef __cplusplus -%rename("+") *::operator+; -//%rename("u+") *::operator+(); // Unary + -//%rename("u+") *::operator+() const; // Unary + -%rename("-") *::operator-; -//%rename("u-") *::operator-(); // Unary - -//%rename("u-") *::operator-() const; // Unary - -%rename("*") *::operator*; -%rename("/") *::operator/; -%rename("<<") *::operator<<; -%rename(">>") *::operator>>; -%rename("&") *::operator&; -%rename("|") *::operator|; -%rename("^") *::operator^; -%rename("%") *::operator%; -%rename("=") *::operator=; - -/* Ignored operators */ -%ignoreoperator(NOTEQUAL) operator!=; -%ignoreoperator(PLUSEQ) operator+=; -%ignoreoperator(MINUSEQ) operator-=; -%ignoreoperator(MULEQ) operator*=; -%ignoreoperator(DIVEQ) operator/=; -%ignoreoperator(MODEQ) operator%=; -%ignoreoperator(LSHIFTEQ) operator<<=; -%ignoreoperator(RSHIFTEQ) operator>>=; -%ignoreoperator(ANDEQ) operator&=; -%ignoreoperator(OREQ) operator|=; -%ignoreoperator(XOREQ) operator^=; - -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclprimtypes.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclprimtypes.swg deleted file mode 100755 index 615c324f..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclprimtypes.swg +++ /dev/null @@ -1,230 +0,0 @@ -/* ------------------------------------------------------------ - * Primitive Types - * ------------------------------------------------------------ */ - -/* boolean */ - -%fragment(SWIG_From_frag(bool),"header") { - %define_as(SWIG_From_dec(bool), Tcl_NewBooleanObj) -} - -%fragment(SWIG_AsVal_frag(bool),"header") { -SWIGINTERN int -SWIG_AsVal_dec(bool)(Tcl_Obj *obj, bool *val) -{ - int v; - if (Tcl_GetBooleanFromObj(0, obj, &v) == TCL_OK) { - if (val) *val = v ? true : false; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -/* long */ - -%fragment(SWIG_From_frag(long),"header", - fragment="") { -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(long)(long value) -{ - if (((long) INT_MIN <= value) && (value <= (long) INT_MAX)) { - return Tcl_NewIntObj(%numeric_cast(value,int)); - } else { - return Tcl_NewLongObj(value); - } -} -} - -%fragment(SWIG_AsVal_frag(long),"header") { -SWIGINTERN int -SWIG_AsVal_dec(long)(Tcl_Obj *obj, long* val) -{ - long v; - if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) { - if (val) *val = (long) v; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -/* unsigned long */ - -%fragment(SWIG_From_frag(unsigned long),"header", - fragment=SWIG_From_frag(long), - fragment="") { -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(unsigned long)(unsigned long value) -{ - if (value < (unsigned long) LONG_MAX) { - return SWIG_From(long)(%numeric_cast(value, long)); - } else { - char temp[256]; - sprintf(temp, "%lu", value); - return Tcl_NewStringObj(temp,-1); - } -} -} - -%fragment(SWIG_AsVal_frag(unsigned long),"header", - fragment="") { -SWIGINTERN int -SWIG_AsVal_dec(unsigned long)(Tcl_Obj *obj, unsigned long *val) { - long v; - if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) { - if (v >= 0) { - if (val) *val = (unsigned long) v; - return SWIG_OK; - } - /* If v is negative, then this could be a negative number, or an - unsigned value which doesn't fit in a signed long, so try to - get it as a string so we can distinguish these cases. */ - } - { - int len = 0; - const char *nptr = Tcl_GetStringFromObj(obj, &len); - if (nptr && len > 0) { - char *endptr; - unsigned long v; - if (*nptr == '-') return SWIG_OverflowError; - errno = 0; - v = strtoul(nptr, &endptr,0); - if (nptr[0] == '\0' || *endptr != '\0') - return SWIG_TypeError; - if (v == ULONG_MAX && errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_OK; - } - } - } - } - - return SWIG_TypeError; -} -} - -/* long long */ - -%fragment(SWIG_From_frag(long long),"header", - fragment=SWIG_From_frag(long), - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(long long)(long long value) -{ - if (((long long) LONG_MIN <= value) && (value <= (long long) LONG_MAX)) { - return SWIG_From(long)(%numeric_cast(value,long)); - } else { - char temp[256]; - sprintf(temp, "%lld", value); - return Tcl_NewStringObj(temp,-1); - } -} -%#endif -} - -%fragment(SWIG_AsVal_frag(long long),"header", - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(long long)(Tcl_Obj *obj, long long *val) -{ - Tcl_WideInt v; - if (Tcl_GetWideIntFromObj(0, obj, &v) == TCL_OK) { - if (sizeof(v) > sizeof(*val) && (v < LLONG_MIN || v > LLONG_MAX)) { - return SWIG_OverflowError; - } - if (val) *val = v; - return SWIG_OK; - } - return SWIG_TypeError; -} -%#endif -} - -/* unsigned long long */ - -%fragment(SWIG_From_frag(unsigned long long),"header", - fragment=SWIG_From_frag(long long), - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE Tcl_Obj* -SWIG_From_dec(unsigned long long)(unsigned long long value) -{ - if (value < (unsigned long long) LONG_MAX) { - return SWIG_From(long long)(%numeric_cast(value, long long)); - } else { - char temp[256]; - sprintf(temp, "%llu", value); - return Tcl_NewStringObj(temp,-1); - } -} -%#endif -} - -%fragment(SWIG_AsVal_frag(unsigned long long),"header", - fragment=SWIG_AsVal_frag(unsigned long), - fragment="SWIG_LongLongAvailable", - fragment="") { -%#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_dec(unsigned long long)(Tcl_Obj *obj, unsigned long long *val) -{ - long v; - if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) { - if (val) *val = (unsigned long) v; - return SWIG_OK; - } else { - int len = 0; - const char *nptr = Tcl_GetStringFromObj(obj, &len); - if (nptr && len > 0) { - char *endptr; - unsigned long long v; - if (*nptr == '-') return SWIG_OverflowError; - errno = 0; - v = strtoull(nptr, &endptr,0); - if (nptr[0] == '\0' || *endptr != '\0') - return SWIG_TypeError; - if (v == ULLONG_MAX && errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_OK; - } - } - } - } - return SWIG_TypeError; -} -%#endif -} - -/* double */ - -%fragment(SWIG_From_frag(double),"header") { - %define_as(SWIG_From(double), Tcl_NewDoubleObj) -} - -%fragment(SWIG_AsVal_frag(double),"header") { -SWIGINTERN int -SWIG_AsVal_dec(double)(Tcl_Obj *obj, double *val) -{ - double v; - if (Tcl_GetDoubleFromObj(0, obj, &v) == TCL_OK) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclresult.i b/win64/bin/swig/share/swig/4.1.0/tcl/tclresult.i deleted file mode 100755 index 7bc90cec..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclresult.i +++ /dev/null @@ -1,27 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclresult.i - * ----------------------------------------------------------------------------- */ - -/* -int Tcl_Result - - Makes the integer return code of a function the return value - of a SWIG generated wrapper function. For example : - - int foo() { - ... do stuff ... - return TCL_OK; - } - - could be wrapped as follows : - - %include typemaps.i - %apply int Tcl_Result { int foo }; - int foo(); -*/ - -// If return code is a Tcl_Result, simply pass it on - -%typemap(out) int Tcl_Result { - return $1; -} diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclrun.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclrun.swg deleted file mode 100755 index 4decfdd1..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclrun.swg +++ /dev/null @@ -1,722 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclrun.swg - * - * This file contains the runtime support for Tcl modules and includes - * code for managing global variables and pointer type checking. - * ----------------------------------------------------------------------------- */ - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_ConvertPtr(oc, ptr, ty, flags) SWIG_Tcl_ConvertPtr(interp, oc, ptr, ty, flags) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Tcl_NewPointerObj(ptr, type, flags) - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Tcl_ConvertPacked(interp, obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Tcl_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_Tcl_ConvertPtr(interp, obj, pptr, type, flags) -#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_Tcl_NewInstanceObj(interp, thisvalue, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Tcl_ConvertPtr(interp, obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Tcl_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Tcl_ConvertPacked(interp,obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Tcl_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Tcl_GetModule((Tcl_Interp *) (clientdata)) -#define SWIG_SetModule(clientdata, pointer) SWIG_Tcl_SetModule((Tcl_Interp *) (clientdata), pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Tcl_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Tcl_SetErrorMsg(interp, SWIG_Tcl_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Tcl-specific SWIG API */ - -#define SWIG_Acquire(ptr) SWIG_Tcl_Acquire(ptr) -#define SWIG_MethodCommand SWIG_Tcl_MethodCommand -#define SWIG_Disown(ptr) SWIG_Tcl_Disown(ptr) -#define SWIG_ConvertPtrFromString(c, ptr, ty, flags) SWIG_Tcl_ConvertPtrFromString(interp, c, ptr, ty, flags) -#define SWIG_MakePtr(c, ptr, ty, flags) SWIG_Tcl_MakePtr(c, ptr, ty, flags) -#define SWIG_PointerTypeFromString(c) SWIG_Tcl_PointerTypeFromString(c) -#define SWIG_GetArgs SWIG_Tcl_GetArgs -#define SWIG_GetConstantObj(key) SWIG_Tcl_GetConstantObj(key) -#define SWIG_ObjectConstructor SWIG_Tcl_ObjectConstructor -#define SWIG_Thisown(ptr) SWIG_Tcl_Thisown(ptr) -#define SWIG_ObjectDelete SWIG_Tcl_ObjectDelete - - -#define SWIG_TCL_DECL_ARGS_2(arg1, arg2) (Tcl_Interp *interp SWIGUNUSED, arg1, arg2) -#define SWIG_TCL_CALL_ARGS_2(arg1, arg2) (interp, arg1, arg2) -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_GetConstant SWIG_GetConstantObj -#define SWIG_Tcl_GetConstant SWIG_Tcl_GetConstantObj - -#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 5) -#define SWIG_TCL_HASHTABLE_INIT {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#else -#define SWIG_TCL_HASHTABLE_INIT {0} -#endif - -#include "assert.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Object support */ - -SWIGRUNTIME Tcl_HashTable* -SWIG_Tcl_ObjectTable(void) { - static Tcl_HashTable swigobjectTable; - static int swigobjectTableinit = 0; - if (!swigobjectTableinit) { - Tcl_InitHashTable(&swigobjectTable, TCL_ONE_WORD_KEYS); - swigobjectTableinit = 1; - } - return &swigobjectTable; -} - -/* Acquire ownership of a pointer */ -SWIGRUNTIME void -SWIG_Tcl_Acquire(void *ptr) { - int newobj; - Tcl_CreateHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr, &newobj); -} - -SWIGRUNTIME int -SWIG_Tcl_Thisown(void *ptr) { - if (Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr)) { - return 1; - } - return 0; -} - -/* Disown a pointer. Returns 1 if we owned it to begin with */ -SWIGRUNTIME int -SWIG_Tcl_Disown(void *ptr) { - Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr); - if (entryPtr) { - Tcl_DeleteHashEntry(entryPtr); - return 1; - } - return 0; -} - -/* Convert a pointer value */ -SWIGRUNTIME int -SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swig_type_info *ty, int flags) { - swig_cast_info *tc; - const char *cmd_name; - /* Pointer values must start with leading underscore */ - while (*c != '_') { - *ptr = (void *) 0; - if (strcmp(c,"NULL") == 0) - return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; - - /* Empty string: not a pointer */ - if (*c == 0) return SWIG_ERROR; - - /* Hmmm. It could be an object name. */ - - /* Check if this is a command at all. Prevents cget -this */ - /* from being called when c is not a command, firing the unknown proc */ - if (Tcl_VarEval(interp,"info commands ", c, (char *) NULL) == TCL_OK) { - Tcl_Obj *result = Tcl_GetObjResult(interp); - if (*(Tcl_GetStringFromObj(result, NULL)) == 0) { - /* It's not a command, so it can't be a pointer */ - Tcl_ResetResult(interp); - return SWIG_ERROR; - } - } else { - /* This will only fail if the argument is multiple words. */ - /* Multiple words are also not commands. */ - Tcl_ResetResult(interp); - return SWIG_ERROR; - } - - /* Check if this is really a SWIG pointer */ - if (Tcl_VarEval(interp,c," cget -this", (char *) NULL) != TCL_OK) { - Tcl_ResetResult(interp); - return SWIG_ERROR; - } - - c = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), NULL); - } - cmd_name = c; - - c++; - c = SWIG_UnpackData(c,ptr,sizeof(void *)); - - if (ty) { - tc = c ? SWIG_TypeCheck(c,ty) : 0; - if (tc) { - Tcl_CmdInfo info; - if (Tcl_GetCommandInfo(interp, cmd_name, &info)) { - swig_instance *inst = (swig_instance *)info.objClientData; - if (!inst->thisvalue) { - *ptr = 0; - } - assert(inst->thisvalue == *ptr); - if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !SWIG_Thisown(inst->thisvalue)) { - return SWIG_ERROR_RELEASE_NOT_OWNED; - } else { - if (flags & SWIG_POINTER_DISOWN) { - SWIG_Disown((void *) *ptr); - } - if (flags & SWIG_POINTER_CLEAR) { - inst->thisvalue = 0; - } - { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,(void *) *ptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } - } - } - } else { - return SWIG_ERROR; - } - } - - return SWIG_OK; -} - -/* Convert a pointer value */ -SWIGRUNTIMEINLINE int -SWIG_Tcl_ConvertPtr(Tcl_Interp *interp, Tcl_Obj *oc, void **ptr, swig_type_info *ty, int flags) { - return SWIG_Tcl_ConvertPtrFromString(interp, Tcl_GetStringFromObj(oc,NULL), ptr, ty, flags); -} - -/* Convert a pointer value */ -SWIGRUNTIME char * -SWIG_Tcl_PointerTypeFromString(char *c) { - char d; - /* Pointer values must start with leading underscore. NULL has no type */ - if (*c != '_') { - return 0; - } - c++; - /* Extract hex value from pointer */ - while ((d = *c)) { - if (!(((d >= '0') && (d <= '9')) || ((d >= 'a') && (d <= 'f')))) break; - c++; - } - return c; -} - -/* Convert a packed pointer value */ -SWIGRUNTIME int -SWIG_Tcl_ConvertPacked(Tcl_Interp *SWIGUNUSEDPARM(interp) , Tcl_Obj *obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c; - - if (!obj) goto type_error; - c = Tcl_GetStringFromObj(obj,NULL); - /* Pointer values must start with leading underscore */ - if (*c != '_') goto type_error; - c++; - c = SWIG_UnpackData(c,ptr,sz); - if (ty) { - tc = SWIG_TypeCheck(c,ty); - if (!tc) goto type_error; - } - return SWIG_OK; - - type_error: - - return SWIG_ERROR; -} - - -/* Take a pointer and convert it to a string */ -SWIGRUNTIME void -SWIG_Tcl_MakePtr(char *c, void *ptr, swig_type_info *ty, int SWIGUNUSEDPARM(flags)) { - if (ptr) { - *(c++) = '_'; - c = SWIG_PackData(c,&ptr,sizeof(void *)); - strcpy(c,ty->name); - } else { - strcpy(c,"NULL"); - } -} - -/* Create a new pointer object */ -SWIGRUNTIMEINLINE Tcl_Obj * -SWIG_Tcl_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - Tcl_Obj *robj; - char result[SWIG_BUFFER_SIZE]; - SWIG_MakePtr(result,ptr,type,flags); - robj = Tcl_NewStringObj(result,-1); - return robj; -} - -SWIGRUNTIME Tcl_Obj * -SWIG_Tcl_NewPackedObj(void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - strcpy(r,type->name); - return Tcl_NewStringObj(result,-1); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -SWIGRUNTIME swig_module_info * -SWIG_Tcl_GetModule(Tcl_Interp *interp) { - const char *data; - swig_module_info *ret = 0; - - /* first check if pointer already created */ - data = Tcl_GetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TCL_GLOBAL_ONLY); - if (data) { - SWIG_UnpackData(data, &ret, sizeof(swig_type_info **)); - } - - return ret; -} - -SWIGRUNTIME void -SWIG_Tcl_SetModule(Tcl_Interp *interp, swig_module_info *module) { - char buf[SWIG_BUFFER_SIZE]; - char *data; - - /* create a new pointer */ - data = SWIG_PackData(buf, &module, sizeof(swig_type_info **)); - *data = 0; - Tcl_SetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, buf, TCL_GLOBAL_ONLY); -} - -/* -----------------------------------------------------------------------------* - * Object auxiliaries - * -----------------------------------------------------------------------------*/ - - -SWIGRUNTIME void -SWIG_Tcl_ObjectDelete(ClientData clientData) { - swig_instance *si = (swig_instance *) clientData; - if (!si) return; - if (si->destroy && SWIG_Disown(si->thisvalue)) { - if (si->classptr->destructor) { - (si->classptr->destructor)(si->thisvalue); - } - } - Tcl_DecrRefCount(si->thisptr); - free(si); -} - -/* Function to invoke object methods given an instance */ -SWIGRUNTIME int -SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST _objv[]) { - char *method, *attrname; - swig_instance *inst = (swig_instance *) clientData; - swig_method *meth; - swig_attribute *attr; - Tcl_Obj *oldarg; - Tcl_Obj **objv; - int rcode; - swig_class *cls; - swig_class *cls_stack[64]; - int cls_stack_bi[64]; - int cls_stack_top = 0; - int numconf = 2; - int bi; - - objv = (Tcl_Obj **) _objv; - if (objc < 2) { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - method = Tcl_GetStringFromObj(objv[1],NULL); - if (strcmp(method,"-acquire") == 0) { - inst->destroy = 1; - SWIG_Acquire(inst->thisvalue); - return TCL_OK; - } - if (strcmp(method,"-disown") == 0) { - if (inst->destroy) { - SWIG_Disown(inst->thisvalue); - } - inst->destroy = 0; - return TCL_OK; - } - if (strcmp(method,"-delete") == 0) { - Tcl_DeleteCommandFromToken(interp,inst->cmdtok); - return TCL_OK; - } - cls_stack[cls_stack_top] = inst->classptr; - cls_stack_bi[cls_stack_top] = -1; - while (1) { - Tcl_HashEntry* hashentry; - bi = cls_stack_bi[cls_stack_top]; - cls = cls_stack[cls_stack_top]; - if (bi != -1) { - if (!cls->bases[bi] && cls->base_names[bi]) { - /* lookup and cache the base class */ - swig_type_info *info = SWIG_TypeQueryModule(cls->module, cls->module, cls->base_names[bi]); - if (info) cls->bases[bi] = (swig_class *) info->clientdata; - } - cls = cls->bases[bi]; - if (cls) { - cls_stack_bi[cls_stack_top]++; - cls_stack_top++; - cls_stack[cls_stack_top] = cls; - cls_stack_bi[cls_stack_top] = -1; - continue; - } - } - if (!cls) { - cls_stack_top--; - if (cls_stack_top < 0) break; - else continue; - } - cls_stack_bi[cls_stack_top]++; - - hashentry = Tcl_FindHashEntry(&(cls->hashtable), method); - if (hashentry) { - ClientData cd = Tcl_GetHashValue(hashentry); - swig_wrapper method_wrapper = (swig_wrapper)cd; - oldarg = objv[1]; - objv[1] = inst->thisptr; - Tcl_IncrRefCount(inst->thisptr); - rcode = (method_wrapper)(clientData,interp,objc,objv); - objv[1] = oldarg; - Tcl_DecrRefCount(inst->thisptr); - return rcode; - } - /* Check class methods for a match */ - if (strcmp(method,"cget") == 0) { - if (objc < 3) { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - attrname = Tcl_GetStringFromObj(objv[2],NULL); - attr = cls->attributes; - while (attr && attr->name) { - if ((strcmp(attr->name, attrname) == 0) && (attr->getmethod)) { - oldarg = objv[1]; - objv[1] = inst->thisptr; - Tcl_IncrRefCount(inst->thisptr); - rcode = (*attr->getmethod)(clientData,interp,2, objv); - objv[1] = oldarg; - Tcl_DecrRefCount(inst->thisptr); - return rcode; - } - attr++; - } - if (strcmp(attrname, "-this") == 0) { - Tcl_SetObjResult(interp, Tcl_DuplicateObj(inst->thisptr)); - return TCL_OK; - } - if (strcmp(attrname, "-thisown") == 0) { - if (SWIG_Thisown(inst->thisvalue)) { - Tcl_SetResult(interp,(char*)"1",TCL_STATIC); - } else { - Tcl_SetResult(interp,(char*)"0",TCL_STATIC); - } - return TCL_OK; - } - } else if (strcmp(method, "configure") == 0) { - int i; - if (objc < 4) { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - i = 2; - while (i < objc) { - attrname = Tcl_GetStringFromObj(objv[i],NULL); - attr = cls->attributes; - while (attr && attr->name) { - if ((strcmp(attr->name, attrname) == 0) && (attr->setmethod)) { - oldarg = objv[i]; - objv[i] = inst->thisptr; - Tcl_IncrRefCount(inst->thisptr); - rcode = (*attr->setmethod)(clientData,interp,3, &objv[i-1]); - objv[i] = oldarg; - Tcl_DecrRefCount(inst->thisptr); - if (rcode != TCL_OK) return rcode; - numconf += 2; - } - attr++; - } - i+=2; - } - } - } - if (strcmp(method,"configure") == 0) { - if (numconf >= objc) { - return TCL_OK; - } else { - Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC); - return TCL_ERROR; - } - } - if (strcmp(method,"cget") == 0) { - Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC); - return TCL_ERROR; - } - Tcl_SetResult(interp, (char *) "Invalid method. Must be one of: configure cget -acquire -disown -delete", TCL_STATIC); - cls = inst->classptr; - bi = 0; - while (cls) { - meth = cls->methods; - while (meth && meth->name) { - char *cr = (char *) Tcl_GetStringResult(interp); - size_t meth_len = strlen(meth->name); - char* where = strchr(cr,':'); - while(where) { - where = strstr(where, meth->name); - if(where) { - if(where[-1] == ' ' && (where[meth_len] == ' ' || where[meth_len]==0)) { - break; - } else { - where++; - } - } - } - - if (!where) - Tcl_AppendElement(interp, (char *) meth->name); - meth++; - } - cls = inst->classptr->bases[bi++]; - } - return TCL_ERROR; -} - -/* This function takes the current result and turns it into an object command */ -SWIGRUNTIME Tcl_Obj * -SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *type, int flags) { - Tcl_Obj *robj = SWIG_NewPointerObj(thisvalue, type,0); - /* Check to see if this pointer belongs to a class or not */ - if (thisvalue && (type->clientdata) && (interp)) { - Tcl_CmdInfo ci; - int has_command; - char *name; - name = Tcl_GetStringFromObj(robj,NULL); - has_command = Tcl_GetCommandInfo(interp, name, &ci); - if (!has_command || flags) { - swig_instance *newinst = (swig_instance *) malloc(sizeof(swig_instance)); - newinst->thisptr = Tcl_DuplicateObj(robj); - Tcl_IncrRefCount(newinst->thisptr); - newinst->thisvalue = thisvalue; - newinst->classptr = (swig_class *) type->clientdata; - newinst->destroy = flags; - newinst->cmdtok = Tcl_CreateObjCommand(interp, Tcl_GetStringFromObj(robj,NULL), (swig_wrapper_func) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); - if (flags) { - SWIG_Acquire(thisvalue); - } - } else { - swig_instance *inst = (swig_instance *)ci.objClientData; - /* Restore thisvalue as SWIG_POINTER_CLEAR may have been used to set it to zero. - Occurs when the C pointer is re-used by the memory allocator and the command has - been created and not destroyed - bug?? - see cpp11_std_unique_ptr_runme.tcl test. */ - if (inst->thisvalue != thisvalue) { - assert(inst->thisvalue == 0); - inst->thisvalue = thisvalue; - } - } - } - return robj; -} - -/* Function to create objects */ -SWIGRUNTIME int -SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - Tcl_Obj *newObj = 0; - void *thisvalue = 0; - swig_instance *newinst = 0; - swig_class *classptr = (swig_class *) clientData; - swig_wrapper cons = 0; - char *name = 0; - int firstarg = 0; - int thisarg = 0; - int destroy = 1; - - if (!classptr) { - Tcl_SetResult(interp, (char *) "swig: internal runtime error. No class object defined.", TCL_STATIC); - return TCL_ERROR; - } - cons = classptr->constructor; - if (objc > 1) { - char *s = Tcl_GetStringFromObj(objv[1],NULL); - if (strcmp(s,"-this") == 0) { - thisarg = 2; - cons = 0; - } else if (strcmp(s,"-args") == 0) { - firstarg = 1; - } else if (objc == 2) { - firstarg = 1; - name = s; - } else if (objc >= 3) { - char *s1; - name = s; - s1 = Tcl_GetStringFromObj(objv[2],NULL); - if (strcmp(s1,"-this") == 0) { - thisarg = 3; - cons = 0; - } else { - firstarg = 1; - } - } - } - if (cons) { - int result; - result = (*cons)(0, interp, objc-firstarg, &objv[firstarg]); - if (result != TCL_OK) { - return result; - } - newObj = Tcl_DuplicateObj(Tcl_GetObjResult(interp)); - if (!name) name = Tcl_GetStringFromObj(newObj,NULL); - } else if (thisarg > 0) { - if (thisarg < objc) { - destroy = 0; - newObj = Tcl_DuplicateObj(objv[thisarg]); - if (!name) name = Tcl_GetStringFromObj(newObj,NULL); - } else { - Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); - return TCL_ERROR; - } - } else { - Tcl_SetResult(interp, (char *) "No constructor available.", TCL_STATIC); - return TCL_ERROR; - } - if (SWIG_Tcl_ConvertPtr(interp,newObj, (void **) &thisvalue, *(classptr->type), 0) != SWIG_OK) { - Tcl_DecrRefCount(newObj); - return TCL_ERROR; - } - newinst = (swig_instance *) malloc(sizeof(swig_instance)); - newinst->thisptr = newObj; - Tcl_IncrRefCount(newObj); - newinst->thisvalue = thisvalue; - newinst->classptr = classptr; - newinst->destroy = destroy; - if (destroy) { - SWIG_Acquire(thisvalue); - } - newinst->cmdtok = Tcl_CreateObjCommand(interp,name, (swig_wrapper) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); - return TCL_OK; -} - -/* -----------------------------------------------------------------------------* - * Get arguments - * -----------------------------------------------------------------------------*/ -SWIGRUNTIME int -SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char *fmt, ...) { - int argno = 0, opt = 0; - long tempi; - double tempd; - const char *c; - va_list ap; - void *vptr; - Tcl_Obj *obj = 0; - swig_type_info *ty; - - va_start(ap,fmt); - for (c = fmt; (*c && (*c != ':') && (*c != ';')); c++,argno++) { - if (*c == '|') { - opt = 1; - c++; - } - if (argno >= (objc-1)) { - if (!opt) { - Tcl_SetResult(interp, (char *) "Wrong number of arguments ", TCL_STATIC); - goto argerror; - } else { - va_end(ap); - return TCL_OK; - } - } - - vptr = va_arg(ap,void *); - if (vptr) { - if (isupper(*c)) { - obj = SWIG_Tcl_GetConstantObj(Tcl_GetStringFromObj(objv[argno+1],0)); - if (!obj) obj = objv[argno+1]; - } else { - obj = objv[argno+1]; - } - switch(*c) { - case 'i': case 'I': - case 'l': case 'L': - case 'h': case 'H': - case 'b': case 'B': - if (Tcl_GetLongFromObj(interp,obj,&tempi) != TCL_OK) goto argerror; - if ((*c == 'i') || (*c == 'I')) *((int *)vptr) = (int)tempi; - else if ((*c == 'l') || (*c == 'L')) *((long *)vptr) = (long)tempi; - else if ((*c == 'h') || (*c == 'H')) *((short*)vptr) = (short)tempi; - else if ((*c == 'b') || (*c == 'B')) *((unsigned char *)vptr) = (unsigned char)tempi; - break; - case 'f': case 'F': - case 'd': case 'D': - if (Tcl_GetDoubleFromObj(interp,obj,&tempd) != TCL_OK) goto argerror; - if ((*c == 'f') || (*c == 'F')) *((float *) vptr) = (float)tempd; - else if ((*c == 'd') || (*c == 'D')) *((double*) vptr) = tempd; - break; - case 's': case 'S': - if (*(c+1) == '#') { - int *vlptr = (int *) va_arg(ap, void *); - *((char **) vptr) = Tcl_GetStringFromObj(obj, vlptr); - c++; - } else { - *((char **)vptr) = Tcl_GetStringFromObj(obj,NULL); - } - break; - case 'c': case 'C': - *((char *)vptr) = *(Tcl_GetStringFromObj(obj,NULL)); - break; - case 'p': case 'P': - ty = (swig_type_info *) va_arg(ap, void *); - if (SWIG_Tcl_ConvertPtr(interp, obj, (void **) vptr, ty, 0) != SWIG_OK) goto argerror; - break; - case 'o': case 'O': - *((Tcl_Obj **)vptr) = objv[argno+1]; - break; - default: - break; - } - } - } - - if ((*c != ';') && ((objc-1) > argno)) { - Tcl_SetResult(interp, (char *) "Wrong # args.", TCL_STATIC); - goto argerror; - } - va_end(ap); - return TCL_OK; - - argerror: - { - char temp[32]; - sprintf(temp,"%d", argno+1); - c = strchr(fmt,':'); - if (!c) c = strchr(fmt,';'); - if (!c) c = (char *)""; - Tcl_AppendResult(interp,c," argument ", temp, NULL); - va_end(ap); - return TCL_ERROR; - } -} - -#ifdef __cplusplus -} -#endif diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclruntime.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclruntime.swg deleted file mode 100755 index 6c46a00a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclruntime.swg +++ /dev/null @@ -1,15 +0,0 @@ -/* tcl.h has to appear first */ -%insert(runtime) %{ -#include -#include -#include -#include -#include -#include -%} - -%insert(runtime) "swigrun.swg"; /* Common C API type-checking code */ -%insert(runtime) "swigerrors.swg" /* SWIG errors */ -%insert(runtime) "tclerrors.swg"; /* Tcl Errors */ -%insert(runtime) "tclapi.swg"; /* Tcl API */ -%insert(runtime) "tclrun.swg"; /* Tcl run-time code */ diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclsh.i b/win64/bin/swig/share/swig/4.1.0/tcl/tclsh.i deleted file mode 100755 index 2de5f814..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclsh.i +++ /dev/null @@ -1,57 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclsh.i - * - * SWIG File for building new tclsh program - * ----------------------------------------------------------------------------- */ - -#ifdef AUTODOC -%subsection "tclsh.i" -%text %{ -This module provides the Tcl_AppInit() function needed to build a -new version of the tclsh executable. This file should not be used -when using dynamic loading. To make an interface file work with -both static and dynamic loading, put something like this in your -interface file : - - #ifdef STATIC - %include - #endif -%} -#endif - -%{ - -/* A TCL_AppInit() function that lets you build a new copy - * of tclsh. - * - * The macro SWIG_init contains the name of the initialization - * function in the wrapper file. - */ - -#ifndef SWIG_RcFileName -char *SWIG_RcFileName = "~/.myapprc"; -#endif - - -int Tcl_AppInit(Tcl_Interp *interp){ - - if (Tcl_Init(interp) == TCL_ERROR) - return TCL_ERROR; - - /* Now initialize our functions */ - - if (SWIG_init(interp) == TCL_ERROR) - return TCL_ERROR; - Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY); - - return TCL_OK; -} - -int main(int argc, char **argv) { - Tcl_Main(argc, argv, Tcl_AppInit); - return(0); - -} - -%} - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclstrings.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclstrings.swg deleted file mode 100755 index 78831b1b..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclstrings.swg +++ /dev/null @@ -1,31 +0,0 @@ -/* ------------------------------------------------------------ - * utility methods for char strings - * ------------------------------------------------------------ */ - -%fragment("SWIG_AsCharPtrAndSize","header") { -SWIGINTERN int -SWIG_AsCharPtrAndSize(Tcl_Obj *obj, char** cptr, size_t* psize, int *alloc) -{ - int len = 0; - char *cstr = Tcl_GetStringFromObj(obj, &len); - if (cstr) { - if (cptr) *cptr = cstr; - if (psize) *psize = len + 1; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - - -%fragment("SWIG_FromCharPtrAndSize","header", - fragment="") { -SWIGINTERNINLINE Tcl_Obj * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - return (size < INT_MAX) ? Tcl_NewStringObj(carray, %numeric_cast(size,int)) : NULL; -} -} - - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tcltypemaps.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tcltypemaps.swg deleted file mode 100755 index 5438e731..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tcltypemaps.swg +++ /dev/null @@ -1,86 +0,0 @@ -/* ------------------------------------------------------------ - * Typemap specializations for Tcl - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * Fragment section - * ------------------------------------------------------------ */ - -/* - In Tcl we need to pass the interp value, so we define the decl/call - macros as needed. -*/ - -#define SWIG_AS_DECL_ARGS SWIG_TCL_DECL_ARGS_2 -#define SWIG_AS_CALL_ARGS SWIG_TCL_CALL_ARGS_2 - - -/* Include fundamental fragment definitions */ -%include - -/* Look for user fragments file. */ -%include - -/* Tcl fragments for primitive types */ -%include - -/* Tcl fragments for char* strings */ -%include - - -/* ------------------------------------------------------------ - * Unified typemap section - * ------------------------------------------------------------ */ - -/* No director support in Tcl */ -#ifdef SWIG_DIRECTOR_TYPEMAPS -#undef SWIG_DIRECTOR_TYPEMAPS -#endif - - -/* Tcl types */ -#define SWIG_Object Tcl_Obj * - -/* Overload of the output/constant/exception handling */ - -/* output */ -#define %set_output(obj) Tcl_SetObjResult(interp,obj) - -/* append output */ -#define %append_output(obj) Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),obj) - -/* set constant */ -#define SWIG_SetConstant(name, obj) SWIG_Tcl_SetConstantObj(interp, name, obj) - -/* raise */ -#define SWIG_Raise(obj,type,desc) SWIG_Tcl_SetErrorObj(interp,type,obj) - - -/* Include the unified typemap library */ -%include - - -/* ------------------------------------------------------------ - * Tcl extra typemaps / typemap overrides - * ------------------------------------------------------------ */ - -#if 1 -// Old 1.3.25 typemaps needed to avoid premature object deletion -%typemap(out,noblock=1) SWIGTYPE *INSTANCE, SWIGTYPE &INSTANCE, SWIGTYPE &&INSTANCE, SWIGTYPE INSTANCE[] { - Tcl_SetObjResult(interp, SWIG_NewInstanceObj( %as_voidptr($1), $1_descriptor,0)); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,%as_voidptrptr(&$1)); - Tcl_SetObjResult(interp,SWIG_NewInstanceObj(%as_voidptr($1), ty,0)); -} - -#endif - -%typemap(out) SWIGTYPE = SWIGTYPE INSTANCE; -%typemap(out) SWIGTYPE * = SWIGTYPE *INSTANCE; -%typemap(out) SWIGTYPE *const = SWIGTYPE *; -%typemap(out) SWIGTYPE & = SWIGTYPE &INSTANCE; -%typemap(out) SWIGTYPE && = SWIGTYPE &&INSTANCE; -%typemap(out) SWIGTYPE [] = SWIGTYPE INSTANCE[]; -%typemap(varout) SWIGTYPE = SWIGTYPE INSTANCE; diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tcluserdir.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tcluserdir.swg deleted file mode 100755 index 296b2d6a..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tcluserdir.swg +++ /dev/null @@ -1,5 +0,0 @@ -/* ----------------------------------------------------------------------------- - * Special user directives - * ----------------------------------------------------------------------------- */ - - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/tclwstrings.swg b/win64/bin/swig/share/swig/4.1.0/tcl/tclwstrings.swg deleted file mode 100755 index b29f456e..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/tclwstrings.swg +++ /dev/null @@ -1,68 +0,0 @@ -/* ----------------------------------------------------------------------------- - * tclwstrings.wg - * - * Utility methods for wchar strings - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -%fragment("SWIG_AsWCharPtrAndSize","header") { -SWIGINTERN int -SWIG_AsWCharPtrAndSize(Tcl_Obj *obj, wchar_t** cptr, size_t* psize, int *alloc) -{ - int len = 0; - Tcl_UniChar *ustr = Tcl_GetUnicodeFromObj(obj, &len); - if (ustr) { - if (cptr) { - Tcl_Encoding encoding = NULL; - char *src = (char *) ustr; - int srcLen = (len)*sizeof(Tcl_UniChar); - int dstLen = sizeof(wchar_t)*(len + 1); - char *dst = %new_array(dstLen, char); - int flags = 0; - Tcl_EncodingState *statePtr = 0; - int srcRead = 0; - int dstWrote = 0; - int dstChars = 0; - Tcl_UtfToExternal(0, encoding, src, srcLen, flags, statePtr, dst, - dstLen, &srcRead, &dstWrote, &dstChars); - - *cptr = (wchar_t*)dst; - if (alloc) *alloc = SWIG_NEWOBJ; - } - if (psize) *psize = len + 1; - return SWIG_OK; - } - return SWIG_TypeError; -} -} - -%fragment("SWIG_FromWCharPtrAndSize","header") { -SWIGINTERNINLINE Tcl_Obj * -SWIG_FromWCharPtrAndSize(const wchar_t* carray, size_t size) -{ - Tcl_Obj *res = NULL; - if (size < INT_MAX) { - Tcl_Encoding encoding = NULL; - char *src = (char *) carray; - int srcLen = (int)(size*sizeof(wchar_t)); - int dstLen = (int)(size*sizeof(Tcl_UniChar)); - char *dst = %new_array(dstLen, char); - int flags = 0; - Tcl_EncodingState *statePtr = 0; - int srcRead = 0; - int dstWrote = 0; - int dstChars = 0; - - Tcl_ExternalToUtf(0, encoding, src, srcLen, flags, statePtr, dst, - dstLen, &srcRead, &dstWrote, &dstChars); - - res = Tcl_NewUnicodeObj((Tcl_UniChar*)dst, (int)size); - %delete_array(dst); - } - return res; -} -} - diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/typemaps.i b/win64/bin/swig/share/swig/4.1.0/tcl/typemaps.i deleted file mode 100755 index a88b6ad2..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/typemaps.i +++ /dev/null @@ -1,464 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * SWIG typemap library for Tcl8. This file contains various sorts - * of typemaps for modifying SWIG's code generation. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIG_USE_OLD_TYPEMAPS) -%include -#else - -/* -The SWIG typemap library provides a language independent mechanism for -supporting output arguments, input values, and other C function -calling mechanisms. The primary use of the library is to provide a -better interface to certain C function--especially those involving -pointers. -*/ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - double fadd(double *INPUT, double *INPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INPUT { double *a, double *b }; - double fadd(double *a, double *b); - -*/ - -%typemap(in) double *INPUT(double temp), double &INPUT(double temp) -{ - if (Tcl_GetDoubleFromObj(interp,$input,&temp) == TCL_ERROR) { - SWIG_fail; - } - $1 = &temp; -} - -%typemap(in) float *INPUT(double dvalue, float temp), float &INPUT(double dvalue, float temp) -{ - if (Tcl_GetDoubleFromObj(interp,$input,&dvalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (float) dvalue; - $1 = &temp; -} - -%typemap(in) int *INPUT(int temp), int &INPUT(int temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&temp) == TCL_ERROR) { - SWIG_fail; - } - $1 = &temp; -} - -%typemap(in) short *INPUT(int ivalue, short temp), short &INPUT(int ivalue, short temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (short) ivalue; - $1 = &temp; -} - -%typemap(in) long *INPUT(int ivalue, long temp), long &INPUT(int ivalue, long temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (long) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned int *INPUT(int ivalue, unsigned int temp), - unsigned int &INPUT(int ivalue, unsigned int temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned int) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned short *INPUT(int ivalue, unsigned short temp), - unsigned short &INPUT(int ivalue, unsigned short temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned short) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned long *INPUT(int ivalue, unsigned long temp), - unsigned long &INPUT(int ivalue, unsigned long temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned long) ivalue; - $1 = &temp; -} - -%typemap(in) unsigned char *INPUT(int ivalue, unsigned char temp), - unsigned char &INPUT(int ivalue, unsigned char temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (unsigned char) ivalue; - $1 = &temp; -} - -%typemap(in) signed char *INPUT(int ivalue, signed char temp), - signed char &INPUT(int ivalue, signed char temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = (signed char) ivalue; - $1 = &temp; -} - -%typemap(in) bool *INPUT(int ivalue, bool temp), - bool &INPUT(int ivalue, bool temp) -{ - if (Tcl_GetIntFromObj(interp,$input,&ivalue) == TCL_ERROR) { - SWIG_fail; - } - temp = ivalue ? true : false; - $1 = &temp; -} - -%typemap(in) long long *INPUT($*1_ltype temp), - long long &INPUT($*1_ltype temp) -{ - temp = ($*1_ltype) strtoll(Tcl_GetStringFromObj($input,NULL),0,0); - $1 = &temp; -} - -%typemap(in) unsigned long long *INPUT($*1_ltype temp), - unsigned long long &INPUT($*1_ltype temp) -{ - temp = ($*1_ltype) strtoull(Tcl_GetStringFromObj($input,NULL),0,0); - $1 = &temp; -} - -// OUTPUT typemaps. These typemaps are used for parameters that -// are output only. The output value is appended to the result as -// a list element. - -/* -The following methods can be applied to turn a pointer into an "output" -value. When calling a function, no input value would be given for -a parameter, but an output value would be returned. In the case of -multiple output values, they are returned in the form of a Tcl list. - - int *OUTPUT - short *OUTPUT - long *OUTPUT - long long *OUTPUT - unsigned int *OUTPUT - unsigned short *OUTPUT - unsigned long *OUTPUT - unsigned long long *OUTPUT - unsigned char *OUTPUT - bool *OUTPUT - float *OUTPUT - double *OUTPUT - -For example, suppose you were trying to wrap the modf() function in the -C math library which splits x into integral and fractional parts (and -returns the integer part in one of its parameters).K: - - double modf(double x, double *ip); - -You could wrap it with SWIG as follows : - - %include typemaps.i - double modf(double x, double *OUTPUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *OUTPUT { double *ip }; - double modf(double x, double *ip); - -The Tcl output of the function would be a list containing both -output values. - -*/ - -%typemap(in,numinputs=0) int *OUTPUT(int temp), - short *OUTPUT(short temp), - long *OUTPUT(long temp), - unsigned int *OUTPUT(unsigned int temp), - unsigned short *OUTPUT(unsigned short temp), - unsigned long *OUTPUT(unsigned long temp), - unsigned char *OUTPUT(unsigned char temp), - signed char *OUTPUT(signed char temp), - bool *OUTPUT(bool temp), - float *OUTPUT(float temp), - double *OUTPUT(double temp), - long long *OUTPUT($*1_ltype temp), - unsigned long long *OUTPUT($*1_ltype temp), - int &OUTPUT(int temp), - short &OUTPUT(short temp), - long &OUTPUT(long temp), - unsigned int &OUTPUT(unsigned int temp), - unsigned short &OUTPUT(unsigned short temp), - unsigned long &OUTPUT(unsigned long temp), - signed char &OUTPUT(signed char temp), - bool &OUTPUT(bool temp), - unsigned char &OUTPUT(unsigned char temp), - float &OUTPUT(float temp), - double &OUTPUT(double temp), - long long &OUTPUT($*1_ltype temp), - unsigned long long &OUTPUT($*1_ltype temp) -"$1 = &temp;"; - -%typemap(argout) int *OUTPUT, int &OUTPUT, - short *OUTPUT, short &OUTPUT, - long *OUTPUT, long &OUTPUT, - unsigned int *OUTPUT, unsigned int &OUTPUT, - unsigned short *OUTPUT, unsigned short &OUTPUT, - unsigned long *OUTPUT, unsigned long &OUTPUT, - unsigned char *OUTPUT, unsigned char &OUTPUT, - signed char *OUTPUT, signed char &OUTPUT, - bool *OUTPUT, bool &OUTPUT -{ - Tcl_Obj *o; - o = Tcl_NewIntObj((int) *($1)); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -%typemap(argout) float *OUTPUT, float &OUTPUT, - double *OUTPUT, double &OUTPUT -{ - Tcl_Obj *o; - o = Tcl_NewDoubleObj((double) *($1)); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -%typemap(argout) long long *OUTPUT, long long &OUTPUT -{ - char temp[256]; - Tcl_Obj *o; - sprintf(temp,"%lld",(long long)*($1)); - o = Tcl_NewStringObj(temp,-1); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -%typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT -{ - char temp[256]; - Tcl_Obj *o; - sprintf(temp,"%llu",(unsigned long long)*($1)); - o = Tcl_NewStringObj(temp,-1); - Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); -} - -// INOUT -// Mappings for an argument that is both an input and output -// parameter - -/* -The following methods can be applied to make a function parameter both -an input and output value. This combines the behavior of both the -"INPUT" and "OUTPUT" methods described earlier. Output values are -returned in the form of a Tcl list. - - int *INOUT - short *INOUT - long *INOUT - long long *INOUT - unsigned int *INOUT - unsigned short *INOUT - unsigned long *INOUT - unsigned long long *INOUT - unsigned char *INOUT - bool *INOUT - float *INOUT - double *INOUT - -For example, suppose you were trying to wrap the following function : - - void neg(double *x) { - *x = -(*x); - } - -You could wrap it with SWIG as follows : - - %include typemaps.i - void neg(double *INOUT); - -or you can use the %apply directive : - - %include typemaps.i - %apply double *INOUT { double *x }; - void neg(double *x); - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in Tcl). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a Tcl variable you might do this : - - set x [neg $x] - -*/ - - -%typemap(in) int *INOUT = int *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) unsigned int *INOUT = unsigned int *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) signed char *INOUT = signed char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) unsigned int &INOUT = unsigned int &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) signed char &INOUT = signed char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) unsigned int *INOUT = unsigned int *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) signed char *INOUT = signed char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) unsigned int &INOUT = unsigned int &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) signed char &INOUT = signed char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; - - -/* Overloading information */ - -%typemap(typecheck) double *INPUT = double; -%typemap(typecheck) bool *INPUT = bool; -%typemap(typecheck) signed char *INPUT = signed char; -%typemap(typecheck) unsigned char *INPUT = unsigned char; -%typemap(typecheck) unsigned long *INPUT = unsigned long; -%typemap(typecheck) unsigned short *INPUT = unsigned short; -%typemap(typecheck) unsigned int *INPUT = unsigned int; -%typemap(typecheck) long *INPUT = long; -%typemap(typecheck) short *INPUT = short; -%typemap(typecheck) int *INPUT = int; -%typemap(typecheck) float *INPUT = float; -%typemap(typecheck) long long *INPUT = long long; -%typemap(typecheck) unsigned long long *INPUT = unsigned long long; - -%typemap(typecheck) double &INPUT = double; -%typemap(typecheck) bool &INPUT = bool; -%typemap(typecheck) signed char &INPUT = signed char; -%typemap(typecheck) unsigned char &INPUT = unsigned char; -%typemap(typecheck) unsigned long &INPUT = unsigned long; -%typemap(typecheck) unsigned short &INPUT = unsigned short; -%typemap(typecheck) unsigned int &INPUT = unsigned int; -%typemap(typecheck) long &INPUT = long; -%typemap(typecheck) short &INPUT = short; -%typemap(typecheck) int &INPUT = int; -%typemap(typecheck) float &INPUT = float; -%typemap(typecheck) long long &INPUT = long long; -%typemap(typecheck) unsigned long long &INPUT = unsigned long long; - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) bool *INOUT = bool; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) float *INOUT = float; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) bool &INOUT = bool; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) float &INOUT = float; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; - -#endif - -// -------------------------------------------------------------------- -// Special types -// -------------------------------------------------------------------- - -%include -%include diff --git a/win64/bin/swig/share/swig/4.1.0/tcl/wish.i b/win64/bin/swig/share/swig/4.1.0/tcl/wish.i deleted file mode 100755 index e10a92c5..00000000 --- a/win64/bin/swig/share/swig/4.1.0/tcl/wish.i +++ /dev/null @@ -1,113 +0,0 @@ -/* ----------------------------------------------------------------------------- - * wish.i - * - * SWIG File for making wish - * ----------------------------------------------------------------------------- */ - -#ifdef AUTODOC -%subsection "wish.i" -%text %{ -This module provides the Tk_AppInit() function needed to build a -new version of the wish executable. Like tclsh.i, this file should -not be used with dynamic loading. To make an interface file work with -both static and dynamic loading, put something like this in your -interface file : - - #ifdef STATIC - %include - #endif - -A startup file may be specified by defining the symbol SWIG_RcFileName -as follows (this should be included in a code-block) : - - #define SWIG_RcFileName "~/.mywishrc" -%} -#endif - -%{ - - -/* Initialization code for wish */ - -#include - -#ifndef SWIG_RcFileName -char *SWIG_RcFileName = "~/.wishrc"; -#endif - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppInit -- - * - * This procedure performs application-specific initialization. - * Most applications, especially those that incorporate additional - * packages, will have their own version of this procedure. - * - * Results: - * Returns a standard Tcl completion code, and leaves an error - * message in interp->result if an error occurs. - * - * Side effects: - * Depends on the startup script. - * - *---------------------------------------------------------------------- - */ - -int Tcl_AppInit(Tcl_Interp *interp) -{ - Tk_Window main; - main = Tk_MainWindow(interp); - - /* - * Call the init procedures for included packages. Each call should - * look like this: - * - * if (Mod_Init(interp) == TCL_ERROR) { - * return TCL_ERROR; - * } - * - * where "Mod" is the name of the module. - */ - - if (Tcl_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - if (Tk_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - /* - * Call Tcl_CreateCommand for application-specific commands, if - * they weren't already created by the init procedures called above. - */ - - if (SWIG_init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - /* - * Specify a user-specific startup file to invoke if the application - * is run interactively. Typically the startup file is "~/.apprc" - * where "app" is the name of the application. If this line is deleted - * then no user-specific startup file will be run under any conditions. - */ - - Tcl_SetVar(interp, (char *) "tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY); - return TCL_OK; -} - -#if TK_MAJOR_VERSION >= 4 -int main(int argc, char **argv) { - Tk_Main(argc, argv, Tcl_AppInit); - return(0); -} -#else -extern int main(); -#endif - -%} - - - diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/README b/win64/bin/swig/share/swig/4.1.0/typemaps/README old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/attribute.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/attribute.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/carrays.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/carrays.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/cdata.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/cdata.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/cmalloc.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/cmalloc.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/cpointer.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/cpointer.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/cstring.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/cstring.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/cstrings.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/cstrings.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/cwstring.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/cwstring.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/enumint.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/enumint.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/exception.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/exception.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/factory.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/factory.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/fragments.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/fragments.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/implicit.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/implicit.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/inoutlist.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/inoutlist.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/misctypes.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/misctypes.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/primtypes.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/primtypes.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/ptrtypes.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/ptrtypes.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/std_except.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/std_except.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/std_string.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/std_string.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/std_strings.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/std_strings.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/std_wstring.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/std_wstring.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/string.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/string.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/strings.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/strings.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/swigmacros.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/swigmacros.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/swigmove.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/swigmove.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/swigobject.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/swigobject.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/swigtype.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/swigtype.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/swigtypemaps.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/swigtypemaps.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/typemaps.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/typemaps.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/valtypes.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/valtypes.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/void.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/void.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/typemaps/wstring.swg b/win64/bin/swig/share/swig/4.1.0/typemaps/wstring.swg old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/wchar.i b/win64/bin/swig/share/swig/4.1.0/wchar.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/windows.i b/win64/bin/swig/share/swig/4.1.0/windows.i old mode 100755 new mode 100644 diff --git a/win64/bin/swig/share/swig/4.1.0/xml/typemaps.i b/win64/bin/swig/share/swig/4.1.0/xml/typemaps.i deleted file mode 100755 index 3b8ad0a6..00000000 --- a/win64/bin/swig/share/swig/4.1.0/xml/typemaps.i +++ /dev/null @@ -1,3 +0,0 @@ -// -------------------------------------------------------------------- -// Empty file for %include to work -// -------------------------------------------------------------------- diff --git a/win64/bin/swig/share/swig/4.1.0/xml/xml.swg b/win64/bin/swig/share/swig/4.1.0/xml/xml.swg deleted file mode 100755 index c7bdbad0..00000000 --- a/win64/bin/swig/share/swig/4.1.0/xml/xml.swg +++ /dev/null @@ -1 +0,0 @@ -/* nothing special */ \ No newline at end of file